Skip to content

Commit

Permalink
Upmerge to the latest CUDF and fix compile errors (NVIDIA#1154)
Browse files Browse the repository at this point in the history
Signed-off-by: Robert (Bobby) Evans <[email protected]>
  • Loading branch information
revans2 authored May 19, 2023
1 parent 318bdbd commit a6985de
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 12 deletions.
19 changes: 14 additions & 5 deletions src/main/cpp/src/cast_string.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, NVIDIA CORPORATION.
* Copyright (c) 2022-2023, 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 @@

#include <cudf/column/column.hpp>
#include <cudf/column/column_device_view.cuh>
#include <cudf/detail/null_mask.hpp>
#include <cudf/detail/utilities/cuda.cuh>
#include <cudf/detail/utilities/integer_utils.hpp>
#include <cudf/null_mask.hpp>
Expand Down Expand Up @@ -652,7 +653,8 @@ struct string_to_integer_impl {
rmm::mr::device_memory_resource* mr)
{
if (string_col.size() == 0) {
return std::make_unique<column>(data_type{type_to_id<T>()}, 0, rmm::device_buffer{});
return std::make_unique<column>(data_type{type_to_id<T>()}, 0, rmm::device_buffer{},
rmm::device_buffer{}, 0);
}

rmm::device_uvector<T> data(string_col.size(), stream, mr);
Expand All @@ -672,8 +674,10 @@ struct string_to_integer_impl {
ansi_mode,
strip);

auto null_count = cudf::detail::null_count(null_mask.data(), 0, string_col.size(), stream);

auto col = std::make_unique<column>(
data_type{type_to_id<T>()}, string_col.size(), data.release(), null_mask.release());
data_type{type_to_id<T>()}, string_col.size(), data.release(), null_mask.release(), null_count);

if (ansi_mode) { validate_ansi_column(col->view(), string_col, stream); }

Expand Down Expand Up @@ -737,8 +741,11 @@ struct string_to_decimal_impl {
precision,
strip);

auto null_count = cudf::detail::null_count(null_mask.data(), 0, string_col.size(), stream);

auto col =
std::make_unique<column>(dtype, string_col.size(), data.release(), null_mask.release());
std::make_unique<column>(dtype, string_col.size(), data.release(),
null_mask.release(), null_count);

if (ansi_mode) { validate_ansi_column(col->view(), string_col, stream); }

Expand Down Expand Up @@ -818,7 +825,9 @@ std::unique_ptr<column> string_to_decimal(int32_t precision,
CUDF_FAIL("Unable to support decimal with precision " + std::to_string(precision));
}();

if (string_col.size() == 0) { return std::make_unique<column>(dtype, 0, rmm::device_buffer{}); }
if (string_col.size() == 0) {
return std::make_unique<column>(dtype, 0, rmm::device_buffer{}, rmm::device_buffer{}, 0);
}

return type_dispatcher(
dtype, detail::string_to_decimal_impl{}, dtype, precision, string_col, ansi_mode, strip, stream, mr);
Expand Down
5 changes: 4 additions & 1 deletion src/main/cpp/src/map_utils.cu
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,11 @@ std::unique_ptr<cudf::column> from_json(cudf::column_view const &input,
auto structs_col = cudf::make_structs_column(num_pairs, std::move(out_keys_vals), 0,
rmm::device_buffer{}, stream, mr);

auto offsets = std::make_unique<cudf::column>(std::move(list_offsets),
rmm::device_buffer{}, 0);

return cudf::make_lists_column(
input.size(), std::make_unique<cudf::column>(std::move(list_offsets)), std::move(structs_col),
input.size(), std::move(offsets), std::move(structs_col),
input.null_count(), cudf::detail::copy_bitmask(input, stream, mr), stream, mr);
}

Expand Down
7 changes: 5 additions & 2 deletions src/main/cpp/src/row_conversion.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1886,10 +1886,13 @@ std::vector<std::unique_ptr<column>> convert_to_rows(
auto const offset_count = batch_info.row_batches[batch].row_offsets.size();
auto offsets = std::make_unique<column>(
data_type{type_id::INT32}, (size_type)offset_count,
batch_info.row_batches[batch].row_offsets.release());
batch_info.row_batches[batch].row_offsets.release(),
rmm::device_buffer{}, 0);
auto data = std::make_unique<column>(data_type{type_id::INT8},
batch_info.row_batches[batch].num_bytes,
std::move(output_buffers[batch]));
std::move(output_buffers[batch]),
rmm::device_buffer{},
0);

