-
Notifications
You must be signed in to change notification settings - Fork 126
[rocDecode][Samples] - Fix rocdecDecode sample filesystem issue on SLES #3028
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
base: develop
Are you sure you want to change the base?
[rocDecode][Samples] - Fix rocdecDecode sample filesystem issue on SLES #3028
Conversation
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.
Pull request overview
This PR fixes a filesystem compatibility issue in the rocdecDecode sample on SLES by adding fallback support for std::experimental::filesystem when std::filesystem is unavailable.
Changes:
- Adds conditional compilation to detect and use
std::filesystem(C++17) or fall back tostd::experimental::filesystem - Introduces a
fsnamespace alias to abstract filesystem implementation differences - Links against
stdc++fslibrary in CMake to support experimental filesystem - Removes color formatting from CMake messages
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| projects/rocdecode/samples/rocdecDecode/rocdecdecode.cpp | Adds conditional filesystem header inclusion with namespace aliasing and updates filesystem API calls to use the fs alias |
| projects/rocdecode/samples/rocdecDecode/CMakeLists.txt | Adds stdc++fs library linking and simplifies CMake message formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| bool b_sort_filenames = false; | ||
| if (std::filesystem::is_directory(input_file_path)) { | ||
| for (const auto& entry : std::filesystem::directory_iterator(input_file_path)) { | ||
| if (fs::is_directory(input_file_path)) { |
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.
Why is this changed from std::filesystem?
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.
@rrawther it is changed to support both std::filesystem and std::experimental::filesystem (please see below)
#if __cplusplus >= 201703L && __has_include(<filesystem>)Expand commentComment on line R28Resolved
#include <filesystem>
namespace fs = std::filesystem;
#else
#include <experimental/filesystem>
namespace fs = std::experimental::filesystem;
#endif
rrawther
left a comment
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.
Added a comment
Motivation
It fixes rocdecDecode sample filesystem issue on SLES
Technical Details
It introduces a check to verify the existence of std::filesystem; if it is unavailable, the code falls back to using std::experimental::filesystem.
JIRA ID
Test Plan
rocDecode CTEST
Test Result
rocDecode CTEST should pass.
Submission Checklist