- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Totally green with openCL. I'm trying to get the source from this tutorial to build. But I cannot.
In particular, I'm getting CL_INVALID_MEM_OBJECT when executing the following code:
err = clSetKernelArg(ocl->kernel, 2, sizeof(cl_mem), (void *)&width); if (CL_SUCCESS != err) { LogError("Error: Failed to set argument dstMem, returned %s\n", TranslateOpenCLError(err)); return err; }
The tutorial is supposed to work on an image, and specifically states the arguments should be set as such:
err |= clSetKernelArg(ocl->kernel, 2, sizeof(cl_mem), (void *) &width); err |= clSetKernelArg(ocl->kernel, 3, sizeof(cl_mem), (void *) &height);
When I try to change the sizeof() to be sizeof(cl_uint), then it says CL_INVALID_ARG_SIZE.
This is the full function:
cl_uint SetKernelArguments(ocl_args_d_t *ocl, cl_uint width, cl_uint height) { cl_int err = CL_SUCCESS; err = clSetKernelArg(ocl->kernel, 0, sizeof(cl_mem), (void *)&ocl->srcA); if (CL_SUCCESS != err) { LogError("error: Failed to set argument srcA, returned %s\n", TranslateOpenCLError(err)); return err; } err = clSetKernelArg(ocl->kernel, 1, sizeof(cl_mem), (void *)&ocl->dstMem); if (CL_SUCCESS != err) { LogError("Error: Failed to set argument dstMem, returned %s\n", TranslateOpenCLError(err)); return err; } err = clSetKernelArg(ocl->kernel, 2, sizeof(cl_uint), (void *)&width); if (CL_SUCCESS != err) { LogError("Error: Failed to set argument dstMem, returned %s\n", TranslateOpenCLError(err)); return err; } err = clSetKernelArg(ocl->kernel, 3, sizeof(cl_mem), (void *)&height); if (CL_SUCCESS != err) { LogError("Error: Failed to set argument dstMem, returned %s\n", TranslateOpenCLError(err)); return err; } return err; }
If you wish to see the full source, or even download it and try it, you may do so by looking at the it on my github repo here: https://github.com/kwende/SimpleOpenCL/blob/master/EdgeDetectionOnGPU/EdgeDetectionOnGPU.cpp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ben,
This tutorial is outdated, I probably should just delete it. For a couple of sample applications, you can try these : https://software.intel.com/en-us/articles/optimizing-simple-opencl-kernels - there are two files there, Modulate.zip and Sobel.zip, right after the videos. You can then try to use this sample: https://software.intel.com/en-us/articles/getting-the-most-from-opencl-12-how-to-increase-performance-by-minimizing-buffer-copies-on-intel-processor-graphics and try modifying Modulate and Sobel to use zero-copy buffers.
You can use http://www.irfanview.com/ to visualize the results.
Other samples are available here: https://software.intel.com/en-us/intel-opencl-support/code-samples.
Sorry for the confusion.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ben,
This tutorial is outdated, I probably should just delete it. For a couple of sample applications, you can try these : https://software.intel.com/en-us/articles/optimizing-simple-opencl-kernels - there are two files there, Modulate.zip and Sobel.zip, right after the videos. You can then try to use this sample: https://software.intel.com/en-us/articles/getting-the-most-from-opencl-12-how-to-increase-performance-by-minimizing-buffer-copies-on-intel-processor-graphics and try modifying Modulate and Sobel to use zero-copy buffers.
You can use http://www.irfanview.com/ to visualize the results.
Other samples are available here: https://software.intel.com/en-us/intel-opencl-support/code-samples.
Sorry for the confusion.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Robert Ioffe (Intel) wrote:
Sorry for the confusion.
No worries. I'll be pestering you a bit over the next couple days as I'm sure I'll have a lot of questions...so at the end we can consider ourselves even ;)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Bring it on :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Robert Ioffe (Intel) wrote:
Bring it on :)
I applaud your energy :) I posted something here about a performance issue I'm seeing. Sorry, but I figured it'd be better to put it into a new thread. Also, damn good tutorials you've put together. Those videos were very useful, especially for someone as new as I.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ben,
Hopefully I answered some of your questions in another thread. Glad you found the tutorials useful: I had fun making them :)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page