我一直在做一个使用C++绑定的OpenCL项目,现在需要使用使用C OpenCL绑定编写的外部代码。为了将C++ OpenCL变量转换为C语言,我使用了()运算符,但似乎找不到与之相反的运算符。我需要转换的变量是cl_program to cl::Program。
// calling C OpenCL function with cpp member variables
cl_program programc = aocl_utils::func(m_context(), binary_file.c_str(), &device(), 0);
// converting programc back to C++ OpenCL
cl::Program program(&programc); // this doesn't work发布于 2017-02-01 07:06:56
使用构造函数创建对象。
cl::Program::Program ( const Context & context,
const vector< Device > & devices,
const Binaries & binaries,
vector< cl_int > * binaryStatus = NULL,
cl_int * err = NULL
) 或者使用此构造函数从cl_program进行转换。
cl::Program::Program ( const cl_program & program,
bool retainObject = false
) https://stackoverflow.com/questions/41969022
复制相似问题