-
Notifications
You must be signed in to change notification settings - Fork 849
[UR] Coverity fixes #22699
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: sycl
Are you sure you want to change the base?
[UR] Coverity fixes #22699
Changes from all commits
ec78cf3
6122d96
958ef91
04567a4
1936c00
3f7553a
f53becd
c5fb538
1b8cfd5
bdb285a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,7 +94,17 @@ ur_result_t DeviceInfo::allocShadowMemory() { | |
| &ShadowContext)); | ||
| Shadow = GetShadowMemory(ShadowContext, Handle, Type); | ||
| assert(Shadow && "Failed to get shadow memory"); | ||
| UR_CALL(Shadow->Setup()); | ||
| auto Result = Shadow->Setup(); | ||
| // Release the shadow context if the operation failed or if the device type is | ||
| // CPU. Note that the singleton CPU shadow does not store per-device contexts. | ||
| if (Result != UR_RESULT_SUCCESS || Type == DeviceType::CPU) { | ||
| [[maybe_unused]] auto ReleaseResult = | ||
| getContext()->urDdiTable.Context.pfnRelease(ShadowContext); | ||
| assert(ReleaseResult == UR_RESULT_SUCCESS); | ||
| } | ||
|
Comment on lines
+100
to
+104
Contributor
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. did this just leak on the cpu type before?
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. Yes, CPU shadow context |
||
| if (Result != UR_RESULT_SUCCESS) { | ||
| return Result; | ||
| } | ||
| UR_LOG_L(getContext()->logger, INFO, "ShadowMemory(Global): {} - {}", | ||
| (void *)Shadow->ShadowBegin, (void *)Shadow->ShadowEnd); | ||
| return UR_RESULT_SUCCESS; | ||
|
|
||
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.
was the previous comment incorrect?
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.
Coverity claims that there could be a race condition here if another thread concurrently performs a lookup or insertion