Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace stream.value() with stream for stream_view args #7236

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions cpp/include/cudf/detail/copy_if_else.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -176,12 +176,8 @@ std::unique_ptr<column> copy_if_else(
constexpr int block_size = 256;
cudf::detail::grid_1d grid{num_els, block_size, 1};

std::unique_ptr<column> out =
make_fixed_width_column(output_type,
size,
nullable ? mask_state::UNINITIALIZED : mask_state::UNALLOCATED,
stream.value(),
mr);
std::unique_ptr<column> out = make_fixed_width_column(
output_type, size, nullable ? mask_state::UNINITIALIZED : mask_state::UNALLOCATED, stream, mr);

auto out_v = mutable_column_device_view::create(*out);

Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf/detail/scatter.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -115,7 +115,7 @@ struct column_scatterer_impl<string_view, MapIterator> {
rmm::mr::device_memory_resource* mr) const
{
using strings::detail::create_string_vector_from_column;
auto const source_vector = create_string_vector_from_column(source, stream.value());
auto const source_vector = create_string_vector_from_column(source, stream);
auto const begin = source_vector.begin();
auto const end = begin + std::distance(scatter_map_begin, scatter_map_end);
return strings::detail::scatter(begin, end, scatter_map_begin, target, stream, mr);
Expand Down
12 changes: 6 additions & 6 deletions cpp/include/cudf/lists/detail/scatter.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -375,7 +375,7 @@ struct list_child_constructor {
num_child_rows,
child_null_mask.first,
child_null_mask.second,
stream.value(),
stream,
mr);

auto copy_child_values_for_list_index = [d_scattered_lists =
Expand Down Expand Up @@ -514,7 +514,7 @@ struct list_child_constructor {
std::move(string_chars),
child_null_mask.second, // Null count.
std::move(child_null_mask.first), // Null mask.
stream.value(),
stream,
mr);
}

Expand Down Expand Up @@ -616,7 +616,7 @@ struct list_child_constructor {
std::move(child_column),
child_null_mask.second, // Null count
std::move(child_null_mask.first), // Null mask
stream.value(),
stream,
mr);
}

Expand Down Expand Up @@ -710,7 +710,7 @@ struct list_child_constructor {
std::move(child_columns),
child_null_mask.second,
std::move(child_null_mask.first),
stream.value(),
stream,
mr);
}
};
Expand Down Expand Up @@ -814,7 +814,7 @@ std::unique_ptr<column> scatter(
std::move(child_column),
cudf::UNKNOWN_NULL_COUNT,
std::move(null_mask),
stream.value(),
stream,
mr);
}

Expand Down
4 changes: 2 additions & 2 deletions cpp/include/cudf/strings/detail/copy_if_else.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -112,7 +112,7 @@ std::unique_ptr<cudf::column> copy_if_else(
std::move(chars_column),
null_count,
std::move(null_mask),
stream.value(),
stream,
mr);
}

