File: CMakeLists.txt

package info (click to toggle)
libthrust 1.17.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 10,900 kB
  • sloc: ansic: 29,519; cpp: 23,989; python: 1,421; sh: 811; perl: 460; makefile: 112
file content (29 lines) | stat: -rw-r--r-- 1,050 bytes parent folder | download
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
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
  # MSVC builds fail at runtime. Benchmarks are linux-only for now.
  message(STATUS "Thrust benchmarking is not available on MSVC.")
  return()
endif()

add_custom_target(thrust.all.bench)

foreach(thrust_target IN LISTS THRUST_TARGETS)
  thrust_get_target_property(config_host ${thrust_target} HOST)
  thrust_get_target_property(config_device ${thrust_target} DEVICE)
  thrust_get_target_property(config_prefix ${thrust_target} PREFIX)

  # Skip non cpp.cuda targets:
  if (NOT config_host   STREQUAL "CPP" OR
      NOT config_device STREQUAL "CUDA")
    continue()
  endif()

  set(bench_target ${config_prefix}.bench)

  add_executable(${bench_target} bench.cu)
  target_link_libraries(${bench_target} PRIVATE ${thrust_target})
  target_include_directories(${bench_target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
  thrust_clone_target_properties(${bench_target} ${thrust_target})

  add_dependencies(thrust.all.bench ${bench_target})
  add_dependencies(${config_prefix}.all ${bench_target})
endforeach()