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.
1668 Discussions

clSetKernelArgSVMPointer() does not support a constant?

明_王_
Beginner
186 Views

Hi,

   I meet some problems with clSetKernelArgSVMPointer() 

 

main.cpp:

 

cl_uchar4* svmbuffer=(cl_uchar4*)clSVMAlloc(....)

cl_uchar4* svmoutbuffer=(cl_uchar4*)clSVMAlloc(....)

int n=2;

...............

status = clSetKernelArgSVMPointer(kernel2D,0,svmbuffer);

status = clSetKernelArgSVMPointer( kernel2D,1,svmoutbuffer);

status = clSetKernelArgSVMPointer( kernel2D,1,&n);

 

kernel.cl:

__kernel void image1dCopy(global uchar4* svmbuffer,global uchar4* svmoutbuffer, global int *n)

{

******

}

 

But an error is located at  "status = clSetKernelArgSVMPointer( kernel2D,1,&n);",

and the error code is CL_INVALID_ARG_VALUE.

When I change the "global int *n" to "global int n", it show me error: parameter may not be qualified with an address space.

So, clSetKernelArgSVMPointer() does not support a constant?

0 Kudos
1 Reply
Robert_I_Intel
Employee
186 Views

Try just int n instead of global int n.

Reply