Skip to content

Commit

Permalink
Eliminate literal parameters to uvector::set_element_async and device…
Browse files Browse the repository at this point in the history
…_scalar::set_value (#7563)

After rapidsai/rmm#725 is merged, this PR updates cuspatial to eliminate passing literal values to `device_scalar::set_value`.

Note there are still similar issues with uses of `cudf::scalar` that need to be addressed. But I wanted to get this open before the end of the week. This can be merged after RMM 725 is merged to fix the build, so I think the `scalar` issues should be fixed separately.

Authors:
  - Mark Harris (@harrism)

Approvers:
  - Devavret Makkar (@devavret)
  - Paul Taylor (@trxcllnt)
  - Mike Wilson (@hyperbolic2346)

URL: #7563
  • Loading branch information
harrism authored Mar 19, 2021
1 parent c13351d commit 6fe8b1b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cpp/src/io/json/reader_impl.cu
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ std::unique_ptr<table> create_json_keys_info_table(const parse_options_view &opt
auto const info_table_mdv = mutable_table_device_view::create(info_table->mutable_view(), stream);

// Reset the key counter - now used for indexing
key_counter.set_value(0, stream);
key_counter.set_value_zero(stream);
// Fill the allocated columns
cudf::io::json::gpu::collect_keys_info(
options, data, row_offsets, key_counter.data(), {*info_table_mdv}, stream);
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/join/hash_join.cu
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ std::pair<rmm::device_vector<size_type>, rmm::device_vector<size_type>> probe_jo

constexpr int block_size{DEFAULT_JOIN_BLOCK_SIZE};
detail::grid_1d config(probe_table.num_rows(), block_size);
write_index.set_value(0, stream);
write_index.set_value_zero(stream);

row_hash hash_probe{probe_table};
row_equality equality{probe_table, build_table, compare_nulls == null_equality::EQUAL};
Expand Down
2 changes: 1 addition & 1 deletion cpp/src/join/hash_join.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ size_type estimate_join_output_size(table_device_view build_table,
do {
sample_probe_num_rows = std::min(sample_probe_num_rows, probe_table_num_rows);

size_estimate.set_value(0, stream);
size_estimate.set_value_zero(stream);

row_hash hash_probe{probe_table};
row_equality equality{probe_table, build_table, compare_nulls == null_equality::EQUAL};
Expand Down
6 changes: 3 additions & 3 deletions cpp/src/join/nested_loop_join.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ size_type estimate_nested_loop_join_output_size(table_device_view left,
int num_sms{-1};
CUDA_TRY(cudaDeviceGetAttribute(&num_sms, cudaDevAttrMultiProcessorCount, dev_id));

size_estimate.set_value(0, stream);
size_estimate.set_value_zero(stream);

row_equality equality{left, right, compare_nulls == null_equality::EQUAL};
// Determine number of output rows without actually building the output to simply
Expand Down Expand Up @@ -163,7 +163,7 @@ get_base_nested_loop_join_indices(table_view const& left,

constexpr int block_size{DEFAULT_JOIN_BLOCK_SIZE};
detail::grid_1d config(left_table->num_rows(), block_size);
write_index.set_value(0);
write_index.set_value_zero(stream);

row_equality equality{*left_table, *right_table, compare_nulls == null_equality::EQUAL};
const auto& join_output_l =
Expand All @@ -182,7 +182,7 @@ get_base_nested_loop_join_indices(table_view const& left,

CHECK_CUDA(stream.value());

join_size = write_index.value();
join_size = write_index.value(stream);
current_estimated_size = estimated_size;
estimated_size *= 2;
} while ((current_estimated_size < join_size));
Expand Down
6 changes: 4 additions & 2 deletions cpp/tests/jit/jit-cache-multiprocess-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,10 @@ TEST_F(JitCacheMultiProcessTest, MultiProcessTest)
// Brand new cache object that has nothing in in-memory cache
cudf::jit::cudfJitCache cache;

input->set_value(4);
output->set_value(1);
auto const in{4};
auto const out{1};
input->set_value(in);
output->set_value(out);

// make program
auto program = cache.getProgram("FileCacheTestProg3", program3_source);
Expand Down

0 comments on commit 6fe8b1b

Please sign in to comment.