Files
composable_kernel/test/ck_tile/permute/CMakeLists.txt
Emily Martins 1fa1c34b7e Tests for CK tile Permute and MOE Sorting (#2417)
* Convert ck-tile 06_permute smoke test to unit tests for fp16, fp8, and fp32

* Apply clang format and update copy right year

* Convert ck tile moe sorting example smoke tests to unit tests

* fix CMakelists to ensure that permute and moe_sorting are built for gfx9 only.

* Remove number prefix from permute and moe_sorting directory names

* code cleanup

* add missing test cases for fp16 permute

* remove unecessary parentheses

* Cleanup

* Remove uneccessary final nullptr

* update copyright and licensing statement in files

* Add custom target for permute tests

* Add missing new line at end of file for moe sorting CMakelist.

* Update MOE sorting tests to account for MOE sorting example updates

The ck_tile/13_moe_sorting example was updated to include different
cases dependending on whether MOE_SORTING_FMOE_2D_BUF is set. So,
the ck_tile tests for MOE sorting were updated to account for these
changes.

---------

Co-authored-by: Andriy Roshchenko <107577548+andriy-ca@users.noreply.github.com>
2025-07-21 11:20:28 -07:00

34 lines
1.2 KiB
CMake

# Currently ck_tile is only built on gfx9
if(GPU_TARGETS MATCHES "gfx9")
function(add_permute_test TARGET_NAME MAIN_SRC)
add_test_executable(${TARGET_NAME} ${MAIN_SRC})
if(NOT DEFINED PERMUTE_USE_ALTERNATIVE_IMPL)
set(PERMUTE_USE_ALTERNATIVE_IMPL true)
endif()
if(PERMUTE_USE_ALTERNATIVE_IMPL)
target_compile_options(${TARGET_NAME} PRIVATE -DPERMUTE_USE_ALTERNATIVE_IMPL)
target_sources(${TARGET_NAME} PRIVATE alternative_impl/matrix_core_swizzle.cpp)
endif()
endfunction(add_permute_test TARGET_NAME MAIN_SRC)
set(CUSTOM_TARGET_NAME test_ck_tile_permute)
add_custom_target(${CUSTOM_TARGET_NAME})
add_permute_test(test_ck_tile_permute_fp16 permute_fp16.cpp)
add_dependencies(${CUSTOM_TARGET_NAME} test_ck_tile_permute_fp16)
add_permute_test(test_ck_tile_permute_fp8 permute_fp8.cpp)
add_dependencies(${CUSTOM_TARGET_NAME} test_ck_tile_permute_fp8)
add_permute_test(test_ck_tile_permute_fp32 permute_fp32.cpp)
add_dependencies(${CUSTOM_TARGET_NAME} test_ck_tile_permute_fp32)
else()
message(DEBUG "Skipping ck_tile_permute tests for current target")
endif()