-
Notifications
You must be signed in to change notification settings - Fork 771
[SYCL] Add the notion of default contexts. #2805
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 all commits
Commits
Show all changes
52 commits
Select commit
Hold shift + click to select a range
7d53b82
Add the notion of a default context to a platform. Queue creation wi…
jbrodman 664e6e1
Update ABI symbols
jbrodman 4292706
Update tests to the new behavior
jbrodman 8ef4616
Update unit test for the new behavior
jbrodman 8d5bc04
Make contexts in interop test explicit
jbrodman 0bb715e
Change tests to use explicit contexts to keep exercising the original…
jbrodman f13c910
Add on-device tests and error when popping default context stack woul…
jbrodman ef1592b
Merge branch 'sycl' into defaultctxts
jbrodman 634af84
Formatting/style changes
jbrodman 5e55c1c
clang-format tests
jbrodman 76c94be
Add extension doc for platform contexts
jbrodman ea071c9
Add mutex and update ABI
jbrodman 6db087f
Update spec to have a table
jbrodman bedea74
Merge branch 'sycl' into defaultctxts
jbrodman 5546f9b
Remove push/pop methods
jbrodman 76d9322
Remove tests for push/pop
jbrodman 1b98a82
Address feedback. Change vector of contexts to a single one.
jbrodman 774a0be
Add Platform Context extension to README.md
jbrodman 275ff5c
Merge branch 'sycl' into defaultctxts
jbrodman fc86ff0
Fix logic bug. Returning nullptr all the time wasn't the intended beh…
jbrodman c5d9ae7
Remove auto in a function
jbrodman e14ccad
Merge branch 'sycl' into defaultctxts
jbrodman c576a08
Change to using shared_ptr of context_impl, but keep context() logic
jbrodman 82ab84a
Better conform to extension guidelines.
jbrodman dd790df
Merge branch 'sycl' into defaultctxts
jbrodman c191b8a
Handle host default context slightly specially
jbrodman dbfc5e3
Merge remote-tracking branch 'public/sycl' into defaultctxts
6654c0a
Fix issue
b9f9b66
Merge remote-tracking branch 'public/sycl' into HEAD
romanovvlad 53d11ea
draft
romanovvlad 1a6a082
Merge remote-tracking branch 'public/sycl' into private/vromanov/FixC…
romanovvlad 5ec61b0
remove leftovers
romanovvlad 9b4f707
Apply comments
romanovvlad 914710d
Add missing include
romanovvlad 6d3868c
clang-format
romanovvlad f6f1806
Avoid using default context when creating host queue
romanovvlad ac3aa59
Do not use default contexts for sub-devices
romanovvlad b3012a3
Release default context cache before releasing plugins because cache
romanovvlad 3463c1e
Workaround CUDA fails during shutdown
romanovvlad ca6640e
Fix workaround for cuda
romanovvlad 78cc85b
Test treating CUDA_ERROR_DEINITIALIZED as succsess in all cases
romanovvlad 32462b5
Make default contexts optional
def28c0
Add docs
9adb576
Merge branch 'sycl' into defaultctxts
91a4882
Address test failures and review comments
9ef815e
fix env var cache
a976215
Update sycl/unittests/misc/CMakeLists.txt
alexbatashev 9f4afb7
Fix some issues
c283796
Merge branch 'defaultctxts' of github.com:jbrodman/llvm into defaultc…
12504a1
fix rest of the issues
cc6cbc8
Merge remote-tracking branch 'upstream/sycl' into defaultctxts
08c72e7
Update sycl/source/detail/queue_impl.hpp
alexbatashev 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
= SYCL(TM) Proposals: Platform Default Contexts | ||
James Brodman <james.brodman@intel.com> | ||
v0.1 | ||
:source-highlighter: pygments | ||
:icons: font | ||
:y: icon:check[role="green"] | ||
:n: icon:times[role="red"] | ||
|
||
== Platform Default Contexts | ||
|
||
This extension adds the notion of a default SYCL context per SYCL platform. The default context for each platform contains all devices in the platform. | ||
|
||
The platform class gains one new method: | ||
|
||
[cols="^60a,40"] | ||
jbrodman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|=== | ||
| Member Function | Description | ||
|
||
| | ||
[source,c++] | ||
---- | ||
context ext_oneapi_get_default_context() | ||
---- | ||
|
||
| Returns the current default context for this `platform` | ||
|
||
jbrodman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|=== | ||
|
||
This extension also modifies the behavior of `queue` constructors. Queues will no longer create a new `context` upon construction. Instead, they will use the default context from the device's platform. | ||
|
||
== Feature Test Macro | ||
|
||
This extension defines the macro `SYCL_EXT_ONEAPI_DEFAULT_CONTEXT` to `1` to indicate that it is enabled. | ||
|
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
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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
set(CMAKE_CXX_EXTENSIONS OFF) | ||
|
||
# Enable exception handling for these unit tests | ||
set(LLVM_REQUIRES_EH 1) | ||
add_sycl_unittest(ExtensionsTests OBJECT | ||
DefaultContext.cpp | ||
) | ||
|
Oops, something went wrong.
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.