diff options
| author | Anthony LaTorre <devnull@localhost> | 2012-12-18 17:40:38 -0500 |
|---|---|---|
| committer | tlatorre <tlatorre@uchicago.edu> | 2021-05-09 08:42:39 -0700 |
| commit | 581f4305ffe86cb42d5bcaa9bf081e6ea4abceca (patch) | |
| tree | 231c6fd423a75add4c6c616b8185998400e7ef9f /chroma/cuda | |
| parent | 46e73fee0217b8ae72c6f5afbe55c17e82193ef5 (diff) | |
| download | chroma-581f4305ffe86cb42d5bcaa9bf081e6ea4abceca.tar.gz chroma-581f4305ffe86cb42d5bcaa9bf081e6ea4abceca.tar.bz2 chroma-581f4305ffe86cb42d5bcaa9bf081e6ea4abceca.zip | |
add norm() function to get the length of vectors and shorten normalize() function.
Diffstat (limited to 'chroma/cuda')
| -rw-r--r-- | chroma/cuda/transform.cu | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/chroma/cuda/transform.cu b/chroma/cuda/transform.cu index 1f4405e..1c5a6cb 100644 --- a/chroma/cuda/transform.cu +++ b/chroma/cuda/transform.cu @@ -31,6 +31,17 @@ rotate(int nthreads, float3 *a, float phi, float3 axis) a[id] = rotate(a[id], phi, axis); } +__global__ void +rotate_(int nthreads, float3 *a, float phi, float3 axis) +{ + int id = blockIdx.x*blockDim.x + threadIdx.x; + + if (id >= nthreads) + return; + + 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` . */ |
