Bug 458

Summary: clCreateProgramWithSource does not block on MacOS
Product: [JogAmp] Jocl Reporter: Michael Bien <bienator>
Component: openclAssignee: Michael Bien <bienator>
Status: VERIFIED FIXED    
Severity: blocker CC: rwlentz
Priority: P2    
Version: 1   
Hardware: All   
OS: macosx   
URL: http://jogamp.762907.n3.nabble.com/jocl-CLProgram-create-line-74-tp2250272p2250272.html
Type: DEFECT SCM Refs:
Workaround: ---
Attachments: junit test
new test case

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/

commit:
https://github.com/mbien/jocl/commit/6ca42ce154439b8c2f7f76ce4300ae08678f223a

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