-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
73 lines (61 loc) · 2.46 KB
/
CMakeLists.txt
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
cmake_minimum_required(VERSION 3.20.0 FATAL_ERROR)
project(STINCILLA CXX)
enable_testing()
find_package(AnyDSL_runtime REQUIRED)
include_directories(${AnyDSL_runtime_INCLUDE_DIRS})
set(BACKEND "cpu" CACHE STRING "select the backend from the following: CPU, AVX, NVVM, CUDA, OPENCL, AMDGPU_HSA, AMDGPU_PAL")
set_property(CACHE BACKEND PROPERTY STRINGS cpu avx nvvm cuda opencl amdgpu_hsa amdgpu_pal)
string(TOLOWER ${BACKEND} BACKEND)
message(STATUS "Selected backend: ${BACKEND}")
set(BACKEND_FILE backend_${BACKEND}.impala)
if(BACKEND STREQUAL "cpu" OR BACKEND STREQUAL "avx")
set(DEVICE "cpu")
else()
set(DEVICE "acc")
endif()
set(CLANG_FLAGS -march=native)
set(ARTIC_FLAGS --log-level info --max-errors 5)
set(STINCILLA_COMMON_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/common/pnm_image)
include_directories(${STINCILLA_COMMON_INCLUDE_DIRS})
add_subdirectory(aobench)
add_subdirectory(bilateral_grid)
add_subdirectory(halide)
add_subdirectory(harris_corner)
add_subdirectory(test)
add_subdirectory(image_sharpening)
add_subdirectory(sorting_networks)
add_subdirectory(vcycle)
# simple CPU-based examples
anydsl_runtime_wrap(MATMUL_PROGRAM
FRONTEND "artic"
CLANG_FLAGS ${CLANG_FLAGS}
ARTIC_FLAGS ${ARTIC_FLAGS}
FILES ${BACKEND_FILE} utils.impala matmul.impala)
add_executable(matmul ${MATMUL_PROGRAM})
target_link_libraries(matmul ${AnyDSL_runtime_LIBRARIES})
add_test("matmul" matmul)
# examples based on the "mapping"
anydsl_runtime_wrap(GAUSSIAN_PROGRAM
FRONTEND "artic"
CLANG_FLAGS ${CLANG_FLAGS}
ARTIC_FLAGS ${ARTIC_FLAGS}
FILES ${BACKEND_FILE} utils.impala stencil_lib.impala mapping_${DEVICE}.impala gaussian.impala)
add_executable(gaussian ${GAUSSIAN_PROGRAM})
target_link_libraries(gaussian ${AnyDSL_runtime_LIBRARIES})
add_test("gaussian" gaussian)
anydsl_runtime_wrap(BILATERAL_PROGRAM
FRONTEND "artic"
CLANG_FLAGS ${CLANG_FLAGS}
ARTIC_FLAGS ${ARTIC_FLAGS}
FILES ${BACKEND_FILE} utils.impala stencil_lib.impala mapping_${DEVICE}.impala bilateral.impala)
add_executable(bilateral ${BILATERAL_PROGRAM})
target_link_libraries(bilateral ${AnyDSL_runtime_LIBRARIES})
add_test("bilateral" bilateral)
anydsl_runtime_wrap(JACOBI_PROGRAM
FRONTEND "artic"
CLANG_FLAGS ${CLANG_FLAGS}
ARTIC_FLAGS ${ARTIC_FLAGS}
FILES ${BACKEND_FILE} utils.impala stencil_lib.impala mapping_${DEVICE}.impala jacobi.impala)
add_executable(jacobi ${JACOBI_PROGRAM})
target_link_libraries(jacobi ${AnyDSL_runtime_LIBRARIES})
add_test("jacobi" jacobi)