-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SmallptGPU regression #44
Comments
And LLVM 3.4-scripts doesn't work either? |
No. 3.4 assert in LLVM, possibly 3.3-api does too (not sure if I have a debug build of it). Only 3.3-scripts looks correct. |
At least one sort of failure is due to 49af9a9 (adding of -DNDEBUG) when LLVM has debug symbols. Guess we need to check at ./configure time if LLVM is built with or without NDEBUG, and set CXXFLAGS according to this. |
I checked out SmallPTGPU v1.0 from code.google.com and it seems to work fine (LLVM 3.4+LLVMAPI). Something like 1.8M samples/sec with this Intel 4-core CPU. How should it break exactly? The version you used is different as I could not find the file to patch. Are you sure this is not a bug in the app itself that causes undef behavior? |
Sorry - the latest master doesn't fix this issue for me, I'm seeing:
|
With the following cpu:
|
OK, I tracked this in the fabiand's box. This is somehow related to the lack of aligned_malloc in that system. It complains about it during compilation but compiles OK. After I replaced those calls with the plain malloc it works. What I do not yet understand is which function it ends up calling for aligned_malloc() if it doesn't find the function (there is no linkage error). The result of the call is an illegal pointer which causes the crash when it tries to copy the argument data to the parameter buffer. The proper fix is to find or implement a replacement for aligned_malloc that works also in this fedora box correctly. |
Actually it was the other way around: it has aligned_alloc() which is used for aligned allocation instead of posix_memalign which works. If I force POSIX_MEMALIGN, it works (added these to the pocl_util.h): +#undef HAVE_ALIGNED_ALLOC |
"The function aligned_alloc() is the same as memalign(), except for the added restriction that size should be a multiple of alignment." http://en.cppreference.com/w/c/memory/aligned_alloc. The alignment can be bigger than the size, I think, thus it might not work. I think we can fix this by just removing the possibility to use aligned_alloc. If there is no posix_memalign we have the custom fallback function already. Testing this. |
Yes Pekka! @pjaaskel - That was it. Runs now smooth and fine :) |
This example program http://davibu.interfree.it/opencl/smallptgpu/smallptGPU.html works with current pocl when compiled against LLVM 3.3-scripts, API mode or LLVM 3.4 does not work.
The above example needs this patch to compile: https://gist.github.com/kraiskil/8004743
Seemingly newer, but of lesser version number, ocl-toys are available here: http://code.google.com/p/ocltoys/
The text was updated successfully, but these errors were encountered: