PeriDyno
1.0.0
Loading...
Searching...
No Matches
D:
Peridyno
peridyno
src
Core
Backend
Cuda
Algorithm
CudaRand.h
Go to the documentation of this file.
1
#pragma once
2
#include <curand_kernel.h>
3
#include "Platform.h"
4
5
namespace
dyno
{
6
7
#define DIV 10000
8
9
class
RandNumber
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
dyno::RandNumber::RandNumber
GPU_FUNC RandNumber(int seed)
Definition
CudaRand.h:12
dyno::RandNumber::Generate
GPU_FUNC float Generate()
Generate a float number ranging from 0 to 1.
Definition
CudaRand.h:21
dyno::RandNumber::s
curandState s
Definition
CudaRand.h:27
dyno::RandNumber::~RandNumber
GPU_FUNC ~RandNumber()
Definition
CudaRand.h:16
dyno
This is an implementation of AdditiveCCD based on peridyno.
Definition
Array.h:25
Generated by
1.13.2