summaryrefslogtreecommitdiff
path: root/test.py
diff options
context:
space:
mode:
authorAnthony LaTorre <telatorre@gmail.com>2011-05-09 11:49:25 -0400
committerAnthony LaTorre <telatorre@gmail.com>2011-05-09 11:49:25 -0400
commit4d3bf194aa395e818fc67230b219f41e454c435f (patch)
treeed412e97788a470660f148e974af38b10840b96a /test.py
parent152240722edb92f84de18818c137804b7db63e6a (diff)
downloadchroma-4d3bf194aa395e818fc67230b219f41e454c435f.tar.gz
chroma-4d3bf194aa395e818fc67230b219f41e454c435f.tar.bz2
chroma-4d3bf194aa395e818fc67230b219f41e454c435f.zip
slight speed increase
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() + \