Skip to content

Commit

Permalink
Ensure minimal set of cpp/ functions used by tests are marked public
Browse files Browse the repository at this point in the history
  • Loading branch information
robertmaynard committed Jun 11, 2024
1 parent 44d6a5f commit 16b3656
Show file tree
Hide file tree
Showing 13 changed files with 50 additions and 23 deletions.
3 changes: 2 additions & 1 deletion cpp/src/io/comp/gpuinflate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
#pragma once

#include <cudf/io/types.hpp>
#include <cudf/utilities/export.hpp>
#include <cudf/utilities/span.hpp>

#include <rmm/cuda_stream_view.hpp>

#include <cstdint>

namespace cudf {
namespace CUDF_EXPORT cudf {
namespace io {

/**
Expand Down
13 changes: 9 additions & 4 deletions cpp/src/io/json/nested_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,20 @@
#include <cudf/types.hpp>
#include <cudf/utilities/bit.hpp>
#include <cudf/utilities/error.hpp>
#include <cudf/utilities/export.hpp>

#include <rmm/resource_ref.hpp>

#include <map>
#include <vector>

// 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.
Expand Down Expand Up @@ -348,4 +351,6 @@ struct path_from_tree {

} // namespace detail

} // namespace cudf::io::json
} // namespace json
} // namespace io
} // namespace cudf
7 changes: 5 additions & 2 deletions cpp/src/io/json/read_json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <cudf/io/datasource.hpp>
#include <cudf/io/json.hpp>
#include <cudf/types.hpp>
#include <cudf/utilities/export.hpp>
#include <cudf/utilities/span.hpp>

#include <rmm/cuda_stream_view.hpp>
Expand All @@ -27,7 +28,8 @@

#include <memory>

namespace cudf::io::json::detail {
namespace CUDF_EXPORT cudf {
namespace io::json::detail {

table_with_metadata read_json(host_span<std::unique_ptr<datasource>> sources,
json_reader_options const& reader_opts,
Expand All @@ -43,4 +45,5 @@ size_type find_first_delimiter_in_chunk(host_span<std::unique_ptr<cudf::io::data
char const delimiter,
rmm::cuda_stream_view stream);

} // namespace cudf::io::json::detail
} // namespace io::json::detail
} // namespace cudf
10 changes: 7 additions & 3 deletions cpp/src/io/parquet/compact_protocol_reader.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@

#include "parquet.hpp"

#include <cudf/utilities/export.hpp>

#include <algorithm>
#include <cstddef>
#include <optional>
#include <string>
#include <utility>
#include <vector>

namespace cudf::io::parquet::detail {
namespace CUDF_EXPORT cudf {
namespace io::parquet::detail {

/**
* @brief Class for parsing Parquet's Thrift Compact Protocol encoded metadata
Expand All @@ -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)
Expand Down Expand Up @@ -149,4 +152,5 @@ class CompactProtocolReader {
friend class parquet_field_struct_blob;
};

} // namespace cudf::io::parquet::detail
} // namespace io::parquet::detail
} // namespace cudf
8 changes: 6 additions & 2 deletions cpp/src/io/utilities/base64_utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,13 @@
// altered: applying clang-format for libcudf on this file.

// altered: include required headers
#include <cudf/utilities/export.hpp>

#include <string>

// altered: use cudf namespaces
namespace cudf::io::detail {
namespace CUDF_EXPORT cudf {
namespace io::detail {

/**
* @brief Encodes input string to base64 and returns it
Expand All @@ -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
}
3 changes: 2 additions & 1 deletion cpp/src/io/utilities/file_io_utilities.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,13 @@

#include <cudf/io/datasource.hpp>
#include <cudf/utilities/error.hpp>
#include <cudf/utilities/export.hpp>

#include <rmm/cuda_stream_view.hpp>

#include <string>

namespace cudf {
namespace CUDF_EXPORT cudf {
namespace io {
namespace detail {

Expand Down
6 changes: 4 additions & 2 deletions cpp/src/io/utilities/row_selection.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#include <optional>
#include <utility>

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
Expand All @@ -38,4 +39,5 @@ std::pair<int64_t, int64_t> skip_rows_num_rows_from_options(int64_t skip_rows,
std::optional<int64_t> const& num_rows,
int64_t num_source_rows);

} // namespace cudf::io::detail
} // namespace io::detail
} // namespace cudf
5 changes: 3 additions & 2 deletions cpp/src/io/utilities/string_parsing.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "io/utilities/parsing_utils.cuh"

#include <cudf/types.hpp>
#include <cudf/utilities/export.hpp>
#include <cudf/utilities/span.hpp>

#include <rmm/cuda_stream_view.hpp>
Expand All @@ -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<char const> data,
thrust::zip_iterator<thrust::tuple<const size_type*, const size_type*>> offset_length_begin,
Expand All @@ -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<column> parse_data(
CUDF_EXPORT std::unique_ptr<column> parse_data(
const char* data,
thrust::zip_iterator<thrust::tuple<const size_type*, const size_type*>> offset_length_begin,
size_type col_size,
Expand Down
5 changes: 3 additions & 2 deletions cpp/src/io/utilities/trie.cuh
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -21,6 +21,7 @@

#pragma once

#include <cudf/utilities/export.hpp>
#include <cudf/utilities/span.hpp>

#include <optional>
Expand Down Expand Up @@ -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<std::string> const& keys, rmm::cuda_stream_view stream);
CUDF_EXPORT trie create_serialized_trie(std::vector<std::string> const& keys, rmm::cuda_stream_view stream);

/*
* @brief Searches for a string in a serialized trie.
Expand Down
4 changes: 3 additions & 1 deletion cpp/src/jit/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@

#pragma once

#include <cudf/utilities/export.hpp>

#include <map>
#include <set>
#include <string>
#include <vector>

namespace cudf {
namespace CUDF_EXPORT cudf {
namespace jit {
/**
* @brief Parse and transform a piece of PTX code that contains the implementation
Expand Down
1 change: 1 addition & 0 deletions cpp/src/lists/stream_compaction/distinct.cu
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
* limitations under the License.
*/


#include "lists/utilities.hpp"

#include <cudf/column/column_factories.hpp>
Expand Down
1 change: 0 additions & 1 deletion cpp/src/stream_compaction/distinct.cu
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/

#include "distinct_helpers.hpp"

#include <cudf/column/column_view.hpp>
Expand Down
7 changes: 5 additions & 2 deletions cpp/src/utilities/stacktrace.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include <cudf/detail/utilities/stacktrace.hpp>
#include <cudf/utilities/export.hpp>

#if defined(__GNUC__) && defined(CUDF_BUILD_STACKTRACE_DEBUG)
#include <cxxabi.h>
Expand All @@ -25,7 +26,8 @@
#include <sstream>
#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)
{
Expand Down Expand Up @@ -85,4 +87,5 @@ std::string get_stacktrace(capture_last_stackframe capture_last_frame)
#endif // __GNUC__
}

} // namespace cudf::detail
} // namespace detail
} // namespace cudf

0 comments on commit 16b3656

Please sign in to comment.