MCPcopy Create free account
hub / github.com/ROCm/AMDMIGraphX / TEST_CASE

Function TEST_CASE

test/fp4_casts.cpp:40–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38static float fp4e2m1_to_fp32_value(uint8_t input) { return test_fp4_casts::e2m1_lut[input]; }
39
40TEST_CASE(test_fp4_to_float)
41{
42 std::vector<uint8_t> bit_vals(16);
43 std::iota(bit_vals.begin(), bit_vals.end(), 0);
44 EXPECT(std::all_of(bit_vals.begin(), bit_vals.end(), [](uint8_t bit_val) {
45 float float_val = migraphx::fp4_to_float(bit_val);
46 return migraphx::float_equal(float_val, fp4e2m1_to_fp32_value(bit_val));
47 }));
48}
49
50TEST_CASE(test_fp4_to_fp8)
51{

Callers

nothing calls this directly

Calls 10

iotaFunction · 0.85
fp4_to_floatFunction · 0.85
fp4e2m1_to_fp32_valueFunction · 0.85
fp4_to_fp8Function · 0.85
all_ofFunction · 0.50
float_equalFunction · 0.50
equalFunction · 0.50
cast_to_fp4Function · 0.50
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected