Skip to content

Commit

Permalink
Add debug code
Browse files Browse the repository at this point in the history
Signed-off-by: Nghia Truong <[email protected]>
  • Loading branch information
ttnghia committed Nov 27, 2024
1 parent aad7900 commit a63179e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/main/cpp/src/test_host_udf_agg.cu
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,21 @@ struct test_udf_simple_type : cudf::host_udf_base {
static_cast<OutputType>(init_value),
thrust::plus<>{});

if constexpr (std::is_same_v<InputType, double> && std::is_same_v<OutputType, double>) {
std::vector<double> in(values.size());
CUDF_CUDA_TRY(cudaMemcpyAsync(in.data(),
values.begin<double>(),
values.size() * sizeof(double),
cudaMemcpyDefault,
stream.value()));
stream.synchronize();
std::cout << "input: " << std::endl;
for (auto x : in) {
std::cout << x << ", ";
}
std::cout << "\nresult: " << result << std::endl;
}

auto output = cudf::make_numeric_scalar(output_dtype, stream, mr);
static_cast<cudf::scalar_type_t<OutputType>*>(output.get())->set_value(result, stream);
return output;
Expand Down

0 comments on commit a63179e

Please sign in to comment.