Skip to content

Commit

Permalink
update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikeyann committed Aug 9, 2024
1 parent 7188095 commit fa0e168
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
9 changes: 4 additions & 5 deletions cpp/tests/io/json/json_quote_normalization_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <cudf/io/json.hpp>
#include <cudf/io/types.hpp>

#include <rmm/device_uvector.hpp>
#include <rmm/device_buffer.hpp>
#include <rmm/mr/device/cuda_memory_resource.hpp>
#include <rmm/mr/device/device_memory_resource.hpp>

Expand All @@ -42,12 +42,11 @@ void run_test(std::string const& host_input, std::string const& expected_host_ou
std::make_shared<rmm::mr::cuda_memory_resource>();

auto stream_view = cudf::test::get_default_stream();
auto device_input = cudf::detail::make_device_uvector_async(
host_input, stream_view, rmm::mr::get_current_device_resource());
auto device_input = rmm::device_buffer(
host_input.c_str(), host_input.size(), stream_view, rmm::mr::get_current_device_resource());

// Preprocessing FST
cudf::io::datasource::owning_buffer<rmm::device_uvector<char>> device_data(
std::move(device_input));
cudf::io::datasource::owning_buffer<rmm::device_buffer> device_data(std::move(device_input));
cudf::io::json::detail::normalize_single_quotes(device_data, stream_view, rsc.get());

std::string preprocessed_host_output(device_data.size(), 0);
Expand Down
7 changes: 3 additions & 4 deletions cpp/tests/io/json/json_whitespace_normalization_test.cu
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,11 @@ void run_test(std::string const& host_input, std::string const& expected_host_ou
// Prepare cuda stream for data transfers & kernels
auto stream_view = cudf::test::get_default_stream();

auto device_input = cudf::detail::make_device_uvector_async(
host_input, stream_view, rmm::mr::get_current_device_resource());
auto device_input = rmm::device_buffer(
host_input.c_str(), host_input.size(), stream_view, rmm::mr::get_current_device_resource());

// Preprocessing FST
cudf::io::datasource::owning_buffer<rmm::device_uvector<char>> device_data(
std::move(device_input));
cudf::io::datasource::owning_buffer<rmm::device_buffer> device_data(std::move(device_input));
cudf::io::json::detail::normalize_whitespace(
device_data, stream_view, rmm::mr::get_current_device_resource());

Expand Down

0 comments on commit fa0e168

Please sign in to comment.