Bug 458 - clCreateProgramWithSource does not block on MacOS
Summary: clCreateProgramWithSource does not block on MacOS
Alias: None
Product: Jocl
Classification: JogAmp
Component: opencl (show other bugs)
Version: 1
Hardware: All macosx
: P2 blocker
Assignee: Michael Bien
URL: http://jogamp.762907.n3.nabble.com/jo...
Depends on:
Reported: 2011-01-14 16:47 CET by Michael Bien
Modified: 2011-01-22 03:04 CET (History)
1 user (show)

See Also:
SCM Refs:
Workaround: ---

junit test (deleted)
2011-01-14 16:47 CET, Michael Bien
new test case (6.01 KB, text/x-java)
2011-01-22 03:04 CET, Michael Bien

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Bien 2011-01-14 16:47:38 CET
Created attachment 217 [details]
junit test

we suspect that the Apple implementation of OpenCL does not use a copy of the provided sources but uses the provided source string directly. The current JNI binding code assumes that the function (http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/clCreateProgramWithSource.html) blocks until the code is fully uploaded (same as in GLSL).

Result is a race condition with often not compileable programs.

All other CL implementations block and use a copy (tested on amd, intel, nv).

further investigation needed. There are multiple ways to fix this issue...
Comment 1 Michael Bien 2011-01-14 16:52:46 CET
mailing list discussion: http://jogamp.762907.n3.nabble.com/jocl-CLProgram-create-line-74-tp2250272p2250272.html
Comment 2 Michael Bien 2011-01-14 17:31:14 CET
Rick Lentz / mailing list:

I tested on another Mac just to ensure that it was not a single case regarding APPLE.  Here is the console output /results (Failed):

OS: Mac OS X
ARCH: x86_64
VM: Java HotSpot(TM) 64-Bit Server VM
lib path: /Users/hinerm/Documents/workspace/OpenCLIterative3DDeconvolution/lib:/Users/hinerm/Documents/workspace/OpenCLIterative3DDeconvolution/lib/APPLE
CLContext [id: 4296115824, platform: Apple, profile: FULL_PROFILE, devices: 2]
OpenCL 1.0 (Aug 22 2010 18:08:16)
src:    __kernel vo 

... compilation failed
Comment 3 Michael Bien 2011-01-22 01:38:22 CET
bug fixed in build 246: http://jogamp.org/chuck/view/fwd/job/jocl/label=macosx-10_6-x86_64/246/


could you take a look and verify that its working for you also? (if not please reopen the bug)

please use the high level api with CLProgram.create(...) since the test is also broken :)
Comment 4 Michael Bien 2011-01-22 03:03:31 CET
The content of attachment 217 [details] has been deleted by
    Michael Bien <bienator@arcor.de>
without providing any reason.

The token used to delete this attachment was generated at 2011-01-22 03:03:19 CET.
Comment 5 Michael Bien 2011-01-22 03:04:08 CET
Created attachment 221 [details]
new test case