diff options
author | Anthony LaTorre <telatorre@gmail.com> | 2011-05-06 16:50:20 -0400 |
---|---|---|
committer | Anthony LaTorre <telatorre@gmail.com> | 2011-05-06 16:50:20 -0400 |
commit | 61a7a1ebdc028517db22f33741b31f63018979c2 (patch) | |
tree | eae95a199de20258f654d16f8a34914dfecd4270 /tests/linalg_test.cu | |
parent | 4e2720ff56afff978acaf589218cee0122d2ae29 (diff) | |
download | chroma-61a7a1ebdc028517db22f33741b31f63018979c2.tar.gz chroma-61a7a1ebdc028517db22f33741b31f63018979c2.tar.bz2 chroma-61a7a1ebdc028517db22f33741b31f63018979c2.zip |
added unary minus operator for matrix and float3; updated tests
Diffstat (limited to 'tests/linalg_test.cu')
-rw-r--r-- | tests/linalg_test.cu | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/linalg_test.cu b/tests/linalg_test.cu index bce5ea6..b61488f 100644 --- a/tests/linalg_test.cu +++ b/tests/linalg_test.cu @@ -99,16 +99,28 @@ __global__ void floatdivfloat3(float3 *a, float c, float3 *dest) dest[idx] = c/a[idx]; } -__global__ void dot(float3 *a, float3 *b, float* dest) +__global__ void dot(float3 *a, float3 *b, float *dest) { int idx = blockIdx.x*blockDim.x + threadIdx.x; dest[idx] = dot(a[idx],b[idx]); } -__global__ void cross(float3 *a, float3 *b, float3* dest) +__global__ void cross(float3 *a, float3 *b, float3 *dest) { int idx = blockIdx.x*blockDim.x + threadIdx.x; dest[idx] = cross(a[idx],b[idx]); } +__global__ void norm(float3 *a, float *dest) +{ + int idx = blockIdx.x*blockDim.x + threadIdx.x; + dest[idx] = norm(a[idx]); +} + +__global__ void minusfloat3(float3 *a, float3 *dest) +{ + int idx = blockIdx.x*blockDim.x + threadIdx.x; + dest[idx] = -a[idx]; +} + } // extern "c" |