OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU.
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.

SVM Trouble


Hello, everyone!

I've some problem with Shared Virtual Memory and its buffers.

I've got structure like this:

typedef struct ListOfPtr ListOfPtr;
struct ListOfPtr
	cl_int		some_value;
	ListOfPtr	*first;
	ListOfPtr	*last;
	ListOfPtr	*next;
	ListOfPtr	*prev;

I declared a pointer of ListOfPtr type.

ListOfPtr *list = (ListOfPtr *)calloc(1, sizeof(ListOfPtr));

Then I get platform IDs, device IDs, creating a context and command queue...

Now I try to declare a pointer of SVM buffer:

ListOfPtr *list = (ListOfPtr *)clSVMAlloc(my_context, CL_MEM_READ_WRITE, sizeof(ListOfPtr) * 6, 0);

But something is going wromg and I've got error: Unable exception at 0x00000000 in MyCLProject.exe: 0xC0000005: Access Violation in the performance at 0x00000000.

Is there any solution of this problem?

P.S.: According to this my device has SVM support.


0 Kudos
1 Reply

Some questions:

The SVM sample uses a similar structure:

typedef struct _Element
    global float* internal; //points to the "value" of another Element from the same array
    global float* external; //points to the entry in a separate array of floating-point values
    float value;
} Element;

If you modify the sample to use your structure are you able to reproduce the behavior you're seeing?

0 Kudos