Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16597 Discussions

Output Message: "...A host pointer is provided without also specifying one of..."

Altera_Forum
Honored Contributor II
1,176 Views

The full message I am getting on the terminal is : 

 

Context callback: A host pointer is provided without also specifying one of CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR Context callback: A host pointer is provided without also specifying one of CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR Context callback: A host pointer is provided without also specifying one of CL_MEM_USE_HOST_PTR or CL_MEM_COPY_HOST_PTR 

 

The program seems to be working just fine. 

 

 

They are associated with each time I set the parameters of the kernel. 

 

uint *init_ptr = (uint *)malloc(sizeof(uint)); 

*init_ptr = 0; 

 

 

int *size_ptr = (int *)malloc(sizeof(int)); 

*size_ptr = SIZE; 

 

 

status = clSetKernelArg(well_kernel, 3, sizeof(cl_uint), seed_ptr); 

checkError(status, "Failed to set kernel arg 3"); 

status = clSetKernelArg(well_kernel, 4, sizeof(cl_uint), init_ptr); 

checkError(status, "Failed to set kernel arg 4"); 

status = clSetKernelArg(well_kernel, 5, sizeof(cl_int), size_ptr); 

checkError(status, "Failed to set kernel arg 5"); 

 

 

 

So, are those messages a problem?
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
437 Views

You are trying to pass a host pointer directly to the device, without first creating buffers on the device. I am surprised this even works. Read up on the "clCreateBuffer()" function or check one of Altera's basic examples (or basically any OpenCL code example) to see how you should first create buffers on the device.

0 Kudos
Altera_Forum
Honored Contributor II
437 Views

 

--- Quote Start ---  

You are trying to pass a host pointer directly to the device, without first creating buffers on the device. I am surprised this even works. Read up on the "clCreateBuffer()" function or check one of Altera's basic examples (or basically any OpenCL code example) to see how you should first create buffers on the device. 

--- Quote End ---  

 

 

I tried the following but the messages continue to show. 

 

uint *init_ptr = (uint *)malloc(sizeof(uint)); *init_ptr = 0; cl_mem init_buffer = clCreateBuffer(my_context, CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, sizeof(uint), init_ptr, &status); int *size_ptr = (int *)malloc(sizeof(int)); *size_ptr = SIZE; cl_mem size_buffer = clCreateBuffer(my_context, CL_MEM_READ_ONLY | CL_MEM_ALLOC_HOST_PTR, sizeof(int), size_ptr, &status); status = clSetKernelArg(well_kernel, 4, sizeof(cl_uint), &init_buffer); checkError(status, "Failed to set kernel arg 4"); status = clSetKernelArg(well_kernel, 5, sizeof(cl_int), &size_buffer); checkError(status, "Failed to set kernel arg 5");
0 Kudos
Altera_Forum
Honored Contributor II
437 Views

I am not really sure if I understand what you are trying to do with that code. Are you trying to pass two values (rather than buffers) to the kernel? If that is the case, just pass them as values, no need to define pointers and allocate buffers. 

 

uint init = 0; int size = SIZE; status = clSetKernelArg(well_kernel, 4, sizeof(uint), (void *) &init); checkError(status, "Failed to set kernel arg 4"); status = clSetKernelArg(well_kernel, 5, sizeof(int), (void *) &size); checkError(status, "Failed to set kernel arg 5");
0 Kudos
Reply