Blame view

stim/cuda/cudatools/devices.h 599 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"
f186dbda   Tianshu Cheng   header file for b...
18
19
20
21
22
23
24
25
  int sharedMemPerBlock()
  {
  	int device;
  	cudaGetDevice(&device);		//get the id of the current device
  	cudaDeviceProp props;		//device property structure
  	cudaGetDeviceProperties(&props, device);
  	return props.sharedMemPerBlock;
  }
a9275be5   David Mayerich   added vector fiel...
26
27
  }	//end namespace rts
  
8a86bd56   David Mayerich   changed rts names...
28
  #endif