MCPcopy Create free account
hub / github.com/Niko1221/Strata / bf16_matrix

Function bf16_matrix

engine/src/split/tools/convert_parallel_test.cpp:46–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

44}
45
46Spec bf16_matrix(const std::string& name, uint64_t cols, uint64_t rows) {
47 Spec s{name, fnx::T_BF16, {cols, rows}, {}};
48 s.data.resize((size_t) (cols * rows * 2));
49 for (size_t i = 0; i < cols * rows; ++i) {
50 const uint16_t b = bf16_of((float) ((int) (rnd() % 2001) - 1000) / 250.0f);
51 std::memcpy(&s.data[i * 2], &b, 2);
52 }
53 return s;
54}
55Spec q6k_matrix(const std::string& name, uint64_t cols, uint64_t rows) {
56 const size_t blocks = (size_t) (cols * rows / 256);
57 Spec s{name, fnx::T_Q6_K, {cols, rows}, std::vector<uint8_t>(blocks * 210)};

Callers 1

mainFunction · 0.85

Calls 4

memcpyFunction · 0.85
bf16_ofFunction · 0.70
rndFunction · 0.70
resizeMethod · 0.45

Tested by

no test coverage detected