-
Notifications
You must be signed in to change notification settings - Fork 795
[SYCL][DOC] Add initial spec draft for new default device #15382
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 11 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
8107ee0
Add initial spec draft for new default devices and queues
jbrodman 56db9f9
Update sycl/doc/extensions/proposed/sycl_ext_oneapi_global_defaults.a…
jbrodman 861a2fa
Update sycl/doc/extensions/proposed/sycl_ext_oneapi_global_defaults.a…
jbrodman 0ff778e
Update sycl/doc/extensions/proposed/sycl_ext_oneapi_global_defaults.a…
jbrodman 9e9483f
Update sycl/doc/extensions/proposed/sycl_ext_oneapi_global_defaults.a…
jbrodman bf2f7b8
Update sycl/doc/extensions/proposed/sycl_ext_oneapi_global_defaults.a…
jbrodman 8a55848
Apply suggestions
jbrodman 45d7580
Change CRLF to LF.
jbrodman 6c72329
Add language specifying that the current device is per-thread.
jbrodman 5d098ce
Remove free enqueue/alloc/dealloc functions
jbrodman f9eb365
Strip it back to just the default device for now
jbrodman 50167bc
Commit the removals I forgot earlier and some edits.
jbrodman 1f7e658
Rename extension to current device from global defaults
jbrodman 899c21c
Begone pesky empty line
jbrodman 4d1c2b6
Edits
jbrodman 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
150 changes: 150 additions & 0 deletions
150
sycl/doc/extensions/proposed/sycl_ext_oneapi_global_defaults.asciidoc
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,150 @@ | ||
| = sycl_ext_oneapi_global_defaults | ||
|
|
||
|
|
||
| :source-highlighter: coderay | ||
| :coderay-linenums-mode: table | ||
|
|
||
| // This section needs to be after the document title. | ||
| :doctype: book | ||
| :toc2: | ||
| :toc: left | ||
| :encoding: utf-8 | ||
| :lang: en | ||
| :dpcpp: pass:[DPC++] | ||
|
|
||
| // Set the default source code type in this document to C++, | ||
| // for syntax highlighting purposes. This is needed because | ||
| // docbook uses c++ and html5 uses cpp. | ||
| :language: {basebackend@docbook:c++:cpp} | ||
|
|
||
|
|
||
| == Notice | ||
|
|
||
| [%hardbreaks] | ||
| Copyright (C) 2024 Intel Corporation. All rights reserved. | ||
|
|
||
| Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are trademarks | ||
| of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc. used by | ||
| permission by Khronos. | ||
|
|
||
|
|
||
| == Contact | ||
|
|
||
| To report problems with this extension, please open a new issue at: | ||
|
|
||
| https://github.com/intel/llvm/issues | ||
|
|
||
|
|
||
| == Dependencies | ||
|
|
||
| This extension is written against the SYCL 2020 revision 9 specification. All | ||
|
|
||
gmlueck marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| references below to the "core SYCL specification" or to section numbers in the | ||
| SYCL specification refer to that revision. | ||
|
|
||
| This extension also depends on the following other SYCL extensions: | ||
|
|
||
| * link:../supported/sycl_ext_oneapi_defaultcontext.asciidoc[ | ||
| sycl_ext_oneapi_defaultcontext] | ||
| * link:../experimental/sycl_ext_oneapi_enqueue_functions.asciidoc[ | ||
| sycl_ext_oneapi_enqueue_functions] | ||
| * link:../supported/sycl_ext_oneapi_enqueue_barrier.asciidoc[ | ||
| sycl_ext_oneapi_enqueue_barrier] | ||
gmlueck marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
|
|
||
| == Status | ||
|
|
||
| This is a proposed extension specification, intended to gather community | ||
| feedback. Interfaces defined in this specification may not be implemented yet | ||
| or may be in a preliminary state. The specification itself may also change in | ||
| incompatible ways before it is finalized. *Shipping software products should | ||
| not rely on APIs defined in this specification.* | ||
|
|
||
| == Overview | ||
|
|
||
| This extension introduces additional state into SYCL in order to simplify | ||
| programming for developers. The extension provides a mechanism to both set and | ||
| query the 'current' global `sycl::device`. By adding the notion of a 'current' | ||
| device, this can simplify interfaces and reduce the amount of boilerplate code | ||
| required to write a SYCL application. | ||
|
|
||
| This extension also introduces the notion of a default queue for a device. When | ||
| combined with the notion of the current device and the extension for new | ||
| free enqueue functions, this allows for a simplified way to write SYCL code. | ||
gmlueck marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| == Specification | ||
|
|
||
| === Feature test macro | ||
|
|
||
| This extension provides a feature-test macro as described in the core SYCL | ||
| specification. An implementation supporting this extension must predefine the | ||
| macro `SYCL_EXT_ONEAPI_GLOBAL_DEFAULTS` to one of the values defined in the table | ||
|
|
||
gmlueck marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| below. Applications can test for the existence of this macro to determine if | ||
| the implementation supports this feature, or applications can test the macro's | ||
| value to determine which of the extension's features the implementation | ||
| supports. | ||
|
|
||
| [%header,cols="1,5"] | ||
| |=== | ||
| |Value | ||
| |Description | ||
|
|
||
| |1 | ||
| |Initial version of this extension. | ||
| |=== | ||
|
|
||
| === New free functions | ||
|
|
||
| This extension adds the following new free functions: | ||
|
|
||
|
|
||
| ''' | ||
|
|
||
| [frame=all,grid=none,separator="@"] | ||
| !==== | ||
| a@ | ||
| [source,c++] | ||
| ---- | ||
| namespace sycl::ext::oneapi::experimental::this_thread { | ||
|
|
||
| sycl::device get_current_device(); | ||
|
|
||
| } // namespace sycl::ext::oneapi::experimental::this_thread | ||
| ---- | ||
| !==== | ||
|
|
||
| _Returns:_ The current default device for the calling host thread. If `set_current_device()` | ||
| has not been called by this thread, returns the device selected by the default device selector. | ||
|
|
||
| _Remarks:_ Calling this method from within a host task or an asynchronous error handler is | ||
| undefined behavior. | ||
jbrodman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
jbrodman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| [frame=all,grid=none,separator="@"] | ||
| !==== | ||
| a@ | ||
| [source,c++] | ||
| ---- | ||
| namespace sycl::ext::oneapi::experimental::this_thread { | ||
|
|
||
| void set_current_device(sycl::device dev); | ||
|
|
||
| } // namespace sycl::ext::oneapi::experimental::this_thread | ||
| ---- | ||
| !==== | ||
|
|
||
| _Returns:_ Nothing | ||
gmlueck marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| _Effects:_ Sets the current default device to `dev` for the current host thread. | ||
jbrodman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| _Remarks:_ Calling this method from within a host task or an asynchronous error handler is | ||
| undefined behavior. | ||
jbrodman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| ''' | ||
|
|
||
| == Issues | ||
| . [RESOLVED] Should the currrent device be global or should we also support a per-thread | ||
jbrodman marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| device? Answer: It should be per-thread to align with the behavior of other programming | ||
| models. | ||
| . [OPEN] We want to add a default queue per device. Should this queue be in-order or out-of-order? | ||
| Do we want to allow the user to specify this? | ||
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.