-
Notifications
You must be signed in to change notification settings - Fork 93
[SYCLomaitc] Migrate 2 CUDA IPC code to level zero APIs. #2818
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: SYCLomatic
Are you sure you want to change the base?
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 migrates two CUDA IPC code paths to level zero APIs by introducing new types and functions for IPC event pool handling and updating type mappings.
- Added a new type and functions in ze_utils.hpp to support event pool creation and IPC handling.
- Updated RulesLang.cpp to check for experimental usage of the new cudaIpcEventHandle_st and revised the namespace mappings in MapNames.cpp.
Reviewed Changes
Copilot reviewed 3 out of 6 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
clang/runtime/dpct-rt/include/dpct/ze_utils.hpp | Adds new structures and functions for creating and handling Level Zero event pool IPC. |
clang/lib/DPCT/RulesLang/RulesLang.cpp | Inserts experimental feature support for cudaIpcEventHandle_st with an updated check. |
clang/lib/DPCT/RuleInfra/MapNames.cpp | Updates type mapping to include cudaIpcEventHandle_t to the new experimental type. |
Files not reviewed (3)
- clang/lib/DPCT/RulesLang/APINamesMisc.inc: Language not supported
- clang/lib/DPCT/SrcAPI/APINames.inc: Language not supported
- clang/test/dpct/IPC/share_mem_exp_option.cu: Language not supported
if (CanonicalTypeStr == "cudaIpcEventHandle_st") { | ||
if (!DpctGlobalInfo::useExtLevelZero()) { | ||
report(TL->getBeginLoc(), Diagnostics::TRY_EXPERIMENTAL_FEATURE, false, | ||
"cudaIpcMemHandle_t", "--use-experimental-features=level_zero"); |
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.
The report message within this block uses 'cudaIpcMemHandle_t' instead of 'cudaIpcEventHandle_t', which may confuse users expecting the correct type name. Please update the string to 'cudaIpcEventHandle_t' to reflect the correct experimental feature.
"cudaIpcMemHandle_t", "--use-experimental-features=level_zero"); | |
"cudaIpcEventHandle_t", "--use-experimental-features=level_zero"); |
Copilot uses AI. Check for mistakes.
int fd = detail::get_fd_of_peer_process(hipc); | ||
if (fd < 0) | ||
throw std::runtime_error("Cannot get file descriptor of peer process."); | ||
*((int *)hipc.handle.data) = detail::get_fd_of_peer_process(hipc); |
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.
Casting hipc.handle.data to an int pointer directly might lead to issues if the underlying type of handle.data is not guaranteed to store an integer file descriptor. Consider using a safer method, like memcpy or a static_cast/reinterpret_cast with appropriate validation.
Copilot uses AI. Check for mistakes.
No description provided.