-
Notifications
You must be signed in to change notification settings - Fork 797
[SYCL][Docs] Add legacy SYCL 1.2.1 image aspect #9217
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
Changes from 1 commit
25c7275
1d8e67e
b2962f8
9b512d4
b4b75d0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
= sycl_ext_intel_legacy_image | ||
|
||
: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) 2023-2023 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 6 specification. All | ||
references below to the "core SYCL specification" or to section numbers in the | ||
SYCL specification refer to that revision. | ||
|
||
|
||
== Status | ||
|
||
This extension is implemented and fully supported by {dpcpp}. | ||
|
||
|
||
== Overview | ||
|
||
SYCL 2020 removed the SYCL 1.2.1 `image` class as well as the associated image | ||
accessors and `sampler` class. However, the device info query for | ||
`sycl::info::device::image_support` stayed in SYCL 2020 as deprecated. As the | ||
specification states that this query returns the same value as | ||
`device::has(aspect::image)`, the user can no longer query support for the SYCL | ||
1.2.1 images in implementations that support these. | ||
|
||
This extension adds the new aspect `sycl::aspect::ext_intel_legacy_image` | ||
intended for querying if a device supports SYCL 1.2.1 images. | ||
|
||
|
||
== 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_INTEL_LEGACY_IMAGE` 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. | ||
|=== | ||
|
||
|
||
=== More sections at your discretion | ||
|
||
This extension adds the following new value to the SYCL `aspect` enum: | ||
|
||
``` | ||
namespace sycl { | ||
|
||
enum class aspect { | ||
... | ||
ext_intel_legacy_image | ||
}; | ||
|
||
} // namespace sycl | ||
``` | ||
|
||
The new aspect has the following behaviour when queried via `device::has()`: | ||
|
||
[%header,cols="1,5"] | ||
|=== | ||
|Aspect | ||
|Description | ||
|
||
|`aspect::legacy_image` | ||
|Indicates that the device supports SYCL 1.2.1 image accessor, as defined in | ||
section 4.7.6.11 to 4.7.6.13 of the SYCL 1.2.1 Specification Rev. 7, and | ||
samplers, as defined in section 4.7.8 and 4.7.9 of the SYCL 1.2.1 Specification | ||
Rev. 7. | ||
|=== | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -58,6 +58,20 @@ | |
#endif | ||
#endif // __SYCL2020_DEPRECATED | ||
|
||
#ifndef __SYCL_WARN_IMAGE_ASPECT | ||
#if !defined(SYCL_DISABLE_IMAGE_ASPECT_WARNING) && __has_attribute(diagnose_if) | ||
#define __SYCL_WARN_IMAGE_ASPECT(aspect_param) \ | ||
__attribute__((diagnose_if( \ | ||
aspect_param == aspect::image, \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happens here if the value of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sadly it would not produce the warning. For example a call like sycl::aspect A = sycl::aspect::image;
Dev.has(A); would not produce the warning. However, the expectation is that using the aspect directly is the most common pattern and as such should catch the majority of cases. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's OK. I was worried that the compiler might diagnose an error if the expression |
||
"SYCL 2020 images are not supported on any devices. Consider using " \ | ||
"‘aspect::ext_intel_legacy_image’ instead. Disable this warning with " \ | ||
"by defining SYCL_DISABLE_IMAGE_ASPECT_WARNING.", \ | ||
"warning"))) | ||
#else | ||
#define __SYCL_WARN_IMAGE_ASPECT(aspect) | ||
#endif | ||
#endif // __SYCL_WARN_IMAGE_ASPECT | ||
|
||
#ifndef __SYCL_HAS_CPP_ATTRIBUTE | ||
#if defined(__cplusplus) && defined(__has_cpp_attribute) | ||
#define __SYCL_HAS_CPP_ATTRIBUTE(x) __has_cpp_attribute(x) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need a better title for this section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. It has been changed!