std::vector conversion to cl_float
I have been struggling with getting a two dimensional vector into an
openCL float array.
Defining a test array and a dynamic vector as such:
double ABCD[2][2]; //Works
vector< vector<float> > Jacobian(0, vector<float>(0)); //Doesn't work
cl_float *input_float; //openCL Input Array
I am doing a lot of work with the Jacobian in a C++ program and need to
eventually pass it to the openCL program.
input_double = *ABCD; //works fine in the openCL program
input_float = Jacobian; /*error C2440 no suitable conversion
from std::vector to cl_float exists*/
No amount of playing with pointers is making this work. Any ideas on how I
can get a dynamic vector into the cl_float structure? There is a dearth of
documentation IMHO.
Eventually, I am placing it in its own buffer and working on it inside the
GPU.
inMapPtr = clEnqueueMapBuffer(
commandQueue,
inplaceBuffer,
CL_FALSE,
CL_MAP_WRITE,
0,
SIZE_F,
0,
NULL,
&inMapEvt,
&status);
memcpy(inMapPtr, input_float, SIZE_F);
Any help is much appreciated.
No comments:
Post a Comment