CMS 3D CMS Logo

Classes | Functions | Variables
cms::cudacompat Namespace Reference

Classes

struct  CPUTraits
 
struct  GPUTraits
 
struct  HostTraits
 

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 atomicCAS (T1 *address, T1 compare, T2 val)
 
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)
 

Variables

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

Function Documentation

◆ __ldg()

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

◆ __syncthreads()

gpuVertexFinder::__syncthreads ( )
inline

◆ __syncthreads_and()

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

Definition at line 80 of file cudaCompat.h.

80 { return x; }

◆ __syncthreads_or()

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

Definition at line 79 of file cudaCompat.h.

79 { return x; }

◆ __threadfence()

void cms::cudacompat::__threadfence ( )
inline

Definition at line 78 of file cudaCompat.h.

78 {}

Referenced by GPUCACell::__attribute__().

◆ atomicAdd()

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

◆ atomicCAS()

template<typename T1 , typename T2 >
T1 cms::cudacompat::atomicCAS ( T1 *  address,
T1  compare,
T2  val 
)

Definition at line 36 of file cudaCompat.h.

36  {
37  T1 old = *address;
38  *address = old == compare ? val : old;
39  return old;
40  }

References heppy_batch::val.

Referenced by GPUCACell::__attribute__().

◆ atomicInc()

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

Definition at line 43 of file cudaCompat.h.

43  {
44  auto ret = *a;
45  if ((*a) < T1(b))
46  (*a)++;
47  return ret;
48  }

References a, b, and runTheMatrix::ret.

Referenced by gpuVertexFinder::__attribute__().

◆ atomicMax()

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

Definition at line 71 of file cudaCompat.h.

71  {
72  auto ret = *a;
73  *a = std::max(*a, T1(b));
74  return ret;
75  }

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

Referenced by gpuPixelRecHits::__attribute__().

◆ atomicMin()

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

Definition at line 65 of file cudaCompat.h.

65  {
66  auto ret = *a;
67  *a = std::min(*a, T1(b));
68  return ret;
69  }

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

Referenced by gpuPixelRecHits::__attribute__(), and gpuVertexFinder::while().

◆ atomicSub()

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

Variable Documentation

◆ blockDim

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

◆ blockIdx

const dim3 cms::cudacompat::blockIdx = {0, 0, 0}

◆ gridDim

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

◆ threadIdx

const dim3 cms::cudacompat::threadIdx = {0, 0, 0}
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:542
min
T min(T a, T b)
Definition: MathUtil.h:58
b
double b
Definition: hdecay.h:118
a
double a
Definition: hdecay.h:119
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
heppy_batch.val
val
Definition: heppy_batch.py:351
genVertex_cff.x
x
Definition: genVertex_cff.py:12
compare
Definition: compare.py:1