PeriDyno 1.0.0
Loading...
Searching...
No Matches
CudaRand.h
Go to the documentation of this file.
1#pragma once
2#include <curand_kernel.h>
3#include "Platform.h"
4
5namespace dyno {
6
7#define DIV 10000
8
10 {
11 public:
12 GPU_FUNC RandNumber(int seed)
13 {
14 curand_init(seed, 0, 0, &s);
15 }
16 GPU_FUNC ~RandNumber() {};
17
21 GPU_FUNC float Generate()
22 {
23 return curand_uniform(&s);
24 }
25
26 private:
27 curandState s;
28 };
29}
30
GPU_FUNC RandNumber(int seed)
Definition CudaRand.h:12
GPU_FUNC float Generate()
Generate a float number ranging from 0 to 1.
Definition CudaRand.h:21
curandState s
Definition CudaRand.h:27
GPU_FUNC ~RandNumber()
Definition CudaRand.h:16
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25