diff options
Diffstat (limited to 'test/test_sample_cdf.cu')
-rw-r--r-- | test/test_sample_cdf.cu | 16 |
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); +} + +} |