Skip to content

Commit

Permalink
tests pass
Browse files Browse the repository at this point in the history
  • Loading branch information
vuule committed Feb 28, 2025
1 parent 1d580b8 commit b64f7db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions cpp/src/io/comp/comp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@ void host_compress(compression_type compression,
{
auto const nvcomp_type = to_nvcomp_compression(compression);
switch (compression) {
case compression_type::GZIP:
case compression_type::LZ4:
case compression_type::ZLIB:
case compression_type::ZSTD: return not nvcomp::is_compression_disabled(nvcomp_type.value());
Expand Down
4 changes: 3 additions & 1 deletion cpp/src/io/comp/nvcomp_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ size_t compress_max_output_chunk_size(compression_type compression,
capped_uncomp_bytes, nvcompBatchedSnappyDefaultOpts, &max_comp_chunk_size);
break;
case compression_type::DEFLATE:
case compression_type::GZIP: // HACK!
status = nvcompBatchedDeflateCompressGetMaxOutputChunkSize(
capped_uncomp_bytes, nvcompBatchedDeflateDefaultOpts, &max_comp_chunk_size);
break;
Expand Down Expand Up @@ -495,7 +496,8 @@ size_t required_alignment(compression_type compression)
std::optional<size_t> compress_max_allowed_chunk_size(compression_type compression)
{
switch (compression) {
case compression_type::DEFLATE: return nvcompDeflateCompressionMaxAllowedChunkSize;
case compression_type::DEFLATE:
case compression_type::GZIP: return nvcompDeflateCompressionMaxAllowedChunkSize;
case compression_type::SNAPPY: return nvcompSnappyCompressionMaxAllowedChunkSize;
case compression_type::ZSTD: return nvcompZstdCompressionMaxAllowedChunkSize;
case compression_type::LZ4: return nvcompLZ4CompressionMaxAllowedChunkSize;
Expand Down
5 changes: 2 additions & 3 deletions cpp/tests/io/comp/comp_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void roundtip_test(cudf::io::compression_type compression)
ASSERT_EQ(hd_stats[0].status, compression_status::SUCCESS);
d_comp.resize(hd_stats[0].bytes_written, stream);
}
std::cout << "Compressed size: " << d_comp.size() << std::endl;

auto d_got = cudf::detail::hostdevice_vector<uint8_t>(expected.size(), stream);
{
auto hd_srcs = cudf::detail::hostdevice_vector<device_span<uint8_t const>>(1, stream);
Expand All @@ -314,14 +314,13 @@ void roundtip_test(cudf::io::compression_type compression)
EXPECT_EQ(expected, got);
}
}
/*

TEST_P(HostCompressTest, HostCompression) { roundtip_test(GetParam()); }

INSTANTIATE_TEST_CASE_P(HostCompression,
HostCompressTest,
::testing::Values(cudf::io::compression_type::GZIP,
cudf::io::compression_type::SNAPPY));
*/

TEST_P(HostDecompressTest, HostDecompression) { roundtip_test(GetParam()); }

Expand Down

0 comments on commit b64f7db

Please sign in to comment.