CMS 3D CMS Logo

Classes | Functions | Variables
cms::cudacompat Namespace Reference

Classes

struct  dim3
 

Functions

template<typename T >
T __ldg (T const *x)
 
void __syncthreads ()
 
bool __syncthreads_and (bool x)
 
bool __syncthreads_or (bool x)
 
void __threadfence ()
 
template<typename T1 , typename T2 >
T1 atomicAdd (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicInc (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicMax (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicMin (T1 *a, T2 b)
 
template<typename T1 , typename T2 >
T1 atomicSub (T1 *a, T2 b)
 
void resetGrid ()
 

Variables

const dim3 blockDim = {1, 1, 1}
 
thread_local dim3 blockIdx
 
thread_local dim3 gridDim
 
const dim3 threadIdx = {0, 0, 0}
 

Function Documentation

◆ __ldg()

template<typename T >
T cms::cudacompat::__ldg ( T const *  x)
inline

Definition at line 70 of file cudaCompat.h.

70  {
71  return *x;
72  }

Referenced by eigenSoA::ScalarSoA< T, S >::operator()(), and eigenSoA::ScalarSoA< T, S >::operator[]().

◆ __syncthreads()

void cms::cudacompat::__syncthreads ( )
inline

Definition at line 65 of file cudaCompat.h.

65 {}

◆ __syncthreads_and()

bool cms::cudacompat::__syncthreads_and ( bool  x)
inline

Definition at line 68 of file cudaCompat.h.

68 { return x; }

◆ __syncthreads_or()

bool cms::cudacompat::__syncthreads_or ( bool  x)
inline

Definition at line 67 of file cudaCompat.h.

67 { return x; }

◆ __threadfence()

void cms::cudacompat::__threadfence ( )
inline

Definition at line 66 of file cudaCompat.h.

66 {}

◆ atomicAdd()

template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicAdd ( T1 *  a,
T2  b 
)

◆ atomicInc()

template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicInc ( T1 *  a,
T2  b 
)

Definition at line 31 of file cudaCompat.h.

31  {
32  auto ret = *a;
33  if ((*a) < T1(b))
34  (*a)++;
35  return ret;
36  }

References a, b, and runTheMatrix::ret.

◆ atomicMax()

template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicMax ( T1 *  a,
T2  b 
)

Definition at line 59 of file cudaCompat.h.

59  {
60  auto ret = *a;
61  *a = std::max(*a, T1(b));
62  return ret;
63  }

References a, b, SiStripPI::max, and runTheMatrix::ret.

◆ atomicMin()

template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicMin ( T1 *  a,
T2  b 
)

Definition at line 53 of file cudaCompat.h.

53  {
54  auto ret = *a;
55  *a = std::min(*a, T1(b));
56  return ret;
57  }

References a, b, min(), and runTheMatrix::ret.

◆ atomicSub()

template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicSub ( T1 *  a,
T2  b 
)

◆ resetGrid()

void cms::cudacompat::resetGrid ( )
inline

Definition at line 74 of file cudaCompat.h.

74  {
75  blockIdx = {0, 0, 0};
76  gridDim = {1, 1, 1};
77  }

References blockIdx, and gridDim.

Variable Documentation

◆ blockDim

const dim3 cms::cudacompat::blockDim = {1, 1, 1}

◆ blockIdx

thread_local dim3 cms::cudacompat::blockIdx

◆ gridDim

thread_local dim3 cms::cudacompat::gridDim

◆ threadIdx

const dim3 cms::cudacompat::threadIdx = {0, 0, 0}
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:355
min
T min(T a, T b)
Definition: MathUtil.h:58
cms::cudacompat::gridDim
thread_local dim3 gridDim
Definition: cudaCompat.cc:6
vertices_cff.x
x
Definition: vertices_cff.py:29
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
cms::cudacompat::blockIdx
thread_local dim3 blockIdx
Definition: cudaCompat.cc:5