Skip to content

Commit bc2bbfa

Browse files
committed
Follow new spec template
--------------------------------- 1. remove ipmlemetation details 2. rename extension 3. fix feature test macro to have same name 4. fix name space to be in sycl::ext::intel::experimental::property::usm
1 parent 9737bb4 commit bc2bbfa

File tree

1 file changed

+71
-63
lines changed

1 file changed

+71
-63
lines changed

sycl/doc/extensions/experimental/sycl_ext_intel_runtime_buffer_location.asciidoc

Lines changed: 71 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,109 +1,117 @@
1-
= SYCL_INTEL_usm_runtime_properties
1+
= sycl_ext_intel_runtime_buffer_location
22

3-
== Introduction
4-
IMPORTANT: This specification is a draft.
3+
:source-highlighter: coderay
4+
:coderay-linenums-mode: table
55

6-
NOTE: 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.
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++]
713

8-
NOTE: This document is better viewed when rendered as html with asciidoctor. GitHub does not render image icons.
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}
918

10-
NOTE: This serves as a temporary workaround for usm allocation to accept buffer location properties, and the formal solution may change in the future.
19+
== Notice
1120

12-
This document propose a new buffer_location runtime property that can be passed to `malloc_device`.
21+
[%hardbreaks]
22+
Copyright (C) 2022-2022 Intel Corporation. All rights reserved.
1323

14-
== Name Strings
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.
1527

16-
+SYCL_INTEL_runtime_buffer_location+
28+
== Contact
1729

18-
== Contributors
19-
Aditi Kumaraswamy, Intel +
20-
Gregory Lueck, Intel +
21-
Joe Garvey, Intel +
22-
Sherry Yuan, Intel +
23-
Steffen Larsen, Intel
30+
To report problems with this extension, please open a new issue at:
2431

25-
== Notice
32+
https://github.com/intel/llvm/issues
2633

27-
Copyright (c) 2020 Intel Corporation. All rights reserved.
34+
== Dependencies
2835

29-
== Status
36+
This extension is written against the SYCL 2020 revision 4 specification. All
37+
references below to the "core SYCL specification" or to section numbers in the
38+
SYCL specification refer to that revision.
3039

31-
Working Draft
32-
33-
This is a preview extension specification, intended to provide early access to a feature for review and community feedback. When the feature matures, this specification may be released as a formal extension.
34-
35-
Because the interfaces defined by this specification are not final and are subject to change they are not intended to be used by shipping software products.
40+
== Status
41+
This is an experimental extension specification, intended to provide early
42+
access to features and gather community feedback. Interfaces defined in this
43+
specification are implemented in {dpcpp}, but they are not finalized and may
44+
change incompatibly in future versions of {dpcpp} without prior notice.
45+
*Shipping software products should not rely on APIs defined in this
46+
specification.*
3647

37-
== Version
48+
[NOTE]
49+
====
50+
This extension is currently implemented in {dpcpp} only for FPGA devices. Attempting to use this extension on other devices or backends may result in no effect.
3851
39-
Built On: {docdate} +
40-
Revision: 1
52+
This serves as a temporary workaround for usm allocation to accept buffer location properties, and the formal solution will come in the future.
53+
====
4154

4255
== Overview
4356

44-
This spec describes the solution of passing runtime buffer location properties to malloc APIs, specifically `malloc_device`.
57+
This document propose a new buffer_location runtime property that can be passed to `malloc_device`.
4558

4659
On targets that provide more than one type of global memory, this provide users the flexibility of choosing which memory the device usm should be allocated to.
4760

4861
This information is not a hint; it is a functional requirement of the program that must be respected.
4962

63+
== Specification
64+
65+
=== Feature test macro
66+
67+
This extension provides a feature-test macro as described in the core SYCL
68+
specification. An implementation supporting this extension must predefine the
69+
macro `SYCL_EXT_INTEL_RUNTIME_BUFFER_LOCATION` to one of the values defined in the table
70+
below. Applications can test for the existence of this macro to determine if
71+
the implementation supports this feature, or applications can test the macro's
72+
value to determine which of the extension's features the implementation
73+
supports.
74+
75+
[%header,cols="1,5"]
76+
|===
77+
|Value
78+
|Description
79+
80+
|1
81+
|The APIs of this experimental extension are not versioned, so the
82+
feature-test macro always has this value.
83+
|===
84+
5085
== Examples
5186

5287
[source,c++]
5388
----
5489
array = (int *)malloc_device<int>(
5590
N * sizeof(int), q,
56-
property_list{property::buffer::detail::buffer_location(2)});
91+
property_list{sycl::ext::intel::experimental::property::usm::buffer_location(2)});
5792
5893
sycl::queue q;
5994
q.parallel_for(range<1>(N), [=] (id<1> i){
6095
data[i] *= 2;
6196
}).wait();
6297
----
6398

64-
== Proposal
65-
66-
=== Feature test macro
67-
68-
This extension provides a feature-test macro as described in the core SYCL
69-
specification, Section 6.3.3 "Feature test macros". Therefore, an
70-
implementation supporting this extension must predefine the macro
71-
`SYCL_EXT_ONEAPI_RUNTIME_BUFFER_LOCATION` to one of the values defined in the table below.
72-
Applications can test for the existence of this macro to determine if the
73-
implementation supports this feature, or applications can test the macro's
74-
value to determine which of the extension's features
75-
that the implementation supports.
76-
77-
[%header,cols="1,5"]
78-
|===
79-
|Value |Description
80-
|1 |Initial extension version
81-
|===
8299

83100
=== Changes to runtime properties
84101

85102
To pass the runtime properties into malloc API, a new buffer properties is introduced.
86103

87104
[source,c++]
88105
----
89-
namespace sycl {
90-
namespace property {
91-
namespace buffer {
92-
namespace detail {
93-
class buffer_location
94-
: public sycl::detail::PropertyWithData<
95-
sycl::detail::PropWithDataKind::AccPropBufferLocation> {
96-
public:
97-
buffer_location(uint64_t Location) : MLocation(Location) {}
98-
uint64_t get_buffer_location() const { return MLocation; }
99-
100-
private:
101-
uint64_t MLocation;
106+
namespace sycl::ext::intel::experimental::property::usm {
107+
108+
class buffer_location {
109+
public:
110+
buffer_location(int location);
111+
int get_buffer_location() const;
102112
};
103-
} // namespace detail
104-
} // namespace buffer
105-
} // namespace property
106-
} // namespace sycl
113+
114+
} // namespace sycl::ext::intel::experimental::property::usm
107115
----
108116

109117
== Issues

0 commit comments

Comments
 (0)