diff options
author | Anthony LaTorre <telatorre@gmail.com> | 2011-05-09 11:49:25 -0400 |
---|---|---|
committer | Anthony LaTorre <telatorre@gmail.com> | 2011-05-09 11:49:25 -0400 |
commit | 4d3bf194aa395e818fc67230b219f41e454c435f (patch) | |
tree | ed412e97788a470660f148e974af38b10840b96a /test.py | |
parent | 152240722edb92f84de18818c137804b7db63e6a (diff) | |
download | chroma-4d3bf194aa395e818fc67230b219f41e454c435f.tar.gz chroma-4d3bf194aa395e818fc67230b219f41e454c435f.tar.bz2 chroma-4d3bf194aa395e818fc67230b219f41e454c435f.zip |
slight speed increase
Diffstat (limited to 'test.py')
-rw-r--r-- | test.py | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -17,6 +17,17 @@ def array2float3(arr): return x +def array2float4(arr): + if len(arr.shape) != 2 or arr.shape[-1] != 3: + raise Exception('shape mismatch') + + x = np.empty(arr.shape[0], dtype=gpuarray.vec.float4) + x['x'] = arr[:,0] + x['y'] = arr[:,1] + x['z'] = arr[:,2] + + return x + print 'device %s' % autoinit.device.name() source = open('src/linalg.h').read() + open('src/matrix.h').read() + \ |