-
Notifications
You must be signed in to change notification settings - Fork 1k
Add C++ tests for different compression implementations #18690
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
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
26c4bfb
ORC writer w/ rep code
vuule 0bd7df5
unified fixture
vuule 96084b8
parquet reader
vuule e0c4dc3
orc reader
vuule 84b48b5
orc chunked reader
vuule 4ac6a3c
Merge branch 'branch-25.06' into test-comp-impls
vuule 7adfb09
style
vuule d6a87fc
Merge branch 'test-comp-impls' of https://github.com/vuule/cudf into …
vuule db532e4
more style
vuule b5c3b64
add check and fix :\
vuule 23f26fb
Merge branch 'branch-25.06' into test-comp-impls
vuule 3742289
consistent test names
vuule 9c579e6
Merge branch 'test-comp-impls' of https://github.com/vuule/cudf into …
vuule 27decb9
Merge branch 'branch-25.06' of https://github.com/rapidsai/cudf into …
vuule 1855c0b
code review
vuule bf3ee1e
Merge branch 'branch-25.06' into test-comp-impls
vuule 35a40d5
make tmp_env_var non copyable and non movable
vuule f8c1b85
Merge branch 'test-comp-impls' of https://github.com/vuule/cudf into …
vuule 1d4d505
Merge branch 'branch-25.06' into test-comp-impls
vuule 4cd16b8
remove device internal zstd cases
vuule 74d6847
Merge branch 'test-comp-impls' of https://github.com/vuule/cudf into …
vuule File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| /* | ||
| * Copyright (c) 2025, NVIDIA CORPORATION. | ||
| * | ||
| * Licensed under the Apache License, Version 2.0 (the "License"); | ||
| * you may not use this file except in compliance with the License. | ||
| * You may obtain a copy of the License at | ||
| * | ||
| * http://www.apache.org/licenses/LICENSE-2.0 | ||
| * | ||
| * Unless required by applicable law or agreed to in writing, software | ||
| * distributed under the License is distributed on an "AS IS" BASIS, | ||
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| * See the License for the specific language governing permissions and | ||
| * limitations under the License. | ||
| */ | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <cudf/io/types.hpp> | ||
| #include <cudf/utilities/error.hpp> | ||
|
|
||
| #include <gtest/gtest.h> | ||
|
|
||
| #include <cstdlib> | ||
| #include <list> | ||
| #include <string> | ||
| #include <tuple> | ||
|
|
||
| class tmp_env_var { | ||
| public: | ||
| explicit tmp_env_var(std::string name, std::string const& value) : name_(std::move(name)) | ||
| { | ||
| auto const previous_value = std::getenv(name_.c_str()); | ||
| if (previous_value != nullptr) { previous_value_ = std::string(previous_value); } | ||
|
|
||
| setenv(name_.c_str(), value.c_str(), 1); | ||
| } | ||
|
|
||
| tmp_env_var(tmp_env_var const&) = delete; | ||
| tmp_env_var& operator=(tmp_env_var const&) = delete; | ||
| tmp_env_var(tmp_env_var&&) = delete; | ||
| tmp_env_var& operator=(tmp_env_var&&) = delete; | ||
|
Comment on lines
+39
to
+42
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Deleted these to remove the sharp edges, like having a vector of |
||
|
|
||
| ~tmp_env_var() | ||
| { | ||
| if (previous_value_.has_value()) { | ||
| setenv(name_.c_str(), previous_value_->c_str(), 1); | ||
| } else { | ||
| unsetenv(name_.c_str()); | ||
| } | ||
| } | ||
|
|
||
| private: | ||
| std::string name_; | ||
| std::optional<std::string> previous_value_; | ||
| }; | ||
|
|
||
| static constexpr char const* host_comp_env_var = "LIBCUDF_HOST_COMPRESSION"; | ||
| static constexpr char const* host_decomp_env_var = "LIBCUDF_HOST_DECOMPRESSION"; | ||
| static constexpr char const* nvcomp_policy_env_var = "LIBCUDF_NVCOMP_POLICY"; | ||
|
|
||
| template <typename Base> | ||
| struct CompressionTest | ||
| : public Base, | ||
| public ::testing::WithParamInterface<std::tuple<std::string, cudf::io::compression_type>> { | ||
| CompressionTest() | ||
| { | ||
| auto const comp_impl = std::get<0>(GetParam()); | ||
|
|
||
| if (comp_impl == "NVCOMP") { | ||
| env_vars.emplace_back(host_comp_env_var, "OFF"); | ||
| env_vars.emplace_back(nvcomp_policy_env_var, "ALWAYS"); | ||
| } else if (comp_impl == "DEVICE_INTERNAL") { | ||
| env_vars.emplace_back(host_comp_env_var, "OFF"); | ||
| env_vars.emplace_back(nvcomp_policy_env_var, "OFF"); | ||
| } else if (comp_impl == "HOST") { | ||
| env_vars.emplace_back(host_comp_env_var, "ON"); | ||
| } else { | ||
| CUDF_FAIL("Invalid test parameter"); | ||
| } | ||
| } | ||
|
|
||
| private: | ||
| std::list<tmp_env_var> env_vars; | ||
| }; | ||
|
|
||
| template <typename Base> | ||
| struct DecompressionTest | ||
| : public Base, | ||
| public ::testing::WithParamInterface<std::tuple<std::string, cudf::io::compression_type>> { | ||
| DecompressionTest() | ||
| { | ||
| auto const comp_impl = std::get<0>(GetParam()); | ||
|
|
||
| if (comp_impl == "NVCOMP") { | ||
| env_vars.emplace_back(host_decomp_env_var, "OFF"); | ||
| env_vars.emplace_back(nvcomp_policy_env_var, "ALWAYS"); | ||
| } else if (comp_impl == "DEVICE_INTERNAL") { | ||
| env_vars.emplace_back(host_decomp_env_var, "OFF"); | ||
| env_vars.emplace_back(nvcomp_policy_env_var, "OFF"); | ||
| } else if (comp_impl == "HOST") { | ||
| env_vars.emplace_back(host_decomp_env_var, "ON"); | ||
| } else { | ||
| CUDF_FAIL("Invalid test parameter"); | ||
| } | ||
| } | ||
|
|
||
| private: | ||
| std::list<tmp_env_var> env_vars; | ||
vuule marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
missed this one in #18644, because the test did not cover dictionary pages.