|
| 1 | += sycl_ext_oneapi_prod |
| 2 | + |
| 3 | +:source-highlighter: coderay |
| 4 | +:coderay-linenums-mode: table |
| 5 | + |
| 6 | +// This section needs to be after the document title. |
| 7 | +:doctype: book |
| 8 | +:toc2: |
| 9 | +:toc: left |
| 10 | +:encoding: utf-8 |
| 11 | +:lang: en |
| 12 | +:dpcpp: pass:[DPC++] |
| 13 | + |
| 14 | +// Set the default source code type in this document to C++, |
| 15 | +// for syntax highlighting purposes. This is needed because |
| 16 | +// docbook uses c++ and html5 uses cpp. |
| 17 | +:language: {basebackend@docbook:c++:cpp} |
| 18 | + |
| 19 | + |
| 20 | +== Notice |
| 21 | + |
| 22 | +[%hardbreaks] |
| 23 | +Copyright (C) 2022-2022 Intel Corporation. All rights reserved. |
| 24 | + |
| 25 | +Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are trademarks |
| 26 | +of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc. used by |
| 27 | +permission by Khronos. |
| 28 | + |
| 29 | + |
| 30 | +== Contact |
| 31 | + |
| 32 | +To report problems with this extension, please open a new issue at: |
| 33 | + |
| 34 | +https://github.com/intel/llvm/issues |
| 35 | + |
| 36 | + |
| 37 | +== Dependencies |
| 38 | + |
| 39 | +This extension is written against the SYCL 2020 revision 5 specification. All |
| 40 | +references below to the "core SYCL specification" or to section numbers in the |
| 41 | +SYCL specification refer to that revision. |
| 42 | + |
| 43 | +== Status |
| 44 | + |
| 45 | +This is a proposed extension specification, intended to gather community |
| 46 | +feedback. Interfaces defined in this specification may not be implemented yet |
| 47 | +or may be in a preliminary state. The specification itself may also change in |
| 48 | +incompatible ways before it is finalized. *Shipping software products should |
| 49 | +not rely on APIs defined in this specification.* |
| 50 | + |
| 51 | +== Overview |
| 52 | + |
| 53 | +This extension adds a mechanism to signal that it is desirable for a SYCL queue |
| 54 | +to begin executing any previously submitted commands once their dependencies |
| 55 | +have been satisfied. |
| 56 | + |
| 57 | +This can be a useful performance hint if a SYCL runtime or backend runtime |
| 58 | +batches several commands before passing them to a device for execution. |
| 59 | + |
| 60 | +== Specification |
| 61 | + |
| 62 | +=== Feature test macro |
| 63 | + |
| 64 | +This extension provides a feature-test macro as described in the core SYCL |
| 65 | +specification. An implementation supporting this extension must predefine the |
| 66 | +macro `SYCL_EXT_ONEAPI_PROD` to one of the values defined in the table |
| 67 | +below. Applications can test for the existence of this macro to determine if |
| 68 | +the implementation supports this feature, or applications can test the macro's |
| 69 | +value to determine which of the extension's features the implementation |
| 70 | +supports. |
| 71 | + |
| 72 | +[%header,cols="1,5"] |
| 73 | +|=== |
| 74 | +|Value |
| 75 | +|Description |
| 76 | + |
| 77 | +|1 |
| 78 | +|Initial version of this extension. |
| 79 | +|=== |
| 80 | + |
| 81 | +=== New member function |
| 82 | + |
| 83 | +This extension adds the following new member function to the SYCL `queue` |
| 84 | +class: |
| 85 | + |
| 86 | +``` |
| 87 | +class queue { |
| 88 | + void ext_oneapi_prod(); |
| 89 | +}; |
| 90 | +``` |
| 91 | + |
| 92 | +A call to `ext_oneapi_prod` provides a hint to the SYCL runtime that it |
| 93 | +should start executing any previously submitted commands once their |
| 94 | +prerequisites have been satisfied. Calls to `ext_oneapi_prod` are |
| 95 | +non-blocking. Calling `ext_oneapi_prod` does not guarantee that |
| 96 | +previously submitted commands will eventually begin executing, nor that any |
| 97 | +previously submitted commands will execute concurrently with the host thread. |
| 98 | + |
| 99 | +[NOTE] |
| 100 | +==== |
| 101 | +Since commands submitted to a SYCL queue are not required to execute |
| 102 | +immediately, SYCL devices and backends may buffer commands until a |
| 103 | +blocking call is encountered (e.g. `queue::wait`) or until some |
| 104 | +implementation-specific threshold is met. `ext_oneapi_prod` can be used |
| 105 | +in such cases to override default behavior and encourage earlier execution. |
| 106 | +==== |
| 107 | + |
| 108 | +[NOTE] |
| 109 | +==== |
| 110 | +Although `ext_oneapi_prod` is a performance hint, its impact upon application |
| 111 | +performance will be highly dependent upon the combination of device, backend |
| 112 | +and application characteristics. In some cases, it may even degrade performance |
| 113 | +(e.g. by interfering with batching or fusion optimizations). |
| 114 | +==== |
0 commit comments