MCPcopy Create free account
hub / github.com/catboost/catboost / DotProductOnFloatAuto

Method DotProductOnFloatAuto

library/cpp/float16/float16.cpp:113–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113float NFloat16Ops::DotProductOnFloatAuto(const float* f32, const TFloat16* f16, size_t len) {
114 Y_ASSERT(size_t(f16) % Float16BufferAlignmentRequirementInBytes == 0);
115 Y_ASSERT(size_t(f32) % Float32BufferAlignmentRequirementInBytes == 0);
116
117 if (AreIntrinsicsAvailableOnHost()) {
118 return DotProductOnFloatIntrisincs(f32, f16, len);
119 }
120 float res = 0;
121 while(len > 0) {
122 res += (*f32) * f16->AsFloat();
123 f32 += 1;
124 f16 += 1;
125 len -= 1;
126 }
127 return res;
128}
129
130template <>
131void Out<TFloat16>(IOutputStream& out, typename TTypeTraits<TFloat16>::TFuncParam value) {

Callers

nothing calls this directly

Calls 1

AsFloatMethod · 0.45

Tested by

no test coverage detected