From 142b3c3caff164deb9bc7b2848e58e52387723ff Mon Sep 17 00:00:00 2001 From: Stan Seibert Date: Fri, 16 Sep 2011 15:02:02 -0400 Subject: Move CUDA source inside chroma package, rename tests directory to test --- test/test_sample_cdf.cu | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/test_sample_cdf.cu (limited to 'test/test_sample_cdf.cu') 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); +} + +} -- cgit