From feca919c25b10ed020fb0f375f60232cb6c57b11 Mon Sep 17 00:00:00 2001 From: apoorva Date: Tue, 1 Jul 2025 15:06:32 +0000 Subject: [PATCH] Cleaned up the code. --- example/68_gemm_add/CMakeLists.txt | 21 ++++++++++--------- example/68_gemm_add/common.hpp | 10 ++++----- example/68_gemm_add/gemm_add_wmma_fp16.cpp | 11 ---------- example/68_gemm_add/gemm_add_wmma_v3_bf16.cpp | 13 ------------ example/68_gemm_add/gemm_add_wmma_v3_fp16.cpp | 15 ------------- 5 files changed, 15 insertions(+), 55 deletions(-) diff --git a/example/68_gemm_add/CMakeLists.txt b/example/68_gemm_add/CMakeLists.txt index 2cf152c893..5bd7d73a92 100644 --- a/example/68_gemm_add/CMakeLists.txt +++ b/example/68_gemm_add/CMakeLists.txt @@ -1,18 +1,19 @@ +add_custom_target(example_gemm_add_xdl) + +add_library(example_gemm_add_xdl_fp16 gemm_add_xdl_fp16.cpp) +add_example_executable(example_gemm_add_xdl_fp16 gemm_add_xdl_fp16.cpp) + +add_library(example_gemm_add_xdl_bf16 gemm_add_xdl_bf16.cpp) +add_example_executable(example_gemm_add_xdl_bf16 gemm_add_xdl_bf16.cpp) + + +add_custom_target(example_gemm_add_wmma) add_example_executable(example_gemm_add_wmma_bf16 gemm_add_wmma_bf16.cpp) add_example_executable(example_gemm_add_wmma_fp16 gemm_add_wmma_fp16.cpp) add_example_executable(example_gemm_add_wmma_v3_fp16 gemm_add_wmma_v3_fp16.cpp) add_example_executable(example_gemm_add_wmma_v3_bf16 gemm_add_wmma_v3_bf16.cpp) -add_custom_target(example_gemm_add_xdl) -set_source_files_properties(example_gemm_add_xdl_fp16/gemm_add_xdl_fp16.cpp PROPERTIES COMPILE_OPTIONS ";-mllvm;-greedy-reverse-local-assignment=1") -add_library(example_gemm_add_xdl_fp16 gemm_add_xdl_fp16.cpp) -add_example_executable(example_gemm_add_xdl_fp16 gemm_add_xdl_fp16.cpp) -add_example_dependencies(example_gemm_add_xdl example_gemm_add_xdl_fp16) - -set_source_files_properties(example_gemm_add_xdl_bf16/gemm_add_xdl_bf16.cpp PROPERTIES COMPILE_OPTIONS ";-mllvm;-greedy-reverse-local-assignment=1") -add_library(example_gemm_add_xdl_bf16 gemm_add_xdl_bf16.cpp) -add_example_executable(example_gemm_add_xdl_bf16 gemm_add_xdl_bf16.cpp) -add_example_dependencies(example_gemm_add_xdl example_gemm_add_xdl_bf16) + diff --git a/example/68_gemm_add/common.hpp b/example/68_gemm_add/common.hpp index 4435503e6b..eab37e4132 100644 --- a/example/68_gemm_add/common.hpp +++ b/example/68_gemm_add/common.hpp @@ -13,17 +13,11 @@ #include "ck/tensor_operation/gpu/device/tensor_layout.hpp" #include "ck/tensor_operation/gpu/device/gemm_specialization.hpp" -#ifndef CK_USE_XDL #include "ck/tensor_operation/gpu/device/impl/device_gemm_multiple_d_xdl_cshuffle.hpp" -#endif -#ifndef CK_USE_MULTIPLE_D_WMMA #include "ck/tensor_operation/gpu/device/impl/device_gemm_multiple_d_wmma_cshuffle.hpp" -#endif -#ifndef CK_USE_WMMA_V3 #include "ck/tensor_operation/gpu/device/impl/device_gemm_multiple_d_wmma_cshuffle_v3.hpp" -#endif #include "ck/tensor_operation/gpu/element/element_wise_operation.hpp" #include "ck/utility/data_type.hpp" @@ -48,6 +42,10 @@ using BF16 = ck::bhalf_t; using F16 = ck::half_t; using F32 = float; +using Row_Tuple = ck::Tuple; +using F16_Tuple = ck::Tuple; +using BF16_Tuple = ck::Tuple; + struct ProblemSize final { ck::index_t M = 3840; diff --git a/example/68_gemm_add/gemm_add_wmma_fp16.cpp b/example/68_gemm_add/gemm_add_wmma_fp16.cpp index 3a6d40ea49..3aa25bb471 100644 --- a/example/68_gemm_add/gemm_add_wmma_fp16.cpp +++ b/example/68_gemm_add/gemm_add_wmma_fp16.cpp @@ -3,17 +3,6 @@ #include "common.hpp" -template -using S = ck::Sequence; - -using F16 = ck::half_t; -using F32 = float; - -using Row = ck::tensor_layout::gemm::RowMajor; -using Col = ck::tensor_layout::gemm::ColumnMajor; - -using PassThrough = ck::tensor_operation::element_wise::PassThrough; - using ADataType = F16; using BDataType = F16; using AccDataType = F32; diff --git a/example/68_gemm_add/gemm_add_wmma_v3_bf16.cpp b/example/68_gemm_add/gemm_add_wmma_v3_bf16.cpp index 7a4204e12d..2a3641defc 100644 --- a/example/68_gemm_add/gemm_add_wmma_v3_bf16.cpp +++ b/example/68_gemm_add/gemm_add_wmma_v3_bf16.cpp @@ -3,19 +3,6 @@ #include "common.hpp" -template -using S = ck::Sequence; - -using BF16 = ck::bhalf_t; -using F32 = float; - -using Row = ck::tensor_layout::gemm::RowMajor; -using Col = ck::tensor_layout::gemm::ColumnMajor; - -using PassThrough = ck::tensor_operation::element_wise::PassThrough; - -using BF16_Tuple = ck::Tuple; - using ADataType = BF16; using BDataType = BF16; using AccDataType = F32; diff --git a/example/68_gemm_add/gemm_add_wmma_v3_fp16.cpp b/example/68_gemm_add/gemm_add_wmma_v3_fp16.cpp index 7844ae721d..c98fc4b39e 100644 --- a/example/68_gemm_add/gemm_add_wmma_v3_fp16.cpp +++ b/example/68_gemm_add/gemm_add_wmma_v3_fp16.cpp @@ -3,19 +3,6 @@ #include "common.hpp" -template -using S = ck::Sequence; - -using F16 = ck::half_t; -using F32 = float; - -using Row = ck::tensor_layout::gemm::RowMajor; -using Col = ck::tensor_layout::gemm::ColumnMajor; - -using PassThrough = ck::tensor_operation::element_wise::PassThrough; - -using F16_Tuple = ck::Tuple; - using ADataType = F16; using BDataType = F16; using AccDataType = F32; @@ -24,8 +11,6 @@ using DDataType = F16; using DsDataType = F16_Tuple; using EDataType = F16; -using Row_Tuple = ck::Tuple; - using ALayout = Row; using BLayout = Row; using DLayout = Row;