I have a C++ input that is formed as a std::vector and I would like to pass it to my OpenCL kernel (Nvidia platform).
But I keep getting a segmentation fault when the following is executed:
queue.enqueueReadBuffer(dev_input, CL_TRUE, 0, sizeof(bool) * input.size(), &input);
Therefore, I tried to copy my std::vector<bool>
to a bool[]
and everything worked perfectly. However, the common methods to convert a vector to a C array (&input[0], input.data())
don't work at all.
Would you have any suggestions either for the ReadBuffer or the fast assignment to a C array?
Thank you!