CMakeLists.txt 1.82 KB
Newer Older
Chao Liu's avatar
Chao Liu committed
1
2
3
4
cmake_minimum_required(VERSION 3.15)
project(ck_app)
add_compile_options(-std=c++17)

5
if (DTYPES)
6
7
8
9
10
    add_definitions(-DDTYPES)
    if (DTYPES MATCHES "int8")
        add_definitions(-DCK_ENABLE_INT8)
        if(NOT DEFINED ${CK_ENABLE_INT8})
            set(CK_ENABLE_INT8 "ON")
11
        endif()
12
13
14
15
16
    endif()
    if (DTYPES MATCHES "fp8")
        add_definitions(-DCK_ENABLE_FP8)
        if(NOT DEFINED ${CK_ENABLE_FP8})
            set(CK_ENABLE_FP8 "ON")
17
        endif()
18
19
20
21
22
    endif()
    if (DTYPES MATCHES "fp16")
        add_definitions(-DCK_ENABLE_FP16)
        if(NOT DEFINED ${CK_ENABLE_FP16})
            set(CK_ENABLE_FP16 "ON")
23
        endif()
24
25
26
27
28
    endif()
    if (DTYPES MATCHES "fp32")
        add_definitions(-DCK_ENABLE_FP32)
        if(NOT DEFINED ${CK_ENABLE_FP32})
            set(CK_ENABLE_FP32 "ON")
29
        endif()
30
31
32
33
34
    endif()
    if (DTYPES MATCHES "fp64")
        add_definitions(-DCK_ENABLE_FP64)
        if(NOT DEFINED ${CK_ENABLE_FP64})
            set(CK_ENABLE_FP64 "ON")
35
        endif()
36
37
38
39
40
    endif()
    if (DTYPES MATCHES "bf16")
        add_definitions(-DCK_ENABLE_BF16)
        if(NOT DEFINED ${CK_ENABLE_BF16})
            set(CK_ENABLE_BF16 "ON")
41
        endif()
42
43
    endif()
    message("DTYPES macro set to ${DTYPES}")
44
else()
45
46
47
48
    add_definitions(-DCK_ENABLE_INT8 -DCK_ENABLE_FP8 -DCK_ENABLE_FP16 -DCK_ENABLE_FP32 -DCK_ENABLE_FP64 -DCK_ENABLE_BF16)
    if(NOT DEFINED ${CK_ENABLE_ALL_DTYPES})
        set(CK_ENABLE_ALL_DTYPES "ON")
    endif()
49
50
endif()

51
find_package(composable_kernel COMPONENTS device_operations)
Chao Liu's avatar
Chao Liu committed
52
53
54
find_package(hip REQUIRED PATHS /opt/rocm)
message(STATUS "Build with HIP ${hip_VERSION}")

Shaojie WANG's avatar
Shaojie WANG committed
55
56
57
# add all example subdir
file(GLOB dir_list LIST_DIRECTORIES true *)
FOREACH(subdir ${dir_list})
58
    IF(IS_DIRECTORY "${subdir}" AND (NOT "${subdir}" MATCHES "build"))
Shaojie WANG's avatar
Shaojie WANG committed
59
60
61
        add_subdirectory(${subdir})
    ENDIF()
ENDFOREACH()