summaryrefslogtreecommitdiff
path: root/src/transform.cu
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-09-06 17:18:14 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-09-06 17:18:14 -0400
commit86cb5f26029b3357727b88fee3fa7dd799a8d6c8 (patch)
treefc915556ef813cf4ad59edeb7b59fee0e3244c34 /src/transform.cu
parent3d3140071713e523516793258e3c904ca162d7b7 (diff)
downloadchroma-86cb5f26029b3357727b88fee3fa7dd799a8d6c8.tar.gz
chroma-86cb5f26029b3357727b88fee3fa7dd799a8d6c8.tar.bz2
chroma-86cb5f26029b3357727b88fee3fa7dd799a8d6c8.zip
geometry on the GPU is now a struct created in the GPUGeometry class. coding style for cuda code is now compliant with python PEP 7 -- Style Guide for C Code.
Diffstat (limited to 'src/transform.cu')
-rw-r--r--src/transform.cu38
1 files changed, 21 insertions, 17 deletions
diff --git a/src/transform.cu b/src/transform.cu
index 57bd509..1f4405e 100644
--- a/src/transform.cu
+++ b/src/transform.cu
@@ -7,41 +7,45 @@ extern "C"
{
/* Translate the points `a` by the vector `v` */
-__global__ void translate(int nthreads, float3 *a, float3 v)
+__global__ void
+translate(int nthreads, float3 *a, float3 v)
{
- int id = blockIdx.x*blockDim.x + threadIdx.x;
+ int id = blockIdx.x*blockDim.x + threadIdx.x;
- if (id >= nthreads)
- return;
+ if (id >= nthreads)
+ return;
- a[id] += v;
+ a[id] += v;
}
/* Rotate the points `a` through an angle `phi` counter-clockwise about the
axis `axis` (when looking towards +infinity). */
-__global__ void rotate(int nthreads, float3 *a, float phi, float3 axis)
+__global__ void
+rotate(int nthreads, float3 *a, float phi, float3 axis)
{
- int id = blockIdx.x*blockDim.x + threadIdx.x;
+ int id = blockIdx.x*blockDim.x + threadIdx.x;
- if (id >= nthreads)
- return;
+ if (id >= nthreads)
+ return;
- a[id] = rotate(a[id], phi, axis);
+ a[id] = rotate(a[id], phi, axis);
}
/* Rotate the points `a` through an angle `phi` counter-clockwise
(when looking towards +infinity along `axis`) about the axis defined
by the point `point` and the vector `axis` . */
-__global__ void rotate_around_point(int nthreads, float3 *a, float phi, float3 axis, float3 point)
+__global__ void
+rotate_around_point(int nthreads, float3 *a, float phi, float3 axis,
+ float3 point)
{
- int id = blockIdx.x*blockDim.x + threadIdx.x;
+ int id = blockIdx.x*blockDim.x + threadIdx.x;
- if (id >= nthreads)
- return;
+ if (id >= nthreads)
+ return;
- a[id] -= point;
- a[id] = rotate(a[id], phi, axis);
- a[id] += point;
+ a[id] -= point;
+ a[id] = rotate(a[id], phi, axis);
+ a[id] += point;
}
} // extern "c"