Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
composable_kernel_ROCM
Commits
7ad7e3da
Commit
7ad7e3da
authored
Jun 06, 2024
by
Rostyslav Geyyer
Browse files
Add a test
parent
61e09a18
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
0 deletions
+30
-0
test/data_type/CMakeLists.txt
test/data_type/CMakeLists.txt
+5
-0
test/data_type/test_custom_type.cpp
test/data_type/test_custom_type.cpp
+25
-0
No files found.
test/data_type/CMakeLists.txt
View file @
7ad7e3da
...
@@ -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
)
test/data_type/test_custom_type.cpp
0 → 100644
View file @
7ad7e3da
// 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
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment