예제 #1
0
        public static void generate_kernel(GThread thread, RandStateXORWOW[] state, int[] result)
        {
            int id = thread.threadIdx.x + thread.blockIdx .x * 64;
            int count = 0;
            uint x = 0;

            /* Copy state to local memory for efficiency */
            RandStateXORWOW localState = state[id];
            /* Generate pseudo - random unsigned ints */
            for (int n = 0; n < 100000; n++)
            {
                x = thread.curand(ref localState);
                /* Check if low bit set */
                if ((x & 1) == 1)
                {
                    count++;
                }
            }
            /* Copy state back to global memory */
            state[id] = localState;
            /* Store results */
            result[id] += count;
        }
예제 #2
0
 // __device__ unsigned int curand (curandStateXORWOW_t  state)
 public static uint curand(this GThread thread, ref RandStateXORWOW state)
 {
     throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "curand");
 }
예제 #3
0
 public static void skipahead_sequence(this GThread thread, ulong n, ref RandStateXORWOW state)
 {
     throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "skipahead_sequence");
 }
예제 #4
0
 //__device__ oat curand_uniform (curandStateXORWOW_t  state)
 public static double curand_uniform_double(this GThread thread, ref RandStateXORWOW state)
 {
     throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "curand_uniform_double");
 }
예제 #5
0
//__device__ oat curand_normal (curandStateXORWOW_t  state)
        public static float curand_normal(this GThread thread, ref RandStateXORWOW state)
        {
            throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "curand_normal");
        }
예제 #6
0
//__device__ double curand_log_normal_double (curandStateXORWOW_t 
//state, double mean, double stddev)
        public static float curand_log_normal_double(this GThread thread, ref RandStateXORWOW state, double mean, double stddev)
        {
            throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "curand_log_normal");
        }
예제 #7
0
//__device__ void curand_init (unsigned long long seed, unsigned long long
//subsequence, unsigned long long offset, curandStateXORWOW_t  state)
        public static void curand_init(this GThread thread, ulong seed, ulong subsequence, ulong offset, ref RandStateXORWOW state)
        {
            throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "curand_init");
        }
예제 #8
0
파일: Rand.cs 프로젝트: rblenis/cudafy
 // __device__ unsigned int curand (curandStateXORWOW_t  state)
 public static uint curand(this GThread thread, ref RandStateXORWOW state)
 {
     throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "curand");
 }
예제 #9
0
 public static void setup_kernel(GThread thread, RandStateXORWOW[] state)
 {
     int id = thread.threadIdx.x + thread.blockIdx.x * 64;
     thread.curand_init(1234, (ulong)id, 0, ref state[id]);
 }
예제 #10
0
파일: Rand.cs 프로젝트: rblenis/cudafy
 public static void skipahead_sequence(this GThread thread, ulong n, ref RandStateXORWOW state)
 {
     throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "skipahead_sequence");
 }
예제 #11
0
파일: Rand.cs 프로젝트: rblenis/cudafy
 //__device__ oat curand_uniform (curandStateXORWOW_t  state)
 public static double curand_uniform_double(this GThread thread, ref RandStateXORWOW state)
 {
     throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "curand_uniform_double");
 }
예제 #12
0
파일: Rand.cs 프로젝트: rblenis/cudafy
//__device__ oat curand_normal (curandStateXORWOW_t  state)
        public static float curand_normal(this GThread thread, ref RandStateXORWOW state)
        {
            throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "curand_normal");
        }
예제 #13
0
파일: Rand.cs 프로젝트: rblenis/cudafy
//__device__ double curand_log_normal_double (curandStateXORWOW_t 
//state, double mean, double stddev)
        public static float curand_log_normal_double(this GThread thread, ref RandStateXORWOW state, double mean, double stddev)
        {
            throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "curand_log_normal");
        }
예제 #14
0
파일: Rand.cs 프로젝트: rblenis/cudafy
//__device__ void curand_init (unsigned long long seed, unsigned long long
//subsequence, unsigned long long offset, curandStateXORWOW_t  state)
        public static void curand_init(this GThread thread, ulong seed, ulong subsequence, ulong offset, ref RandStateXORWOW state)
        {
            throw new CudafyException(CudafyException.csX_NOT_SUPPORTED, "curand_init");
        }