Debian Codegraph @

packages/kokkos/cmake/deps/CUDA.cmake

raw
1 #@HEADER
2 # ************************************************************************
3 #
4 # Kokkos v. 4.0
5 # Copyright (2022) National Technology & Engineering
6 # Solutions of Sandia, LLC (NTESS).
7 #
8 # Under the terms of Contract DE-NA0003525 with NTESS,
9 # the U.S. Government retains certain rights in this software.
10 #
11 # Part of Kokkos, under the Apache License v2.0 with LLVM Exceptions.
12 #
13 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
14 #
15 # ************************************************************************
16 # @HEADER
17
18 # Check for CUDA support
19
20 set(_CUDA_FAILURE OFF)
21
22 # Have CMake find CUDA
23 if(NOT _CUDA_FAILURE)
24 find_package(CUDA 3.2)
25 if(NOT CUDA_FOUND)
26 set(_CUDA_FAILURE ON)
27 endif()
28 endif()
29
30 if(NOT _CUDA_FAILURE)
31 # if we haven't met failure
32 macro(PACKAGE_ADD_CUDA_LIBRARY cuda_target)
33 tribits_add_library(${cuda_target} ${ARGN} CUDALIBRARY)
34 endmacro()
35 global_set(TPL_CUDA_LIBRARY_DIRS)
36 global_set(TPL_CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE})
37 global_set(TPL_CUDA_LIBRARIES ${CUDA_CUDART_LIBRARY} ${CUDA_cublas_LIBRARY} ${CUDA_cufft_LIBRARY})
38 else()
39 set(TPL_ENABLE_CUDA OFF)
40 endif()