|
| 1 | += sycl_ext_oneapi_queue_empty |
| 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 | +Copyright (C) 2022-2022 Intel Corporation. All rights reserved. |
| 23 | + |
| 24 | +Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are trademarks |
| 25 | +of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc. used by |
| 26 | +permission by Khronos. |
| 27 | + |
| 28 | + |
| 29 | +== Contact |
| 30 | + |
| 31 | +To report problems with this extension, please open a new issue at: |
| 32 | + |
| 33 | +https://github.com/intel/llvm/issues |
| 34 | + |
| 35 | + |
| 36 | +== Dependencies |
| 37 | + |
| 38 | +This extension is written against the SYCL 2020 revision 6 specification. All |
| 39 | +references below to the "core SYCL specification" or to section numbers in the |
| 40 | +SYCL specification refer to that revision. |
| 41 | + |
| 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 | + |
| 52 | +== Overview |
| 53 | + |
| 54 | +:cuda-stream: https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__STREAM.html#group__CUDART__STREAM_1g2021adeb17905c7ec2a3c1bf125c5435 |
| 55 | + |
| 56 | +This extension adds a new API that tells whether a `queue` is empty, similar to |
| 57 | +the CUDA function {cuda-stream}[CudaStreamQuery]. |
| 58 | + |
| 59 | + |
| 60 | +== Specification |
| 61 | + |
| 62 | +This extension provides a feature-test macro as described in the core SYCL |
| 63 | +specification. An implementation supporting this extension must predefine the |
| 64 | +macro `SYCL_EXT_ONEAPI_QUEUE_EMPTY` to one of the values defined in the table |
| 65 | +below. Applications can test for the existence of this macro to determine if |
| 66 | +the implementation supports this feature, or applications can test the macro's |
| 67 | +value to determine which of the extension's features the implementation |
| 68 | +supports. |
| 69 | + |
| 70 | +[%header,cols="2,5"] |
| 71 | +|=== |
| 72 | +|Value |
| 73 | +|Description |
| 74 | + |
| 75 | +|1 |
| 76 | +|Initial version of this extension. |
| 77 | +|=== |
| 78 | + |
| 79 | +=== New queue member function |
| 80 | + |
| 81 | +This extension adds the following new member function to the `queue` class. |
| 82 | + |
| 83 | +[source,c++] |
| 84 | +---- |
| 85 | +namespace sycl { |
| 86 | +
|
| 87 | +class queue { |
| 88 | + bool ext_oneapi_empty() const; |
| 89 | +}; |
| 90 | +
|
| 91 | +} // namespace sycl |
| 92 | +---- |
| 93 | + |
| 94 | +The semantics of the new function are: |
| 95 | + |
| 96 | +[frame="topbot",options="header"] |
| 97 | +|=== |
| 98 | +|Function |Description |
| 99 | + |
| 100 | +// --- ROW BREAK --- |
| 101 | +a| |
| 102 | +[source,c++] |
| 103 | +---- |
| 104 | +bool ext_oneapi_empty() const |
| 105 | +---- |
| 106 | +| |
| 107 | +Returns `true` if all commands previously submitted to this queue have |
| 108 | +completed at the point when this function is called. |
| 109 | + |
| 110 | +|=== |
0 commit comments