diff options
author | Stan Seibert <stan@mtrr.org> | 2011-09-08 11:38:18 -0400 |
---|---|---|
committer | Stan Seibert <stan@mtrr.org> | 2011-09-08 11:38:18 -0400 |
commit | 3defeae5de899b315928f1b518fe2ff75662d430 (patch) | |
tree | eefd3114a10284db2eaec4d2b6358ba1c97bb965 /src/tools.cu | |
parent | 7cae8c3b343d1bde0320ff2ea224cc1ef79889df (diff) | |
parent | c7c161179a0a26dc9b4e3acdbc61a48803fa00e7 (diff) | |
download | chroma-3defeae5de899b315928f1b518fe2ff75662d430.tar.gz chroma-3defeae5de899b315928f1b518fe2ff75662d430.tar.bz2 chroma-3defeae5de899b315928f1b518fe2ff75662d430.zip |
merge
Diffstat (limited to 'src/tools.cu')
-rw-r--r-- | src/tools.cu | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/tools.cu b/src/tools.cu index 3d3fed7..80d06ec 100644 --- a/src/tools.cu +++ b/src/tools.cu @@ -3,15 +3,19 @@ extern "C" { -__global__ void interleave(int nthreads, unsigned long long *x, unsigned long long *y, unsigned long long *z, int bits, unsigned long long *dest) +__global__ void +interleave(int nthreads, unsigned long long *x, unsigned long long *y, + unsigned long long *z, int bits, unsigned long long *dest) { - int id = blockIdx.x*blockDim.x + threadIdx.x; + int id = blockIdx.x*blockDim.x + threadIdx.x; - if (id >= nthreads) - return; + if (id >= nthreads) + return; - for (int i=0; i < bits; i++) - dest[id] |= (x[id] & 1 << i) << (2*i) | (y[id] & 1 << i) << (2*i+1) | (z[id] & 1 << i) << (2*i+2); + for (int i=0; i < bits; i++) + dest[id] |= (x[id] & 1 << i) << (2*i) | + (y[id] & 1 << i) << (2*i+1) | + (z[id] & 1 << i) << (2*i+2); } -} +} // extern "C" |