MCPcopy Create free account
hub / github.com/3DAnimals/3DAnimals / fetch

Method fetch

model/render/renderutils/c_src/tensor.h:38–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36 __device__ inline int nhwcIndexContinuous(int n, int h, int w, int c) const { return ((n * _dims[1] + h) * _dims[2] + w) * _dims[3] + c; }
37#ifdef BFLOAT16
38 __device__ inline float fetch(unsigned int idx) const { return fp16 ? __bfloat162float(((__nv_bfloat16*)val)[idx]) : ((float*)val)[idx]; }
39 __device__ inline void store(unsigned int idx, float _val) { if (fp16) ((__nv_bfloat16*)val)[idx] = __float2bfloat16(_val); else ((float*)val)[idx] = _val; }
40 __device__ inline void store_grad(unsigned int idx, float _val) { if (fp16) ((__nv_bfloat16*)d_val)[idx] = __float2bfloat16(_val); else ((float*)d_val)[idx] = _val; }
41#else

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected