reid from https://github.com/michuanhaohao/reid-strong-baseline
zhangmeng
2020-01-10 c3765bd24fe73747688a0ec2a550f219c9acb384
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
44
45
46
47
48
49
50
51
52
53
#ifndef THC_GENERIC_FILE
#define THC_GENERIC_FILE "THC/generic/THCStorage.h"
#else
 
#define THCStorage THStorage
 
// These used to be distinct types; for some measure of backwards compatibility and documentation
// alias these to the single THCStorage type.
#define THCudaStorage           THCStorage
#define THCudaDoubleStorage     THCStorage
#define THCudaHalfStorage       THCStorage
#define THCudaByteStorage       THCStorage
#define THCudaCharStorage       THCStorage
#define THCudaShortStorage      THCStorage
#define THCudaIntStorage        THCStorage
#define THCudaLongStorage       THCStorage
#define THCudaBoolStorage       THCStorage
#define THCudaBFloat16Storage   THCStorage
 
THC_API scalar_t* THCStorage_(data)(THCState *state, const THCStorage*);
THC_API ptrdiff_t THCStorage_(size)(THCState *state, const THCStorage*);
THC_API int THCStorage_(elementSize)(THCState *state);
 
/* slow access -- checks everything */
THC_API void THCStorage_(set)(THCState *state, THCStorage*, ptrdiff_t, scalar_t);
THC_API scalar_t THCStorage_(get)(THCState *state, const THCStorage*, ptrdiff_t);
 
THC_API THCStorage* THCStorage_(new)(THCState *state);
THC_API THCStorage* THCStorage_(newWithSize)(THCState *state, ptrdiff_t size);
THC_API THCStorage* THCStorage_(newWithSize1)(THCState *state, scalar_t);
THC_API THCStorage* THCStorage_(newWithSize2)(THCState *state, scalar_t, scalar_t);
THC_API THCStorage* THCStorage_(newWithSize3)(THCState *state, scalar_t, scalar_t, scalar_t);
THC_API THCStorage* THCStorage_(newWithSize4)(THCState *state, scalar_t, scalar_t, scalar_t, scalar_t);
THC_API THCStorage* THCStorage_(newWithMapping)(THCState *state, const char *filename, ptrdiff_t size, int shared);
 
THC_API THCStorage* THCStorage_(newWithAllocator)(
  THCState *state, ptrdiff_t size,
  at::Allocator* allocator);
THC_API THCStorage* THCStorage_(newWithDataAndAllocator)(
  THCState *state, at::DataPtr&& data, ptrdiff_t size,
  at::Allocator* allocator);
 
THC_API void THCStorage_(setFlag)(THCState *state, THCStorage *storage, const char flag);
THC_API void THCStorage_(clearFlag)(THCState *state, THCStorage *storage, const char flag);
THC_API void THCStorage_(retain)(THCState *state, THCStorage *storage);
 
THC_API void THCStorage_(free)(THCState *state, THCStorage *storage);
THC_API void THCStorage_(resize)(THCState *state, THCStorage *storage, ptrdiff_t size);
THC_API void THCStorage_(fill)(THCState *state, THCStorage *storage, scalar_t value);
 
THC_API int THCStorage_(getDevice)(THCState* state, const THCStorage* storage);
 
#endif