clEnqueueCopyBufferRect crashes with access violation in cpu_device32.dll

clEnqueueCopyBufferRect crashes with access violation in cpu_device32.dll

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

 

3 帖子 / 0 全新
最新文章
如需更全面地了解编译器优化,请参阅优化注意事项

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

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.

 

登陆并发表评论。