summaryrefslogtreecommitdiff
path: root/test/test_sample_cdf.cu
diff options
context:
space:
mode:
authorStan Seibert <stan@mtrr.org>2011-09-16 15:02:02 -0400
committerStan Seibert <stan@mtrr.org>2011-09-16 15:02:02 -0400
commit142b3c3caff164deb9bc7b2848e58e52387723ff (patch)
tree417da3ad69a2756aff7a21dca4b08733d3e87afb /test/test_sample_cdf.cu
parent084dfd08b714faefaea77cb7dc04d2e93dc04b1d (diff)
downloadchroma-142b3c3caff164deb9bc7b2848e58e52387723ff.tar.gz
chroma-142b3c3caff164deb9bc7b2848e58e52387723ff.tar.bz2
chroma-142b3c3caff164deb9bc7b2848e58e52387723ff.zip
Move CUDA source inside chroma package, rename tests directory to test
Diffstat (limited to 'test/test_sample_cdf.cu')
-rw-r--r--test/test_sample_cdf.cu16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/test_sample_cdf.cu b/test/test_sample_cdf.cu
new file mode 100644
index 0000000..1401772
--- /dev/null
+++ b/test/test_sample_cdf.cu
@@ -0,0 +1,16 @@
+// -*-c++-*-
+#include "random.h"
+
+extern "C" {
+
+__global__ void test_sample_cdf(int offset, int ncdf,
+ float *cdf_x, float *cdf_y, float *out)
+{
+ int id = blockDim.x * blockIdx.x + threadIdx.x;
+ curandState s;
+ curand_init(0, id, offset, &s);
+
+ out[id] = sample_cdf(&s, ncdf, cdf_x, cdf_y);
+}
+
+}