CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
103 lines
3.2 KiB
CMake
103 lines
3.2 KiB
CMake
# Copyright (c) Advanced Micro Devices, Inc., or its affiliates.
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
cmake_minimum_required(VERSION 3.15)
|
|
project(ck_app)
|
|
add_compile_options(-std=c++20)
|
|
|
|
if (DTYPES)
|
|
add_definitions(-DDTYPES)
|
|
if (DTYPES MATCHES "int8")
|
|
add_definitions(-DCK_ENABLE_INT8)
|
|
set(CK_ENABLE_INT8 "ON")
|
|
endif()
|
|
if (DTYPES MATCHES "fp8")
|
|
add_definitions(-DCK_ENABLE_FP8)
|
|
set(CK_ENABLE_FP8 "ON")
|
|
endif()
|
|
if (DTYPES MATCHES "bf8")
|
|
add_definitions(-DCK_ENABLE_BF8)
|
|
set(CK_ENABLE_BF8 "ON")
|
|
endif()
|
|
if (DTYPES MATCHES "fp16")
|
|
add_definitions(-DCK_ENABLE_FP16)
|
|
set(CK_ENABLE_FP16 "ON")
|
|
endif()
|
|
if (DTYPES MATCHES "fp32")
|
|
add_definitions(-DCK_ENABLE_FP32)
|
|
set(CK_ENABLE_FP32 "ON")
|
|
endif()
|
|
if (DTYPES MATCHES "tf32")
|
|
set(CK_ENABLE_TF32 "ON")
|
|
endif()
|
|
if (DTYPES MATCHES "fp64")
|
|
add_definitions(-DCK_ENABLE_FP64)
|
|
set(CK_ENABLE_FP64 "ON")
|
|
endif()
|
|
if (DTYPES MATCHES "bf16")
|
|
add_definitions(-DCK_ENABLE_BF16)
|
|
set(CK_ENABLE_BF16 "ON")
|
|
endif()
|
|
message(DEBUG "DTYPES macro set to ${DTYPES}")
|
|
else()
|
|
add_definitions(-DCK_ENABLE_INT8 -DCK_ENABLE_FP16 -DCK_ENABLE_FP32 -DCK_ENABLE_FP64 -DCK_ENABLE_BF16)
|
|
set(CK_ENABLE_INT8 "ON")
|
|
set(CK_ENABLE_FP16 "ON")
|
|
set(CK_ENABLE_FP32 "ON")
|
|
set(CK_ENABLE_TF32 "ON")
|
|
set(CK_ENABLE_FP64 "ON")
|
|
set(CK_ENABLE_BF16 "ON")
|
|
if (GPU_TARGETS MATCHES "gfx94")
|
|
add_definitions(-DCK_ENABLE_FP8 -DCK_ENABLE_BF8)
|
|
set(CK_ENABLE_FP8 "ON")
|
|
set(CK_ENABLE_BF8 "ON")
|
|
endif()
|
|
endif()
|
|
|
|
if (GPU_TARGETS)
|
|
if (GPU_TARGETS MATCHES "gfx9|gfx11|gfx12")
|
|
add_definitions(-DCK_USE_XDL)
|
|
set(CK_USE_XDL "ON")
|
|
endif()
|
|
if (GPU_TARGETS MATCHES "gfx11")
|
|
add_definitions(-DCK_USE_WMMA)
|
|
set(CK_USE_WMMA "ON")
|
|
endif()
|
|
if (GPU_TARGETS MATCHES "gfx12" OR GPU_TARGETS MATCHES "gfx950")
|
|
add_definitions(-DCK_USE_OCP_FP8)
|
|
set(CK_USE_OCP_FP8 "ON")
|
|
endif()
|
|
if (GPU_TARGETS MATCHES "gfx90a" OR GPU_TARGETS MATCHES "gfx94")
|
|
add_definitions(-DCK_USE_FNUZ_FP8)
|
|
set(CK_USE_FNUZ_FP8 "ON")
|
|
endif()
|
|
if ((GPU_TARGETS MATCHES "gfx942" OR GPU_TARGETS MATCHES "gfx95") AND CK_ENABLE_TF32)
|
|
add_definitions(-DCK_ENABLE_TF32)
|
|
set(CK_ENABLE_TF32 "ON")
|
|
else()
|
|
message(STATUS "Disabling TF32 instances for this target")
|
|
remove_definitions(-DCK_ENABLE_TF32)
|
|
set(CK_ENABLE_TF32 "OFF")
|
|
endif()
|
|
else()
|
|
add_definitions(-DCK_USE_WMMA -DCK_USE_XDL)
|
|
set(CK_USE_XDL "ON")
|
|
set(CK_USE_WMMA "ON")
|
|
endif()
|
|
|
|
find_package(composable_kernel COMPONENTS device_other_operations device_gemm_operations device_conv_operations device_reduction_operations utility)
|
|
if(GPU_TARGETS MATCHES "gfx9")
|
|
find_package(composable_kernel COMPONENTS device_contraction_operations)
|
|
endif()
|
|
find_package(hip REQUIRED PATHS /opt/rocm)
|
|
message(STATUS "Build with HIP ${hip_VERSION}")
|
|
|
|
# add all example subdir
|
|
file(GLOB dir_list LIST_DIRECTORIES true *)
|
|
FOREACH(subdir ${dir_list})
|
|
IF(IS_DIRECTORY "${subdir}" AND (NOT "${subdir}" MATCHES "build")
|
|
AND (NOT "${subdir}" MATCHES ".vscode"))
|
|
add_subdirectory(${subdir})
|
|
ENDIF()
|
|
ENDFOREACH()
|