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
kernel wrapper example for oclRun does not handle integer input #10
Comments
I cannot reproduce it. Can you, please, provide details such as I suspect that the compact representation is a red herring - I recall having seen issues on some GPUs when you try to use integer vectors instead of doubles since only doubles are supported by the hardware (that's why the example uses |
Yes, your guess seems better than mine; coercing to double 'fixes' the problem.
Also, from the above, it is the single-precision version of |
@mtmorgan Thanks, I can replicate it on an M1: > f(0:4)
[1] 0.3989423 0.3989423 0.3989423 0.3989423 0.3989423
> f(as.numeric(0:4))
[1] 0.3989422917 0.2419707328 0.0539909676 0.0044318484 0.0001338302 The problem is that Alternatively, we may want to add |
To add to this, we currently don't do any type checking when passing arguments to kernels. There is actually an API function to get argument types, clGetKernelArgInfo, which would allow us to do that. But it's only available with OpenCL 2.0 and newer, as far as I can see. Sadly OpenCL needlessly ties its API version to supported hardware features—there is actually no reason this function couldn't be supported on devices that don't offer the full OpenCL 2.0 functionality, it's purely a question of the software stack. What I also thought about (briefly) is optionally using libclang, if available, to get that information, but optional linking is not so easy and platform-dependent. (Most platforms that support OpenCL actually use Clang under the hood anyway, but it might not be available as a separate library, so we wouldn't want to require it.) |
After
we have very different values
I guess
x
is a 'compact' representationCorrect results are obtained by forcing expansion of compact representation
The text was updated successfully, but these errors were encountered: