diff options
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() + \ |