-
Notifications
You must be signed in to change notification settings - Fork 797
[SYCL] Add Level-Zero interop with specification of ownership for Queue. #4066
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 8 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
a00dbe2
[SYCL] Add Level-Zero interop with specification of ownership for Queue.
rbegam 8f58fb9
clang formatted.
rbegam 9ed3cea
fixed the unittest fail and modified the API version.
rbegam a0bc966
change pi_cuda.
rbegam 5d107bb
clang formatted.
rbegam d237f85
clang formatted.
rbegam 9bd92cc
fixed the lit-test fail.
rbegam 458672c
clang formatted.
rbegam 066ed64
fix review comments.
rbegam ea9b3f4
clang formatted.
rbegam 39e9f6d
fixed the lit fail.
rbegam 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
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
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
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 |
---|---|---|
|
@@ -2411,7 +2411,7 @@ pi_result piQueueCreate(pi_context Context, pi_device Device, | |
|
||
try { | ||
*Queue = new _pi_queue(ZeComputeCommandQueue, ZeCopyCommandQueue, Context, | ||
Device, ZeCommandListBatchSize, Properties); | ||
Device, ZeCommandListBatchSize, true, Properties); | ||
} catch (const std::bad_alloc &) { | ||
return PI_OUT_OF_HOST_MEMORY; | ||
} catch (...) { | ||
|
@@ -2494,11 +2494,14 @@ pi_result piQueueRelease(pi_queue Queue) { | |
ZE_CALL(zeFenceDestroy, (MapEntry.second.ZeFence)); | ||
} | ||
Queue->ZeCommandListFenceMap.clear(); | ||
ZE_CALL(zeCommandQueueDestroy, (Queue->ZeComputeCommandQueue)); | ||
Queue->ZeComputeCommandQueue = nullptr; | ||
if (Queue->ZeCopyCommandQueue) { | ||
ZE_CALL(zeCommandQueueDestroy, (Queue->ZeCopyCommandQueue)); | ||
Queue->ZeCopyCommandQueue = nullptr; | ||
|
||
if (Queue->OwnZeCommandQueue) { | ||
ZE_CALL(zeCommandQueueDestroy, (Queue->ZeComputeCommandQueue)); | ||
Queue->ZeComputeCommandQueue = nullptr; | ||
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. I think we should still null-ify these, even if we don't own the handles 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. done. |
||
if (Queue->ZeCopyCommandQueue) { | ||
ZE_CALL(zeCommandQueueDestroy, (Queue->ZeCopyCommandQueue)); | ||
Queue->ZeCopyCommandQueue = nullptr; | ||
} | ||
} | ||
|
||
zePrint("piQueueRelease NumTimesClosedFull %d, NumTimesClosedEarly %d\n", | ||
|
@@ -2545,8 +2548,8 @@ pi_result piextQueueGetNativeHandle(pi_queue Queue, | |
} | ||
|
||
pi_result piextQueueCreateWithNativeHandle(pi_native_handle NativeHandle, | ||
pi_context Context, | ||
pi_queue *Queue) { | ||
pi_context Context, pi_queue *Queue, | ||
bool OwnNativeHandle) { | ||
PI_ASSERT(Context, PI_INVALID_CONTEXT); | ||
PI_ASSERT(NativeHandle, PI_INVALID_VALUE); | ||
PI_ASSERT(Queue, PI_INVALID_QUEUE); | ||
|
@@ -2558,8 +2561,8 @@ pi_result piextQueueCreateWithNativeHandle(pi_native_handle NativeHandle, | |
pi_device Device = Context->Devices[0]; | ||
// TODO: see what we can do to correctly initialize PI queue for | ||
// compute vs. copy Level-Zero queue. | ||
*Queue = | ||
new _pi_queue(ZeQueue, nullptr, Context, Device, ZeCommandListBatchSize); | ||
*Queue = new _pi_queue(ZeQueue, nullptr, Context, Device, | ||
ZeCommandListBatchSize, OwnNativeHandle); | ||
return PI_SUCCESS; | ||
} | ||
|
||
|
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.