crash when setting kernel argument for dynamic local memory

crash when setting kernel argument for dynamic local memory

Hello List,

I am trying to pass dynamically allocated local memory to my kernel.

So, I am using the line

    clSetKernelArg(myKernel, 2, localMemSize, NULL);

where argument two in the kernel is prefixed by local.

When I run this (windows 7, visual studio 2012), I get an exception:


Unhandled exception at 0x51AFF594 (IntelOpenCLProfiler.dll) in ocldwt.exe: 0xC0000005: Access violation reading location 0x00000000.


Any ideas?



5 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I can easily reproduce this on any intel sample project:

Just add a dummy local variable to the kernel, (let's say it is argument number 8),

and call

 error_code = clSetKernelArg(kernel, 7, 256, NULL);

    if (CL_SUCCESS != error_code)
        LogError("Error: clSetKernelArg (6) returned %s.\n", TranslateOpenCLError(error_code));
        return error_code;


This results in an access violation crash.

Hi Aaron,

We are aware of this issue. It will be fixed in a next release.


Hi Aaron,

This is a known issue we have already addressed, and will be fixed on the next release

(we will update the website in due course).

For now you can work around this issue by disabling API Debugger:

Visual Studio > Tools > Code Builder - Options > API Debugger

and uncheck "Enable OpenCL API Debugger".


This (disabling API Debugger) will not be necessary in the next release.


Note: API Debugger provides you valuable information about your OpenCL host application, such as:

  • Trace of all your API calls with their return values, and parameters passed:

  • Objects (tree) view of all the Context, Devices, Memory OpenCL objects
    INDE Code Builder - Objects Tree View
  • etc

and much more.

You can find more about it in our Users Guide.



Thanks and sorry for the temporary inconvenience,

Ofir Cohen

Thanks, Guys. I wish I had known about this issue before.

How about having a publicly accessible issue tracker, so that we can see what's broken.

Also, do you have a ballpark time for the next release?


@Ofir thanks for the info about the api debugger : I had not been using it, but I will start once this issue is fixed.






Leave a Comment

Please sign in to add a comment. Not a member? Join today