-
Notifications
You must be signed in to change notification settings - Fork 791
[SYCL][DOC] Add new extension sycl_ext_oneapi_clock #19842
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 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
a5f0e9d
[SYCL][DOC] Add new extension sycl_ext_oneapi_clock
KornevNikita 571c693
apply suggestions
KornevNikita eeb908b
apply suggestions
KornevNikita 0843199
small edit
KornevNikita 42ab657
apply suggestions
KornevNikita 4fd1334
apply suggestion
KornevNikita a01aeb3
various fixes
KornevNikita d1f70e7
resolve issue
KornevNikita 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
132 changes: 132 additions & 0 deletions
132
sycl/doc/extensions/proposed/sycl_ext_oneapi_clock.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,132 @@ | ||
= sycl_ext_oneapi_clock | ||
|
||
: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++] | ||
:endnote: —{nbsp}end{nbsp}note | ||
|
||
// 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) 2025 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 10 specification. All | ||
references below to the "core SYCL specification" or to section numbers in the | ||
SYCL specification refer to that revision. | ||
|
||
== 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.* | ||
|
||
== Backend support status | ||
|
||
The APIs in this extension may be used only on a device that has | ||
`aspect::ext_oneapi_clock`. The application must check that the device has | ||
this aspect before submitting a kernel using any of the APIs in this | ||
extension. If the application fails to do this, the implementation throws | ||
a synchronous exception with the `errc::feature_not_supported` error code | ||
when the kernel is submitted to the queue. | ||
|
||
== Overview | ||
|
||
This extension defines a new free function `clock()`. It returns the sample | ||
value of a clock as seen by the shader processor. An idealized clock is an | ||
unbounded unsigned scalar integer tick count increasing monotonically over | ||
time. A clock’s rate of progress may vary within the lifetime of an invocation, | ||
may vary across different executions of the program, and may be affected by | ||
conditions beyond the control of the programmer. The sampled value read by this | ||
instruction consists of the least significant bits of the idealized clock’s tick | ||
count at the time the instruction was executed. In particular, an observer may | ||
see sampled values wrap around zero. | ||
|
||
== 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_CLOCK` to one of the values defined in the table | ||
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. | ||
|=== | ||
KornevNikita marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
=== New device aspect | ||
|
||
This extension adds new device aspect: | ||
|
||
```c++ | ||
namespace sycl::ext::oneapi { | ||
|
||
enum class aspect : /*unspecified*/ { | ||
ext_oneapi_clock | ||
}; | ||
|
||
} // namespace sycl::ext::oneapi | ||
KornevNikita marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
``` | ||
|
||
[width="100%",%header,cols="50%,50%"] | ||
|=== | ||
|Aspect | ||
|Description | ||
|
||
|`ext_oneapi_clock` | ||
|Indicates that the device supports the `clock()` call. | ||
KornevNikita marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|=== | ||
|
||
=== New free function | ||
|
||
```c++ | ||
namespace sycl::ext::oneapi { | ||
KornevNikita marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
uint64_t clock(); | ||
|
||
} // namespace sycl::ext::oneapi | ||
``` | ||
|
||
KornevNikita marked this conversation as resolved.
Show resolved
Hide resolved
|
||
_Returns:_ the sample value of a clock as seen by the shader processor. | ||
gmlueck marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
_Throws:_ an exception with the errc::feature_not_supported error code if the | ||
device does not have aspect::ext_oneapi_clock. | ||
KornevNikita marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
== Issues |
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.