Skip to content

Commit

Permalink
Fix default values for stream parameter (#1583)
Browse files Browse the repository at this point in the history
* Fix stream

Signed-off-by: Nghia Truong <nghiat@nvidia.com>

* Remove empty comment lines

Signed-off-by: Nghia Truong <nghiat@nvidia.com>

* Add `#pragma once`

Signed-off-by: Nghia Truong <nghiat@nvidia.com>

* Reformat

Signed-off-by: Nghia Truong <nghiat@nvidia.com>

* Revert "Reformat"

This reverts commit 9b6b528.

Signed-off-by: Nghia Truong <nghiat@nvidia.com>

---------

Signed-off-by: Nghia Truong <nghiat@nvidia.com>
  • Loading branch information
ttnghia authored Nov 21, 2023
1 parent 0eec2c6 commit edc0868
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
18 changes: 11 additions & 7 deletions src/main/cpp/src/decimal_utils.hpp
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 @@ -14,8 +14,12 @@
* limitations under the License.
*/

#pragma once

#include <cudf/column/column_view.hpp>
#include <cudf/table/table.hpp>
#include <cudf/utilities/default_stream.hpp>

#include <rmm/cuda_stream_view.hpp>

#include <cstddef>
Expand All @@ -26,35 +30,35 @@ std::unique_ptr<cudf::table> multiply_decimal128(
cudf::column_view const& a,
cudf::column_view const& b,
int32_t product_scale,
rmm::cuda_stream_view stream = rmm::cuda_stream_default);
rmm::cuda_stream_view stream = cudf::get_default_stream());

std::unique_ptr<cudf::table> divide_decimal128(
cudf::column_view const& a,
cudf::column_view const& b,
int32_t quotient_scale,
rmm::cuda_stream_view stream = rmm::cuda_stream_default);
rmm::cuda_stream_view stream = cudf::get_default_stream());

std::unique_ptr<cudf::table> integer_divide_decimal128(
cudf::column_view const& a,
cudf::column_view const& b,
int32_t quotient_scale,
rmm::cuda_stream_view stream = rmm::cuda_stream_default);
rmm::cuda_stream_view stream = cudf::get_default_stream());

std::unique_ptr<cudf::table> remainder_decimal128(
cudf::column_view const& a,
cudf::column_view const& b,
int32_t remainder_scale,
rmm::cuda_stream_view stream = rmm::cuda_stream_default);
rmm::cuda_stream_view stream = cudf::get_default_stream());

std::unique_ptr<cudf::table> add_decimal128(
cudf::column_view const& a,
cudf::column_view const& b,
int32_t quotient_scale,
rmm::cuda_stream_view stream = rmm::cuda_stream_default);
rmm::cuda_stream_view stream = cudf::get_default_stream());

std::unique_ptr<cudf::table> sub_decimal128(
cudf::column_view const& a,
cudf::column_view const& b,
int32_t quotient_scale,
rmm::cuda_stream_view stream = rmm::cuda_stream_default);
rmm::cuda_stream_view stream = cudf::get_default_stream());
} // namespace cudf::jni
3 changes: 2 additions & 1 deletion src/main/cpp/src/parse_uri.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#include <cudf/strings/strings_column_view.hpp>
#include <cudf/types.hpp>
#include <cudf/utilities/default_stream.hpp>

#include <rmm/cuda_stream_view.hpp>

Expand All @@ -35,7 +36,7 @@ namespace spark_rapids_jni {
*/
std::unique_ptr<cudf::column> parse_uri_to_protocol(
cudf::strings_column_view const& input,
rmm::cuda_stream_view stream = rmm::cuda_stream_default,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

} // namespace spark_rapids_jni
16 changes: 9 additions & 7 deletions src/main/cpp/src/row_conversion.hpp
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 @@ -16,36 +16,38 @@

#pragma once

#include <memory>

#include <cudf/lists/lists_column_view.hpp>
#include <cudf/table/table_view.hpp>
#include <cudf/utilities/default_stream.hpp>

#include <rmm/cuda_stream_view.hpp>

#include <memory>

namespace spark_rapids_jni {

std::vector<std::unique_ptr<cudf::column>> convert_to_rows_fixed_width_optimized(
cudf::table_view const& tbl,
// TODO need something for validity
rmm::cuda_stream_view stream = rmm::cuda_stream_default,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

std::vector<std::unique_ptr<cudf::column>> convert_to_rows(
cudf::table_view const& tbl,
// TODO need something for validity
rmm::cuda_stream_view stream = rmm::cuda_stream_default,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

std::unique_ptr<cudf::table> convert_from_rows_fixed_width_optimized(
cudf::lists_column_view const& input,
std::vector<cudf::data_type> const& schema,
rmm::cuda_stream_view stream = rmm::cuda_stream_default,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

std::unique_ptr<cudf::table> convert_from_rows(
cudf::lists_column_view const& input,
std::vector<cudf::data_type> const& schema,
rmm::cuda_stream_view stream = rmm::cuda_stream_default,
rmm::cuda_stream_view stream = cudf::get_default_stream(),
rmm::mr::device_memory_resource* mr = rmm::mr::get_current_device_resource());

} // namespace spark_rapids_jni

0 comments on commit edc0868

Please sign in to comment.