-
Notifications
You must be signed in to change notification settings - Fork 0
/
modernGPU.cuh
68 lines (54 loc) · 2.22 KB
/
modernGPU.cuh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef MODERN_GPU_CUH
#define MODERN_GPU_CUH
#include <cuda_runtime.h>
#include <cuda.h>
void reduce_wrapper(uint numBlocks,
uint numThreads,
int * result,
int* vector,
int vectorSize,
int vt);
__global__ void k_reduce(int * result, int* vector, int vectorSize, int vt);
void exclusiveScan_wrapper2(uint numBlocks,
uint numThreads,
int* result,
int* vector,
int vectorSize,
int vt);
__global__ void k_downsweep2(int* result,
int* originalArray,
int* parallelScans,
int* blocksExclusiveScan,
int vt,
int size,
int realsize);
void exclusiveScan_wrapper(uint numBlocks,
uint numThreads,
int* result,
int* vector,
int vectorSize,
int vt);
void exclusiveScan_thrust(int *first,
int *last,
int *result,
int init);
__global__ void k_upsweep(int* result,
int* partialSums,
int* vector,
int vectorSize,
int vt,
int realSize);
__global__ void k_exclusiveScan(int* result, int*vector, int vectorSize, int vt);
__global__ void k_downsweep(int* result,
int* originalArray,
int* parallelScans,
int* blocksExclusiveScan,
int vt,
int size);
__host__ __device__ uint iDivUp(uint a,
uint b);
__host__ __device__ void computeGridSize(uint n,
uint blockSize,
uint &numBlocks,
uint &numThreads);
#endif // PARTICLES_KERNEL_IMPL_CUH