Commit 96023bdb authored by Rostyslav Geyyer's avatar Rostyslav Geyyer
Browse files

Add a test failing on gfx10/11/12

parent 25935b57
......@@ -23,5 +23,9 @@ add_gtest_executable(test_bf8 test_bf8.cpp)
if(result EQUAL 0)
target_link_libraries(test_bf8 PRIVATE utility)
endif()
add_gtest_executable(failing_test failing_test.cpp)
if(result EQUAL 0)
target_link_libraries(failing_test PRIVATE utility)
endif()
add_gtest_executable(test_type_convert_const type_convert_const.cpp)
// SPDX-License-Identifier: MIT
// Copyright (c) 2018-2024, Advanced Micro Devices, Inc. All rights reserved.
#include "gtest/gtest.h"
#include "ck/utility/data_type.hpp"
#include "ck/utility/type_convert.hpp"
using ck::bf8_t;
using ck::f8_convert_rne;
using ck::f8_t;
using ck::type_convert;
TEST(FailingTest, FP8)
{
// fix the tolerance value
float abs_tol = 1e-6;
// convert minimal float to fp8 and back, check if holds
ASSERT_NEAR(std::numeric_limits<float>::min(),
type_convert<float>(f8_convert_rne<f8_t>(std::numeric_limits<float>::min())),
abs_tol);
}
TEST(FailingTest, BF8)
{
// fix the tolerance value
float abs_tol = 1e-6;
// convert minimal float to bf8 and back, check if holds
ASSERT_NEAR(std::numeric_limits<float>::min(),
type_convert<float>(f8_convert_rne<bf8_t>(std::numeric_limits<float>::min())),
abs_tol);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment