| 38 | static float fp4e2m1_to_fp32_value(uint8_t input) { return test_fp4_casts::e2m1_lut[input]; } |
| 39 | |
| 40 | TEST_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 | |
| 50 | TEST_CASE(test_fp4_to_fp8) |
| 51 | { |
nothing calls this directly
no test coverage detected