1
0
mirror of https://github.com/rapidsai/cudf.git synced 2021-11-08 00:24:56 +03:00

Enable CMake format in CI and fix style (#9570)

This PR uses cmake-format to reformat all CMake files in the repository and addresses higher-level issues raised by running cmake-lint. It enables both cmake-format and cmake-lint in CI by pulling the cmake-format-rapids-cmake.json file from the [rapids-cmake](https://github.com/rapidsai/rapids-cmake) repo's main branch on demand. Running CI on CMake will ensure consistent style going forward.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Jason Lowe (https://github.com/jlowe)
  - Robert Maynard (https://github.com/robertmaynard)
  - AJ Schmidt (https://github.com/ajschmidt8)
  - Mark Harris (https://github.com/harrism)

URL: https://github.com/rapidsai/cudf/pull/9570
This commit is contained in:
Vyas Ramasubramani
2021-11-03 09:25:26 -07:00
committed by GitHub
parent 395b19064f
commit 0674316dd8
24 changed files with 1965 additions and 1869 deletions

View File

@@ -78,7 +78,7 @@ repos:
# Note that pre-commit autoupdate does not update the versions
# of dependencies, so we'll have to update this manually.
additional_dependencies:
- cmakelang==0.6.13
- cmake-format==0.6.11
- id: cmake-lint
name: cmake-lint
entry: bash cpp/scripts/run-cmake-format.sh cmake-lint
@@ -87,7 +87,7 @@ repos:
# Note that pre-commit autoupdate does not update the versions
# of dependencies, so we'll have to update this manually.
additional_dependencies:
- cmakelang==0.6.13
- cmake-format==0.6.11
default_language_version:
python: python3

View File

@@ -14,6 +14,11 @@ LANG=C.UTF-8
. /opt/conda/etc/profile.d/conda.sh
conda activate rapids
FORMAT_FILE_URL=https://raw.githubusercontent.com/rapidsai/rapids-cmake/main/cmake-format-rapids-cmake.json
export RAPIDS_CMAKE_FORMAT_FILE=/tmp/rapids_cmake_ci/cmake-formats-rapids-cmake.json
mkdir -p $(dirname ${RAPIDS_CMAKE_FORMAT_FILE})
wget -O ${RAPIDS_CMAKE_FORMAT_FILE} ${FORMAT_FILE_URL}
pre-commit run --hook-stage manual --all-files
PRE_COMMIT_RETVAL=$?

File diff suppressed because it is too large Load Diff

View File

@@ -1,231 +1,232 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2018-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
find_package(Threads REQUIRED)
add_library(cudf_datagen STATIC common/generate_benchmark_input.cpp)
target_compile_features(cudf_datagen PUBLIC cxx_std_17 cuda_std_17)
target_compile_options(cudf_datagen
PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${CUDF_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_FLAGS}>")
target_compile_options(
cudf_datagen PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${CUDF_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_FLAGS}>"
)
target_link_libraries(cudf_datagen
PUBLIC GTest::gmock
GTest::gtest
GTest::gmock_main
GTest::gtest_main
benchmark::benchmark
nvbench::nvbench
Threads::Threads
cudf)
target_link_libraries(
cudf_datagen PUBLIC GTest::gmock GTest::gtest GTest::gmock_main GTest::gtest_main
benchmark::benchmark nvbench::nvbench Threads::Threads cudf
)
target_include_directories(cudf_datagen
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}/src>")
target_include_directories(
cudf_datagen
PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>" "$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}>"
"$<BUILD_INTERFACE:${CUDF_SOURCE_DIR}/src>"
)
###################################################################################################
# - compiler function -----------------------------------------------------------------------------
# ##################################################################################################
# * compiler function -----------------------------------------------------------------------------
# Use an OBJECT library so we only compile these helper source files only once
add_library(cudf_benchmark_common OBJECT
"${CUDF_SOURCE_DIR}/tests/utilities/base_fixture.cpp"
synchronization/synchronization.cpp
io/cuio_benchmark_common.cpp)
add_library(
cudf_benchmark_common OBJECT "${CUDF_SOURCE_DIR}/tests/utilities/base_fixture.cpp"
synchronization/synchronization.cpp io/cuio_benchmark_common.cpp
)
target_link_libraries(cudf_benchmark_common PRIVATE cudf_datagen)
# This function takes in a benchmark name and benchmark source and handles setting all of the
# associated properties and linking to build the benchmark
function(ConfigureBench CMAKE_BENCH_NAME)
add_executable(${CMAKE_BENCH_NAME} ${ARGN})
set_target_properties(${CMAKE_BENCH_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUDF_BINARY_DIR}/benchmarks>")
target_link_libraries(${CMAKE_BENCH_NAME}
PRIVATE cudf_benchmark_common cudf_datagen benchmark::benchmark_main)
add_executable(${CMAKE_BENCH_NAME} ${ARGN})
set_target_properties(
${CMAKE_BENCH_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"$<BUILD_INTERFACE:${CUDF_BINARY_DIR}/benchmarks>"
)
target_link_libraries(
${CMAKE_BENCH_NAME} PRIVATE cudf_benchmark_common cudf_datagen benchmark::benchmark_main
)
endfunction()
# This function takes in a benchmark name and benchmark source for nvbench benchmarks and handles
# setting all of the associated properties and linking to build the benchmark
function(ConfigureNVBench CMAKE_BENCH_NAME)
add_executable(${CMAKE_BENCH_NAME} ${ARGN})
set_target_properties(${CMAKE_BENCH_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUDF_BINARY_DIR}/benchmarks>")
target_link_libraries(${CMAKE_BENCH_NAME}
PRIVATE cudf_benchmark_common cudf_datagen nvbench::main)
add_executable(${CMAKE_BENCH_NAME} ${ARGN})
set_target_properties(
${CMAKE_BENCH_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"$<BUILD_INTERFACE:${CUDF_BINARY_DIR}/benchmarks>"
)
target_link_libraries(
${CMAKE_BENCH_NAME} PRIVATE cudf_benchmark_common cudf_datagen nvbench::main
)
endfunction()
###################################################################################################
# - column benchmarks -----------------------------------------------------------------------------
# ##################################################################################################
# * column benchmarks -----------------------------------------------------------------------------
ConfigureBench(COLUMN_CONCAT_BENCH column/concatenate_benchmark.cpp)
###################################################################################################
# - gather benchmark ------------------------------------------------------------------------------
# ##################################################################################################
# * gather benchmark ------------------------------------------------------------------------------
ConfigureBench(GATHER_BENCH copying/gather_benchmark.cu)
###################################################################################################
# - scatter benchmark -----------------------------------------------------------------------------
# ##################################################################################################
# * scatter benchmark -----------------------------------------------------------------------------
ConfigureBench(SCATTER_BENCH copying/scatter_benchmark.cu)
###################################################################################################
# - lists scatter benchmark -----------------------------------------------------------------------
# ##################################################################################################
# * lists scatter benchmark -----------------------------------------------------------------------
ConfigureBench(SCATTER_LISTS_BENCH lists/copying/scatter_lists_benchmark.cu)
###################################################################################################
# - contiguous_split benchmark -------------------------------------------------------------------
# ##################################################################################################
# * contiguous_split benchmark -------------------------------------------------------------------
ConfigureBench(CONTIGUOUS_SPLIT_BENCH copying/contiguous_split_benchmark.cu)
###################################################################################################
# - shift benchmark -------------------------------------------------------------------------------
# ##################################################################################################
# * shift benchmark -------------------------------------------------------------------------------
ConfigureBench(SHIFT_BENCH copying/shift_benchmark.cu)
###################################################################################################
# - copy-if-else benchmark -----------------------------------------------------------------------------
# ##################################################################################################
# * copy-if-else benchmark
# -----------------------------------------------------------------------------
ConfigureBench(COPY_IF_ELSE_BENCH copying/copy_if_else_benchmark.cpp)
###################################################################################################
# - transpose benchmark ---------------------------------------------------------------------------
# ##################################################################################################
# * transpose benchmark ---------------------------------------------------------------------------
ConfigureBench(TRANSPOSE_BENCH transpose/transpose_benchmark.cu)
###################################################################################################
# - apply_boolean_mask benchmark ------------------------------------------------------------------
# ##################################################################################################
# * apply_boolean_mask benchmark ------------------------------------------------------------------
ConfigureBench(APPLY_BOOLEAN_MASK_BENCH stream_compaction/apply_boolean_mask_benchmark.cpp)
###################################################################################################
# - stream_compaction benchmark -------------------------------------------------------------------
# ##################################################################################################
# * stream_compaction benchmark -------------------------------------------------------------------
ConfigureBench(STREAM_COMPACTION_BENCH stream_compaction/drop_duplicates_benchmark.cpp)
###################################################################################################
# - join benchmark --------------------------------------------------------------------------------
# ##################################################################################################
# * join benchmark --------------------------------------------------------------------------------
ConfigureBench(JOIN_BENCH join/join_benchmark.cu join/conditional_join_benchmark.cu)
ConfigureNVBench(JOIN_NVBENCH join/join_nvbench.cu)
###################################################################################################
# - iterator benchmark ----------------------------------------------------------------------------
# ##################################################################################################
# * iterator benchmark ----------------------------------------------------------------------------
ConfigureBench(ITERATOR_BENCH iterator/iterator_benchmark.cu)
###################################################################################################
# - search benchmark ------------------------------------------------------------------------------
# ##################################################################################################
# * search benchmark ------------------------------------------------------------------------------
ConfigureBench(SEARCH_BENCH search/search_benchmark.cpp)
###################################################################################################
# - sort benchmark --------------------------------------------------------------------------------
ConfigureBench(SORT_BENCH
sort/rank_benchmark.cpp
sort/sort_benchmark.cpp
sort/sort_strings_benchmark.cpp)
# ##################################################################################################
# * sort benchmark --------------------------------------------------------------------------------
ConfigureBench(
SORT_BENCH sort/rank_benchmark.cpp sort/sort_benchmark.cpp sort/sort_strings_benchmark.cpp
)
###################################################################################################
# - quantiles benchmark --------------------------------------------------------------------------------
ConfigureBench(QUANTILES_BENCH
quantiles/quantiles_benchmark.cpp)
# ##################################################################################################
# * quantiles benchmark
# --------------------------------------------------------------------------------
ConfigureBench(QUANTILES_BENCH quantiles/quantiles_benchmark.cpp)
###################################################################################################
# - type_dispatcher benchmark ---------------------------------------------------------------------
# ##################################################################################################
# * type_dispatcher benchmark ---------------------------------------------------------------------
ConfigureBench(TYPE_DISPATCHER_BENCH type_dispatcher/type_dispatcher_benchmark.cu)
###################################################################################################
# - reduction benchmark ---------------------------------------------------------------------------
ConfigureBench(REDUCTION_BENCH
reduction/anyall_benchmark.cpp
reduction/dictionary_benchmark.cpp
reduction/reduce_benchmark.cpp
reduction/scan_benchmark.cpp
reduction/minmax_benchmark.cpp)
# ##################################################################################################
# * reduction benchmark ---------------------------------------------------------------------------
ConfigureBench(
REDUCTION_BENCH reduction/anyall_benchmark.cpp reduction/dictionary_benchmark.cpp
reduction/reduce_benchmark.cpp reduction/scan_benchmark.cpp reduction/minmax_benchmark.cpp
)
###################################################################################################
# - reduction benchmark ---------------------------------------------------------------------------
ConfigureBench(REPLACE_BENCH
replace/clamp_benchmark.cpp
replace/nans_benchmark.cpp)
# ##################################################################################################
# * reduction benchmark ---------------------------------------------------------------------------
ConfigureBench(REPLACE_BENCH replace/clamp_benchmark.cpp replace/nans_benchmark.cpp)
###################################################################################################
# - filling benchmark -----------------------------------------------------------------------------
ConfigureBench(FILL_BENCH
filling/repeat_benchmark.cpp)
# ##################################################################################################
# * filling benchmark -----------------------------------------------------------------------------
ConfigureBench(FILL_BENCH filling/repeat_benchmark.cpp)
###################################################################################################
# - groupby benchmark -----------------------------------------------------------------------------
ConfigureBench(GROUPBY_BENCH
groupby/group_sum_benchmark.cu
groupby/group_nth_benchmark.cu
groupby/group_shift_benchmark.cu)
# ##################################################################################################
# * groupby benchmark -----------------------------------------------------------------------------
ConfigureBench(
GROUPBY_BENCH groupby/group_sum_benchmark.cu groupby/group_nth_benchmark.cu
groupby/group_shift_benchmark.cu
)
###################################################################################################
# - hashing benchmark -----------------------------------------------------------------------------
ConfigureBench(HASHING_BENCH
hashing/hash_benchmark.cpp
hashing/partition_benchmark.cpp)
# ##################################################################################################
# * hashing benchmark -----------------------------------------------------------------------------
ConfigureBench(HASHING_BENCH hashing/hash_benchmark.cpp hashing/partition_benchmark.cpp)
###################################################################################################
# - merge benchmark -------------------------------------------------------------------------------
# ##################################################################################################
# * merge benchmark -------------------------------------------------------------------------------
ConfigureBench(MERGE_BENCH merge/merge_benchmark.cpp)
###################################################################################################
# - null_mask benchmark ---------------------------------------------------------------------------
# ##################################################################################################
# * null_mask benchmark ---------------------------------------------------------------------------
ConfigureBench(NULLMASK_BENCH null_mask/set_null_mask_benchmark.cpp)
###################################################################################################
# - parquet writer chunks benchmark ---------------------------------------------------------------
# ##################################################################################################
# * parquet writer chunks benchmark ---------------------------------------------------------------
ConfigureBench(PARQUET_WRITER_CHUNKS_BENCH io/parquet/parquet_writer_chunks_benchmark.cpp)
###################################################################################################
# - parquet reader benchmark ----------------------------------------------------------------------
# ##################################################################################################
# * parquet reader benchmark ----------------------------------------------------------------------
ConfigureBench(PARQUET_READER_BENCH io/parquet/parquet_reader_benchmark.cpp)
###################################################################################################
# - orc reader benchmark --------------------------------------------------------------------------
# ##################################################################################################
# * orc reader benchmark --------------------------------------------------------------------------
ConfigureBench(ORC_READER_BENCH io/orc/orc_reader_benchmark.cpp)
###################################################################################################
# - csv reader benchmark --------------------------------------------------------------------------
# ##################################################################################################
# * csv reader benchmark --------------------------------------------------------------------------
ConfigureBench(CSV_READER_BENCH io/csv/csv_reader_benchmark.cpp)
###################################################################################################
# - parquet writer benchmark ----------------------------------------------------------------------
# ##################################################################################################
# * parquet writer benchmark ----------------------------------------------------------------------
ConfigureBench(PARQUET_WRITER_BENCH io/parquet/parquet_writer_benchmark.cpp)
###################################################################################################
# - orc writer benchmark --------------------------------------------------------------------------
# ##################################################################################################
# * orc writer benchmark --------------------------------------------------------------------------
ConfigureBench(ORC_WRITER_BENCH io/orc/orc_writer_benchmark.cpp)
###################################################################################################
# - csv writer benchmark --------------------------------------------------------------------------
# ##################################################################################################
# * csv writer benchmark --------------------------------------------------------------------------
ConfigureBench(CSV_WRITER_BENCH io/csv/csv_writer_benchmark.cpp)
###################################################################################################
# - ast benchmark ---------------------------------------------------------------------------------
# ##################################################################################################
# * ast benchmark ---------------------------------------------------------------------------------
ConfigureBench(AST_BENCH ast/transform_benchmark.cpp)
###################################################################################################
# - binaryop benchmark ----------------------------------------------------------------------------
ConfigureBench(BINARYOP_BENCH
binaryop/binaryop_benchmark.cpp
binaryop/compiled_binaryop_benchmark.cpp
binaryop/jit_binaryop_benchmark.cpp)
# ##################################################################################################
# * binaryop benchmark ----------------------------------------------------------------------------
ConfigureBench(
BINARYOP_BENCH binaryop/binaryop_benchmark.cpp binaryop/compiled_binaryop_benchmark.cpp
binaryop/jit_binaryop_benchmark.cpp
)
###################################################################################################
# - nvtext benchmark -------------------------------------------------------------------
ConfigureBench(TEXT_BENCH
# ##################################################################################################
# * nvtext benchmark -------------------------------------------------------------------
ConfigureBench(
TEXT_BENCH
text/ngrams_benchmark.cpp
text/normalize_benchmark.cpp
text/normalize_spaces_benchmark.cpp
text/replace_benchmark.cpp
text/subword_benchmark.cpp
text/tokenize_benchmark.cpp)
text/tokenize_benchmark.cpp
)
###################################################################################################
# - strings benchmark -------------------------------------------------------------------
ConfigureBench(STRINGS_BENCH
# ##################################################################################################
# * strings benchmark -------------------------------------------------------------------
ConfigureBench(
STRINGS_BENCH
string/case_benchmark.cpp
string/combine_benchmark.cpp
string/contains_benchmark.cpp
@@ -244,14 +245,13 @@ ConfigureBench(STRINGS_BENCH
string/split_benchmark.cpp
string/substring_benchmark.cpp
string/translate_benchmark.cpp
string/url_decode_benchmark.cpp)
string/url_decode_benchmark.cpp
)
###################################################################################################
# - json benchmark -------------------------------------------------------------------
ConfigureBench(JSON_BENCH
string/json_benchmark.cpp)
# ##################################################################################################
# * json benchmark -------------------------------------------------------------------
ConfigureBench(JSON_BENCH string/json_benchmark.cpp)
###################################################################################################
# - io benchmark ---------------------------------------------------------------------
ConfigureBench(MULTIBYTE_SPLIT_BENCHMARK
io/text/multibyte_split_benchmark.cpp)
# ##################################################################################################
# * io benchmark ---------------------------------------------------------------------
ConfigureBench(MULTIBYTE_SPLIT_BENCHMARK io/text/multibyte_split_benchmark.cpp)

View File

@@ -1,21 +1,19 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2018-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
if(CMAKE_COMPILER_IS_GNUCXX)
list(APPEND CUDF_CXX_FLAGS -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations)
list(APPEND CUDF_CXX_FLAGS -Wall -Werror -Wno-unknown-pragmas -Wno-error=deprecated-declarations)
endif()
list(APPEND CUDF_CUDA_FLAGS --expt-extended-lambda --expt-relaxed-constexpr)
@@ -25,20 +23,21 @@ list(APPEND CUDF_CUDA_FLAGS -Werror=cross-execution-space-call)
list(APPEND CUDF_CUDA_FLAGS -Xcompiler=-Wall,-Werror,-Wno-error=deprecated-declarations)
if(DISABLE_DEPRECATION_WARNING)
list(APPEND CUDF_CXX_FLAGS -Wno-deprecated-declarations)
list(APPEND CUDF_CUDA_FLAGS -Xcompiler=-Wno-deprecated-declarations)
list(APPEND CUDF_CXX_FLAGS -Wno-deprecated-declarations)
list(APPEND CUDF_CUDA_FLAGS -Xcompiler=-Wno-deprecated-declarations)
endif()
# make sure we produce smallest binary size
list(APPEND CUDF_CUDA_FLAGS -Xfatbin=-compress-all)
# Option to enable line info in CUDA device compilation to allow introspection when profiling / memchecking
# Option to enable line info in CUDA device compilation to allow introspection when profiling /
# memchecking
if(CUDA_ENABLE_LINEINFO)
list(APPEND CUDF_CUDA_FLAGS -lineinfo)
list(APPEND CUDF_CUDA_FLAGS -lineinfo)
endif()
# Debug options
if(CMAKE_BUILD_TYPE MATCHES Debug)
message(VERBOSE "CUDF: Building with debugging flags")
list(APPEND CUDF_CUDA_FLAGS -Xcompiler=-rdynamic)
message(VERBOSE "CUDF: Building with debugging flags")
list(APPEND CUDF_CUDA_FLAGS -Xcompiler=-rdynamic)
endif()

View File

@@ -1,17 +1,15 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
#[=======================================================================[.rst:
FindcuFile
@@ -48,81 +46,73 @@ This will define the following variables in your project:
#]=======================================================================]
# use pkg-config to get the directories and then use these values
# in the FIND_PATH() and FIND_LIBRARY() calls
# use pkg-config to get the directories and then use these values in the FIND_PATH() and
# FIND_LIBRARY() calls
find_package(PkgConfig QUIET)
pkg_check_modules(PKG_cuFile QUIET cuFile)
set(cuFile_COMPILE_OPTIONS ${PKG_cuFile_CFLAGS_OTHER})
set(cuFile_VERSION ${PKG_cuFile_VERSION})
find_path(cuFile_INCLUDE_DIR
NAMES
cufile.h
HINTS
${PKG_cuFile_INCLUDE_DIRS}
/usr/local/cuda/include
/usr/local/cuda/lib64
find_path(
cuFile_INCLUDE_DIR
NAMES cufile.h
HINTS ${PKG_cuFile_INCLUDE_DIRS} /usr/local/cuda/include /usr/local/cuda/lib64
)
find_library(cuFile_LIBRARY
NAMES
cufile
HINTS
${PKG_cuFile_LIBRARY_DIRS}
/usr/local/cuda/lib64
find_library(
cuFile_LIBRARY
NAMES cufile
HINTS ${PKG_cuFile_LIBRARY_DIRS} /usr/local/cuda/lib64
)
find_library(cuFileRDMA_LIBRARY
NAMES
cufile_rdma
HINTS
${PKG_cuFile_LIBRARY_DIRS}
/usr/local/cuda/lib64
find_library(
cuFileRDMA_LIBRARY
NAMES cufile_rdma
HINTS ${PKG_cuFile_LIBRARY_DIRS} /usr/local/cuda/lib64
)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(cuFile
FOUND_VAR
cuFile_FOUND
REQUIRED_VARS
cuFile_LIBRARY
cuFileRDMA_LIBRARY
cuFile_INCLUDE_DIR
VERSION_VAR
cuFile_VERSION
find_package_handle_standard_args(
cuFile
FOUND_VAR cuFile_FOUND
REQUIRED_VARS cuFile_LIBRARY cuFileRDMA_LIBRARY cuFile_INCLUDE_DIR
VERSION_VAR cuFile_VERSION
)
if (cuFile_INCLUDE_DIR AND NOT TARGET cuFile::cuFile_interface)
if(cuFile_INCLUDE_DIR AND NOT TARGET cuFile::cuFile_interface)
add_library(cuFile::cuFile_interface IMPORTED INTERFACE)
target_include_directories(cuFile::cuFile_interface INTERFACE "$<BUILD_INTERFACE:${cuFile_INCLUDE_DIR}>")
target_include_directories(
cuFile::cuFile_interface INTERFACE "$<BUILD_INTERFACE:${cuFile_INCLUDE_DIR}>"
)
target_compile_options(cuFile::cuFile_interface INTERFACE "${cuFile_COMPILE_OPTIONS}")
target_compile_definitions(cuFile::cuFile_interface INTERFACE CUFILE_FOUND)
endif ()
endif()
if (cuFile_FOUND AND NOT TARGET cuFile::cuFile)
if(cuFile_FOUND AND NOT TARGET cuFile::cuFile)
add_library(cuFile::cuFile UNKNOWN IMPORTED)
set_target_properties(cuFile::cuFile PROPERTIES
IMPORTED_LOCATION "${cuFile_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${cuFile_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${cuFile_INCLUDE_DIR}"
set_target_properties(
cuFile::cuFile
PROPERTIES IMPORTED_LOCATION "${cuFile_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${cuFile_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${cuFile_INCLUDE_DIR}"
)
endif ()
endif()
if (cuFile_FOUND AND NOT TARGET cuFile::cuFileRDMA)
if(cuFile_FOUND AND NOT TARGET cuFile::cuFileRDMA)
add_library(cuFile::cuFileRDMA UNKNOWN IMPORTED)
set_target_properties(cuFile::cuFileRDMA PROPERTIES
IMPORTED_LOCATION "${cuFileRDMA_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${cuFile_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${cuFile_INCLUDE_DIR}"
set_target_properties(
cuFile::cuFileRDMA
PROPERTIES IMPORTED_LOCATION "${cuFileRDMA_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${cuFile_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${cuFile_INCLUDE_DIR}"
)
endif ()
endif()
mark_as_advanced(cuFile_LIBRARY cuFileRDMA_LIBRARY cuFile_INCLUDE_DIR)
if (cuFile_FOUND)
if(cuFile_FOUND)
set(cuFile_LIBRARIES ${cuFile_LIBRARY})
set(cuFileRDMA_LIBRARIES ${cuFileRDMA_LIBRARY})
set(cuFile_INCLUDE_DIRS ${cuFile_INCLUDE_DIR})
endif ()
endif()

View File

@@ -1,69 +1,62 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
# Create `jitify_preprocess` executable
add_executable(jitify_preprocess "${JITIFY_INCLUDE_DIR}/jitify2_preprocess.cpp")
target_link_libraries(jitify_preprocess CUDA::cudart ${CMAKE_DL_LIBS})
# Take a list of files to JIT-compile and run them through jitify_preprocess.
function(jit_preprocess_files)
cmake_parse_arguments(ARG
""
"SOURCE_DIRECTORY"
"FILES"
${ARGN}
)
cmake_parse_arguments(ARG "" "SOURCE_DIRECTORY" "FILES" ${ARGN})
get_target_property(libcudacxx_raw_includes libcudacxx::libcudacxx INTERFACE_INCLUDE_DIRECTORIES)
foreach(inc IN LISTS libcudacxx_raw_includes)
list(APPEND libcudacxx_includes "-I${inc}")
endforeach()
foreach(ARG_FILE ${ARG_FILES})
set(ARG_OUTPUT ${CUDF_GENERATED_INCLUDE_DIR}/include/jit_preprocessed_files/${ARG_FILE}.jit.hpp)
get_filename_component(jit_output_directory "${ARG_OUTPUT}" DIRECTORY )
list(APPEND JIT_PREPROCESSED_FILES "${ARG_OUTPUT}")
add_custom_command(WORKING_DIRECTORY ${ARG_SOURCE_DIRECTORY}
DEPENDS jitify_preprocess "${ARG_SOURCE_DIRECTORY}/${ARG_FILE}"
OUTPUT ${ARG_OUTPUT}
VERBATIM
COMMAND ${CMAKE_COMMAND} -E make_directory "${jit_output_directory}"
COMMAND jitify_preprocess ${ARG_FILE}
-o ${CUDF_GENERATED_INCLUDE_DIR}/include/jit_preprocessed_files
-i
-m
-std=c++17
-remove-unused-globals
-D__CUDACC_RTC__
-I${CUDF_SOURCE_DIR}/include
-I${CUDF_SOURCE_DIR}/src
${libcudacxx_includes}
-I${CUDAToolkit_INCLUDE_DIRS}
--no-preinclude-workarounds
--no-replace-pragma-once
)
endforeach()
set(JIT_PREPROCESSED_FILES "${JIT_PREPROCESSED_FILES}" PARENT_SCOPE)
get_target_property(libcudacxx_raw_includes libcudacxx::libcudacxx INTERFACE_INCLUDE_DIRECTORIES)
foreach(inc IN LISTS libcudacxx_raw_includes)
list(APPEND libcudacxx_includes "-I${inc}")
endforeach()
foreach(ARG_FILE ${ARG_FILES})
set(ARG_OUTPUT ${CUDF_GENERATED_INCLUDE_DIR}/include/jit_preprocessed_files/${ARG_FILE}.jit.hpp)
get_filename_component(jit_output_directory "${ARG_OUTPUT}" DIRECTORY)
list(APPEND JIT_PREPROCESSED_FILES "${ARG_OUTPUT}")
add_custom_command(
OUTPUT ${ARG_OUTPUT}
DEPENDS jitify_preprocess "${ARG_SOURCE_DIRECTORY}/${ARG_FILE}"
WORKING_DIRECTORY ${ARG_SOURCE_DIRECTORY}
VERBATIM
COMMAND ${CMAKE_COMMAND} -E make_directory "${jit_output_directory}"
COMMAND
jitify_preprocess ${ARG_FILE} -o
${CUDF_GENERATED_INCLUDE_DIR}/include/jit_preprocessed_files -i -m -std=c++17
-remove-unused-globals -D__CUDACC_RTC__ -I${CUDF_SOURCE_DIR}/include
-I${CUDF_SOURCE_DIR}/src ${libcudacxx_includes} -I${CUDAToolkit_INCLUDE_DIRS}
--no-preinclude-workarounds --no-replace-pragma-once
COMMENT "Custom command to JIT-compile files."
)
endforeach()
set(JIT_PREPROCESSED_FILES
"${JIT_PREPROCESSED_FILES}"
PARENT_SCOPE
)
endfunction()
jit_preprocess_files(SOURCE_DIRECTORY ${CUDF_SOURCE_DIR}/src
FILES binaryop/jit/kernel.cu
transform/jit/masked_udf_kernel.cu
transform/jit/kernel.cu
rolling/jit/kernel.cu
)
add_custom_target(jitify_preprocess_run DEPENDS ${JIT_PREPROCESSED_FILES})
jit_preprocess_files(
SOURCE_DIRECTORY ${CUDF_SOURCE_DIR}/src FILES binaryop/jit/kernel.cu
transform/jit/masked_udf_kernel.cu transform/jit/kernel.cu rolling/jit/kernel.cu
)
add_custom_target(
jitify_preprocess_run
DEPENDS ${JIT_PREPROCESSED_FILES}
COMMENT "Target representing jitified files."
)

View File

@@ -25,7 +25,8 @@
"tab_size": 2,
"command_case": "unchanged",
"max_lines_hwrap": 1,
"max_pargs_hwrap": 999
"max_pargs_hwrap": 999,
"dangle_parens": true
},
"lint": {
"disabled_codes": ["C0301"],

View File

@@ -1,163 +1,188 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
function(find_and_configure_arrow VERSION BUILD_STATIC ENABLE_S3 ENABLE_ORC ENABLE_PYTHON ENABLE_PARQUET)
# Finding arrow is far more complex than it should be, and as a result we violate multiple linting
# rules aiming to limit complexity. Since all our other CMake scripts conform to expectations
# without undue difficulty, disabling those rules for just this function is our best approach for
# now. The spacing between this comment, the cmake-lint directives, and the function docstring is
# necessary to prevent cmake-format from trying to combine the lines.
# cmake-lint: disable=R0912,R0913,R0915
# This function finds arrow and sets any additional necessary environment variables.
function(find_and_configure_arrow VERSION BUILD_STATIC ENABLE_S3 ENABLE_ORC ENABLE_PYTHON
ENABLE_PARQUET
)
if(BUILD_STATIC)
if(TARGET arrow_static AND TARGET arrow_cuda_static)
list(APPEND ARROW_LIBRARIES arrow_static)
list(APPEND ARROW_LIBRARIES arrow_cuda_static)
set(ARROW_FOUND
TRUE
PARENT_SCOPE
)
set(ARROW_LIBRARIES
${ARROW_LIBRARIES}
PARENT_SCOPE
)
return()
endif()
else()
if(TARGET arrow_shared AND TARGET arrow_cuda_shared)
list(APPEND ARROW_LIBRARIES arrow_shared)
list(APPEND ARROW_LIBRARIES arrow_cuda_shared)
set(ARROW_FOUND
TRUE
PARENT_SCOPE
)
set(ARROW_LIBRARIES
${ARROW_LIBRARIES}
PARENT_SCOPE
)
return()
endif()
endif()
set(ARROW_BUILD_SHARED ON)
set(ARROW_BUILD_STATIC OFF)
set(CPMAddOrFindPackage CPMFindPackage)
if(NOT ARROW_ARMV8_ARCH)
set(ARROW_ARMV8_ARCH "armv8-a")
endif()
if(NOT ARROW_SIMD_LEVEL)
set(ARROW_SIMD_LEVEL "NONE")
endif()
if(BUILD_STATIC)
set(ARROW_BUILD_STATIC ON)
set(ARROW_BUILD_SHARED OFF)
# Turn off CPM using `find_package` so we always download and make sure we get proper static
# library
set(CPM_DOWNLOAD_ALL TRUE)
endif()
set(ARROW_PYTHON_OPTIONS "")
if(ENABLE_PYTHON)
list(APPEND ARROW_PYTHON_OPTIONS "ARROW_PYTHON ON")
# Arrow's logic to build Boost from source is busted, so we have to get it from the system.
list(APPEND ARROW_PYTHON_OPTIONS "BOOST_SOURCE SYSTEM")
list(APPEND ARROW_PYTHON_OPTIONS "Thrift_SOURCE BUNDLED")
list(APPEND ARROW_PYTHON_OPTIONS "ARROW_DEPENDENCY_SOURCE AUTO")
endif()
# Set this so Arrow correctly finds the CUDA toolkit when the build machine does not have the CUDA
# driver installed. This must be an env var.
set(ENV{CUDA_LIB_PATH} "${CUDAToolkit_LIBRARY_DIR}/stubs")
rapids_cpm_find(
Arrow ${VERSION}
GLOBAL_TARGETS arrow_shared arrow_cuda_shared
CPM_ARGS
GIT_REPOSITORY https://github.com/apache/arrow.git
GIT_TAG apache-arrow-${VERSION}
GIT_SHALLOW TRUE SOURCE_SUBDIR cpp
OPTIONS "CMAKE_VERBOSE_MAKEFILE ON"
"CUDA_USE_STATIC_CUDA_RUNTIME ${CUDA_STATIC_RUNTIME}"
"ARROW_IPC ON"
"ARROW_CUDA ON"
"ARROW_DATASET ON"
"ARROW_WITH_BACKTRACE ON"
"ARROW_CXXFLAGS -w"
"ARROW_JEMALLOC OFF"
"ARROW_S3 ${ENABLE_S3}"
"ARROW_ORC ${ENABLE_ORC}"
# e.g. needed by blazingsql-io
"ARROW_PARQUET ${ENABLE_PARQUET}"
${ARROW_PYTHON_OPTIONS}
# Arrow modifies CMake's GLOBAL RULE_LAUNCH_COMPILE unless this is off
"ARROW_USE_CCACHE OFF"
"ARROW_ARMV8_ARCH ${ARROW_ARMV8_ARCH}"
"ARROW_SIMD_LEVEL ${ARROW_SIMD_LEVEL}"
"ARROW_BUILD_STATIC ${ARROW_BUILD_STATIC}"
"ARROW_BUILD_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_DEPENDENCY_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_BOOST_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_BROTLI_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_GFLAGS_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_GRPC_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_PROTOBUF_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_ZSTD_USE_SHARED ${ARROW_BUILD_SHARED}"
)
set(ARROW_FOUND TRUE)
set(ARROW_LIBRARIES "")
# Arrow_ADDED: set if CPM downloaded Arrow from Github Arrow_DIR: set if CPM found Arrow on the
# system/conda/etc.
if(Arrow_ADDED OR Arrow_DIR)
if(BUILD_STATIC)
if(TARGET arrow_static AND TARGET arrow_cuda_static)
list(APPEND ARROW_LIBRARIES arrow_static)
list(APPEND ARROW_LIBRARIES arrow_cuda_static)
set(ARROW_FOUND TRUE PARENT_SCOPE)
set(ARROW_LIBRARIES ${ARROW_LIBRARIES} PARENT_SCOPE)
return()
endif()
list(APPEND ARROW_LIBRARIES arrow_static)
list(APPEND ARROW_LIBRARIES arrow_cuda_static)
else()
if(TARGET arrow_shared AND TARGET arrow_cuda_shared)
list(APPEND ARROW_LIBRARIES arrow_shared)
list(APPEND ARROW_LIBRARIES arrow_cuda_shared)
set(ARROW_FOUND TRUE PARENT_SCOPE)
set(ARROW_LIBRARIES ${ARROW_LIBRARIES} PARENT_SCOPE)
return()
endif()
list(APPEND ARROW_LIBRARIES arrow_shared)
list(APPEND ARROW_LIBRARIES arrow_cuda_shared)
endif()
set(ARROW_BUILD_SHARED ON)
set(ARROW_BUILD_STATIC OFF)
set(CPMAddOrFindPackage CPMFindPackage)
if(NOT ARROW_ARMV8_ARCH)
set(ARROW_ARMV8_ARCH "armv8-a")
if(Arrow_DIR)
# Set this to enable `find_package(ArrowCUDA)`
set(ArrowCUDA_DIR "${Arrow_DIR}")
find_package(Arrow REQUIRED QUIET)
find_package(ArrowCUDA REQUIRED QUIET)
elseif(Arrow_ADDED)
# Copy these files so we can avoid adding paths in Arrow_BINARY_DIR to
# target_include_directories. That defeats ccache.
file(INSTALL "${Arrow_BINARY_DIR}/src/arrow/util/config.h"
DESTINATION "${Arrow_SOURCE_DIR}/cpp/src/arrow/util"
)
file(INSTALL "${Arrow_BINARY_DIR}/src/arrow/gpu/cuda_version.h"
DESTINATION "${Arrow_SOURCE_DIR}/cpp/src/arrow/gpu"
)
if(ENABLE_PARQUET)
file(INSTALL "${Arrow_BINARY_DIR}/src/parquet/parquet_version.h"
DESTINATION "${Arrow_SOURCE_DIR}/cpp/src/parquet"
)
endif()
#
# This shouldn't be necessary!
#
# Arrow populates INTERFACE_INCLUDE_DIRECTORIES for the `arrow_static` and `arrow_shared`
# targets in FindArrow and FindArrowCUDA respectively, so for static source-builds, we have to
# do it after-the-fact.
#
# This only works because we know exactly which components we're using. Don't forget to update
# this list if we add more!
#
foreach(ARROW_LIBRARY ${ARROW_LIBRARIES})
target_include_directories(
${ARROW_LIBRARY}
INTERFACE "$<BUILD_INTERFACE:${Arrow_SOURCE_DIR}/cpp/src>"
"$<BUILD_INTERFACE:${Arrow_SOURCE_DIR}/cpp/src/generated>"
"$<BUILD_INTERFACE:${Arrow_SOURCE_DIR}/cpp/thirdparty/hadoop/include>"
"$<BUILD_INTERFACE:${Arrow_SOURCE_DIR}/cpp/thirdparty/flatbuffers/include>"
)
endforeach()
endif()
else()
set(ARROW_FOUND FALSE)
message(FATAL_ERROR "CUDF: Arrow library not found or downloaded.")
endif()
if(NOT ARROW_SIMD_LEVEL)
set(ARROW_SIMD_LEVEL "NONE")
endif()
if(BUILD_STATIC)
set(ARROW_BUILD_STATIC ON)
set(ARROW_BUILD_SHARED OFF)
# Turn off CPM using `find_package` so we always download
# and make sure we get proper static library
set(CPM_DOWNLOAD_ALL TRUE)
endif()
set(ARROW_PYTHON_OPTIONS "")
if(ENABLE_PYTHON)
list(APPEND ARROW_PYTHON_OPTIONS "ARROW_PYTHON ON")
# Arrow's logic to build Boost from source is busted, so we have to get it from the system.
list(APPEND ARROW_PYTHON_OPTIONS "BOOST_SOURCE SYSTEM")
list(APPEND ARROW_PYTHON_OPTIONS "Thrift_SOURCE BUNDLED")
list(APPEND ARROW_PYTHON_OPTIONS "ARROW_DEPENDENCY_SOURCE AUTO")
endif()
# Set this so Arrow correctly finds the CUDA toolkit when the build machine
# does not have the CUDA driver installed. This must be an env var.
set(ENV{CUDA_LIB_PATH} "${CUDAToolkit_LIBRARY_DIR}/stubs")
rapids_cpm_find(Arrow ${VERSION}
GLOBAL_TARGETS arrow_shared arrow_cuda_shared
CPM_ARGS
GIT_REPOSITORY https://github.com/apache/arrow.git
GIT_TAG apache-arrow-${VERSION}
GIT_SHALLOW TRUE
SOURCE_SUBDIR cpp
OPTIONS "CMAKE_VERBOSE_MAKEFILE ON"
"CUDA_USE_STATIC_CUDA_RUNTIME ${CUDA_STATIC_RUNTIME}"
"ARROW_IPC ON"
"ARROW_CUDA ON"
"ARROW_DATASET ON"
"ARROW_WITH_BACKTRACE ON"
"ARROW_CXXFLAGS -w"
"ARROW_JEMALLOC OFF"
"ARROW_S3 ${ENABLE_S3}"
"ARROW_ORC ${ENABLE_ORC}"
# e.g. needed by blazingsql-io
"ARROW_PARQUET ${ENABLE_PARQUET}"
${ARROW_PYTHON_OPTIONS}
# Arrow modifies CMake's GLOBAL RULE_LAUNCH_COMPILE unless this is off
"ARROW_USE_CCACHE OFF"
"ARROW_ARMV8_ARCH ${ARROW_ARMV8_ARCH}"
"ARROW_SIMD_LEVEL ${ARROW_SIMD_LEVEL}"
"ARROW_BUILD_STATIC ${ARROW_BUILD_STATIC}"
"ARROW_BUILD_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_DEPENDENCY_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_BOOST_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_BROTLI_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_GFLAGS_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_GRPC_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_PROTOBUF_USE_SHARED ${ARROW_BUILD_SHARED}"
"ARROW_ZSTD_USE_SHARED ${ARROW_BUILD_SHARED}")
set(ARROW_FOUND TRUE)
set(ARROW_LIBRARIES "")
# Arrow_ADDED: set if CPM downloaded Arrow from Github
# Arrow_DIR: set if CPM found Arrow on the system/conda/etc.
if(Arrow_ADDED OR Arrow_DIR)
if(BUILD_STATIC)
list(APPEND ARROW_LIBRARIES arrow_static)
list(APPEND ARROW_LIBRARIES arrow_cuda_static)
else()
list(APPEND ARROW_LIBRARIES arrow_shared)
list(APPEND ARROW_LIBRARIES arrow_cuda_shared)
endif()
if(Arrow_DIR)
# Set this to enable `find_package(ArrowCUDA)`
set(ArrowCUDA_DIR "${Arrow_DIR}")
find_package(Arrow REQUIRED QUIET)
find_package(ArrowCUDA REQUIRED QUIET)
elseif(Arrow_ADDED)
# Copy these files so we can avoid adding paths in
# Arrow_BINARY_DIR to target_include_directories.
# That defeats ccache.
file(INSTALL "${Arrow_BINARY_DIR}/src/arrow/util/config.h"
DESTINATION "${Arrow_SOURCE_DIR}/cpp/src/arrow/util")
file(INSTALL "${Arrow_BINARY_DIR}/src/arrow/gpu/cuda_version.h"
DESTINATION "${Arrow_SOURCE_DIR}/cpp/src/arrow/gpu")
if(ENABLE_PARQUET)
file(INSTALL "${Arrow_BINARY_DIR}/src/parquet/parquet_version.h"
DESTINATION "${Arrow_SOURCE_DIR}/cpp/src/parquet")
endif()
###
# This shouldn't be necessary!
#
# Arrow populates INTERFACE_INCLUDE_DIRECTORIES for the `arrow_static`
# and `arrow_shared` targets in FindArrow and FindArrowCUDA respectively,
# so for static source-builds, we have to do it after-the-fact.
#
# This only works because we know exactly which components we're using.
# Don't forget to update this list if we add more!
###
foreach(ARROW_LIBRARY ${ARROW_LIBRARIES})
target_include_directories(${ARROW_LIBRARY}
INTERFACE "$<BUILD_INTERFACE:${Arrow_SOURCE_DIR}/cpp/src>"
"$<BUILD_INTERFACE:${Arrow_SOURCE_DIR}/cpp/src/generated>"
"$<BUILD_INTERFACE:${Arrow_SOURCE_DIR}/cpp/thirdparty/hadoop/include>"
"$<BUILD_INTERFACE:${Arrow_SOURCE_DIR}/cpp/thirdparty/flatbuffers/include>"
)
endforeach()
endif()
else()
set(ARROW_FOUND FALSE)
message(FATAL_ERROR "CUDF: Arrow library not found or downloaded.")
endif()
if(Arrow_ADDED)
set(arrow_code_string
if(Arrow_ADDED)
set(arrow_code_string
[=[
if (TARGET cudf::arrow_shared AND (NOT TARGET arrow_shared))
add_library(arrow_shared ALIAS cudf::arrow_shared)
@@ -166,8 +191,8 @@ function(find_and_configure_arrow VERSION BUILD_STATIC ENABLE_S3 ENABLE_ORC ENAB
add_library(arrow_static ALIAS cudf::arrow_static)
endif()
]=]
)
set(arrow_cuda_code_string
)
set(arrow_cuda_code_string
[=[
if (TARGET cudf::arrow_cuda_shared AND (NOT TARGET arrow_cuda_shared))
add_library(arrow_cuda_shared ALIAS cudf::arrow_cuda_shared)
@@ -176,49 +201,54 @@ function(find_and_configure_arrow VERSION BUILD_STATIC ENABLE_S3 ENABLE_ORC ENAB
add_library(arrow_cuda_static ALIAS cudf::arrow_cuda_static)
endif()
]=]
)
)
rapids_export(BUILD Arrow
VERSION ${VERSION}
EXPORT_SET arrow_targets
GLOBAL_TARGETS arrow_shared arrow_static
NAMESPACE cudf::
FINAL_CODE_BLOCK arrow_code_string)
rapids_export(
BUILD Arrow
VERSION ${VERSION}
EXPORT_SET arrow_targets
GLOBAL_TARGETS arrow_shared arrow_static
NAMESPACE cudf::
FINAL_CODE_BLOCK arrow_code_string
)
rapids_export(BUILD ArrowCUDA
VERSION ${VERSION}
EXPORT_SET arrow_cuda_targets
GLOBAL_TARGETS arrow_cuda_shared arrow_cuda_static
NAMESPACE cudf::
FINAL_CODE_BLOCK arrow_cuda_code_string)
endif()
# We generate the arrow-config and arrowcuda-config files
# when we built arrow locally, so always do `find_dependency`
rapids_export_package(BUILD Arrow cudf-exports)
rapids_export_package(INSTALL Arrow cudf-exports)
rapids_export(
BUILD ArrowCUDA
VERSION ${VERSION}
EXPORT_SET arrow_cuda_targets
GLOBAL_TARGETS arrow_cuda_shared arrow_cuda_static
NAMESPACE cudf::
FINAL_CODE_BLOCK arrow_cuda_code_string
)
endif()
# We generate the arrow-config and arrowcuda-config files when we built arrow locally, so always
# do `find_dependency`
rapids_export_package(BUILD Arrow cudf-exports)
rapids_export_package(INSTALL Arrow cudf-exports)
# We have to generate the find_dependency(ArrowCUDA) ourselves
# since we need to specify ArrowCUDA_DIR to be where Arrow
# was found, since Arrow packages ArrowCUDA.config in a non-standard
# location
rapids_export_package(BUILD ArrowCUDA cudf-exports)
# We have to generate the find_dependency(ArrowCUDA) ourselves since we need to specify
# ArrowCUDA_DIR to be where Arrow was found, since Arrow packages ArrowCUDA.config in a
# non-standard location
rapids_export_package(BUILD ArrowCUDA cudf-exports)
include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(BUILD Arrow [=[${CMAKE_CURRENT_LIST_DIR}]=] cudf-exports)
rapids_export_find_package_root(BUILD ArrowCUDA [=[${CMAKE_CURRENT_LIST_DIR}]=] cudf-exports)
include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(BUILD Arrow [=[${CMAKE_CURRENT_LIST_DIR}]=] cudf-exports)
rapids_export_find_package_root(BUILD ArrowCUDA [=[${CMAKE_CURRENT_LIST_DIR}]=] cudf-exports)
set(ARROW_FOUND "${ARROW_FOUND}" PARENT_SCOPE)
set(ARROW_LIBRARIES "${ARROW_LIBRARIES}" PARENT_SCOPE)
set(ARROW_FOUND
"${ARROW_FOUND}"
PARENT_SCOPE
)
set(ARROW_LIBRARIES
"${ARROW_LIBRARIES}"
PARENT_SCOPE
)
endfunction()
set(CUDF_VERSION_Arrow 5.0.0)
find_and_configure_arrow(
${CUDF_VERSION_Arrow}
${CUDF_USE_ARROW_STATIC}
${CUDF_ENABLE_ARROW_S3}
${CUDF_ENABLE_ARROW_ORC}
${CUDF_ENABLE_ARROW_PYTHON}
${CUDF_ENABLE_ARROW_PARQUET}
${CUDF_VERSION_Arrow} ${CUDF_USE_ARROW_STATIC} ${CUDF_ENABLE_ARROW_S3} ${CUDF_ENABLE_ARROW_ORC}
${CUDF_ENABLE_ARROW_PYTHON} ${CUDF_ENABLE_ARROW_PARQUET}
)

View File

@@ -1,33 +1,29 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# cuCollections doesn't have a version
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
# This function finds cucollections and sets any additional necessary environment variables.
function(find_and_configure_cucollections)
# Find or install cuCollections
rapids_cpm_find(cuco 0.0
GLOBAL_TARGETS cuco::cuco
CPM_ARGS
GITHUB_REPOSITORY NVIDIA/cuCollections
GIT_TAG 62b90b7f7adf272455007b1c857e1d621aaf13ca
OPTIONS "BUILD_TESTS OFF"
"BUILD_BENCHMARKS OFF"
"BUILD_EXAMPLES OFF"
)
# Find or install cuCollections
rapids_cpm_find(
# cuCollections doesn't have a version yet
cuco 0.0
GLOBAL_TARGETS cuco::cuco
CPM_ARGS GITHUB_REPOSITORY NVIDIA/cuCollections
GIT_TAG 62b90b7f7adf272455007b1c857e1d621aaf13ca
OPTIONS "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF" "BUILD_EXAMPLES OFF"
)
endfunction()
find_and_configure_cucollections()

View File

@@ -1,35 +1,37 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
# This function finds dlpack and sets any additional necessary environment variables.
function(find_and_configure_dlpack VERSION)
rapids_find_generate_module( DLPACK
HEADER_NAMES dlpack.h)
rapids_find_generate_module(DLPACK HEADER_NAMES dlpack.h)
rapids_cpm_find(dlpack ${VERSION}
GIT_REPOSITORY https://github.com/dmlc/dlpack.git
GIT_TAG v${VERSION}
GIT_SHALLOW TRUE
DOWNLOAD_ONLY TRUE
OPTIONS "BUILD_MOCK OFF")
rapids_cpm_find(
dlpack ${VERSION}
GIT_REPOSITORY https://github.com/dmlc/dlpack.git
GIT_TAG v${VERSION}
GIT_SHALLOW TRUE DOWNLOAD_ONLY TRUE
OPTIONS "BUILD_MOCK OFF"
)
if(DEFINED dlpack_SOURCE_DIR)
#otherwise find_package(DLPACK) will set this variable
set(DLPACK_INCLUDE_DIR "${dlpack_SOURCE_DIR}/include" PARENT_SCOPE)
endif()
if(DEFINED dlpack_SOURCE_DIR)
# otherwise find_package(DLPACK) will set this variable
set(DLPACK_INCLUDE_DIR
"${dlpack_SOURCE_DIR}/include"
PARENT_SCOPE
)
endif()
endfunction()
set(CUDF_MIN_VERSION_dlpack 0.5)

View File

@@ -1,36 +1,38 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
# This function finds gtest and sets any additional necessary environment variables.
function(find_and_configure_gtest)
include(${rapids-cmake-dir}/cpm/gtest.cmake)
include(${rapids-cmake-dir}/cpm/gtest.cmake)
# Find or install GoogleTest
rapids_cpm_gtest(BUILD_EXPORT_SET cudf-testing-exports
INSTALL_EXPORT_SET cudf-testing-exports)
# Find or install GoogleTest
rapids_cpm_gtest(BUILD_EXPORT_SET cudf-testing-exports INSTALL_EXPORT_SET cudf-testing-exports)
if(GTest_ADDED)
rapids_export(BUILD GTest
VERSION ${GTest_VERSION}
EXPORT_SET GTestTargets
GLOBAL_TARGETS gtest gmock gtest_main gmock_main
NAMESPACE GTest::)
if(GTest_ADDED)
rapids_export(
BUILD GTest
VERSION ${GTest_VERSION}
EXPORT_SET GTestTargets
GLOBAL_TARGETS gtest gmock gtest_main gmock_main
NAMESPACE GTest::
)
include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(BUILD GTest [=[${CMAKE_CURRENT_LIST_DIR}]=] cudf-testing-exports)
endif()
include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(
BUILD GTest [=[${CMAKE_CURRENT_LIST_DIR}]=] cudf-testing-exports
)
endif()
endfunction()

View File

@@ -1,28 +1,31 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
# Jitify doesn't have a version :/
# This function finds Jitify and sets any additional necessary environment variables.
function(find_and_configure_jitify)
rapids_cpm_find(jitify 2.0.0
GIT_REPOSITORY https://github.com/rapidsai/jitify.git
GIT_TAG cudf_0.19
GIT_SHALLOW TRUE
DOWNLOAD_ONLY TRUE)
set(JITIFY_INCLUDE_DIR "${jitify_SOURCE_DIR}" PARENT_SCOPE)
rapids_cpm_find(
jitify 2.0.0
GIT_REPOSITORY https://github.com/rapidsai/jitify.git
GIT_TAG cudf_0.19
GIT_SHALLOW TRUE DOWNLOAD_ONLY TRUE
)
set(JITIFY_INCLUDE_DIR
"${jitify_SOURCE_DIR}"
PARENT_SCOPE
)
endfunction()
find_and_configure_jitify()

View File

@@ -1,27 +1,30 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
# This function finds libcudacxx and sets any additional necessary environment variables.
function(find_and_configure_libcudacxx)
include(${rapids-cmake-dir}/cpm/libcudacxx.cmake)
include(${rapids-cmake-dir}/cpm/libcudacxx.cmake)
rapids_cpm_libcudacxx(BUILD_EXPORT_SET cudf-exports
INSTALL_EXPORT_SET cudf-exports
PATCH_COMMAND patch --reject-file=- -p1 -N < ${CUDF_SOURCE_DIR}/cmake/libcudacxx.patch || true)
rapids_cpm_libcudacxx(
BUILD_EXPORT_SET cudf-exports INSTALL_EXPORT_SET cudf-exports PATCH_COMMAND patch
--reject-file=- -p1 -N < ${CUDF_SOURCE_DIR}/cmake/libcudacxx.patch || true
)
set(LIBCUDACXX_INCLUDE_DIR "${libcudacxx_SOURCE_DIR}/include" PARENT_SCOPE)
set(LIBCUDACXX_INCLUDE_DIR
"${libcudacxx_SOURCE_DIR}/include"
PARENT_SCOPE
)
endfunction()
find_and_configure_libcudacxx()

View File

@@ -1,41 +1,37 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
# This function finds nvcomp and sets any additional necessary environment variables.
function(find_and_configure_nvcomp VERSION)
# Find or install nvcomp
rapids_cpm_find(nvcomp ${VERSION}
GLOBAL_TARGETS nvcomp::nvcomp
CPM_ARGS
GITHUB_REPOSITORY NVIDIA/nvcomp
GIT_TAG c435afaf4ba8a8d12f379d688effcb185886cec1
OPTIONS "BUILD_STATIC ON"
"BUILD_TESTS OFF"
"BUILD_BENCHMARKS OFF"
"BUILD_EXAMPLES OFF"
)
# Find or install nvcomp
rapids_cpm_find(
nvcomp ${VERSION}
GLOBAL_TARGETS nvcomp::nvcomp
CPM_ARGS GITHUB_REPOSITORY NVIDIA/nvcomp
GIT_TAG c435afaf4ba8a8d12f379d688effcb185886cec1
OPTIONS "BUILD_STATIC ON" "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF" "BUILD_EXAMPLES OFF"
)
if(NOT TARGET nvcomp::nvcomp)
add_library(nvcomp::nvcomp ALIAS nvcomp)
endif()
if(NOT TARGET nvcomp::nvcomp)
add_library(nvcomp::nvcomp ALIAS nvcomp)
endif()
# Per-thread default stream
if(TARGET nvcomp AND PER_THREAD_DEFAULT_STREAM)
target_compile_definitions(nvcomp PRIVATE CUDA_API_PER_THREAD_DEFAULT_STREAM)
endif()
# Per-thread default stream
if(TARGET nvcomp AND PER_THREAD_DEFAULT_STREAM)
target_compile_definitions(nvcomp PRIVATE CUDA_API_PER_THREAD_DEFAULT_STREAM)
endif()
endfunction()

View File

@@ -1,25 +1,23 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
# This function finds rmm and sets any additional necessary environment variables.
function(find_and_configure_rmm)
include(${rapids-cmake-dir}/cpm/rmm.cmake)
include(${rapids-cmake-dir}/cpm/rmm.cmake)
# Find or install RMM
rapids_cpm_rmm(BUILD_EXPORT_SET cudf-exports
INSTALL_EXPORT_SET cudf-exports)
# Find or install RMM
rapids_cpm_rmm(BUILD_EXPORT_SET cudf-exports INSTALL_EXPORT_SET cudf-exports)
endfunction()

View File

@@ -1,74 +1,83 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2020-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
# This function finds thrust and sets any additional necessary environment variables.
function(find_and_configure_thrust VERSION)
# We only want to set `UPDATE_DISCONNECTED` while
# the GIT tag hasn't moved from the last time we cloned
set(cpm_thrust_disconnect_update "UPDATE_DISCONNECTED TRUE")
set(CPM_THRUST_CURRENT_VERSION ${VERSION} CACHE STRING "version of thrust we checked out")
if(NOT VERSION VERSION_EQUAL CPM_THRUST_CURRENT_VERSION)
set(CPM_THRUST_CURRENT_VERSION ${VERSION} CACHE STRING "version of thrust we checked out" FORCE)
set(cpm_thrust_disconnect_update "")
endif()
# We only want to set `UPDATE_DISCONNECTED` while the GIT tag hasn't moved from the last time we
# cloned
set(cpm_thrust_disconnect_update "UPDATE_DISCONNECTED TRUE")
set(CPM_THRUST_CURRENT_VERSION
${VERSION}
CACHE STRING "version of thrust we checked out"
)
if(NOT VERSION VERSION_EQUAL CPM_THRUST_CURRENT_VERSION)
set(CPM_THRUST_CURRENT_VERSION
${VERSION}
CACHE STRING "version of thrust we checked out" FORCE
)
set(cpm_thrust_disconnect_update "")
endif()
# We currently require cuDF to always build with a custom
# version of thrust. This is needed so that build times of
# of cudf are kept reasonable, without this CI builds
# of cudf will be killed as some source file can take
# over 45 minutes to build
#
set(CPM_DOWNLOAD_ALL TRUE)
rapids_cpm_find(
Thrust ${VERSION}
BUILD_EXPORT_SET cudf-exports
INSTALL_EXPORT_SET cudf-exports
CPM_ARGS
GIT_REPOSITORY https://github.com/NVIDIA/thrust.git
GIT_TAG ${VERSION}
GIT_SHALLOW TRUE
${cpm_thrust_disconnect_update}
PATCH_COMMAND patch --reject-file=- -p1 -N < ${CUDF_SOURCE_DIR}/cmake/thrust.patch || true
OPTIONS "THRUST_INSTALL TRUE")
# We currently require cuDF to always build with a custom version of thrust. This is needed so
# that build times of of cudf are kept reasonable, without this CI builds of cudf will be killed
# as some source file can take over 45 minutes to build
#
set(CPM_DOWNLOAD_ALL TRUE)
rapids_cpm_find(
Thrust ${VERSION}
BUILD_EXPORT_SET cudf-exports
INSTALL_EXPORT_SET cudf-exports
CPM_ARGS
GIT_REPOSITORY https://github.com/NVIDIA/thrust.git
GIT_TAG ${VERSION}
GIT_SHALLOW TRUE ${cpm_thrust_disconnect_update} PATCH_COMMAND patch --reject-file=- -p1 -N <
${CUDF_SOURCE_DIR}/cmake/thrust.patch || true
OPTIONS "THRUST_INSTALL TRUE"
)
if(NOT TARGET cudf::Thrust)
thrust_create_target(cudf::Thrust FROM_OPTIONS)
endif()
if(NOT TARGET cudf::Thrust)
thrust_create_target(cudf::Thrust FROM_OPTIONS)
endif()
if(Thrust_SOURCE_DIR) # only install thrust when we have an in-source version
include(GNUInstallDirs)
install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/"
FILES_MATCHING
PATTERN "*.h"
PATTERN "*.inl")
install(DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/dependencies/"
FILES_MATCHING
PATTERN "*.cuh")
if(Thrust_SOURCE_DIR) # only install thrust when we have an in-source version
include(GNUInstallDirs)
install(
DIRECTORY "${Thrust_SOURCE_DIR}/thrust"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/"
FILES_MATCHING
REGEX "\\.(h|inl)$"
)
install(
DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/dependencies/"
FILES_MATCHING
PATTERN "*.cuh"
)
install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust/cmake"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/thrust/")
install(DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub/cmake"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/dependencies/cub/")
install(DIRECTORY "${Thrust_SOURCE_DIR}/thrust/cmake"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/thrust/"
)
install(DIRECTORY "${Thrust_SOURCE_DIR}/dependencies/cub/cub/cmake"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libcudf/Thrust/dependencies/cub/"
)
# Store where CMake can find our custom Thrust install
include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(INSTALL Thrust [=[${CMAKE_CURRENT_LIST_DIR}/../../../include/libcudf/Thrust/]=] cudf-exports)
endif()
# Store where CMake can find our custom Thrust install
include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(
INSTALL Thrust [=[${CMAKE_CURRENT_LIST_DIR}/../../../include/libcudf/Thrust/]=] cudf-exports
)
endif()
endfunction()
set(CUDF_MIN_VERSION_Thrust 1.12.0)

View File

@@ -1,20 +1,29 @@
cmake_minimum_required(VERSION 3.18)
project(basic_example VERSION 0.0.1 LANGUAGES CXX CUDA)
project(
basic_example
VERSION 0.0.1
LANGUAGES CXX CUDA
)
set(CPM_DOWNLOAD_VERSION v0.32.2)
file(DOWNLOAD https://github.com/cpm-cmake/CPM.cmake/releases/download/${CPM_DOWNLOAD_VERSION}/get_cpm.cmake ${CMAKE_BINARY_DIR}/cmake/get_cpm.cmake)
file(
DOWNLOAD
https://github.com/cpm-cmake/CPM.cmake/releases/download/${CPM_DOWNLOAD_VERSION}/get_cpm.cmake
${CMAKE_BINARY_DIR}/cmake/get_cpm.cmake
)
include(${CMAKE_BINARY_DIR}/cmake/get_cpm.cmake)
set(CUDF_TAG branch-21.12)
CPMFindPackage(NAME cudf
GIT_REPOSITORY https://github.com/rapidsai/cudf
GIT_TAG ${CUDF_TAG}
GIT_SHALLOW TRUE
SOURCE_SUBDIR cpp
CPMFindPackage(
NAME cudf GIT_REPOSITORY https://github.com/rapidsai/cudf
GIT_TAG ${CUDF_TAG}
GIT_SHALLOW
TRUE
SOURCE_SUBDIR
cpp
)
# Configure your project here
add_executable(basic_example src/process_csv.cpp)
target_link_libraries(basic_example PRIVATE cudf::cudf)

View File

@@ -1,22 +1,21 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2018-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
cmake_minimum_required(VERSION 3.20.1 FATAL_ERROR)
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-21.10/RAPIDS.cmake
${CMAKE_BINARY_DIR}/RAPIDS.cmake)
${CMAKE_BINARY_DIR}/RAPIDS.cmake
)
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(rapids-cmake)
@@ -25,19 +24,23 @@ include(rapids-cuda)
include(rapids-export)
include(rapids-find)
project(CUDA_KAFKA VERSION 21.12.00 LANGUAGES CXX)
project(
CUDA_KAFKA
VERSION 21.12.00
LANGUAGES CXX
)
# Set a default build type if none was specified
rapids_cmake_build_type(Release)
###################################################################################################
# - Build options
# ##################################################################################################
# * Build options
option(BUILD_TESTS "Build tests for libcudf_kafka" ON)
message(VERBOSE "CUDF_KAFKA: Build gtests: ${BUILD_TESTS}")
###################################################################################################
# - Dependencies
# ##################################################################################################
# * Dependencies
# add third party dependencies using CPM
rapids_cpm_init()
@@ -45,56 +48,57 @@ include(cmake/thirdparty/get_cudf.cmake)
include(cmake/thirdparty/get_rdkafka.cmake)
# # GTests if enabled
if (BUILD_TESTS)
# GoogleTest
include(../cmake/thirdparty/get_gtest.cmake)
if(BUILD_TESTS)
# GoogleTest
include(../cmake/thirdparty/get_gtest.cmake)
# include CTest module -- automatically calls enable_testing()
include(CTest)
add_subdirectory(tests)
# include CTest module -- automatically calls enable_testing()
include(CTest)
add_subdirectory(tests)
endif()
###################################################################################################
# - library target --------------------------------------------------------------------------------
add_library(cudf_kafka SHARED
src/kafka_consumer.cpp)
# ##################################################################################################
# * library target --------------------------------------------------------------------------------
add_library(cudf_kafka SHARED src/kafka_consumer.cpp)
###################################################################################################
# - include paths ---------------------------------------------------------------------------------
target_include_directories(cudf_kafka
PUBLIC
"$<BUILD_INTERFACE:${CUDA_KAFKA_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>")
# ##################################################################################################
# * include paths ---------------------------------------------------------------------------------
target_include_directories(
cudf_kafka PUBLIC "$<BUILD_INTERFACE:${CUDA_KAFKA_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:include>"
)
###################################################################################################
# - library paths ---------------------------------------------------------------------------------
# ##################################################################################################
# * library paths ---------------------------------------------------------------------------------
target_link_libraries(cudf_kafka PUBLIC cudf::cudf RDKAFKA::RDKAFKA)
set_target_properties(cudf_kafka
PROPERTIES BUILD_RPATH "\$ORIGIN"
INSTALL_RPATH "\$ORIGIN"
# set target compile options
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON)
set_target_properties(
cudf_kafka
PROPERTIES BUILD_RPATH "\$ORIGIN" INSTALL_RPATH "\$ORIGIN" # set target compile options
CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON
)
###################################################################################################
# - cudf_kafka Install ----------------------------------------------------------------------------
# ##################################################################################################
# * cudf_kafka Install ----------------------------------------------------------------------------
rapids_cmake_install_lib_dir(lib_dir)
install(TARGETS cudf_kafka
DESTINATION ${lib_dir}
EXPORT cudf_kafka-exports)
install(
TARGETS cudf_kafka
DESTINATION ${lib_dir}
EXPORT cudf_kafka-exports
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include
DESTINATION include)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include DESTINATION include)
rapids_export(INSTALL cudf_kafka
EXPORT_SET cudf_kafka-exports
GLOBAL_TARGETS cudf_kafka
NAMESPACE cudf_kafka::
)
rapids_export(
INSTALL cudf_kafka
EXPORT_SET cudf_kafka-exports
GLOBAL_TARGETS cudf_kafka
NAMESPACE cudf_kafka::
)
rapids_export(BUILD cudf_kafka
EXPORT_SET cudf_kafka-exports
GLOBAL_TARGETS cudf_kafka
NAMESPACE cudf_kafka::
)
rapids_export(
BUILD cudf_kafka
EXPORT_SET cudf_kafka-exports
GLOBAL_TARGETS cudf_kafka
NAMESPACE cudf_kafka::
)

View File

@@ -1,51 +1,55 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
# This function finds cudf and sets any additional necessary environment variables.
function(find_and_configure_cudf VERSION)
rapids_cmake_parse_version(MAJOR_MINOR ${VERSION} major_minor)
rapids_cpm_find(cudf ${VERSION}
BUILD_EXPORT_SET cudf_kafka-exports
INSTALL_EXPORT_SET cudf_kafka-exports
CPM_ARGS
GIT_REPOSITORY https://github.com/rapidsai/cudf.git
GIT_TAG branch-${major_minor}
GIT_SHALLOW TRUE
SOURCE_SUBDIR cpp
OPTIONS "BUILD_TESTS OFF"
"BUILD_BENCHMARKS OFF")
# If after loading cudf we now have the CMAKE_CUDA_COMPILER
# variable we know that we need to re-enable the cuda language
if(CMAKE_CUDA_COMPILER)
set(cudf_REQUIRES_CUDA TRUE PARENT_SCOPE)
endif()
rapids_cmake_parse_version(MAJOR_MINOR ${VERSION} major_minor)
rapids_cpm_find(
cudf ${VERSION}
BUILD_EXPORT_SET cudf_kafka-exports
INSTALL_EXPORT_SET cudf_kafka-exports
CPM_ARGS
GIT_REPOSITORY https://github.com/rapidsai/cudf.git
GIT_TAG branch-${major_minor}
GIT_SHALLOW TRUE SOURCE_SUBDIR cpp
OPTIONS "BUILD_TESTS OFF" "BUILD_BENCHMARKS OFF"
)
# If after loading cudf we now have the CMAKE_CUDA_COMPILER variable we know that we need to
# re-enable the cuda language
if(CMAKE_CUDA_COMPILER)
set(cudf_REQUIRES_CUDA
TRUE
PARENT_SCOPE
)
endif()
endfunction()
set(CUDA_KAFKA_MIN_VERSION_cudf "${CUDA_KAFKA_VERSION_MAJOR}.${CUDA_KAFKA_VERSION_MINOR}.${CUDA_KAFKA_VERSION_PATCH}")
set(CUDA_KAFKA_MIN_VERSION_cudf
"${CUDA_KAFKA_VERSION_MAJOR}.${CUDA_KAFKA_VERSION_MINOR}.${CUDA_KAFKA_VERSION_PATCH}"
)
find_and_configure_cudf(${CUDA_KAFKA_MIN_VERSION_cudf})
if(cudf_REQUIRES_CUDA)
rapids_cuda_init_architectures(CUDA_KAFKA)
rapids_cuda_init_architectures(CUDA_KAFKA)
# Since we are building cudf as part of ourselves we need
# to enable the CUDA language in the top-most scope
enable_language(CUDA)
# Since we are building cudf as part of ourselves we need to enable the CUDA language in the
# top-most scope
enable_language(CUDA)
# Since CUDA_KAFKA only enables CUDA optionally we need to manually include the file that
# rapids_cuda_init_architectures relies on `project` calling
if(DEFINED CMAKE_PROJECT_CUDA_KAFKA_INCLUDE)
include("${CMAKE_PROJECT_CUDA_KAFKA_INCLUDE}")
endif()
# Since CUDA_KAFKA only enables CUDA optionally we need to manually include the file that
# rapids_cuda_init_architectures relies on `project` calling
if(DEFINED CMAKE_PROJECT_CUDA_KAFKA_INCLUDE)
include("${CMAKE_PROJECT_CUDA_KAFKA_INCLUDE}")
endif()
endif()

View File

@@ -1,40 +1,40 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
function( get_RDKafka )
rapids_find_generate_module(RDKAFKA
# This function finds rdkafka and sets any additional necessary environment variables.
function(get_RDKafka)
rapids_find_generate_module(
RDKAFKA
HEADER_NAMES rdkafkacpp.h
INCLUDE_SUFFIXES librdkafka
LIBRARY_NAMES rdkafka++
BUILD_EXPORT_SET cudf_kafka-exports
INSTALL_EXPORT_SET cudf_kafka-exports
)
)
if(DEFINED ENV{RDKAFKA_ROOT})
# Since this is inside a function the modification of
# CMAKE_PREFIX_PATH won't leak to other callers/users
# Since this is inside a function the modification of CMAKE_PREFIX_PATH won't leak to other
# callers/users
list(APPEND CMAKE_PREFIX_PATH "$ENV{RDKAFKA_ROOT}")
list(APPEND CMAKE_PREFIX_PATH "$ENV{RDKAFKA_ROOT}/build")
endif()
rapids_find_package(RDKAFKA REQUIRED
rapids_find_package(
RDKAFKA REQUIRED
BUILD_EXPORT_SET cudf_kafka-exports
INSTALL_EXPORT_SET cudf_kafka-exports)
INSTALL_EXPORT_SET cudf_kafka-exports
)
endfunction()

View File

@@ -1,32 +1,34 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2018-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
###################################################################################################
# - compiler function -----------------------------------------------------------------------------
# ##################################################################################################
# * compiler function -----------------------------------------------------------------------------
function(ConfigureTest test_name )
add_executable(${test_name} ${ARGN})
set_target_properties(${test_name}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUDA_KAFKA_BINARY_DIR}/gtests>")
target_link_libraries(${test_name} PRIVATE GTest::gmock_main GTest::gtest_main cudf_kafka)
# This function takes in a test name and test source and handles setting all of the associated
# properties and linking to build the test
function(ConfigureTest test_name)
add_executable(${test_name} ${ARGN})
set_target_properties(
${test_name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"$<BUILD_INTERFACE:${CUDA_KAFKA_BINARY_DIR}/gtests>"
)
target_link_libraries(${test_name} PRIVATE GTest::gmock_main GTest::gtest_main cudf_kafka)
add_test(NAME ${test_name} COMMAND ${test_name})
add_test(NAME ${test_name} COMMAND ${test_name})
endfunction()
###################################################################################################
# - Kafka host tests ----------------------------------------------------------------------------------
ConfigureTest(KAFKA_HOST_TEST
kafka_consumer_tests.cpp)
# ##################################################################################################
# * Kafka host tests
# ----------------------------------------------------------------------------------
ConfigureTest(KAFKA_HOST_TEST kafka_consumer_tests.cpp)

View File

@@ -1,144 +1,139 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2018-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
###################################################################################################
# - compiler function -----------------------------------------------------------------------------
# ##################################################################################################
# * compiler function -----------------------------------------------------------------------------
function(ConfigureTest CMAKE_TEST_NAME )
add_executable(${CMAKE_TEST_NAME} ${ARGN})
set_target_properties(${CMAKE_TEST_NAME}
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "$<BUILD_INTERFACE:${CUDF_BINARY_DIR}/gtests>")
target_link_libraries(${CMAKE_TEST_NAME} PRIVATE cudftestutil GTest::gmock_main GTest::gtest_main)
add_test(NAME ${CMAKE_TEST_NAME} COMMAND ${CMAKE_TEST_NAME})
# This function takes in a test name and test source and handles setting all of the associated
# properties and linking to build the test
function(ConfigureTest CMAKE_TEST_NAME)
add_executable(${CMAKE_TEST_NAME} ${ARGN})
set_target_properties(
${CMAKE_TEST_NAME} PROPERTIES RUNTIME_OUTPUT_DIRECTORY
"$<BUILD_INTERFACE:${CUDF_BINARY_DIR}/gtests>"
)
target_link_libraries(${CMAKE_TEST_NAME} PRIVATE cudftestutil GTest::gmock_main GTest::gtest_main)
add_test(NAME ${CMAKE_TEST_NAME} COMMAND ${CMAKE_TEST_NAME})
endfunction()
###################################################################################################
### test sources ##################################################################################
###################################################################################################
# ##################################################################################################
# test sources ##################################################################################
# ##################################################################################################
###################################################################################################
# - column tests ----------------------------------------------------------------------------------
ConfigureTest(COLUMN_TEST
column/bit_cast_test.cpp
column/column_view_shallow_test.cpp
column/column_test.cu
column/column_device_view_test.cu
column/compound_test.cu)
# ##################################################################################################
# * column tests ----------------------------------------------------------------------------------
ConfigureTest(
COLUMN_TEST column/bit_cast_test.cpp column/column_view_shallow_test.cpp column/column_test.cu
column/column_device_view_test.cu column/compound_test.cu
)
###################################################################################################
# - scalar tests ----------------------------------------------------------------------------------
ConfigureTest(SCALAR_TEST
scalar/scalar_test.cpp
scalar/scalar_device_view_test.cu)
# ##################################################################################################
# * scalar tests ----------------------------------------------------------------------------------
ConfigureTest(SCALAR_TEST scalar/scalar_test.cpp scalar/scalar_device_view_test.cu)
###################################################################################################
# - timestamps tests ------------------------------------------------------------------------------
# ##################################################################################################
# * timestamps tests ------------------------------------------------------------------------------
ConfigureTest(TIMESTAMPS_TEST wrappers/timestamps_test.cu)
###################################################################################################
# - cudf tests ------------------------------------------------------------------------------------
# ##################################################################################################
# * cudf tests ------------------------------------------------------------------------------------
ConfigureTest(ERROR_TEST error/error_handling_test.cu)
###################################################################################################
# - groupby tests ---------------------------------------------------------------------------------
ConfigureTest(GROUPBY_TEST
groupby/argmin_tests.cpp
groupby/argmax_tests.cpp
groupby/collect_list_tests.cpp
groupby/collect_set_tests.cpp
groupby/correlation_tests.cpp
groupby/count_scan_tests.cpp
groupby/count_tests.cpp
groupby/covariance_tests.cpp
groupby/groups_tests.cpp
groupby/keys_tests.cpp
groupby/lists_tests.cpp
groupby/m2_tests.cpp
groupby/min_tests.cpp
groupby/max_scan_tests.cpp
groupby/max_tests.cpp
groupby/mean_tests.cpp
groupby/median_tests.cpp
groupby/merge_m2_tests.cpp
groupby/merge_lists_tests.cpp
groupby/merge_sets_tests.cpp
groupby/min_scan_tests.cpp
groupby/nth_element_tests.cpp
groupby/nunique_tests.cpp
groupby/product_tests.cpp
groupby/quantile_tests.cpp
groupby/rank_scan_tests.cpp
groupby/replace_nulls_tests.cpp
groupby/shift_tests.cpp
groupby/std_tests.cpp
groupby/structs_tests.cpp
groupby/sum_of_squares_tests.cpp
groupby/sum_scan_tests.cpp
groupby/sum_tests.cpp
groupby/tdigest_tests.cu
groupby/var_tests.cpp)
# ##################################################################################################
# * groupby tests ---------------------------------------------------------------------------------
ConfigureTest(
GROUPBY_TEST
groupby/argmin_tests.cpp
groupby/argmax_tests.cpp
groupby/collect_list_tests.cpp
groupby/collect_set_tests.cpp
groupby/correlation_tests.cpp
groupby/count_scan_tests.cpp
groupby/count_tests.cpp
groupby/covariance_tests.cpp
groupby/groups_tests.cpp
groupby/keys_tests.cpp
groupby/lists_tests.cpp
groupby/m2_tests.cpp
groupby/min_tests.cpp
groupby/max_scan_tests.cpp
groupby/max_tests.cpp
groupby/mean_tests.cpp
groupby/median_tests.cpp
groupby/merge_m2_tests.cpp
groupby/merge_lists_tests.cpp
groupby/merge_sets_tests.cpp
groupby/min_scan_tests.cpp
groupby/nth_element_tests.cpp
groupby/nunique_tests.cpp
groupby/product_tests.cpp
groupby/quantile_tests.cpp
groupby/rank_scan_tests.cpp
groupby/replace_nulls_tests.cpp
groupby/shift_tests.cpp
groupby/std_tests.cpp
groupby/structs_tests.cpp
groupby/sum_of_squares_tests.cpp
groupby/sum_scan_tests.cpp
groupby/sum_tests.cpp
groupby/tdigest_tests.cu
groupby/var_tests.cpp
)
###################################################################################################
# - join tests ------------------------------------------------------------------------------------
ConfigureTest(JOIN_TEST
join/join_tests.cpp
join/conditional_join_tests.cu
join/cross_join_tests.cpp
join/semi_anti_join_tests.cpp)
# ##################################################################################################
# * join tests ------------------------------------------------------------------------------------
ConfigureTest(
JOIN_TEST join/join_tests.cpp join/conditional_join_tests.cu join/cross_join_tests.cpp
join/semi_anti_join_tests.cpp
)
###################################################################################################
# - is_sorted tests -------------------------------------------------------------------------------
# ##################################################################################################
# * is_sorted tests -------------------------------------------------------------------------------
ConfigureTest(IS_SORTED_TEST sort/is_sorted_tests.cpp)
###################################################################################################
# - datetime tests --------------------------------------------------------------------------------
# ##################################################################################################
# * datetime tests --------------------------------------------------------------------------------
ConfigureTest(DATETIME_OPS_TEST datetime/datetime_ops_test.cpp)
###################################################################################################
# - hashing tests ---------------------------------------------------------------------------------
# ##################################################################################################
# * hashing tests ---------------------------------------------------------------------------------
ConfigureTest(HASHING_TEST hashing/hash_test.cpp)
###################################################################################################
# - partitioning tests ----------------------------------------------------------------------------
ConfigureTest(PARTITIONING_TEST
partitioning/hash_partition_test.cpp
partitioning/round_robin_test.cpp
partitioning/partition_test.cpp)
# ##################################################################################################
# * partitioning tests ----------------------------------------------------------------------------
ConfigureTest(
PARTITIONING_TEST partitioning/hash_partition_test.cpp partitioning/round_robin_test.cpp
partitioning/partition_test.cpp
)
###################################################################################################
# - hash_map tests --------------------------------------------------------------------------------
ConfigureTest(HASH_MAP_TEST
hash_map/map_test.cu
hash_map/multimap_test.cu)
# ##################################################################################################
# * hash_map tests --------------------------------------------------------------------------------
ConfigureTest(HASH_MAP_TEST hash_map/map_test.cu hash_map/multimap_test.cu)
###################################################################################################
# - quantiles tests -------------------------------------------------------------------------------
ConfigureTest(QUANTILES_TEST
quantiles/percentile_approx_test.cu
quantiles/quantile_test.cpp
quantiles/quantiles_test.cpp)
# ##################################################################################################
# * quantiles tests -------------------------------------------------------------------------------
ConfigureTest(
QUANTILES_TEST quantiles/percentile_approx_test.cu quantiles/quantile_test.cpp
quantiles/quantiles_test.cpp
)
###################################################################################################
# - reduction tests -------------------------------------------------------------------------------
ConfigureTest(REDUCTION_TEST
reductions/reduction_tests.cpp
reductions/scan_tests.cpp)
# ##################################################################################################
# * reduction tests -------------------------------------------------------------------------------
ConfigureTest(REDUCTION_TEST reductions/reduction_tests.cpp reductions/scan_tests.cpp)
###################################################################################################
# - replace tests ---------------------------------------------------------------------------------
# ##################################################################################################
# * replace tests ---------------------------------------------------------------------------------
ConfigureTest(REPLACE_TEST replace/replace_tests.cpp)
ConfigureTest(REPLACE_NULLS_TEST replace/replace_nulls_tests.cpp)
@@ -149,53 +144,50 @@ ConfigureTest(NORMALIZE_REPLACE_TEST replace/normalize_replace_tests.cpp)
ConfigureTest(CLAMP_TEST replace/clamp_test.cpp)
###################################################################################################
# - fixed_point tests -----------------------------------------------------------------------------
ConfigureTest(FIXED_POINT_TEST
fixed_point/fixed_point_tests.cpp
fixed_point/fixed_point_tests.cu)
# ##################################################################################################
# * fixed_point tests -----------------------------------------------------------------------------
ConfigureTest(FIXED_POINT_TEST fixed_point/fixed_point_tests.cpp fixed_point/fixed_point_tests.cu)
###################################################################################################
# - unary tests -----------------------------------------------------------------------------------
ConfigureTest(UNARY_TEST
unary/math_ops_test.cpp
unary/unary_ops_test.cpp
unary/cast_tests.cpp)
# ##################################################################################################
# * unary tests -----------------------------------------------------------------------------------
ConfigureTest(UNARY_TEST unary/math_ops_test.cpp unary/unary_ops_test.cpp unary/cast_tests.cpp)
###################################################################################################
# - round tests -----------------------------------------------------------------------------------
# ##################################################################################################
# * round tests -----------------------------------------------------------------------------------
ConfigureTest(ROUND_TEST round/round_tests.cpp)
###################################################################################################
# - binary tests ----------------------------------------------------------------------------------
ConfigureTest(BINARY_TEST
binaryop/binop-verify-input-test.cpp
binaryop/binop-null-test.cpp
binaryop/binop-integration-test.cpp
binaryop/binop-compiled-test.cpp
binaryop/binop-compiled-fixed_point-test.cpp
binaryop/binop-generic-ptx-test.cpp
)
# ##################################################################################################
# * binary tests ----------------------------------------------------------------------------------
ConfigureTest(
BINARY_TEST
binaryop/binop-verify-input-test.cpp
binaryop/binop-null-test.cpp
binaryop/binop-integration-test.cpp
binaryop/binop-compiled-test.cpp
binaryop/binop-compiled-fixed_point-test.cpp
binaryop/binop-generic-ptx-test.cpp
)
###################################################################################################
# - unary transform tests -------------------------------------------------------------------------
ConfigureTest(TRANSFORM_TEST
transform/integration/unary-transform-test.cpp
transform/nans_to_null_test.cpp
transform/mask_to_bools_test.cpp
transform/bools_to_mask_test.cpp
transform/row_bit_count_test.cu
transform/one_hot_encode_tests.cpp)
# ##################################################################################################
# * unary transform tests -------------------------------------------------------------------------
ConfigureTest(
TRANSFORM_TEST
transform/integration/unary-transform-test.cpp
transform/nans_to_null_test.cpp
transform/mask_to_bools_test.cpp
transform/bools_to_mask_test.cpp
transform/row_bit_count_test.cu
transform/one_hot_encode_tests.cpp
)
###################################################################################################
# - interop tests -------------------------------------------------------------------------
ConfigureTest(INTEROP_TEST
interop/to_arrow_test.cpp
interop/from_arrow_test.cpp
interop/dlpack_test.cpp)
# ##################################################################################################
# * interop tests -------------------------------------------------------------------------
ConfigureTest(
INTEROP_TEST interop/to_arrow_test.cpp interop/from_arrow_test.cpp interop/dlpack_test.cpp
)
###################################################################################################
# - io tests --------------------------------------------------------------------------------------
# ##################################################################################################
# * io tests --------------------------------------------------------------------------------------
ConfigureTest(DECOMPRESSION_TEST io/comp/decomp_test.cpp)
ConfigureTest(CSV_TEST io/csv_test.cpp)
@@ -208,252 +200,255 @@ if(CUDF_ENABLE_ARROW_S3)
target_compile_definitions(ARROW_IO_SOURCE_TEST PRIVATE "S3_ENABLED")
endif()
###################################################################################################
# - sort tests ------------------------------------------------------------------------------------
ConfigureTest(SORT_TEST
sort/segmented_sort_tests.cpp
sort/sort_test.cpp
sort/rank_test.cpp)
# ##################################################################################################
# * sort tests ------------------------------------------------------------------------------------
ConfigureTest(SORT_TEST sort/segmented_sort_tests.cpp sort/sort_test.cpp sort/rank_test.cpp)
###################################################################################################
# - copying tests ---------------------------------------------------------------------------------
ConfigureTest(COPYING_TEST
copying/concatenate_tests.cu
copying/copy_if_else_nested_tests.cpp
copying/copy_range_tests.cpp
copying/copy_tests.cpp
copying/detail_gather_tests.cu
copying/gather_list_tests.cpp
copying/gather_str_tests.cpp
copying/gather_struct_tests.cpp
copying/gather_tests.cpp
copying/get_value_tests.cpp
copying/pack_tests.cpp
copying/sample_tests.cpp
copying/scatter_tests.cpp
copying/scatter_list_tests.cpp
copying/scatter_list_scalar_tests.cpp
copying/scatter_struct_tests.cpp
copying/scatter_struct_scalar_tests.cpp
copying/segmented_gather_list_tests.cpp
copying/shift_tests.cpp
copying/slice_tests.cpp
copying/split_tests.cpp
copying/utility_tests.cpp
copying/reverse_tests.cpp)
# ##################################################################################################
# * copying tests ---------------------------------------------------------------------------------
ConfigureTest(
COPYING_TEST
copying/concatenate_tests.cu
copying/copy_if_else_nested_tests.cpp
copying/copy_range_tests.cpp
copying/copy_tests.cpp
copying/detail_gather_tests.cu
copying/gather_list_tests.cpp
copying/gather_str_tests.cpp
copying/gather_struct_tests.cpp
copying/gather_tests.cpp
copying/get_value_tests.cpp
copying/pack_tests.cpp
copying/sample_tests.cpp
copying/scatter_tests.cpp
copying/scatter_list_tests.cpp
copying/scatter_list_scalar_tests.cpp
copying/scatter_struct_tests.cpp
copying/scatter_struct_scalar_tests.cpp
copying/segmented_gather_list_tests.cpp
copying/shift_tests.cpp
copying/slice_tests.cpp
copying/split_tests.cpp
copying/utility_tests.cpp
copying/reverse_tests.cpp
)
###################################################################################################
# - utilities tests -------------------------------------------------------------------------------
ConfigureTest(UTILITIES_TEST
utilities_tests/type_list_tests.cpp
utilities_tests/column_utilities_tests.cpp
utilities_tests/column_wrapper_tests.cpp
utilities_tests/lists_column_wrapper_tests.cpp
utilities_tests/default_stream_tests.cpp
utilities_tests/type_check_tests.cpp)
# ##################################################################################################
# * utilities tests -------------------------------------------------------------------------------
ConfigureTest(
UTILITIES_TEST
utilities_tests/type_list_tests.cpp
utilities_tests/column_utilities_tests.cpp
utilities_tests/column_wrapper_tests.cpp
utilities_tests/lists_column_wrapper_tests.cpp
utilities_tests/default_stream_tests.cpp
utilities_tests/type_check_tests.cpp
)
###################################################################################################
# - span tests -------------------------------------------------------------------------------
# ##################################################################################################
# * span tests -------------------------------------------------------------------------------
ConfigureTest(SPAN_TEST utilities_tests/span_tests.cu)
###################################################################################################
# - iterator tests --------------------------------------------------------------------------------
ConfigureTest(ITERATOR_TEST
iterator/value_iterator.cpp
iterator/value_iterator_test_chrono.cu
iterator/value_iterator_test_numeric.cu
iterator/value_iterator_test_strings.cu
iterator/value_iterator_test_transform.cu
iterator/pair_iterator_test_chrono.cu
iterator/pair_iterator_test_numeric.cu
iterator/scalar_iterator_test.cu
iterator/optional_iterator_test_chrono.cu
iterator/optional_iterator_test_numeric.cu
iterator/indexalator_test.cu
)
# ##################################################################################################
# * iterator tests --------------------------------------------------------------------------------
ConfigureTest(
ITERATOR_TEST
iterator/value_iterator.cpp
iterator/value_iterator_test_chrono.cu
iterator/value_iterator_test_numeric.cu
iterator/value_iterator_test_strings.cu
iterator/value_iterator_test_transform.cu
iterator/pair_iterator_test_chrono.cu
iterator/pair_iterator_test_numeric.cu
iterator/scalar_iterator_test.cu
iterator/optional_iterator_test_chrono.cu
iterator/optional_iterator_test_numeric.cu
iterator/indexalator_test.cu
)
###################################################################################################
# - device atomics tests --------------------------------------------------------------------------
# ##################################################################################################
# * device atomics tests --------------------------------------------------------------------------
ConfigureTest(DEVICE_ATOMICS_TEST device_atomics/device_atomics_test.cu)
###################################################################################################
# - transpose tests -------------------------------------------------------------------------------
# ##################################################################################################
# * transpose tests -------------------------------------------------------------------------------
ConfigureTest(TRANSPOSE_TEST transpose/transpose_test.cpp)
###################################################################################################
# - table tests -----------------------------------------------------------------------------------
ConfigureTest(TABLE_TEST
table/table_tests.cpp
table/table_view_tests.cu
table/row_operators_tests.cpp)
# ##################################################################################################
# * table tests -----------------------------------------------------------------------------------
ConfigureTest(
TABLE_TEST table/table_tests.cpp table/table_view_tests.cu table/row_operators_tests.cpp
)
###################################################################################################
# - sorted-merge tests ----------------------------------------------------------------------------
ConfigureTest(MERGE_TEST
merge/merge_test.cpp
merge/merge_dictionary_test.cpp
merge/merge_string_test.cpp)
# ##################################################################################################
# * sorted-merge tests ----------------------------------------------------------------------------
ConfigureTest(
MERGE_TEST merge/merge_test.cpp merge/merge_dictionary_test.cpp merge/merge_string_test.cpp
)
###################################################################################################
# - stream compaction tests -----------------------------------------------------------------------
ConfigureTest(STREAM_COMPACTION_TEST
stream_compaction/apply_boolean_mask_tests.cpp
stream_compaction/drop_nulls_tests.cpp
stream_compaction/drop_nans_tests.cpp
stream_compaction/drop_duplicates_tests.cpp)
# ##################################################################################################
# * stream compaction tests -----------------------------------------------------------------------
ConfigureTest(
STREAM_COMPACTION_TEST
stream_compaction/apply_boolean_mask_tests.cpp
stream_compaction/drop_nulls_tests.cpp
stream_compaction/drop_nans_tests.cpp
stream_compaction/drop_duplicates_tests.cpp
)
###################################################################################################
# - rolling tests ---------------------------------------------------------------------------------
ConfigureTest(ROLLING_TEST
rolling/collect_ops_test.cpp
rolling/empty_input_test.cpp
rolling/grouped_rolling_test.cpp
rolling/lead_lag_test.cpp
rolling/range_rolling_window_test.cpp
rolling/range_window_bounds_test.cpp
rolling/rolling_test.cpp)
# ##################################################################################################
# * rolling tests ---------------------------------------------------------------------------------
ConfigureTest(
ROLLING_TEST
rolling/collect_ops_test.cpp
rolling/empty_input_test.cpp
rolling/grouped_rolling_test.cpp
rolling/lead_lag_test.cpp
rolling/range_rolling_window_test.cpp
rolling/range_window_bounds_test.cpp
rolling/rolling_test.cpp
)
###################################################################################################
# - filling test ----------------------------------------------------------------------------------
ConfigureTest(FILLING_TEST
filling/fill_tests.cpp
filling/repeat_tests.cpp
filling/sequence_tests.cpp)
# ##################################################################################################
# * filling test ----------------------------------------------------------------------------------
ConfigureTest(
FILLING_TEST filling/fill_tests.cpp filling/repeat_tests.cpp filling/sequence_tests.cpp
)
###################################################################################################
# - search test -----------------------------------------------------------------------------------
ConfigureTest(SEARCH_TEST
search/search_dictionary_test.cpp
search/search_struct_test.cpp
search/search_test.cpp)
# ##################################################################################################
# * search test -----------------------------------------------------------------------------------
ConfigureTest(
SEARCH_TEST search/search_dictionary_test.cpp search/search_struct_test.cpp
search/search_test.cpp
)
###################################################################################################
# - reshape test ----------------------------------------------------------------------------------
ConfigureTest(RESHAPE_TEST
reshape/byte_cast_tests.cpp
reshape/interleave_columns_tests.cpp
reshape/tile_tests.cpp)
# ##################################################################################################
# * reshape test ----------------------------------------------------------------------------------
ConfigureTest(
RESHAPE_TEST reshape/byte_cast_tests.cpp reshape/interleave_columns_tests.cpp
reshape/tile_tests.cpp
)
###################################################################################################
# - traits test -----------------------------------------------------------------------------------
# ##################################################################################################
# * traits test -----------------------------------------------------------------------------------
ConfigureTest(TRAITS_TEST types/traits_test.cpp)
###################################################################################################
# - factories test --------------------------------------------------------------------------------
ConfigureTest(FACTORIES_TEST
scalar/factories_test.cpp
column/factories_test.cpp)
# ##################################################################################################
# * factories test --------------------------------------------------------------------------------
ConfigureTest(FACTORIES_TEST scalar/factories_test.cpp column/factories_test.cpp)
###################################################################################################
# - dispatcher test -------------------------------------------------------------------------------
# ##################################################################################################
# * dispatcher test -------------------------------------------------------------------------------
ConfigureTest(DISPATCHER_TEST types/type_dispatcher_test.cu)
###################################################################################################
# - strings test ----------------------------------------------------------------------------------
ConfigureTest(STRINGS_TEST
strings/array_tests.cpp
strings/attrs_tests.cpp
strings/booleans_tests.cpp
strings/case_tests.cpp
strings/chars_types_tests.cpp
strings/combine/concatenate_tests.cpp
strings/combine/join_list_elements_tests.cpp
strings/combine/join_strings_tests.cpp
strings/concatenate_tests.cpp
strings/contains_tests.cpp
strings/datetime_tests.cpp
strings/durations_tests.cpp
strings/extract_tests.cpp
strings/factories_test.cu
strings/fill_tests.cpp
strings/findall_tests.cpp
strings/find_tests.cpp
strings/find_multiple_tests.cpp
strings/fixed_point_tests.cpp
strings/floats_tests.cpp
strings/integers_tests.cpp
strings/ipv4_tests.cpp
strings/json_tests.cpp
strings/pad_tests.cpp
strings/repeat_strings_tests.cpp
strings/replace_regex_tests.cpp
strings/replace_tests.cpp
strings/split_tests.cpp
strings/strip_tests.cpp
strings/substring_tests.cpp
strings/translate_tests.cpp
strings/urls_tests.cpp)
# ##################################################################################################
# * strings test ----------------------------------------------------------------------------------
ConfigureTest(
STRINGS_TEST
strings/array_tests.cpp
strings/attrs_tests.cpp
strings/booleans_tests.cpp
strings/case_tests.cpp
strings/chars_types_tests.cpp
strings/combine/concatenate_tests.cpp
strings/combine/join_list_elements_tests.cpp
strings/combine/join_strings_tests.cpp
strings/concatenate_tests.cpp
strings/contains_tests.cpp
strings/datetime_tests.cpp
strings/durations_tests.cpp
strings/extract_tests.cpp
strings/factories_test.cu
strings/fill_tests.cpp
strings/findall_tests.cpp
strings/find_tests.cpp
strings/find_multiple_tests.cpp
strings/fixed_point_tests.cpp
strings/floats_tests.cpp
strings/integers_tests.cpp
strings/ipv4_tests.cpp
strings/json_tests.cpp
strings/pad_tests.cpp
strings/repeat_strings_tests.cpp
strings/replace_regex_tests.cpp
strings/replace_tests.cpp
strings/split_tests.cpp
strings/strip_tests.cpp
strings/substring_tests.cpp
strings/translate_tests.cpp
strings/urls_tests.cpp
)
###################################################################################################
# - structs test ----------------------------------------------------------------------------------
ConfigureTest(STRUCTS_TEST
structs/structs_column_tests.cpp
structs/utilities_tests.cpp
)
# ##################################################################################################
# * structs test ----------------------------------------------------------------------------------
ConfigureTest(STRUCTS_TEST structs/structs_column_tests.cpp structs/utilities_tests.cpp)
###################################################################################################
# - nvtext test -----------------------------------------------------------------------------------
ConfigureTest(TEXT_TEST
text/edit_distance_tests.cpp
text/ngrams_tests.cpp
text/ngrams_tokenize_tests.cpp
text/normalize_tests.cpp
text/replace_tests.cpp
text/stemmer_tests.cpp
text/subword_tests.cpp
text/tokenize_tests.cpp)
# ##################################################################################################
# * nvtext test -----------------------------------------------------------------------------------
ConfigureTest(
TEXT_TEST
text/edit_distance_tests.cpp
text/ngrams_tests.cpp
text/ngrams_tokenize_tests.cpp
text/normalize_tests.cpp
text/replace_tests.cpp
text/stemmer_tests.cpp
text/subword_tests.cpp
text/tokenize_tests.cpp
)
###################################################################################################
# - bitmask tests ---------------------------------------------------------------------------------
ConfigureTest(BITMASK_TEST
bitmask/valid_if_tests.cu
bitmask/set_nullmask_tests.cu
bitmask/bitmask_tests.cpp
bitmask/is_element_valid_tests.cpp)
# ##################################################################################################
# * bitmask tests ---------------------------------------------------------------------------------
ConfigureTest(
BITMASK_TEST bitmask/valid_if_tests.cu bitmask/set_nullmask_tests.cu bitmask/bitmask_tests.cpp
bitmask/is_element_valid_tests.cpp
)
# ##################################################################################################
# * dictionary tests ------------------------------------------------------------------------------
ConfigureTest(
DICTIONARY_TEST
dictionary/add_keys_test.cpp
dictionary/decode_test.cpp
dictionary/encode_test.cpp
dictionary/factories_test.cpp
dictionary/fill_test.cpp
dictionary/gather_test.cpp
dictionary/remove_keys_test.cpp
dictionary/scatter_test.cpp
dictionary/search_test.cpp
dictionary/set_keys_test.cpp
dictionary/slice_test.cpp
)
###################################################################################################
# - dictionary tests ------------------------------------------------------------------------------
ConfigureTest(DICTIONARY_TEST
dictionary/add_keys_test.cpp
dictionary/decode_test.cpp
dictionary/encode_test.cpp
dictionary/factories_test.cpp
dictionary/fill_test.cpp
dictionary/gather_test.cpp
dictionary/remove_keys_test.cpp
dictionary/scatter_test.cpp
dictionary/search_test.cpp
dictionary/set_keys_test.cpp
dictionary/slice_test.cpp)
###################################################################################################
# - encode tests -----------------------------------------------------------------------------------
# ##################################################################################################
# * encode tests -----------------------------------------------------------------------------------
ConfigureTest(ENCODE_TEST encode/encode_tests.cpp)
###################################################################################################
# - ast tests -------------------------------------------------------------------------------------
# ##################################################################################################
# * ast tests -------------------------------------------------------------------------------------
ConfigureTest(AST_TEST ast/transform_tests.cpp)
###################################################################################################
# - lists tests ----------------------------------------------------------------------------------
ConfigureTest(LISTS_TEST
lists/combine/concatenate_list_elements_tests.cpp
lists/combine/concatenate_rows_tests.cpp
lists/contains_tests.cpp
lists/count_elements_tests.cpp
lists/drop_list_duplicates_tests.cpp
lists/explode_tests.cpp
lists/extract_tests.cpp
lists/sort_lists_tests.cpp)
# ##################################################################################################
# * lists tests ----------------------------------------------------------------------------------
ConfigureTest(
LISTS_TEST
lists/combine/concatenate_list_elements_tests.cpp
lists/combine/concatenate_rows_tests.cpp
lists/contains_tests.cpp
lists/count_elements_tests.cpp
lists/drop_list_duplicates_tests.cpp
lists/explode_tests.cpp
lists/extract_tests.cpp
lists/sort_lists_tests.cpp
)
###################################################################################################
# - bin tests ----------------------------------------------------------------------------------
ConfigureTest(LABEL_BINS_TEST
labeling/label_bins_tests.cpp)
# ##################################################################################################
# * bin tests ----------------------------------------------------------------------------------
ConfigureTest(LABEL_BINS_TEST labeling/label_bins_tests.cpp)
###################################################################################################
### enable testing ################################################################################
###################################################################################################
# ##################################################################################################
# enable testing ################################################################################
# ##################################################################################################
enable_testing()

View File

@@ -1,22 +1,21 @@
#=============================================================================
# =============================================================================
# Copyright (c) 2019-2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
# in compliance with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================
cmake_minimum_required(VERSION 3.20.1 FATAL_ERROR)
file(DOWNLOAD https://raw.githubusercontent.com/rapidsai/rapids-cmake/branch-21.12/RAPIDS.cmake
${CMAKE_BINARY_DIR}/RAPIDS.cmake)
${CMAKE_BINARY_DIR}/RAPIDS.cmake
)
include(${CMAKE_BINARY_DIR}/RAPIDS.cmake)
include(rapids-cmake)
@@ -29,10 +28,14 @@ if(DEFINED GPU_ARCHS)
endif()
rapids_cuda_init_architectures(CUDF_JNI)
project(CUDF_JNI VERSION 21.12.00 LANGUAGES C CXX CUDA)
project(
CUDF_JNI
VERSION 21.12.00
LANGUAGES C CXX CUDA
)
###################################################################################################
# - build options ---------------------------------------------------------------------------------
# ##################################################################################################
# * build options ---------------------------------------------------------------------------------
option(USE_NVTX "Build with NVTX support" ON)
option(BUILD_TESTS "Configure CMake to build tests" ON)
@@ -49,19 +52,18 @@ message(VERBOSE "CUDF_JNI: Build with GPUDirect Storage support: ${USE_GDS}")
message(VERBOSE "CUDF_JNI: Build with static Arrow library: ${CUDF_JNI_ARROW_STATIC}")
set(CUDF_SOURCE_DIR "${PROJECT_SOURCE_DIR}/../../../../cpp")
if (DEFINED ENV{CUDF_CPP_BUILD_DIR})
if(DEFINED ENV{CUDF_CPP_BUILD_DIR})
set(CUDF_CPP_BUILD_DIR "$ENV{CUDF_CPP_BUILD_DIR}")
else()
set(CUDF_CPP_BUILD_DIR "${CUDF_SOURCE_DIR}/build")
endif()
set(CMAKE_MODULE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/"
"${CUDF_SOURCE_DIR}/cmake/Modules/"
${CMAKE_MODULE_PATH})
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/"
"${CUDF_SOURCE_DIR}/cmake/Modules/" ${CMAKE_MODULE_PATH}
)
###################################################################################################
# - compiler options ------------------------------------------------------------------------------
# ##################################################################################################
# * compiler options ------------------------------------------------------------------------------
set(CUDF_CXX_FLAGS "")
set(CUDF_CUDA_FLAGS "")
@@ -73,80 +75,80 @@ include(ConfigureCUDA) # set other CUDA compilation flags
# Disable NVTX if necessary
if(NOT USE_NVTX)
target_compile_definitions(cudfjni PUBLIC NVTX_DISABLE)
target_compile_definitions(cudfjni PUBLIC NVTX_DISABLE)
endif()
if(PER_THREAD_DEFAULT_STREAM)
message(STATUS "Using per-thread default stream")
add_compile_definitions(CUDA_API_PER_THREAD_DEFAULT_STREAM)
message(STATUS "Using per-thread default stream")
add_compile_definitions(CUDA_API_PER_THREAD_DEFAULT_STREAM)
endif()
###################################################################################################
# - build type ------------------------------------------------------------------------------------
# Set a default build type if none was specified
# ##################################################################################################
# * build type ------------------------------------------------------------------------------------
# Set a default build type if none was specified
rapids_cmake_build_type("Release")
###################################################################################################
# - Thrust/CUB/libcudacxx ------------------------------------------------------------------------------------
find_path(THRUST_INCLUDE "thrust"
HINTS "$ENV{CUDF_ROOT}/_deps/thrust-src"
"${CUDF_CPP_BUILD_DIR}/_deps/thrust-src"
"$ENV{CONDA_PREFIX}/include")
# ##################################################################################################
# * Thrust/CUB/libcudacxx
# ------------------------------------------------------------------------------------
find_path(
THRUST_INCLUDE "thrust"
HINTS "$ENV{CUDF_ROOT}/_deps/thrust-src" "${CUDF_CPP_BUILD_DIR}/_deps/thrust-src"
"$ENV{CONDA_PREFIX}/include"
)
message(STATUS "THRUST: THRUST_INCLUDE set to ${THRUST_INCLUDE}")
find_path(CUB_INCLUDE "cub"
HINTS "$ENV{CUDF_ROOT}/_deps/thrust-src"
"${CUDF_CPP_BUILD_DIR}/_deps/thrust-src"
"$ENV{CONDA_PREFIX}/include")
find_path(
CUB_INCLUDE "cub" HINTS "$ENV{CUDF_ROOT}/_deps/thrust-src"
"${CUDF_CPP_BUILD_DIR}/_deps/thrust-src" "$ENV{CONDA_PREFIX}/include"
)
message(STATUS "CUB: CUB_INCLUDE set to ${CUB_INCLUDE}")
find_path(LIBCUDACXX_INCLUDE "cuda"
HINTS "$ENV{CUDF_ROOT}/_deps/libcudacxx-src/include"
"${CUDF_CPP_BUILD_DIR}/_deps/libcudacxx-src/include")
find_path(LIBCUDACXX_INCLUDE "cuda" HINTS "$ENV{CUDF_ROOT}/_deps/libcudacxx-src/include"
"${CUDF_CPP_BUILD_DIR}/_deps/libcudacxx-src/include"
)
message(STATUS "LIBCUDACXX: LIBCUDACXX_INCLUDE set to ${LIBCUDACXX_INCLUDE}")
find_path(SPDLOG_INCLUDE "spdlog"
HINTS "${CUDF_CPP_BUILD_DIR}/_deps/spdlog-src/include"
"$ENV{RMM_ROOT}/_deps/spdlog-src/include"
"$ENV{RMM_ROOT}/include"
"$ENV{CONDA_PREFIX}/include")
find_path(
SPDLOG_INCLUDE "spdlog"
HINTS "${CUDF_CPP_BUILD_DIR}/_deps/spdlog-src/include" "$ENV{RMM_ROOT}/_deps/spdlog-src/include"
"$ENV{RMM_ROOT}/include" "$ENV{CONDA_PREFIX}/include"
)
message(STATUS "SPDLOG: SPDLOG_INCLUDE set to ${SPDLOG_INCLUDE}")
###################################################################################################
# - CUDF ------------------------------------------------------------------------------------------
# ##################################################################################################
# * CUDF ------------------------------------------------------------------------------------------
set(CUDF_INCLUDE "${PROJECT_SOURCE_DIR}/../../../../cpp/include"
"${PROJECT_SOURCE_DIR}/../../../../cpp/src/")
"${PROJECT_SOURCE_DIR}/../../../../cpp/src/"
)
set(CUDF_LIB_HINTS
HINTS "$ENV{CUDF_ROOT}"
"$ENV{CUDF_ROOT}/lib"
"$ENV{CONDA_PREFIX}/lib"
"${CUDF_CPP_BUILD_DIR}")
set(CUDF_LIB_HINTS HINTS "$ENV{CUDF_ROOT}" "$ENV{CUDF_ROOT}/lib" "$ENV{CONDA_PREFIX}/lib"
"${CUDF_CPP_BUILD_DIR}"
)
find_library(CUDF_LIB "cudf" REQUIRED HINTS ${CUDF_LIB_HINTS})
###################################################################################################
# - RMM -------------------------------------------------------------------------------------------
# ##################################################################################################
# * RMM -------------------------------------------------------------------------------------------
find_path(RMM_INCLUDE "rmm"
HINTS "${CUDF_CPP_BUILD_DIR}/_deps/rmm-src/include"
"$ENV{RMM_ROOT}/include"
"$ENV{RMM_HOME}/include"
"$ENV{CONDA_PREFIX}/include/rmm"
"$ENV{CONDA_PREFIX}/include")
find_path(
RMM_INCLUDE "rmm"
HINTS "${CUDF_CPP_BUILD_DIR}/_deps/rmm-src/include" "$ENV{RMM_ROOT}/include"
"$ENV{RMM_HOME}/include" "$ENV{CONDA_PREFIX}/include/rmm" "$ENV{CONDA_PREFIX}/include"
)
message(STATUS "RMM: RMM_INCLUDE set to ${RMM_INCLUDE}")
###################################################################################################
# - ARROW -----------------------------------------------------------------------------------------
# ##################################################################################################
# * ARROW -----------------------------------------------------------------------------------------
find_path(ARROW_INCLUDE "arrow"
HINTS "$ENV{ARROW_ROOT}/include"
"${CUDF_CPP_BUILD_DIR}/_deps/arrow-src/cpp/src")
find_path(ARROW_INCLUDE "arrow" HINTS "$ENV{ARROW_ROOT}/include"
"${CUDF_CPP_BUILD_DIR}/_deps/arrow-src/cpp/src"
)
message(STATUS "ARROW: ARROW_INCLUDE set to ${ARROW_INCLUDE}")
@@ -157,14 +159,17 @@ else()
set(CUDF_JNI_ARROW_LIBNAME "arrow")
endif()
find_library(ARROW_LIBRARY ${CUDF_JNI_ARROW_LIBNAME} REQUIRED
HINTS "$ENV{ARROW_ROOT}/lib"
"${CUDF_CPP_BUILD_DIR}/_deps/arrow-build/release"
"${CUDF_CPP_BUILD_DIR}/_deps/arrow-build/debug")
find_library(
ARROW_LIBRARY ${CUDF_JNI_ARROW_LIBNAME} REQUIRED
HINTS "$ENV{ARROW_ROOT}/lib" "${CUDF_CPP_BUILD_DIR}/_deps/arrow-build/release"
"${CUDF_CPP_BUILD_DIR}/_deps/arrow-build/debug"
)
if(NOT ARROW_LIBRARY)
if(CUDF_JNI_ARROW_STATIC)
message(FATAL_ERROR "Arrow static library not found. Was libcudf built with CUDF_USE_ARROW_STATIC=ON?")
message(
FATAL_ERROR "Arrow static library not found. Was libcudf built with CUDF_USE_ARROW_STATIC=ON?"
)
else()
message(FATAL_ERROR "Arrow dynamic library not found.")
endif()
@@ -172,28 +177,29 @@ else()
message(STATUS "ARROW: ARROW_LIBRARY set to ${ARROW_LIBRARY}")
endif()
###################################################################################################
# - find JNI -------------------------------------------------------------------------------------
# ##################################################################################################
# * find JNI -------------------------------------------------------------------------------------
find_package(JNI REQUIRED)
if(JNI_FOUND)
message(STATUS "JDK with JNI in ${JNI_INCLUDE_DIRS}")
message(STATUS "JDK with JNI in ${JNI_INCLUDE_DIRS}")
else()
message(FATAL_ERROR "JDK with JNI not found, please check your settings.")
message(FATAL_ERROR "JDK with JNI not found, please check your settings.")
endif()
###################################################################################################
# - nvcomp ----------------------------------------------------------------------------------------
# ##################################################################################################
# * nvcomp ----------------------------------------------------------------------------------------
find_path(NVCOMP_INCLUDE "nvcomp"
HINTS "${CUDF_CPP_BUILD_DIR}/_deps/nvcomp-src/include"
"$ENV{CONDA_PREFIX}/include")
find_path(NVCOMP_INCLUDE "nvcomp" HINTS "${CUDF_CPP_BUILD_DIR}/_deps/nvcomp-src/include"
"$ENV{CONDA_PREFIX}/include"
)
message(STATUS "NVCOMP: NVCOMP_INCLUDE set to ${NVCOMP_INCLUDE}")
set(CUDF_JNI_NVCOMP_LIBNAME "libnvcomp.a")
find_library(NVCOMP_LIBRARY ${CUDF_JNI_NVCOMP_LIBNAME} REQUIRED
HINTS "${CUDF_CPP_BUILD_DIR}/lib"
"$ENV{CONDA_PREFIX}/lib")
find_library(
NVCOMP_LIBRARY ${CUDF_JNI_NVCOMP_LIBNAME} REQUIRED HINTS "${CUDF_CPP_BUILD_DIR}/lib"
"$ENV{CONDA_PREFIX}/lib"
)
if(NOT NVCOMP_LIBRARY)
message(FATAL_ERROR "nvcomp static library not found.")
@@ -201,119 +207,123 @@ else()
message(STATUS "NVCOMP: NVCOMP_LIBRARY set to ${NVCOMP_LIBRARY}")
endif()
###################################################################################################
# - GDS/cufile ------------------------------------------------------------------------------------
# ##################################################################################################
# * GDS/cufile ------------------------------------------------------------------------------------
if(USE_GDS)
message(STATUS "Building with GPUDirect Storage (GDS)/cuFile support")
find_package(cuFile REQUIRED)
message(STATUS "Building with GPUDirect Storage (GDS)/cuFile support")
find_package(cuFile REQUIRED)
endif()
###################################################################################################
# - library targets -------------------------------------------------------------------------------
# ##################################################################################################
# * library targets -------------------------------------------------------------------------------
add_library(cudfjni SHARED
src/row_conversion.cu
src/AggregationJni.cpp
src/CudfJni.cpp
src/CudaJni.cpp
src/ColumnVectorJni.cpp
src/ColumnViewJni.cpp
src/CompiledExpression.cpp
src/ContiguousTableJni.cpp
src/HashJoinJni.cpp
src/HostMemoryBufferNativeUtilsJni.cpp
src/NvcompJni.cpp
src/NvtxRangeJni.cpp
src/RmmJni.cpp
src/ScalarJni.cpp
src/TableJni.cpp
src/map_lookup.cu
src/check_nvcomp_output_sizes.cu)
###################################################################################################
# - include paths ---------------------------------------------------------------------------------
target_include_directories(cudfjni
PUBLIC
"${THRUST_INCLUDE}"
"${CUB_INCLUDE}"
"${LIBCUDACXX_INCLUDE}"
"${CUDAToolkit_INCLUDE_DIRS}"
"${NVCOMP_INCLUDE}"
"${CMAKE_BINARY_DIR}/include"
"${CMAKE_SOURCE_DIR}/include"
"${SPDLOG_INCLUDE}"
"${CMAKE_SOURCE_DIR}/src"
"${JNI_INCLUDE_DIRS}"
"${CUDF_INCLUDE}"
"${RMM_INCLUDE}"
"${ARROW_INCLUDE}")
###################################################################################################
# - compile options ---------------------------------------------------------------------------------
#Override RPATH for cudfjni
set_target_properties(cudfjni
PROPERTIES BUILD_RPATH "\$ORIGIN"
INSTALL_RPATH "\$ORIGIN"
# set target compile options
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
CUDA_STANDARD 17
CUDA_STANDARD_REQUIRED ON
add_library(
cudfjni SHARED
src/row_conversion.cu
src/AggregationJni.cpp
src/CudfJni.cpp
src/CudaJni.cpp
src/ColumnVectorJni.cpp
src/ColumnViewJni.cpp
src/CompiledExpression.cpp
src/ContiguousTableJni.cpp
src/HashJoinJni.cpp
src/HostMemoryBufferNativeUtilsJni.cpp
src/NvcompJni.cpp
src/NvtxRangeJni.cpp
src/RmmJni.cpp
src/ScalarJni.cpp
src/TableJni.cpp
src/map_lookup.cu
src/check_nvcomp_output_sizes.cu
)
target_compile_options(cudfjni
PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${CUDF_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_FLAGS}>"
# ##################################################################################################
# * include paths ---------------------------------------------------------------------------------
target_include_directories(
cudfjni
PUBLIC "${THRUST_INCLUDE}"
"${CUB_INCLUDE}"
"${LIBCUDACXX_INCLUDE}"
"${CUDAToolkit_INCLUDE_DIRS}"
"${NVCOMP_INCLUDE}"
"${CMAKE_BINARY_DIR}/include"
"${CMAKE_SOURCE_DIR}/include"
"${SPDLOG_INCLUDE}"
"${CMAKE_SOURCE_DIR}/src"
"${JNI_INCLUDE_DIRS}"
"${CUDF_INCLUDE}"
"${RMM_INCLUDE}"
"${ARROW_INCLUDE}"
)
target_compile_definitions(cudfjni
PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${CUDF_CXX_DEFINITIONS}>"
"$<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_DEFINITIONS}>"
# ##################################################################################################
# * compile options
# ---------------------------------------------------------------------------------
# Override RPATH for cudfjni
set_target_properties(
cudfjni
PROPERTIES BUILD_RPATH "\$ORIGIN" INSTALL_RPATH "\$ORIGIN" # set target compile options
CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON CUDA_STANDARD 17 CUDA_STANDARD_REQUIRED ON
)
target_compile_options(
cudfjni PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${CUDF_CXX_FLAGS}>"
"$<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_FLAGS}>"
)
target_compile_definitions(
cudfjni PUBLIC "$<$<COMPILE_LANGUAGE:CXX>:${CUDF_CXX_DEFINITIONS}>"
"$<$<COMPILE_LANGUAGE:CUDA>:${CUDF_CUDA_DEFINITIONS}>"
)
if(USE_GDS)
add_library(cufilejni SHARED src/CuFileJni.cpp)
set_target_properties(cufilejni
PROPERTIES BUILD_RPATH "\$ORIGIN"
INSTALL_RPATH "\$ORIGIN"
# set target compile options
CXX_STANDARD 17
CXX_STANDARD_REQUIRED ON
)
target_include_directories(cufilejni
PUBLIC "${LIBCUDACXX_INCLUDE}"
"${CUDF_INCLUDE}"
PRIVATE "${cuFile_INCLUDE_DIRS}")
target_link_libraries(cufilejni PRIVATE cudfjni "${cuFile_LIBRARIES}")
add_library(cufilejni SHARED src/CuFileJni.cpp)
set_target_properties(
cufilejni
PROPERTIES BUILD_RPATH "\$ORIGIN" INSTALL_RPATH "\$ORIGIN" # set target compile options
CXX_STANDARD 17 CXX_STANDARD_REQUIRED ON
)
target_include_directories(
cufilejni
PUBLIC "${LIBCUDACXX_INCLUDE}" "${CUDF_INCLUDE}"
PRIVATE "${cuFile_INCLUDE_DIRS}"
)
target_link_libraries(cufilejni PRIVATE cudfjni "${cuFile_LIBRARIES}")
endif()
###################################################################################################
# - rmm logging level -----------------------------------------------------------------------------
# ##################################################################################################
# * rmm logging level -----------------------------------------------------------------------------
set(RMM_LOGGING_LEVEL "INFO" CACHE STRING "Choose the logging level.")
set(RMM_LOGGING_LEVEL
"INFO"
CACHE STRING "Choose the logging level."
)
# Set the possible values of build type for cmake-gui
set_property(CACHE RMM_LOGGING_LEVEL PROPERTY STRINGS
"TRACE" "DEBUG" "INFO" "WARN" "ERROR" "CRITICAL" "OFF")
set_property(
CACHE RMM_LOGGING_LEVEL PROPERTY STRINGS "TRACE" "DEBUG" "INFO" "WARN" "ERROR" "CRITICAL" "OFF"
)
message(STATUS "RMM_LOGGING_LEVEL = '${RMM_LOGGING_LEVEL}'.")
target_compile_definitions(cudfjni PUBLIC SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_${RMM_LOGGING_LEVEL})
###################################################################################################
# - link libraries --------------------------------------------------------------------------------
# ##################################################################################################
# * link libraries --------------------------------------------------------------------------------
target_link_libraries(cudfjni PRIVATE ${NVCOMP_LIBRARY} ${CUDF_LIB} ${ARROW_LIBRARY})
###################################################################################################
# - cudart options --------------------------------------------------------------------------------
# cudart can be statically linked or dynamically linked. The python ecosystem wants dynamic linking
# ##################################################################################################
# * cudart options --------------------------------------------------------------------------------
# cudart can be statically linked or dynamically linked. The python ecosystem wants dynamic
# linking
if(CUDA_STATIC_RUNTIME)
# Tell CMake what CUDA language runtime to use
set_target_properties(cudfjni PROPERTIES CUDA_RUNTIME_LIBRARY Static)
# Tell CMake what CUDA language runtime to use
set_target_properties(cudfjni PROPERTIES CUDA_RUNTIME_LIBRARY Static)
else()
# Tell CMake what CUDA language runtime to use
set_target_properties(cudfjni PROPERTIES CUDA_RUNTIME_LIBRARY Shared)
# Tell CMake what CUDA language runtime to use
set_target_properties(cudfjni PROPERTIES CUDA_RUNTIME_LIBRARY Shared)
endif()