summaryrefslogtreecommitdiff
path: root/test/test_sample_cdf.cu
blob: 14017723215f0743a0ffc0a6c3397f4f1ba4e0db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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);
}

}