File: CMakeLists.txt

package info (click to toggle)
gridtools 2.3.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 29,480 kB
  • sloc: cpp: 228,792; python: 17,561; javascript: 9,164; ansic: 4,101; sh: 850; makefile: 231; f90: 201
file content (39 lines) | stat: -rw-r--r-- 1,863 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
function(gridtools_add_storage_test tgt_name)
    set(options SKIP_GPU)
    set(one_value_args)
    set(multi_value_args SOURCES)
    cmake_parse_arguments(ARGS "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN})
    foreach(storage IN LISTS GT_STORAGES)
        if(ARGS_SKIP_GPU AND storage STREQUAL "gpu")
            return()
        endif()
        set(tgt ${tgt_name}_${storage})
        gridtools_add_unit_test(${tgt}
                SOURCES ${ARGS_SOURCES}
                LIBRARIES storage_${storage}
                LABELS storage ${storage}
                NO_NVCC)
        string(TOUPPER ${storage} u_storage)
        target_compile_definitions(${tgt} PRIVATE GT_STORAGE_${u_storage})
    endforeach()
endfunction()

gridtools_add_unit_test(test_storage_info SOURCES test_storage_info.cpp LABELS storage)

gridtools_add_storage_test(test_storage_sid SOURCES test_storage_sid.cpp)
gridtools_add_storage_test(test_storage_facility SOURCES test_storage_facility.cpp SKIP_GPU) # see below
gridtools_add_storage_test(test_alignment_inner_region SOURCES test_alignment_inner_region.cpp)
gridtools_add_storage_test(test_data_store SOURCES test_data_store.cpp)
gridtools_add_storage_test(test_host_view SOURCES test_host_view.cpp)


# tests requiring a CUDA compiler
if(TARGET storage_gpu AND TARGET _gridtools_cuda)
    gridtools_add_unit_test(test_target_view_gpu SOURCES test_target_view.cu LIBRARIES storage_gpu _gridtools_cuda LABELS storage gpu NO_NVCC)

    # for test_storage_facility_cuda we need a CUDA compiler for validation, therefore explicitly linking to _gridtools_cuda
    gridtools_add_unit_test(test_storage_facility_gpu SOURCES test_storage_facility.cpp LIBRARIES storage_gpu _gridtools_cuda LABELS storage gpu)
    target_compile_definitions(test_storage_facility_gpu PRIVATE GT_STORAGE_GPU)
endif()

add_subdirectory(adapter)