summaryrefslogtreecommitdiff
path: root/tests/test_sample_cdf.cu
diff options
context:
space:
mode:
authorAnthony LaTorre <tlatorre9@gmail.com>2011-09-03 13:16:37 -0400
committerAnthony LaTorre <tlatorre9@gmail.com>2011-09-03 13:16:37 -0400
commitb651fd549daa7847ec95df6f7009d05285fa73af (patch)
treeef1d5239c59efb889d98c96958221d4d002c3bd3 /tests/test_sample_cdf.cu
parenta0189d3ca6b55a8ea82cd46edc6673e5d4dec65c (diff)
parent38f05bf761490def1886016524f328528b08f549 (diff)
downloadchroma-b651fd549daa7847ec95df6f7009d05285fa73af.tar.gz
chroma-b651fd549daa7847ec95df6f7009d05285fa73af.tar.bz2
chroma-b651fd549daa7847ec95df6f7009d05285fa73af.zip
merge
Diffstat (limited to 'tests/test_sample_cdf.cu')
-rw-r--r--tests/test_sample_cdf.cu16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/test_sample_cdf.cu b/tests/test_sample_cdf.cu
new file mode 100644
index 0000000..1401772
--- /dev/null
+++ b/tests/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);
+}
+
+}