return make_lists_column(
batch_info.row_batches[batch].row_count, std::move(offsets), std::move(data),
Expand Down
9 changes: 6 additions & 3 deletions src/main/cpp/tests/cast_string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,8 @@ TYPED_TEST(StringToIntegerTests, Overflow)

TYPED_TEST(StringToIntegerTests, Empty)
{
auto empty = std::make_unique<column>(data_type{type_id::STRING}, 0, rmm::device_buffer{});
auto empty = std::make_unique<column>(data_type{type_id::STRING}, 0, rmm::device_buffer{},
rmm::device_buffer{}, 0);

auto result = spark_rapids_jni::string_to_integer(data_type{type_to_id<TypeParam>()},
strings_column_view{empty->view()},
Expand Down Expand Up @@ -541,7 +542,8 @@ TEST_F(StringToDecimalTests, Edges)

TEST_F(StringToDecimalTests, Empty)
{
auto empty = std::make_unique<column>(data_type{type_id::STRING}, 0, rmm::device_buffer{});
auto empty = std::make_unique<column>(data_type{type_id::STRING}, 0, rmm::device_buffer{},
rmm::device_buffer{}, 0);

auto const result = spark_rapids_jni::string_to_decimal(
8, 2, strings_column_view{empty->view()}, false, true, cudf::get_default_stream());
Expand Down Expand Up @@ -696,7 +698,8 @@ TYPED_TEST(StringToFloatTests, TrickyValues)

TYPED_TEST(StringToFloatTests, Empty)
{
auto empty = std::make_unique<column>(data_type{type_id::STRING}, 0, rmm::device_buffer{});
auto empty = std::make_unique<column>(data_type{type_id::STRING}, 0, rmm::device_buffer{},
rmm::device_buffer{}, 0);

auto const result = spark_rapids_jni::string_to_float(data_type{type_to_id<TypeParam>()},
strings_column_view{empty->view()},
Expand Down
2 changes: 1 addition & 1 deletion thirdparty/cudf
Submodule cudf updated 37 files
+7 −3 cpp/benchmarks/common/generate_input.cu
+25 −57 cpp/include/cudf/column/column.hpp
+1 −1 cpp/src/column/column_factories.cpp
+2 −6 cpp/src/copying/contiguous_split.cu
+4 −2 cpp/src/datetime/timezone.cpp
+13 −4 cpp/src/interop/from_arrow.cu
+8 −3 cpp/src/io/json/json_column.cu
+2 −2 cpp/src/io/json/nested_json_gpu.cu
+2 −2 cpp/src/io/json/write_json.cu
+14 −2 cpp/src/io/parquet/page_enc.cu
+2 −2 cpp/src/io/utilities/column_buffer.cpp
+5 −2 cpp/src/lists/copying/copying.cu
+2 −1 cpp/src/partitioning/partitioning.cu
+2 −2 cpp/src/round/round.cu
+10 −4 cpp/src/text/subword/load_hash_file.cu
+4 −3 cpp/tests/bitmask/bitmask_tests.cpp
+55 −31 cpp/tests/column/column_test.cpp
+11 −6 cpp/tests/copying/concatenate_tests.cpp
+4 −5 cpp/tests/datetime/datetime_ops_test.cpp
+37 −0 cpp/tests/io/parquet_test.cpp
+2 −2 cpp/tests/structs/structs_column_tests.cpp
+31 −10 cpp/tests/unary/cast_tests.cpp
+99 −0 java/src/main/java/ai/rapids/cudf/ChunkedPack.java
+9 −18 java/src/main/java/ai/rapids/cudf/ContiguousTable.java
+74 −0 java/src/main/java/ai/rapids/cudf/PackedColumnMetadata.java
+100 −90 java/src/main/java/ai/rapids/cudf/Table.java
+57 −19 java/src/main/java/ai/rapids/cudf/TableWriter.java
+2 −0 java/src/main/native/CMakeLists.txt
+75 −0 java/src/main/native/src/ChunkedPackJni.cpp
+0 −20 java/src/main/native/src/ContiguousTableJni.cpp
+2 −2 java/src/main/native/src/CudfJni.cpp
+41 −0 java/src/main/native/src/PackedColumnMetadataJni.cpp
+90 −17 java/src/main/native/src/TableJni.cpp
+7 −6 java/src/main/native/src/row_conversion.cu
+113 −0 java/src/test/java/ai/rapids/cudf/TableTest.java
+6 −3 python/cudf/cudf/_lib/join.pyx
+14 −28 python/cudf/cudf/tests/test_dataframe_copy.py

0 comments on commit a6985de

Please sign in to comment.