Repeated calling of enqueueNDRangeKernel in OpenCL

Repeated calling of enqueueNDRangeKernel in OpenCL

What other OpenCL functions should be called when enqueueNDRangeKernel is called repeatedly?

I have not been able to find a tutorial that shows the use of enqueueNDRangeKernel in this fashion and my coding attempts have unfortunately resulted in an unhandled exception error. A similar question has been asked before but the responses don't seem to apply to my situation.

I currently have a loop in which I call the OpenCL functions in the following sequence:

  1. setArg
  2. enqueueNDRangeKernel
  3. enqueueMapBuffer
  4. enqueueUnmapMemObject

I am calling setArg because the input to the kernel changes before each call to enqueueNDRangeKernel. I am calling enqueueMapBuffer and enqueueUnmapMemObject since the output from the kernel is used in the host code. The kernel runs ok the first time (the output is correct) but during the second pass through the loop I get an unhandled exception error when calling enqueueMapBuffer.

I am using the following set-up:

  1. Intel OpenCL SDK with CL_DEVICE_TYPE_CPU (on an Intel i7 CPU)
  2. Visual Studio 2010 IDE on Windows 7
  3. Host Code is written in C++ with the OpenCL C++ bindings.

Thanks.

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

Problem Resolved ... There was a bug in my kernel that only showed after the first iteration of my loop

Leave a Comment

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