summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'test.py')
-rw-r--r--test.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test.py b/test.py
index 2ff399c..5c7c234 100644
--- a/test.py
+++ b/test.py
@@ -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() + \