Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Zstandard decompression only when all nvcomp integrations are enabled #10944

Merged
merged 3 commits into from
May 25, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions cpp/src/io/comp/nvcomp_adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "nvcomp_adapter.cuh"

#include <cudf/utilities/error.hpp>
#include <io/utilities/config_utils.hpp>

#include <nvcomp/snappy.h>

Expand All @@ -30,6 +31,8 @@

namespace cudf::io::nvcomp {

[[noreturn]] void fail_unsupported() { CUDF_FAIL("Unsupported compression type"); }

template <typename... Args>
auto batched_decompress_get_temp_size(compression_type compression, Args&&... args)
{
Expand All @@ -40,7 +43,7 @@ auto batched_decompress_get_temp_size(compression_type compression, Args&&... ar
case compression_type::ZSTD:
return nvcompBatchedZstdDecompressGetTempSize(std::forward<Args>(args)...);
#endif
default: CUDF_FAIL("Unsupported compression type");
default: fail_unsupported();
}
};

Expand All @@ -54,7 +57,7 @@ auto batched_decompress_async(compression_type compression, Args&&... args)
case compression_type::ZSTD:
return nvcompBatchedZstdDecompressAsync(std::forward<Args>(args)...);
#endif
default: CUDF_FAIL("Unsupported compression type");
default: fail_unsupported();
}
};

Expand All @@ -76,6 +79,11 @@ void batched_decompress(compression_type compression,
size_t max_uncomp_chunk_size,
rmm::cuda_stream_view stream)
{
// TODO Consolidate config use to a common location
if (compression == compression_type::ZSTD and
not cudf::io::detail::nvcomp_integration::is_all_enabled()) {
fail_unsupported();
}
auto const num_chunks = inputs.size();

// cuDF inflate inputs converted to nvcomp inputs
Expand Down