Refactor CMakeLists.txt under 3_CUDA_Features

This commit is contained in:
Rob Armstrong
2024-12-16 14:37:14 -08:00
parent ea694a4b0d
commit 090f957854
24 changed files with 456 additions and 125 deletions

View File

@@ -1,11 +1,25 @@
cmake_minimum_required(VERSION 3.20)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/Modules")
project(bf16TensorCoreGemm LANGUAGES C CXX CUDA)
find_package(CUDAToolkit REQUIRED)
set(CMAKE_CUDA_ARCHITECTURES "native")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
# set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -G") # enable cuda-gdb (expensive)
endif()
# Include directories and libraries
include_directories(../../../Common)
# Source file
set(SRC_FILES
bf16TensorCoreGemm.cu
)
# Add target for bf16TensorCoreGemm
add_executable(bf16TensorCoreGemm ${SRC_FILES})
add_executable(bf16TensorCoreGemm bf16TensorCoreGemm.cu)
target_compile_options(bf16TensorCoreGemm PRIVATE $<$<COMPILE_LANGUAGE:CUDA>:--extended-lambda>)
target_compile_features(bf16TensorCoreGemm PRIVATE cxx_std_17 cuda_std_17)
set_target_properties(bf16TensorCoreGemm PROPERTIES CUDA_SEPARABLE_COMPILATION ON)