OpenCL* for CPU
Ask questions and share information on Intel® SDK for OpenCL™ Applications and OpenCL™ implementations for Intel® CPU
Announcements
This forum covers OpenCL* for CPU only. OpenCL* for GPU questions can be asked in the GPU Compute Software forum. Intel® FPGA SDK for OpenCL™ questions can be ask in the FPGA Intel® High Level Design forum.
1663 Discussions

Repeated calling of enqueueNDRangeKernel in OpenCL

g4craig
Beginner
209 Views

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.

0 Kudos
1 Reply
g4craig
Beginner
209 Views
Problem Resolved ... There was a bug in my kernel that only showed after the first iteration of my loop
Reply