From 586d51f03783249924246b15dc8e66ca541fc1f1 Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Wed, 10 Mar 2021 15:06:53 +1100 Subject: [PATCH 1/2] Fix literal values passed to device_scalar::set_value --- cpp/src/io/json/reader_impl.cu | 2 +- cpp/src/join/hash_join.cu | 2 +- cpp/src/join/hash_join.cuh | 2 +- cpp/tests/jit/jit-cache-multiprocess-test.cpp | 6 ++++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/cpp/src/io/json/reader_impl.cu b/cpp/src/io/json/reader_impl.cu index 5a82c9891b8..1a1fa8d0602 100644 --- a/cpp/src/io/json/reader_impl.cu +++ b/cpp/src/io/json/reader_impl.cu @@ -158,7 +158,7 @@ std::unique_ptr 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); diff --git a/cpp/src/join/hash_join.cu b/cpp/src/join/hash_join.cu index c2c32d4165a..b64e91c18bd 100644 --- a/cpp/src/join/hash_join.cu +++ b/cpp/src/join/hash_join.cu @@ -287,7 +287,7 @@ std::pair, rmm::device_vector> 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}; diff --git a/cpp/src/join/hash_join.cuh b/cpp/src/join/hash_join.cuh index 712d771bd73..b37f228f6d3 100644 --- a/cpp/src/join/hash_join.cuh +++ b/cpp/src/join/hash_join.cuh @@ -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}; diff --git a/cpp/tests/jit/jit-cache-multiprocess-test.cpp b/cpp/tests/jit/jit-cache-multiprocess-test.cpp index 3dbf5b59c88..2f0b353673e 100644 --- a/cpp/tests/jit/jit-cache-multiprocess-test.cpp +++ b/cpp/tests/jit/jit-cache-multiprocess-test.cpp @@ -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); From bd2f4ebd15ad3eacbbf6de26a1fe21f6f4078a4d Mon Sep 17 00:00:00 2001 From: Mark Harris Date: Thu, 11 Mar 2021 10:30:18 +1100 Subject: [PATCH 2/2] Eliminate literal parameter. --- cpp/src/join/nested_loop_join.cuh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cpp/src/join/nested_loop_join.cuh b/cpp/src/join/nested_loop_join.cuh index 03d684f91d4..580017a6704 100644 --- a/cpp/src/join/nested_loop_join.cuh +++ b/cpp/src/join/nested_loop_join.cuh @@ -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 @@ -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 = @@ -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));