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

Bohrium API: supply a way to check if an array needs to be flushed #625

Open dionhaefner opened 5 years ago

dionhaefner commented 5 years ago

Could be helpful for smart __repr__s:

>>> a = bh107.random.rand(2, 2)
>>> b = bh107.random.rand(2, 2)
>>> c = a + b
>>> c  # results are not computed yet
BhArray([[- -],
         [- -]])
>>> bh107.flush()
>>> c
BhArray([[1 2],
         [3 4]])

I think this would be nice sugar to help people understand what's going on inside Bohrium.