Skip to content

Commit

Permalink
Remove cudf_io namespace alias (#11827)
Browse files Browse the repository at this point in the history
Some cuIO tests and benchmarks declare `cudf_io` alias for `cudf::io`. This saves a single letter so it's considered to be of very low utility.

Removing all occurrences of this alias.
Also removed a couple of builder calls where the option was being set to default value.

Authors:
  - Vukasin Milovanovic (https://github.com/vuule)

Approvers:
  - Nghia Truong (https://github.com/ttnghia)
  - Bradley Dice (https://github.com/bdice)
  - Yunsong Wang (https://github.com/PointKernel)

URL: #11827
  • Loading branch information
vuule authored Oct 3, 2022
1 parent 5000e94 commit 0b28d34
Show file tree
Hide file tree
Showing 6 changed files with 1,133 additions and 1,145 deletions.
15 changes: 6 additions & 9 deletions cpp/benchmarks/io/csv/csv_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@
constexpr size_t data_size = 256 << 20;
constexpr cudf::size_type num_cols = 64;

namespace cudf_io = cudf::io;

class CsvWrite : public cudf::benchmark {
};

Expand All @@ -44,9 +42,9 @@ void BM_csv_write_varying_inout(benchmark::State& state)
auto mem_stats_logger = cudf::memory_stats_logger();
for (auto _ : state) {
cuda_event_timer raii(state, true); // flush_l2_cache = true, stream = 0
cudf_io::csv_writer_options options =
cudf_io::csv_writer_options::builder(source_sink.make_sink_info(), view).include_header(true);
cudf_io::write_csv(options);
cudf::io::csv_writer_options options =
cudf::io::csv_writer_options::builder(source_sink.make_sink_info(), view);
cudf::io::write_csv(options);
}

state.SetBytesProcessed(data_size * state.iterations());
Expand Down Expand Up @@ -74,12 +72,11 @@ void BM_csv_write_varying_options(benchmark::State& state)
auto mem_stats_logger = cudf::memory_stats_logger();
for (auto _ : state) {
cuda_event_timer raii(state, true); // flush_l2_cache = true, stream = 0
cudf_io::csv_writer_options options =
cudf_io::csv_writer_options::builder(source_sink.make_sink_info(), view)
.include_header(true)
cudf::io::csv_writer_options options =
cudf::io::csv_writer_options::builder(source_sink.make_sink_info(), view)
.na_rep(na_per)
.rows_per_chunk(rows_per_chunk);
cudf_io::write_csv(options);
cudf::io::write_csv(options);
}

state.SetBytesProcessed(data_size * state.iterations());
Expand Down
16 changes: 7 additions & 9 deletions cpp/benchmarks/io/cuio_common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@

#include <unistd.h>

namespace cudf_io = cudf::io;

temp_directory const cuio_source_sink_pair::tmpdir{"cudf_gbench"};

std::string random_file_in_dir(std::string const& dir_path)
Expand All @@ -43,21 +41,21 @@ cuio_source_sink_pair::cuio_source_sink_pair(io_type type)
{
}

cudf_io::source_info cuio_source_sink_pair::make_source_info()
cudf::io::source_info cuio_source_sink_pair::make_source_info()
{
switch (type) {
case io_type::FILEPATH: return cudf_io::source_info(file_name);
case io_type::HOST_BUFFER: return cudf_io::source_info(buffer.data(), buffer.size());
case io_type::FILEPATH: return cudf::io::source_info(file_name);
case io_type::HOST_BUFFER: return cudf::io::source_info(buffer.data(), buffer.size());
default: CUDF_FAIL("invalid input type");
}
}

cudf_io::sink_info cuio_source_sink_pair::make_sink_info()
cudf::io::sink_info cuio_source_sink_pair::make_sink_info()
{
switch (type) {
case io_type::VOID: return cudf_io::sink_info(&void_sink);
case io_type::FILEPATH: return cudf_io::sink_info(file_name);
case io_type::HOST_BUFFER: return cudf_io::sink_info(&buffer);
case io_type::VOID: return cudf::io::sink_info(&void_sink);
case io_type::FILEPATH: return cudf::io::sink_info(file_name);
case io_type::HOST_BUFFER: return cudf::io::sink_info(&buffer);
default: CUDF_FAIL("invalid output type");
}
}
Expand Down
Loading

0 comments on commit 0b28d34

Please sign in to comment.