Expand Down
5 changes: 2 additions & 3 deletions cpp/include/cudf/strings/detail/scatter.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -69,8 +69,7 @@ std::unique_ptr<column> scatter(
if (target.has_nulls()) null_mask = cudf::detail::copy_bitmask(target.parent(), stream, mr);

// create string vectors
rmm::device_vector<string_view> target_vector =
create_string_vector_from_column(target, stream.value());
rmm::device_vector<string_view> target_vector = create_string_vector_from_column(target, stream);
// do the scatter
thrust::scatter(rmm::exec_policy(stream), begin, end, scatter_map, target_vector.begin());

Expand Down
8 changes: 4 additions & 4 deletions cpp/src/ast/transform.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -128,14 +128,14 @@ std::unique_ptr<column> compute_column(table_view const table,
reinterpret_cast<const cudf::size_type*>(device_data_buffer_ptr + buffer_offsets[3]);

// Create table device view
auto table_device = table_device_view::create(table, stream.value());
auto table_device = table_device_view::create(table, stream);
auto const table_num_rows = table.num_rows();

// Prepare output column
auto output_column = cudf::make_fixed_width_column(
expr_data_type, table_num_rows, mask_state::UNALLOCATED, stream.value(), mr);
expr_data_type, table_num_rows, mask_state::UNALLOCATED, stream, mr);
auto mutable_output_device =
cudf::mutable_column_device_view::create(output_column->mutable_view(), stream.value());
cudf::mutable_column_device_view::create(output_column->mutable_view(), stream);

// Configure kernel parameters
auto const num_intermediates = expr_linearizer.get_intermediate_count();
Expand Down
16 changes: 8 additions & 8 deletions cpp/src/binaryop/binaryop.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, NVIDIA CORPORATION.
* Copyright (c) 2019-2021, NVIDIA CORPORATION.
*
* Copyright 2018-2019 BlazingDB, Inc.
* Copyright 2018 Christian Noboa Mardini <[email protected]>
Expand Down Expand Up @@ -110,7 +110,7 @@ void binary_operation(mutable_column_view& out,
{
if (is_null_dependent(op)) {
cudf::jit::launcher(
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream.value())
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream)
.set_kernel_inst("kernel_v_s_with_validity", // name of the kernel we are
// launching
{cudf::jit::get_type_name(out.type()), // list of template arguments
Expand All @@ -127,7 +127,7 @@ void binary_operation(mutable_column_view& out,
lhs.is_valid());
} else {
cudf::jit::launcher(
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream.value())
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream)
.set_kernel_inst("kernel_v_s", // name of the kernel we are
// launching
{cudf::jit::get_type_name(out.type()), // list of template arguments
Expand All @@ -149,7 +149,7 @@ void binary_operation(mutable_column_view& out,
{
if (is_null_dependent(op)) {
cudf::jit::launcher(
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream.value())
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream)
.set_kernel_inst("kernel_v_s_with_validity", // name of the kernel we are
// launching
{cudf::jit::get_type_name(out.type()), // list of template arguments
Expand All @@ -166,7 +166,7 @@ void binary_operation(mutable_column_view& out,
rhs.is_valid());
} else {
cudf::jit::launcher(
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream.value())
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream)
.set_kernel_inst("kernel_v_s", // name of the kernel we are
// launching
{cudf::jit::get_type_name(out.type()), // list of template arguments
Expand All @@ -188,7 +188,7 @@ void binary_operation(mutable_column_view& out,
{
if (is_null_dependent(op)) {
cudf::jit::launcher(
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream.value())
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream)
.set_kernel_inst("kernel_v_v_with_validity", // name of the kernel we are
// launching
{cudf::jit::get_type_name(out.type()), // list of template arguments
Expand All @@ -206,7 +206,7 @@ void binary_operation(mutable_column_view& out,
rhs.offset());
} else {
cudf::jit::launcher(
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream.value())
hash, code::kernel, header_names, cudf::jit::compiler_flags, headers_code, stream)
.set_kernel_inst("kernel_v_v", // name of the kernel we are
// launching
{cudf::jit::get_type_name(out.type()), // list of template arguments
Expand Down Expand Up @@ -235,7 +235,7 @@ void binary_operation(mutable_column_view& out,
cudf::jit::parse_single_function_ptx(ptx, "GENERIC_BINARY_OP", output_type_name) + code::kernel;

cudf::jit::launcher(
ptx_hash, cuda_source, header_names, cudf::jit::compiler_flags, headers_code, stream.value())
ptx_hash, cuda_source, header_names, cudf::jit::compiler_flags, headers_code, stream)
.set_kernel_inst("kernel_v_v", // name of the kernel
// we are launching
{output_type_name, // list of template arguments
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/column/column.cu
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ struct create_column_from_view {
std::unique_ptr<column> operator()()
{
cudf::strings_column_view sview(view);
return cudf::strings::detail::copy_slice(sview, 0, view.size(), 1, stream.value(), mr);
return cudf::strings::detail::copy_slice(sview, 0, view.size(), 1, stream, mr);
}

template <typename ColumnType,
Expand Down Expand Up @@ -244,7 +244,7 @@ struct create_column_from_view {
std::unique_ptr<column> operator()()
{
auto lists_view = lists_column_view(view);
return cudf::lists::detail::copy_slice(lists_view, 0, view.size(), stream.value(), mr);
return cudf::lists::detail::copy_slice(lists_view, 0, view.size(), stream, mr);
}

template <typename ColumnType,
Expand Down Expand Up @@ -272,7 +272,7 @@ struct create_column_from_view {
std::move(children),
view.null_count(),
cudf::detail::copy_bitmask(view.null_mask(), begin, end, stream, mr),
stream.value(),
stream,
mr);
}
};
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/column/column_factories.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -171,7 +171,7 @@ struct column_from_scalar_dispatch {
auto output_column =
make_fixed_width_column(value.type(), size, mask_state::UNALLOCATED, stream, mr);
auto view = output_column->mutable_view();
detail::fill_in_place(view, 0, size, value, stream.value());
detail::fill_in_place(view, 0, size, value, stream);
return output_column;
}
};
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/copying/sample.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -62,8 +62,8 @@ std::unique_ptr<table> sample(table_view const& input,

return detail::gather(input, begin, end, out_of_bounds_policy::DONT_CHECK, stream, mr);
} else {
auto gather_map = make_numeric_column(
data_type{type_id::INT32}, num_rows, mask_state::UNALLOCATED, stream.value());
auto gather_map =
make_numeric_column(data_type{type_id::INT32}, num_rows, mask_state::UNALLOCATED, stream);
auto gather_map_mutable_view = gather_map->mutable_view();
// Shuffle all the row indices
thrust::shuffle_copy(rmm::exec_policy(stream),
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/groupby/sort/sort_helper.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -162,7 +162,7 @@ sort_groupby_helper::index_vector const& sort_groupby_helper::group_offsets(

_group_offsets = std::make_unique<index_vector>(num_keys(stream) + 1);

auto device_input_table = table_device_view::create(_keys, stream.value());
auto device_input_table = table_device_view::create(_keys, stream);
auto sorted_order = key_sort_order().data<size_type>();
decltype(_group_offsets->begin()) result_end;

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/interop/from_arrow.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -183,7 +183,7 @@ std::unique_ptr<column> dispatch_to_cudf_column::operator()<bool>(
auto out_col = mask_to_bools(static_cast<bitmask_type*>(data.data()),
array.offset(),
array.offset() + array.length(),
stream.value(),
stream,
mr);

auto const has_nulls = skip_mask ? false : array.null_bitmap_data() != nullptr;
Expand Down
12 changes: 6 additions & 6 deletions cpp/src/lists/copying/concatenate.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -65,9 +65,9 @@ std::unique_ptr<column> merge_offsets(std::vector<lists_column_view> const& colu
std::for_each(columns.begin(), columns.end(), [&](lists_column_view const& c) {
if (c.size() > 0) {
// handle sliced columns
int const local_shift = shift - (c.offset() > 0 ? cudf::detail::get_value<size_type>(
c.offsets(), c.offset(), stream.value())
: 0);
int const local_shift =
shift -
(c.offset() > 0 ? cudf::detail::get_value<size_type>(c.offsets(), c.offset(), stream) : 0);
column_device_view offsets(c.offsets(), nullptr, nullptr);
thrust::transform(
rmm::exec_policy(stream),
Expand All @@ -76,7 +76,7 @@ std::unique_ptr<column> merge_offsets(std::vector<lists_column_view> const& colu
d_merged_offsets.begin<size_type>() + count,
[local_shift] __device__(size_type offset) { return offset + local_shift; });

shift += c.get_sliced_child(stream.value()).size();
shift += c.get_sliced_child(stream).size();
count += c.size();
}
});
Expand Down Expand Up @@ -110,7 +110,7 @@ std::unique_ptr<column> concatenate(
[&total_list_count, &children, stream](lists_column_view const& l) {
// count total # of lists
total_list_count += l.size();
children.push_back(l.get_sliced_child(stream.value()));
children.push_back(l.get_sliced_child(stream));
});
auto data = cudf::detail::concatenate(children, stream, mr);

Expand Down
5 changes: 2 additions & 3 deletions cpp/src/quantiles/quantile.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -63,8 +63,7 @@ struct quantile_functor {

auto const type =
is_fixed_point(input.type()) ? input.type() : data_type{type_to_id<StorageResult>()};
auto output =
make_fixed_width_column(type, q.size(), mask_state::UNALLOCATED, stream.value(), mr);
auto output = make_fixed_width_column(type, q.size(), mask_state::UNALLOCATED, stream, mr);

if (output->size() == 0) { return output; }

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/reductions/minmax.cu
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -193,7 +193,7 @@ struct minmax_functor {
auto maximum = new ScalarType(T{}, true, stream, mr);
// copy dev_result to the output scalars
device_single_thread(assign_min_max<T>{dev_result.data(), minimum->data(), maximum->data()},
stream.value());
stream);
return {std::unique_ptr<scalar>(minimum), std::unique_ptr<scalar>(maximum)};
}

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/reductions/simple.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, NVIDIA CORPORATION.
* 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.
Expand Down Expand Up @@ -204,7 +204,7 @@ struct cast_numeric_scalar_fn {
auto result = std::make_unique<numeric_scalar<ResultType>>(ResultType{}, true, stream, mr);
auto d_output = cudf::get_scalar_device_view(*result);
cudf::detail::device_single_thread(assign_scalar_fn<InputType, ResultType>{d_input, d_output},
stream.value());
stream);
return result;
}

Expand Down
Loading