-
Notifications
You must be signed in to change notification settings - Fork 842
[SYCL][DOC] Spec for discard queue events #4922
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
bader
merged 13 commits into
intel:sycl
from
alexanderfle:spec_for_avoid_event_creation
Nov 23, 2021
+213
−0
Merged
Changes from 3 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
d3e543e
[SYCL][DOC] Add avoid_event_creation extension
alexanderfle 95ff7fb
Update avoid_event_creation.asciidoc
alexanderfle 97f2913
Update avoid_event_creation.asciidoc
alexanderfle 6788b91
Fix review comments #1
alexanderfle 1fdf67d
Fix review comments 2
alexanderfle 6d8bc90
Minor fix
alexanderfle 226421f
Fix review comments 3
alexanderfle e6f1871
Fix review comments 4
alexanderfle 5962802
Update SYCL_EXT_ONEAPI_DISCARD_QUEUE_EVENTS.asciidoc
alexanderfle 488e19b
Update sycl/doc/extensions/DiscardQueueEvents/SYCL_EXT_ONEAPI_DISCARD…
alexanderfle 49679e4
Update SYCL_EXT_ONEAPI_DISCARD_QUEUE_EVENTS.asciidoc
alexanderfle 414f578
Added words about L0 support
alexanderfle bf1cff8
Update sycl/doc/extensions/DiscardQueueEvents/SYCL_EXT_ONEAPI_DISCARD…
alexanderfle 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
144 changes: 144 additions & 0 deletions
144
sycl/doc/extensions/Avoid_event_creation/avoid_event_creation.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,144 @@ | ||
| = Avoid event creation | ||
|
|
||
| :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 | ||
|
|
||
| :blank: pass:[ +] | ||
|
|
||
| // 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} | ||
|
|
||
| // This is necessary for asciidoc, but not for asciidoctor | ||
| :cpp: C++ | ||
|
|
||
| == Notice | ||
|
|
||
| IMPORTANT: This specification is a draft. | ||
|
|
||
| Copyright (c) 2021 Intel Corporation. All rights reserved. | ||
|
|
||
| NOTE: 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. | ||
|
|
||
| NOTE: This document is better viewed when rendered as html with asciidoctor. | ||
| GitHub does not render image icons. | ||
|
alexanderfle marked this conversation as resolved.
Outdated
|
||
|
|
||
| == Dependencies | ||
|
|
||
| This extension is written against the SYCL 2020 specification, Revision 3. | ||
|
|
||
| == Status | ||
|
|
||
| Working Draft | ||
|
|
||
| This is a preview extension specification, intended to provide early access to | ||
| a feature for review and community feedback. When the feature matures, this | ||
| specification may be released as a formal extension. | ||
|
|
||
| Because the interfaces defined by this specification are not final and are | ||
| subject to change they are not intended to be used by shipping software | ||
| products. | ||
|
|
||
| == Introduction | ||
|
|
||
| This extension adds `avoid_event_creation` property for `sycl::queue`, by using this property | ||
| the application informs SYCL RT library that it doesn't care about the returned event, | ||
| i.e the application doesn't use the returned event and just ignores it. | ||
|
alexanderfle marked this conversation as resolved.
Outdated
|
||
|
|
||
| In that case, the RT library makes a decision about internal optimization - voiding | ||
|
alexanderfle marked this conversation as resolved.
Outdated
|
||
| the creation of low-level event from the backend. The property affects only kernel cases, | ||
| i.e. avoid creating low-level event for submission of kernels. | ||
| Performance improvement is the main motivation for using this property. | ||
|
|
||
| Below is a usage example: | ||
|
|
||
| [source,c++] | ||
| ---- | ||
| // in order queue is required for avoid_event_creation | ||
| sycl::queue Queue( {property::queue::in_order{}, property::queue::avoid_event_creation{}} ); | ||
|
|
||
| // some USM preparations .. | ||
|
|
||
| // creating "null" events | ||
| sycl::event e1, e2, e3; | ||
|
|
||
| // returning "null" events from each submission function: | ||
| e1 = Queue.parallel_for(NDRange, [=](nd_item<1> item){ do_smth1(); }); | ||
|
|
||
| e2 = Queue.single_task([=](){ do_smth2(); }); | ||
|
|
||
| e3 = Queue.submit([&](handler &CGH) { CGH.parallel_for(NDRange, [=](nd_item<1> item){ do_smth3(); }); }); | ||
|
|
||
| Queue.wait(); | ||
| ---- | ||
|
|
||
| In the example above, the application doesn't use sycl events: `e1`, `e2`, `e3` | ||
| and is waiting for the end of work by `queue::wait()`. The returned events will be | ||
| `null events` - means that low-level events from backend are not created for them. | ||
|
alexanderfle marked this conversation as resolved.
Outdated
|
||
| `null event` is the event created by the default event constructor, i.e `null event` | ||
|
alexanderfle marked this conversation as resolved.
Outdated
|
||
| has the same behavior as if the event was created by the default constructor. | ||
|
alexanderfle marked this conversation as resolved.
Outdated
|
||
|
|
||
| == Limitations | ||
|
|
||
| If the queue has this property and for some reason an event needs to be created, | ||
| then an exception with the `errc::invalid_operation` error code will be thrown. | ||
|
|
||
| The reasons for throwing the exception: | ||
|
|
||
| - using streams, buffer/image accessors (excluding local accessors) | ||
| - using together with `enable_profiling` property | ||
| - using OOO queue | ||
| - using https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/Assert/SYCL_ONEAPI_ASSERT.asciidoc[fallback assert feature] | ||
|
alexanderfle marked this conversation as resolved.
Outdated
|
||
|
|
||
|
|
||
| *Using this extension is well suited for kernels that use USM only, since sycl accessors are used to build a dependency graph, in which case low-level events are needed. | ||
|
alexanderfle marked this conversation as resolved.
Outdated
|
||
|
|
||
| == Version | ||
|
|
||
| Built On: {docdate} + | ||
| Revision: 1 | ||
|
|
||
| == Issues | ||
|
|
||
| None. | ||
|
|
||
| == Revision History | ||
|
|
||
| [cols="5,15,15,70"] | ||
| [grid="rows"] | ||
| [options="header"] | ||
| |======================================== | ||
| |Rev|Date|Author|Changes | ||
| |1|2021-11-09|Alexander Flegontov |*Initial public working draft* | ||
| |======================================== | ||
|
|
||
| //************************************************************************ | ||
| //Other formatting suggestions: | ||
| // | ||
| //* Use *bold* text for host APIs, or [source] syntax highlighting. | ||
| //* Use +mono+ text for device APIs, or [source] syntax highlighting. | ||
| //* Use +mono+ text for extension names, types, or enum values. | ||
| //* Use _italics_ for parameters. | ||
| //************************************************************************ | ||
| © 2021 GitHub, Inc. | ||
| Terms | ||
| Privacy | ||
| Security | ||
| Status | ||
| Docs | ||
| Contact GitHub | ||
| Pricing | ||
| API | ||
| Training | ||
| Blog | ||
| About | ||
|
alexanderfle marked this conversation as resolved.
Outdated
|
||
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.