
# This file was generated by the build system used internally in the Yandex monorepo.
# Only simple modifications are allowed (adding source-files to targets, adding simple properties
# like target_include_directories). These modifications will be ported to original
# ya.make files by maintainers. Any complex modifications which can't be ported back to the
# original buildsystem will not be accepted.


find_package(CUDAToolkit REQUIRED)

add_library(cpp-cuda-wrappers)
target_cuda_sources(cpp-cuda-wrappers PRIVATE
  ${CMAKE_SOURCE_DIR}/library/cpp/cuda/wrappers/kernel.cu
  ${CMAKE_SOURCE_DIR}/library/cpp/cuda/wrappers/kernel_helpers.cu
  ${CMAKE_SOURCE_DIR}/library/cpp/cuda/wrappers/arch.cu
)
target_link_libraries(cpp-cuda-wrappers PUBLIC
  contrib-libs-linux-headers
  contrib-libs-cxxsupp
  yutil
  libs-nvidia-cub
  cpp-cuda-exception
  cpp-threading-future
  CUDA::toolkit
)
target_sources(cpp-cuda-wrappers PRIVATE
  ${CMAKE_SOURCE_DIR}/library/cpp/cuda/wrappers/base.cpp
  ${CMAKE_SOURCE_DIR}/library/cpp/cuda/wrappers/run_gpu_program.cpp
  ${CMAKE_SOURCE_DIR}/library/cpp/cuda/wrappers/cuda_event.cpp
  ${CMAKE_SOURCE_DIR}/library/cpp/cuda/wrappers/stream_pool.cpp
  ${CMAKE_SOURCE_DIR}/library/cpp/cuda/wrappers/cuda_vec.cpp
  ${CMAKE_SOURCE_DIR}/library/cpp/cuda/wrappers/cuda_graph.cpp
  ${CMAKE_SOURCE_DIR}/library/cpp/cuda/wrappers/stream_capture.cpp
)
target_cuda_cflags(cpp-cuda-wrappers)
target_cuda_flags(cpp-cuda-wrappers
  -gencode
  arch=compute_35,code=sm_35
  -gencode
  arch=compute_50,code=compute_50
  -gencode
  arch=compute_52,code=sm_52
  -gencode
  arch=compute_60,code=compute_60
  -gencode
  arch=compute_61,code=compute_61
  -gencode
  arch=compute_61,code=sm_61
  -gencode
  arch=compute_70,code=sm_70
  -gencode
  arch=compute_70,code=compute_70
  --ptxas-options=-v
  -lineinfo
  --use_fast_math
  -gencode=arch=compute_80,code=sm_80
  -gencode=arch=compute_86,code=sm_86
  -gencode=arch=compute_89,code=sm_89
  -gencode=arch=compute_90,code=sm_90
)
