bh107 / bohrium

Automatic parallelization of Python/NumPy, C, and C++ codes on Linux and MacOSX
http://www.bh107.org
Apache License 2.0
220 stars 31 forks source link

bh107: dtype funny business #630

Open jamesavery opened 5 years ago

jamesavery commented 5 years ago

OK, so the dtype is not defined in bh107:

In [1]: import bh107 as bh                                                                                                                                                                                         
In [2]: a = bh.array([1,2,3,4],dtype=bh.float64)                                                                                                                                                                   
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-a29eeb4706b2> in <module>
----> 1 a = bh.array([1,2,3,4],dtype=bh.float64)

AttributeError: module 'bh107' has no attribute 'float64'

Fine, then we load it from numpy:

In [3]: import numpy as np                                                                                                                                                                                         
In [4]: a = bh.array([1,2,3,4],dtype=np.float64)                                                                                                                                                                   
In [5]: a.dtype                                                                                                                                                                                                    
Out[5]: numpy.int64

But bh107 just ignores the dtype and picks int64 from looking at the data! Is dtype not a part of bh107? Is one supposed to set the type in some different way?