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?