OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1718 Discussions

clEnqueueCopyBufferRect crashes with access violation in cpu_device32.dll

ABoxe
Beginner
838 Views

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

 

0 Kudos
2 Replies
Raghupathi_M_Intel
838 Views

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

0 Kudos
ABoxe
Beginner
838 Views

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.

 

0 Kudos
Reply