-
Notifications
You must be signed in to change notification settings - Fork 919
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Promote IO support queries to cudf API
- Loading branch information
1 parent
fb12d98
commit acc0b00
Showing
16 changed files
with
184 additions
and
124 deletions.
There are no files selected for viewing
This file contains 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,53 @@ | ||
/* | ||
* Copyright (c) 2024, 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/utilities/export.hpp> | ||
|
||
namespace CUDF_EXPORT cudf { | ||
namespace io::cufile_integration { | ||
|
||
/** | ||
* @brief Returns true if cuFile and its compatibility mode are enabled. | ||
*/ | ||
bool is_always_enabled(); | ||
|
||
/** | ||
* @brief Returns true if only direct IO through cuFile is enabled (compatibility mode is disabled). | ||
*/ | ||
bool is_gds_enabled(); | ||
|
||
/** | ||
* @brief Returns true if KvikIO is enabled. | ||
*/ | ||
bool is_kvikio_enabled(); | ||
|
||
} // namespace io::cufile_integration | ||
|
||
namespace io::nvcomp_integration { | ||
|
||
/** | ||
* @brief Returns true if all nvCOMP uses are enabled. | ||
*/ | ||
bool is_all_enabled(); | ||
|
||
/** | ||
* @brief Returns true if stable nvCOMP use is enabled. | ||
*/ | ||
bool is_stable_enabled(); | ||
|
||
} // namespace io::nvcomp_integration | ||
} // namespace cudf |
This file contains 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,92 @@ | ||
/* | ||
* Copyright (c) 2024, 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/utilities/export.hpp> | ||
|
||
#include <optional> | ||
#include <string> | ||
|
||
|
||
namespace CUDF_EXPORT cudf { | ||
namespace io::nvcomp { | ||
|
||
enum class compression_type { SNAPPY, ZSTD, DEFLATE, LZ4 }; | ||
|
||
/** | ||
* @brief Set of parameters that impact whether the use nvCOMP features is enabled. | ||
*/ | ||
struct feature_status_parameters { | ||
int lib_major_version; | ||
int lib_minor_version; | ||
int lib_patch_version; | ||
bool are_all_integrations_enabled; | ||
bool are_stable_integrations_enabled; | ||
int compute_capability_major; | ||
|
||
feature_status_parameters(); | ||
feature_status_parameters( | ||
int major, int minor, int patch, bool all_enabled, bool stable_enabled, int cc_major) | ||
: lib_major_version{major}, | ||
lib_minor_version{minor}, | ||
lib_patch_version{patch}, | ||
are_all_integrations_enabled{all_enabled}, | ||
are_stable_integrations_enabled{stable_enabled}, | ||
compute_capability_major{cc_major} | ||
{ | ||
} | ||
}; | ||
|
||
/** | ||
* @brief Equality operator overload. Required to use `feature_status_parameters` as a map key. | ||
*/ | ||
inline bool operator==(feature_status_parameters const& lhs, feature_status_parameters const& rhs) | ||
{ | ||
return lhs.lib_major_version == rhs.lib_major_version and | ||
lhs.lib_minor_version == rhs.lib_minor_version and | ||
lhs.lib_patch_version == rhs.lib_patch_version and | ||
lhs.are_all_integrations_enabled == rhs.are_all_integrations_enabled and | ||
lhs.are_stable_integrations_enabled == rhs.are_stable_integrations_enabled and | ||
lhs.compute_capability_major == rhs.compute_capability_major; | ||
} | ||
|
||
/** | ||
* @brief If a compression type is disabled through nvCOMP, returns the reason as a string. | ||
* | ||
* Result cab depend on nvCOMP version and environment variables. | ||
* | ||
* @param compression Compression type | ||
* @param params Optional parameters to query status with different configurations | ||
* @returns Reason for the feature disablement, `std::nullopt` if the feature is enabled | ||
*/ | ||
[[nodiscard]] std::optional<std::string> is_compression_disabled( | ||
compression_type compression, feature_status_parameters params = feature_status_parameters()); | ||
|
||
/** | ||
* @brief If a decompression type is disabled through nvCOMP, returns the reason as a string. | ||
* | ||
* Result can depend on nvCOMP version and environment variables. | ||
* | ||
* @param compression Compression type | ||
* @param params Optional parameters to query status with different configurations | ||
* @returns Reason for the feature disablement, `std::nullopt` if the feature is enabled | ||
*/ | ||
[[nodiscard]] std::optional<std::string> is_decompression_disabled( | ||
compression_type compression, feature_status_parameters params = feature_status_parameters()); | ||
|
||
} // namespace io::nvcomp | ||
} // namespace cudf |
This file contains 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 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 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 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 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 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 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 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 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 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.