"profiler/src/profile_groupnorm_fwd.cpp" did not exist on "d821d1e54f6ce8131070a1253dfc4dd6662d3d85"
CMakeLists.txt 5.56 KB
Newer Older
1
include_directories(BEFORE
Adam Osewski's avatar
Adam Osewski committed
2
    ${PROJECT_SOURCE_DIR}/
3
    ${PROJECT_SOURCE_DIR}/profiler/include
4
5
)

JD's avatar
JD committed
6
7
include(googletest)

8
9
add_custom_target(tests)

Chao Liu's avatar
Chao Liu committed
10
11
function(add_test_executable TEST_NAME)
    message("adding test ${TEST_NAME}")
12
13
    set(result 1)
    if(DEFINED DTYPES)
14
15
        foreach(source IN LISTS ARGN)
            set(test 0)
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
            if((source MATCHES "_fp16" OR source MATCHES "_f16") AND NOT "fp16" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_fp32" OR source MATCHES "_f32") AND NOT "fp32" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_fp64" OR source MATCHES "_f64") AND NOT "fp64" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_fp8" OR source MATCHES "_f8") AND NOT "fp8" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_bf8" OR source MATCHES "_bf8") AND NOT "bf8" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_bf16" OR source MATCHES "_b16") AND NOT "bf16" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_int8" OR source MATCHES "_i8") AND NOT "int8" IN_LIST DTYPES)
                set(test 1)
            endif()
37
38
39
            if(test EQUAL 1)
                message("removing test ${source} ")
                list(REMOVE_ITEM ARGN "${source}")
40
41
            endif()
        endforeach()
42
43
    endif()
    foreach(source IN LISTS ARGN)
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
        if(NOT DEFINED DL_KERNELS AND source MATCHES "_dl")
            message("removing dl test ${source} ")
            list(REMOVE_ITEM ARGN "${source}")
        endif()
    endforeach()

    #only continue if there are some source files left on the list
    if(ARGN)
        add_executable(${TEST_NAME} ${ARGN})
        add_test(NAME ${TEST_NAME} COMMAND $<TARGET_FILE:${TEST_NAME}>)
        add_dependencies(tests ${TEST_NAME})
        add_dependencies(check ${TEST_NAME})
        rocm_install(TARGETS ${TEST_NAME} COMPONENT tests)
        set(result 0)
    endif()
    #message("add_test returns ${result}")
60
    set(result ${result} PARENT_SCOPE)
Chao Liu's avatar
Chao Liu committed
61
endfunction(add_test_executable TEST_NAME)
62

63
64
65
66
include(GoogleTest)

function(add_gtest_executable TEST_NAME)
    message("adding gtest ${TEST_NAME}")
67
68
    set(result 1)
    if(DEFINED DTYPES)
69
70
        foreach(source IN LISTS ARGN)
            set(test 0)
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
            if((source MATCHES "_fp16" OR source MATCHES "_f16") AND NOT "fp16" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_fp32" OR source MATCHES "_f32") AND NOT "fp32" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_fp64" OR source MATCHES "_f64") AND NOT "fp64" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_fp8" OR source MATCHES "_f8") AND NOT "fp8" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_bf8" OR source MATCHES "_bf8") AND NOT "bf8" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_bf16" OR source MATCHES "_b16") AND NOT "bf16" IN_LIST DTYPES)
                set(test 1)
            endif()
            if((source MATCHES "_int8" OR source MATCHES "_i8") AND NOT "int8" IN_LIST DTYPES)
                set(test 1)
            endif()
92
93
94
            if(test EQUAL 1)
                message("removing gtest ${source} ")
                list(REMOVE_ITEM ARGN "${source}")
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
            endif()
        endforeach()
    endif()
    foreach(source IN LISTS ARGN)
        if(NOT DEFINED DL_KERNELS AND source MATCHES "_dl")
            message("removing dl test ${source} ")
            list(REMOVE_ITEM ARGN "${source}")
        endif()
    endforeach()
    #only continue if there are some source files left on the list
    if(ARGN)
        add_executable(${TEST_NAME} ${ARGN})
        add_dependencies(tests ${TEST_NAME})
        add_dependencies(check ${TEST_NAME})

        # suppress gtest warnings
        target_compile_options(${TEST_NAME} PRIVATE -Wno-global-constructors -Wno-undef)
        target_link_libraries(${TEST_NAME} PRIVATE gtest_main)
        add_test(NAME ${TEST_NAME} COMMAND $<TARGET_FILE:${TEST_NAME}>)
        rocm_install(TARGETS ${TEST_NAME} COMPONENT tests)
        set(result 0)
    endif()
    #message("add_gtest returns ${result}")
118
    set(result ${result} PARENT_SCOPE)
119
120
endfunction(add_gtest_executable TEST_NAME)

Chao Liu's avatar
Chao Liu committed
121
122
123
124
125
add_subdirectory(magic_number_division)
add_subdirectory(space_filling_curve)
add_subdirectory(conv_util)
add_subdirectory(reference_conv_fwd)
add_subdirectory(gemm)
126
add_subdirectory(gemm_layernorm)
Chao Liu's avatar
Chao Liu committed
127
add_subdirectory(gemm_split_k)
Chao Liu's avatar
Chao Liu committed
128
129
add_subdirectory(gemm_reduce)
add_subdirectory(batched_gemm)
130
add_subdirectory(batched_gemm_reduce)
Anthony Chang's avatar
Anthony Chang committed
131
add_subdirectory(batched_gemm_gemm)
Anthony Chang's avatar
Anthony Chang committed
132
add_subdirectory(batched_gemm_softmax_gemm)
133
add_subdirectory(batched_gemm_softmax_gemm_permute)
Chao Liu's avatar
Chao Liu committed
134
add_subdirectory(grouped_gemm)
135
add_subdirectory(reduce)
136
add_subdirectory(convnd_fwd)
JD's avatar
JD committed
137
add_subdirectory(convnd_bwd_data)
138
add_subdirectory(grouped_convnd_fwd)
139
add_subdirectory(grouped_convnd_bwd_weight)
140
add_subdirectory(block_to_ctile_map)
141
add_subdirectory(softmax)
rocking's avatar
rocking committed
142
add_subdirectory(normalization_fwd)
Adam Osewski's avatar
Adam Osewski committed
143
add_subdirectory(data_type)
144
add_subdirectory(elementwise_normalization)
145
add_subdirectory(batchnorm)
146
add_subdirectory(contraction)
147
add_subdirectory(pool)
148
add_subdirectory(batched_gemm_multi_d)
149
add_subdirectory(grouped_convnd_bwd_data)
150
add_subdirectory(conv_tensor_rearrange)
arai713's avatar
arai713 committed
151
add_subdirectory(transpose)
152
if(GPU_TARGETS MATCHES "gfx11")
153
154
    add_subdirectory(wmma_op)
endif()