reid from https://github.com/michuanhaohao/reid-strong-baseline
554325746@qq.com
2020-03-24 495ffcdad0027be02d5fc82825e08f36b6a53b90
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
// Based on the simpleTempltes CUDA example
 
#ifndef THCUNN_SHAREDMEM_H
#define THCUNN_SHAREDMEM_H
 
template <typename T>
struct SharedMem {
  __device__ T *getPointer()
  {
    extern __device__ void error(void);
    error();
    return NULL;
  }
};
 
template <>
struct SharedMem<half>
{
  __device__ half *getPointer() {
    extern __shared__ half s_half[];
    return s_half;
  }
};
 
template <>
struct SharedMem<float>
{
  __device__ float *getPointer() {
    extern __shared__ float s_float[];
    return s_float;
  }
};
 
template <>
struct SharedMem<double>
{
  __device__ double *getPointer() {
    extern __shared__ double s_double[];
    return s_double;
  }
};
 
#endif