- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have several calls to clEnqueueCopyBufferRect to copy data between two device buffers.
After a few calls, I get a crash with an access violation.
I am using the 2014 beta sdk, targetting my Intel i7 cpu.
Here is a code snippet:
size_t bufferOffset[] = { 0, 0};
// The region size must be given in bytes size_t region[] = { img_size.s[0] * sizeof(type_data), img_size.s[1] * sizeof(type_data) }; clEnqueueCopyBufferRect ( oclObjects.queue, //copy command will be queued (cl_mem)d_odata, (cl_mem)(d_idata), bufferOffset, //offset associated with src_buffer bufferOffset, //offset associated with src_buffer region, //(width, height, depth) in bytes of the 2D or 3D rectangle being copied tile_comp->width * sizeof(type_data), //length of each row in bytes 0, //length of each 2D slice in bytes tile_comp->width * sizeof(type_data) , //length of each row in bytes 0, //length of each 2D slice in bytes 0, NULL, NULL); err = clEnqueueBarrier(oclObjects.queue); SAMPLE_CHECK_ERRORS(err);
Thanks,
Aaron
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sounds like you maybe writing beyond the buffer boundaries. Did you narrow it down to some issue in the runtime? Anyway you cannot create and attach a small reproducer?
Raghu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks. Yes, I fixed this - the error was here:
size_t region[] = { img_size.s[0] * sizeof(type_data), img_size.s[1] * sizeof(type_data) };
The y coordinate should not be multiplied by sizeof(type_data).
So, nothing to do with bugs in the library.
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page