cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

hduregger
Journeyman III

Kernel with image2d_t is not being executed on CPU

Everything works fine on the GPU. But on the CPU the kernel is not being executed at all. All other kernels, not using images (but OpenGL shared buffer textures), in the pipeline of my application seem to execute fine on the CPU.

I check for execution with printf. Also with gdb the program would not run into the break point of the kernel  (a different kernel break point was hit successfully, so the debugging procedure should be correct). But the kernel function exists.

The kernel uses a "write_only image2d_t" as argument. Even if the image2d_t is not being accessed, the kernel does not get executed when running the application with an CPU OpenCL context. When commenting out the kernel argument assignment in the client code and also the kernel arguments in the kernel, the kernel executes on the CPU (and the printf message is printed).

The image passed as kernel argument is a texture 2D shared from OpenGL. The memory is getting acquired correctly.

Sorry for pasting code like this, the javascript doesn't seem to work correctly here.


    cl_mem clImage01 = image01->getImageShared();
    cl_mem clImage23 = image23->getImageShared();

    CL_ERROR( clEnqueueAcquireGLObjects(queue, 1, &clImage01, 0, NULL, NULL) );
    CL_ERROR( clEnqueueAcquireGLObjects(queue, 1, &clImage23, 0, NULL, NULL) );
    CL_ERROR( clEnqueueAcquireGLObjects(queue, 1, &sharedPotentialBuffer, 0, NULL, NULL) );

    CL_ERROR( clSetKernelArg(kernelGradient, 1, sizeof(cl_mem), &sharedPotentialBuffer ) );
    CL_ERROR( clSetKernelArg(kernelGradient, 2, sizeof(cl_mem), &clImage01 ) );
    CL_ERROR( clSetKernelArg(kernelGradient, 3, sizeof(cl_mem), &clImage23 ) );

    CL_PROFILE(kernelGradientProfilingId, isProfiling, queue,
            CL_ERROR( clEnqueueNDRangeKernel(queue, kernelGradient, 1, NULL, &threadCount, &workGroupSize, 0, NULL, &event) )
    );

    CL_ERROR( clEnqueueReleaseGLObjects(queue, 1, &sharedPotentialBuffer, 0, NULL, NULL) );
    CL_ERROR( clEnqueueReleaseGLObjects(queue, 1, &clImage01, 0, NULL, NULL) );
    CL_ERROR( clEnqueueReleaseGLObjects(queue, 1, &clImage23, 0, NULL, NULL) );



#pragma OPENCL EXTENSION cl_amd_printf : enable
...
kernel void gradient(const      uint      BUFFER_SIDE_LENGTH,
                     global     float4*   potentialIn,
                     write_only image2d_t gradientOut01,
                     write_only image2d_t gradientOut23)
{
...
printf("test\n");
}


Radeon 6950, Ubuntu 10.10, Catalyst 11.5, APP SDK 2.4, 64bit

EDIT: oopsa, forgot the question.


Any idea what is going on?

0 Likes
17 Replies