cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

spyzer_abhishek0
Journeyman III

Segmentation Fault in clEnqueueWriteBuffer

Hi all,

I am trying to create a buffer of size 2*10^6*sizeof(int) from a dynamically allocated array in my program using clEnqueueWriteBuffer, and instead of any predefined error like out of resources etc. as a return value, I get segmentation fault in allocating buffer. Please help.

 

Thank You.

0 Likes
3 Replies
karbous
Journeyman III

clEnqueueWriteBuffer reads data from the supplied array, most probably your array is shorter than provided size and that's why you are experiencing segmentation fault.

Try post your code.

0 Likes

karbous might be right.Please post a test case.

0 Likes

Thank karbous. With your suggestion I was able to remove the error, by changing the way in which the memory was being dynamically allocated to the array.

Thanks again

0 Likes