From 16b365635ab0f86bb1cc6db5f036564e8290f3b1 Mon Sep 17 00:00:00 2001 From: Robert Maynard Date: Tue, 11 Jun 2024 14:58:54 -0400 Subject: [PATCH] Ensure minimal set of cpp/ functions used by tests are marked public --- cpp/src/io/comp/gpuinflate.hpp | 3 ++- cpp/src/io/json/nested_json.hpp | 13 +++++++++---- cpp/src/io/json/read_json.hpp | 7 +++++-- cpp/src/io/parquet/compact_protocol_reader.hpp | 10 +++++++--- cpp/src/io/utilities/base64_utilities.hpp | 8 ++++++-- cpp/src/io/utilities/file_io_utilities.hpp | 3 ++- cpp/src/io/utilities/row_selection.hpp | 6 ++++-- cpp/src/io/utilities/string_parsing.hpp | 5 +++-- cpp/src/io/utilities/trie.cuh | 5 +++-- cpp/src/jit/parser.hpp | 4 +++- cpp/src/lists/stream_compaction/distinct.cu | 1 + cpp/src/stream_compaction/distinct.cu | 1 - cpp/src/utilities/stacktrace.cpp | 7 +++++-- 13 files changed, 50 insertions(+), 23 deletions(-) diff --git a/cpp/src/io/comp/gpuinflate.hpp b/cpp/src/io/comp/gpuinflate.hpp index 5908b77c98b..c5a11a349aa 100644 --- a/cpp/src/io/comp/gpuinflate.hpp +++ b/cpp/src/io/comp/gpuinflate.hpp @@ -17,13 +17,14 @@ #pragma once #include +#include #include #include #include -namespace cudf { +namespace CUDF_EXPORT cudf { namespace io { /** diff --git a/cpp/src/io/json/nested_json.hpp b/cpp/src/io/json/nested_json.hpp index e12892a2d50..efcdc26acdd 100644 --- a/cpp/src/io/json/nested_json.hpp +++ b/cpp/src/io/json/nested_json.hpp @@ -21,6 +21,7 @@ #include #include #include +#include #include @@ -28,10 +29,12 @@ #include // Forward declaration of parse_options from parsing_utils.cuh -namespace cudf::io { +namespace CUDF_EXPORT cudf { +namespace io { + struct parse_options; -} -namespace cudf::io::json { + +namespace json { /** * @brief Struct that encapsulate all information of a columnar tree representation. @@ -348,4 +351,6 @@ struct path_from_tree { } // namespace detail -} // namespace cudf::io::json +} // namespace json +} // namespace io +} // namespace cudf diff --git a/cpp/src/io/json/read_json.hpp b/cpp/src/io/json/read_json.hpp index 0c30b4cad46..76485256c81 100644 --- a/cpp/src/io/json/read_json.hpp +++ b/cpp/src/io/json/read_json.hpp @@ -19,6 +19,7 @@ #include #include #include +#include #include #include @@ -27,7 +28,8 @@ #include -namespace cudf::io::json::detail { +namespace CUDF_EXPORT cudf { +namespace io::json::detail { table_with_metadata read_json(host_span> sources, json_reader_options const& reader_opts, @@ -43,4 +45,5 @@ size_type find_first_delimiter_in_chunk(host_span + #include #include #include @@ -25,7 +27,8 @@ #include #include -namespace cudf::io::parquet::detail { +namespace CUDF_EXPORT cudf { +namespace io::parquet::detail { /** * @brief Class for parsing Parquet's Thrift Compact Protocol encoded metadata @@ -39,7 +42,7 @@ namespace cudf::io::parquet::detail { * The parser handles both V1 and V2 Parquet datasets, although not all * compression codecs are supported yet. */ -class CompactProtocolReader { +class CUDF_EXPORT CompactProtocolReader { public: explicit CompactProtocolReader(uint8_t const* base = nullptr, size_t len = 0) { init(base, len); } void init(uint8_t const* base, size_t len) @@ -149,4 +152,5 @@ class CompactProtocolReader { friend class parquet_field_struct_blob; }; -} // namespace cudf::io::parquet::detail +} // namespace io::parquet::detail +} // namespace cudf diff --git a/cpp/src/io/utilities/base64_utilities.hpp b/cpp/src/io/utilities/base64_utilities.hpp index 537d9c96d6b..411edf578ab 100644 --- a/cpp/src/io/utilities/base64_utilities.hpp +++ b/cpp/src/io/utilities/base64_utilities.hpp @@ -61,10 +61,13 @@ // altered: applying clang-format for libcudf on this file. // altered: include required headers +#include + #include // altered: use cudf namespaces -namespace cudf::io::detail { +namespace CUDF_EXPORT cudf { +namespace io::detail { /** * @brief Encodes input string to base64 and returns it @@ -84,4 +87,5 @@ std::string base64_encode(std::string_view string_to_encode); */ std::string base64_decode(std::string_view encoded_string); -} // namespace cudf::io::detail +} // namespace io::detail +} diff --git a/cpp/src/io/utilities/file_io_utilities.hpp b/cpp/src/io/utilities/file_io_utilities.hpp index 91ef41fba6e..3a1e9527306 100644 --- a/cpp/src/io/utilities/file_io_utilities.hpp +++ b/cpp/src/io/utilities/file_io_utilities.hpp @@ -26,12 +26,13 @@ #include #include +#include #include #include -namespace cudf { +namespace CUDF_EXPORT cudf { namespace io { namespace detail { diff --git a/cpp/src/io/utilities/row_selection.hpp b/cpp/src/io/utilities/row_selection.hpp index 7fdcc65d77b..d77f2be426b 100644 --- a/cpp/src/io/utilities/row_selection.hpp +++ b/cpp/src/io/utilities/row_selection.hpp @@ -21,7 +21,8 @@ #include #include -namespace cudf::io::detail { +namespace CUDF_EXPORT cudf { +namespace io::detail { /** * @brief Adjusts the input skip_rows and num_rows options to the actual number of rows to @@ -38,4 +39,5 @@ std::pair skip_rows_num_rows_from_options(int64_t skip_rows, std::optional const& num_rows, int64_t num_source_rows); -} // namespace cudf::io::detail +} // namespace io::detail +} // namespace cudf diff --git a/cpp/src/io/utilities/string_parsing.hpp b/cpp/src/io/utilities/string_parsing.hpp index 612889af74b..ca86fd66a4f 100644 --- a/cpp/src/io/utilities/string_parsing.hpp +++ b/cpp/src/io/utilities/string_parsing.hpp @@ -18,6 +18,7 @@ #include "io/utilities/parsing_utils.cuh" #include +#include #include #include @@ -43,7 +44,7 @@ namespace detail { * @param stream CUDA stream used for device memory operations and kernel launches * @return The inferred data type */ -cudf::data_type infer_data_type( +CUDF_EXPORT cudf::data_type infer_data_type( cudf::io::json_inference_options_view const& options, device_span data, thrust::zip_iterator> offset_length_begin, @@ -66,7 +67,7 @@ namespace json::detail { * @param mr The resource to be used for device memory allocation * @return The column that contains the parsed data */ -std::unique_ptr parse_data( +CUDF_EXPORT std::unique_ptr parse_data( const char* data, thrust::zip_iterator> offset_length_begin, size_type col_size, diff --git a/cpp/src/io/utilities/trie.cuh b/cpp/src/io/utilities/trie.cuh index 677743d77d0..d21c347be4f 100644 --- a/cpp/src/io/utilities/trie.cuh +++ b/cpp/src/io/utilities/trie.cuh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2023, NVIDIA CORPORATION. + * Copyright (c) 2018-2024, NVIDIA CORPORATION. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ #pragma once +#include #include #include @@ -67,7 +68,7 @@ inline trie_view make_trie_view(optional_trie const& t) * * @return A host vector of nodes representing the serialized trie */ -trie create_serialized_trie(std::vector const& keys, rmm::cuda_stream_view stream); +CUDF_EXPORT trie create_serialized_trie(std::vector const& keys, rmm::cuda_stream_view stream); /* * @brief Searches for a string in a serialized trie. diff --git a/cpp/src/jit/parser.hpp b/cpp/src/jit/parser.hpp index 86f869c5e97..cb181eb4b20 100644 --- a/cpp/src/jit/parser.hpp +++ b/cpp/src/jit/parser.hpp @@ -16,12 +16,14 @@ #pragma once +#include + #include #include #include #include -namespace cudf { +namespace CUDF_EXPORT cudf { namespace jit { /** * @brief Parse and transform a piece of PTX code that contains the implementation diff --git a/cpp/src/lists/stream_compaction/distinct.cu b/cpp/src/lists/stream_compaction/distinct.cu index cdcb4aa957f..edf2bee0e4e 100644 --- a/cpp/src/lists/stream_compaction/distinct.cu +++ b/cpp/src/lists/stream_compaction/distinct.cu @@ -14,6 +14,7 @@ * limitations under the License. */ + #include "lists/utilities.hpp" #include diff --git a/cpp/src/stream_compaction/distinct.cu b/cpp/src/stream_compaction/distinct.cu index a6f15cc49ec..953ea42b452 100644 --- a/cpp/src/stream_compaction/distinct.cu +++ b/cpp/src/stream_compaction/distinct.cu @@ -13,7 +13,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - #include "distinct_helpers.hpp" #include diff --git a/cpp/src/utilities/stacktrace.cpp b/cpp/src/utilities/stacktrace.cpp index 48cf632bbaa..6405d985e78 100644 --- a/cpp/src/utilities/stacktrace.cpp +++ b/cpp/src/utilities/stacktrace.cpp @@ -15,6 +15,7 @@ */ #include +#include #if defined(__GNUC__) && defined(CUDF_BUILD_STACKTRACE_DEBUG) #include @@ -25,7 +26,8 @@ #include #endif // defined(__GNUC__) && defined(CUDF_BUILD_STACKTRACE_DEBUG) -namespace cudf::detail { +namespace CUDF_EXPORT cudf { +namespace detail { std::string get_stacktrace(capture_last_stackframe capture_last_frame) { @@ -85,4 +87,5 @@ std::string get_stacktrace(capture_last_stackframe capture_last_frame) #endif // __GNUC__ } -} // namespace cudf::detail +} // namespace detail +} // namespace cudf