Good evening! I am writing a high-performance application and trying to use boost to speed up complex computations.
The essence of my question: is there a way to pass an external pointer to array (like float4_ *) to a BOOST_COMPUTE_CLOSURE?
I'd like to get something like:
float4_ *normals = new float4_[NORMALS_NO];
BOOST_COMPUTE_CLOSURE(void, evalNormals, (int4_ indices), (normals), {
...
});
Okay, I have finally found out how to implement the declared options. First thing to do is to pass
boost::compute::detail::device_ptr<float4_>instance to the function. Next we should declare a typename generator for `OpenCL backend` andoperator<<to write pointer information intometa_kernelinstance, which is being used in a hidden way in closure definition. So, the code:1) Passing
device_ptrinstance2) Implement typename generator:
3) Implement
operator<<