MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / toFloat

Function toFloat

plugin/instanceNormalizationPlugin/instanceNormCommon.h:100–110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99template <int32_t N, bool DO_SCALE = false>
100DEVICE_FUNCTION void toFloat(float (&dst)[2 * N], int32_t (&src)[N], float scale = 1.f)
101{
102#pragma unroll
103 for (int32_t i = 0; i < N; ++i)
104 {
105 uint16_t lo, hi;
106 asm volatile("mov.b32 {%0, %1}, %2;" : "=h"(lo), "=h"(hi) : "r"(src[i]));
107 asm volatile("cvt.f32.f16 %0, %1;" : "=f"(dst[2 * i + 0]) : "h"(lo));
108 asm volatile("cvt.f32.f16 %0, %1;" : "=f"(dst[2 * i + 1]) : "h"(hi));
109 }
110}
111
112template <int32_t N, bool DO_SCALE = false>
113DEVICE_FUNCTION void toFloat(float (&dst)[4 * N], int32_t (&src)[N], float scale = 1.f)

Callers 5

ldgFunction · 0.85
ldgStreamFunction · 0.85
findPercentileFunction · 0.85
findMedianFunction · 0.85
findCoeffOfVarianceFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected