Skip to content
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

OpenCL: libmath functions explode for float64 #631

Open
jamesavery opened this issue Jul 7, 2019 · 0 comments
Open

OpenCL: libmath functions explode for float64 #631

jamesavery opened this issue Jul 7, 2019 · 0 comments

Comments

@jamesavery
Copy link
Contributor

Both bh107 and bohrium explode when applying libmath functions (sin, cos, tanh, exp, etc.) to float64 data in OpenCL mode.

In [1]: import bohrium as bh                                                                                                                                                                                       
In [2]: A = bh.random.random((10))                                                                                                                                                                                 
In [3]: A.dtype                                                                                                                                                                                                    
Out[3]: dtype('float64')
In [4]: B = bh.tanh(A)                                                                                                                                                                                             
In [5]: bh.flush()                                                                                                                                                                                                 
Error code: -11
Error building: 
stringInput.cl:18:20: error: call to 'tanh' is ambiguous
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:34:20: note: candidate function
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:133:19: note: candidate function
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:1457:21: note: candidate function
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:1458:21: note: candidate function
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:1459:21: note: candidate function
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:1460:21: note: candidate function
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:1461:22: note: candidate function
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:1462:20: note: candidate function
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:1463:20: note: candidate function
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:1464:20: note: candidate function
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:1465:20: note: candidate function
/usr/lib/x86_64-linux-gnu/beignet/include/ocl_math.h:1466:21: note: candidate function

terminate called after throwing an instance of 'cl::Error'
  what():  clBuildProgram
Aborted

bh107 does exactly the same. However, for float32 it works:

In [1]: import bohrium as bh                                                                                                                                                                                       
In [2]: A = bh.random.random((10)).astype(bh.float32)                                                                                                                                                              
In [3]: B = bh.tanh(A)                                                                                                                                                                                             
In [5]: bh.flush()                                                                                                                                                                                                 
In [6]: print(B)                                                                                                                                                                                                   
[0.7571309  0.37564066 0.19148484 0.27567866 0.7203832  0.5446466
 0.28313637 0.7497538  0.64565045 0.31858957]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant