Commit 7ad7e3da authored by Rostyslav Geyyer's avatar Rostyslav Geyyer
Browse files

Add a test

parent 61e09a18
...@@ -14,4 +14,9 @@ if(result EQUAL 0) ...@@ -14,4 +14,9 @@ if(result EQUAL 0)
target_link_libraries(test_bf8 PRIVATE utility) target_link_libraries(test_bf8 PRIVATE utility)
endif() endif()
add_gtest_executable(test_custom_type test_custom_type.cpp)
if(result EQUAL 0)
target_link_libraries(test_custom_type PRIVATE utility)
endif()
add_gtest_executable(test_type_convert_const type_convert_const.cpp) add_gtest_executable(test_type_convert_const type_convert_const.cpp)
// SPDX-License-Identifier: MIT
// Copyright (c) 2024, Advanced Micro Devices, Inc. All rights reserved.
#include "gtest/gtest.h"
#include "ck/utility/data_type.hpp"
using ck::f8_t;
using ck::half_t;
struct custom_f8_t
{
uint8_t data;
};
TEST(Custom_FP8, Test)
{
ASSERT_EQ(sizeof(f8_t), 1);
ASSERT_EQ(sizeof(ck::f8x2_t), 2);
ASSERT_EQ(sizeof(ck::f8x4_t), 4);
ASSERT_EQ(sizeof(custom_f8_t), 1);
ASSERT_EQ(sizeof(ck::non_native_vector_type<custom_f8_t, 1>), 1);
ASSERT_EQ(sizeof(ck::non_native_vector_type<custom_f8_t, 2>), 2);
ASSERT_EQ(sizeof(ck::non_native_vector_type<custom_f8_t, 4>), 4);
}
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