# This file was generated by the YaTool build system (https://github.com/yandex/yatool),
# from a source YaTool build configuration provided in ya.make files.
#
# If the repository supports both CMake and ya build configurations, please modify both of them.
#
# If only CMake build configuration is supported then modify only CMake files and note that only
# simple modifications are allowed like adding source-files to targets or 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 easily ported back to the ya build
# system may be rejected.
#
# Please refer to the build instructions in the repository for more information about manual
# changes in this file.

add_subdirectory(ut)

add_library(catboost-cuda-methods)


target_link_libraries(catboost-cuda-methods PUBLIC
  contrib-libs-cxxsupp
  yutil
  catboost-cuda-ctrs
  catboost-cuda-cuda_lib
  catboost-cuda-cuda_util
  catboost-cuda-data
  catboost-cuda-gpu_data
  models
  catboost-cuda-targets
  private-libs-ctr_description
  catboost-libs-data
  catboost-libs-helpers
  private-libs-lapack
  catboost-libs-loggers
  catboost-libs-metrics
  catboost-libs-overfitting_detector
  cpp-cuda-exception
  cpp-threading-local_executor
  internal-platform-cuda
)

target_cuda_sources(catboost-cuda-methods PRIVATE
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/linear_cusolver_stub.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pointwise_hist2.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pointwise_hist2_binary.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pointwise_hist2_half_byte.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pointwise_hist2_one_byte_5bit.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pointwise_hist2_one_byte_6bit.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pointwise_hist2_one_byte_7bit.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pointwise_hist2_one_byte_8bit.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pointwise_hist1.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pointwise_scores.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/linear_solver.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pairwise_hist.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pairwise_hist_binary.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pairwise_hist_half_byte.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/exact_estimation.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/langevin_utils.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pairwise_hist_one_byte_5bit.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pairwise_hist_one_byte_6bit.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pairwise_hist_one_byte_7bit.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pairwise_hist_one_byte_8bit_atomics.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pairwise_hist_one_byte_5bit_one_hot.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pairwise_hist_one_byte_6bit_one_hot.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pairwise_hist_one_byte_7bit_one_hot.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/pairwise_hist_one_byte_8bit_atomics_one_hot.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/kernel/split_pairwise.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/kernel/gather_bins.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/kernel/hist.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/kernel/hist_one_byte.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/kernel/hist_2_one_byte_5bit.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/kernel/hist_2_one_byte_6bit.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/kernel/hist_2_one_byte_7bit.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/kernel/hist_half_byte.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/kernel/hist_binary.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/kernel/histogram_utils.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/kernel/split_points.cu
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/kernel/compute_scores.cu
)

target_sources(catboost-cuda-methods PRIVATE
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/split_points.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/model_builder.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/compute_by_blocks_helper.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/split_properties_helper.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/greedy_subsets_searcher/greedy_search_helper.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/add_oblivious_tree_model_feature_parallel.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/histograms_helper.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/helpers.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/pointwise_score_calcer.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/langevin_utils.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/feature_parallel_pointwise_oblivious_tree.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/oblivious_tree_structure_searcher.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/oblivious_tree_doc_parallel_structure_searcher.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/leaves_estimation/oblivious_tree_leaves_estimator.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/leaves_estimation/step_estimator.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/leaves_estimation/leaves_estimation_helper.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/leaves_estimation/descent_helpers.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/leaves_estimation/doc_parallel_leaves_estimator.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/leaves_estimation/pointwise_oracle.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/boosting_progress_tracker.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/boosting_metric_calcer.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/tree_ctrs.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/ctr_from_tensor_calcer.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/batch_feature_tensor_builder.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/tree_ctrs_dataset.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/tree_ctr_datasets_visitor.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/serialization_helper.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/pointwise_optimization_subsets.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/update_feature_weights.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/stripe_target_wrapper.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/pairwise_oblivious_trees/pairwise_score_calcer_for_policy.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/pairwise_oblivious_trees/pairwise_scores_calcer.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/pairwise_oblivious_trees/blocked_histogram_helper.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/pairwise_oblivious_trees/pairwise_oblivious_tree.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/pairwise_oblivious_trees/pairwise_optimization_subsets.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/pairwise_oblivious_trees/pairwise_structure_searcher.cpp
)


target_cuda_flags(catboost-cuda-methods
  -Wno-deprecated-gpu-targets
)

add_global_library_for(catboost-cuda-methods.global
  catboost-cuda-methods)


target_link_libraries(catboost-cuda-methods.global PUBLIC
  contrib-libs-cxxsupp
  yutil
  catboost-cuda-ctrs
  catboost-cuda-cuda_lib
  catboost-cuda-cuda_util
  catboost-cuda-data
  catboost-cuda-gpu_data
  models
  catboost-cuda-targets
  private-libs-ctr_description
  catboost-libs-data
  catboost-libs-helpers
  private-libs-lapack
  catboost-libs-loggers
  catboost-libs-metrics
  catboost-libs-overfitting_detector
  cpp-cuda-exception
  cpp-threading-local_executor
  internal-platform-cuda
)

target_sources(catboost-cuda-methods.global PRIVATE
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/pointwise_kernels.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/pairwise_kernels.cpp
  ${PROJECT_SOURCE_DIR}/catboost/cuda/methods/exact_estimation.cpp
)

