How to get OpenCL context used by TVM module?

I write code on C++ and I need to add another OpenCL code on top of TVM calculations without copying to the host memory in the middle. For that I want to get OpenCL context which is created here:

dev = DLDevice{kDLOpenCL, 0};
module = tvm::runtime::Module::LoadFromFile(filename);
gmod = module.GetFunction("default")(dev);

I see that OpenCLWorkspace in sources has it as class member. But in builded TVM this class is hidden in binaries as far as I understand.

grep -r OpenCLWorkspace ./
Binary file ./lib/libtvm_runtime.so matches
Binary file ./lib/libtvm.so matches

How can I get cl_context?

I copied needed headers to ./include/tvm/runtime folder and did:

dev = DLDevice{kDLOpenCL, 0};
auto deviceAPI = tvm::runtime::DeviceAPI::Get(dev);
auto clWorkspace = dynamic_cast<tvm::runtime::cl::OpenCLWorkspace*>(deviceAPI);

It works! But trying to do:

std::cerr<<queue.enqueueWriteBuffer(cl_input,CL_TRUE,0,output_shape[0]*
                                                      output_shape[1]*
                                                      output_shape[2]*
                                                      output_shape[3]*
                                                      sizeof(float),
                                   output->data+output->byte_offset)<<std::endl;

Gives segmentation Fault.

Is there any method to make tvm::ndarray contiguous without copying it on host?