You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// The compile time property is passed to template arguments of annotated_ptr, and runtime properties are passed to
98
-
auto data = malloc_device(N, q, properties);
116
+
// The compile time property is passed to template arguments of annotated_ptr
117
+
auto data = sycl::ext::oneapi::experimental::malloc_device(N, q, properties);
118
+
// data is of type annotated_ptr<void*, property_list_t<some_compile_time_prop<1>>>
99
119
100
-
auto data2 = malloc_device<int>(N, q, properties);
101
-
// data2 is of type annotated_ptr<int*, property_list_t<sycl::ext::intel::buffer_location<1>>>
120
+
auto data2 = sycl::ext::oneapi::experimental::malloc_device<int>(N, q, properties);
121
+
// data2 is of type annotated_ptr<int*, property_list_t<some_compile_time_prop<1>>>
102
122
103
123
sycl::queue q;
104
124
q.parallel_for(range<1>(N), [=] (id<1> i){
105
125
data2[i] *= 2;
106
126
}).wait();
107
127
----
108
128
109
-
`buffer_location` property is defined as a part of `SYCL_INTEL_buffer_location` extension. Once passed in, buffer_location property is passed onto runtime libraries, and is available as template arguments for annotated_ptr.
110
-
111
-
== Proposal
112
-
113
-
=== Feature test macro
114
-
115
-
This extension provides a feature-test macro as described in the core SYCL
116
-
specification, Section 6.3.3 "Feature test macros". Therefore, an
117
-
implementation supporting this extension must predefine the macro
118
-
`SYCL_EXT_ONEAPI_USM_PROPERTIES` to one of the values defined in the table below.
119
-
Applications can test for the existence of this macro to determine if the
120
-
implementation supports this feature, or applications can test the macro's
121
-
value to determine which of the extension's features
122
-
that the implementation supports.
123
-
124
-
[%header,cols="1,5"]
125
-
|===
126
-
|Value |Description
127
-
|1 |Initial extension version
128
-
|===
129
-
130
129
131
130
=== New USM allocation APIs
132
131
@@ -162,22 +161,8 @@ The same setup is applied to other overloads of malloc APIs.
162
161
163
162
Compile time properties can be pass into runtime properties within the allocation function.
164
163
165
-
The table below describes the effects of associating each properties with each malloc function.
166
-
167
-
|===
168
-
|Property|Description
169
-
170
-
|`buffer_location`
171
-
|The `buffer_location` property adds the requirement that the memory must be
172
-
allocated to the specified memory location as defined in `SYCL_INTEL_buffer_location` extension.
173
-
With `malloc_device` the returned device memory pointer must belong to the specified memory location.
174
-
with `malloc_shared`, memory must implicitly migrate to the specified memory location.
175
-
176
-
|===
164
+
The returned `annotated_ptr` contains the USM pointers and the passed in compile-time properties to enable additional compiler optimizations.
177
165
178
-
SYCL implementations may introduce additional properties. If any
179
-
combinations of properties are invalid, this must be clearly documented
0 commit comments