- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear All,
I have a dynamic library (XXX.so) with a OpenCL kernel.
When I compile the library without -O3 flag the kernel works Ok.
When I compile with the -O3 flag I obtain the follow error from the run of the kernel.
-54 CL_INVALID_WORK_GROUP_SIZE
g++ -c -march=native -O3 -fPIC AoA.cpp -o AoA.o
g++ -shared -march=native -o AoA.so AoA.o -L/usr/lib -llapack -lblas -lOpenCL
Is this normal?
Thanks,
Luís Gonçalves
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you see what the arguments are to the call to clEnqueueNDRangeKernel that is generating the error when your program is compiled with -O3? Are they different than when your program is compiled with -O2?
You might be able to do this with the debugger, or you can use a tool like the OpenCL Intercept Layer to generate an API "call log":
https://github.com/intel/opencl-intercept-layer
https://github.com/intel/opencl-intercept-layer/blob/main/docs/controls.md#calllogging-bool
I'm guessing that aggressive compiler optimizations are causing the local_work_size to be something other than what you are expecting, which is causing the OpenCL driver to return an error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
With -O2 happens the same.
I try to put the variables "static" but did not worked as well.
And It also does not accept "volatile" because of incompability of types.
g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0
- 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