1
- = SYCL_INTEL_bf16_conversion
1
+ = sycl_ext_oneapi_bfloat16
2
2
3
3
:source-highlighter: coderay
4
4
:coderay-linenums-mode: table
24
24
25
25
IMPORTANT: This specification is a draft.
26
26
27
- Copyright (c) 2021 Intel Corporation. All rights reserved.
27
+ Copyright (c) 2021-2022 Intel Corporation. All rights reserved.
28
28
29
29
NOTE: Khronos(R) is a registered trademark and SYCL(TM) and SPIR(TM) are
30
30
trademarks of The Khronos Group Inc. OpenCL(TM) is a trademark of Apple Inc.
31
31
used by permission by Khronos.
32
32
33
33
== Dependencies
34
34
35
- This extension is written against the SYCL 2020 specification, Revision 3 .
35
+ This extension is written against the SYCL 2020 specification, Revision 4 .
36
36
37
37
== Status
38
38
@@ -48,7 +48,7 @@ products.
48
48
49
49
== Version
50
50
51
- Revision: 3
51
+ Revision: 4
52
52
53
53
== Introduction
54
54
@@ -57,7 +57,7 @@ floating-point type(`float`) to `bfloat16` type and vice versa. The extension
57
57
doesn't add support for `bfloat16` type as such, instead it uses 16-bit integer
58
58
type(`uint16_t`) as a storage for `bfloat16` values.
59
59
60
- The purpose of conversion from float to bfloat16 is to reduce ammount of memory
60
+ The purpose of conversion from float to bfloat16 is to reduce the amount of memory
61
61
required to store floating-point numbers. Computations are expected to be done with
62
62
32-bit floating-point values.
63
63
@@ -73,7 +73,7 @@ command (e.g. from `parallel_for`).
73
73
This extension provides a feature-test macro as described in the core SYCL
74
74
specification section 6.3.3 "Feature test macros". Therefore, an implementation
75
75
supporting this extension must predefine the macro
76
- `SYCL_EXT_INTEL_BF16_CONVERSION ` to one of the values defined in the table
76
+ `SYCL_EXT_ONEAPI_BFLOAT16 ` to one of the values defined in the table
77
77
below. Applications can test for the existence of this macro to determine if
78
78
the implementation supports this feature, or applications can test the macro’s
79
79
value to determine which of the extension’s APIs the implementation supports.
@@ -91,19 +91,19 @@ the implementation supports this feature, or applications can test the macro’s
91
91
namespace sycl {
92
92
enum class aspect {
93
93
...
94
- ext_intel_bf16_conversion
94
+ ext_oneapi_bfloat16
95
95
}
96
96
}
97
97
----
98
98
99
- If a SYCL device has the `ext_intel_bf16_conversion ` aspect, then it natively
99
+ If a SYCL device has the `ext_oneapi_bfloat16 ` aspect, then it natively
100
100
supports conversion of values of `float` type to `bfloat16` and back.
101
101
102
102
If the device doesn't have the aspect, objects of `bfloat16` class must not be
103
103
used in the device code.
104
104
105
- **NOTE**: The `ext_intel_bf16_conversion ` aspect is not yet supported. The
106
- `bfloat16` class is currently supported only on Xe HP GPU.
105
+ **NOTE**: The `ext_oneapi_bfloat16 ` aspect is not yet supported. The
106
+ `bfloat16` class is currently supported only on Xe HP GPU and Nvidia A100 GPU .
107
107
108
108
== New `bfloat16` class
109
109
@@ -115,7 +115,7 @@ mode.
115
115
----
116
116
namespace sycl {
117
117
namespace ext {
118
- namespace intel {
118
+ namespace oneapi {
119
119
namespace experimental {
120
120
121
121
class bfloat16 {
@@ -171,7 +171,7 @@ public:
171
171
};
172
172
173
173
} // namespace experimental
174
- } // namespace intel
174
+ } // namespace oneapi
175
175
} // namespace ext
176
176
} // namespace sycl
177
177
----
@@ -277,9 +277,9 @@ OP is `==, !=, <, >, <=, >=`
277
277
[source]
278
278
----
279
279
#include <sycl/sycl.hpp>
280
- #include <sycl/ext/intel /experimental/bfloat16.hpp>
280
+ #include <sycl/ext/oneapi /experimental/bfloat16.hpp>
281
281
282
- using sycl::ext::intel ::experimental::bfloat16;
282
+ using sycl::ext::oneapi ::experimental::bfloat16;
283
283
284
284
bfloat16 operator+(const bfloat16 &lhs, const bfloat16 &rhs) {
285
285
return static_cast<float>(lhs) + static_cast<float>(rhs);
@@ -304,7 +304,7 @@ int main (int argc, char *argv[]) {
304
304
sycl::queue deviceQueue{dev};
305
305
sycl::buffer<float, 1> buf {data, sycl::range<1> {3}};
306
306
307
- if (dev.has(sycl::aspect::ext_intel_bf16_conversion )) {
307
+ if (dev.has(sycl::aspect::ext_oneapi_bfloat16 )) {
308
308
deviceQueue.submit ([&] (sycl::handler& cgh) {
309
309
auto numbers = buf.get_access<sycl::access::mode::read_write> (cgh);
310
310
cgh.single_task<class simple_kernel> ([=] () {
@@ -332,4 +332,5 @@ None.
332
332
Add operator overloadings +
333
333
Apply code review suggestions
334
334
|3|2021-08-18|Alexey Sotkin |Remove `uint16_t` constructor
335
+ |4|2022-03-07|Aidan Belton and Jack Kirk |Switch from Intel vendor specific to oneapi
335
336
|========================================
0 commit comments