Blame view

stim/cuda/cudatools/devices.h 833 Bytes
a9275be5   David Mayerich   added vector fiel...
1
2
3
4
5
  #ifndef RTS_CUDA_DEVICES
  #define RTS_CUDA_DEVICES
  
  #include <cuda.h>
  
8a86bd56   David Mayerich   changed rts names...
6
  namespace stim{
5de3a9c2   Pavel Govyadinov   CHECKPOINT: befo...
7
  extern "C"
a9275be5   David Mayerich   added vector fiel...
8
9
10
11
12
13
14
15
  int maxThreadsPerBlock()
  {
  	int device;
  	cudaGetDevice(&device);		//get the id of the current device
  	cudaDeviceProp props;		//device property structure
  	cudaGetDeviceProperties(&props, device);
  	return props.maxThreadsPerBlock;
  }
f186dbda   Tianshu Cheng   header file for b...
16
  
5de3a9c2   Pavel Govyadinov   CHECKPOINT: befo...
17
  extern "C"
8e4f8364   David Mayerich   started a new opt...
18
  size_t sharedMemPerBlock()
f186dbda   Tianshu Cheng   header file for b...
19
20
21
22
23
24
25
  {
  	int device;
  	cudaGetDevice(&device);		//get the id of the current device
  	cudaDeviceProp props;		//device property structure
  	cudaGetDeviceProperties(&props, device);
  	return props.sharedMemPerBlock;
  }
8e4f8364   David Mayerich   started a new opt...
26
27
28
29
30
31
32
33
34
35
  
  extern "C"
  size_t constMem()
  {
  	int device;
  	cudaGetDevice(&device);		//get the id of the current device
  	cudaDeviceProp props;		//device property structure
  	cudaGetDeviceProperties(&props, device);
  	return props.totalConstMem;
  }
a9275be5   David Mayerich   added vector fiel...
36
37
  }	//end namespace rts
  
8a86bd56   David Mayerich   changed rts names...
38
  #endif