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
* relax error behavior for clSetKernelArgMemPointerINTEL
* also relax error behavior for clSetKernelExecInfo(USM_PTRS)
* add a new issue regarding sub-device accessibility
* a few more wordsmithing fixes
* further clarify what is meant by a valid pointer value
* update XML version to 1.1
Copy file name to clipboardExpand all lines: extensions/cl_intel_unified_shared_memory.asciidoc
+38-27Lines changed: 38 additions & 27 deletions
Original file line number
Diff line number
Diff line change
@@ -52,7 +52,7 @@ Shipping
52
52
== Version
53
53
54
54
Built On: {docdate} +
55
-
Revision: 1.0.0
55
+
Revision: 1.1.0
56
56
57
57
== Dependencies
58
58
@@ -743,9 +743,19 @@ Arguments to the kernel are referred to by indices that go from 0 for the leftmo
743
743
744
744
_arg_value_ is the pointer value that should be used as the argument specified by _arg_index_.
745
745
The pointer value will be used as the argument by all API calls that enqueue a kernel until the argument value is set to a different pointer value by a subsequent call.
746
-
A pointer into Unified Shared Memory allocation may only be set as an argument value for an argument declared to be a pointer to `global` or `constant` memory.
746
+
A pointer may only be set as an argument value for an argument declared to be a pointer to `global` or `constant` memory.
747
+
748
+
[[valid-usm-pointer-argument-definition]]
749
+
The definition of a valid pointer value was changed in extension version 1.1.0:
750
+
751
+
* For extension versions prior to version 1.1.0:
747
752
For devices supporting shared system allocations, any pointer value is valid.
748
753
Otherwise, the pointer value must be `NULL` or must point into a Unified Shared Memory allocation returned by *clHostMemAllocINTEL*, *clDeviceMemAllocINTEL*, or *clSharedMemAllocINTEL*.
754
+
* For extension versions 1.1.0 and newer:
755
+
For all devices, any pointer value is valid and may be set as an argument to a kernel.
756
+
757
+
In this definition, a valid pointer value means that the function will not return an error.
758
+
It still may not be valid to dereference the pointer inside of a kernel if the memory that the pointer points to is not accessible on the device.
749
759
750
760
*clSetKernelArgMemPointerINTEL* returns `CL_SUCCESS` if the function is executed successfully.
751
761
Otherwise, it will return one of the following errors:
@@ -795,6 +805,8 @@ The following errors may be returned by *clSetKernelExecInfo* for these new _par
795
805
* `CL_INVALID_OPERATION` if _param_name_ is `CL_KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL` and no devices in the context associated with _kernel_ support device Unified Shared Memory allocations.
796
806
* `CL_INVALID_OPERATION` if _param_name_ is `CL_KERNEL_EXEC_INFO_INDIRECT_SHARED_ACCESS_INTEL` and no devices in the context associated with _kernel_ support shared Unified Shared Memory allocations.
797
807
808
+
The <<valid-usm-pointer-argument-definition,definition of a valid pointer value>> specified using `CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL` was changed in extension version 1.1.0.
809
+
798
810
==== Filling and Copying Unified Shared Memory
799
811
800
812
The function
@@ -1243,21 +1255,27 @@ Note that some flags will not be valid, such as `CL_MEM_USE_HOST_PTR`.
1243
1255
. Should it be an error to set an unknown pointer as a kernel argument using *clSetKernelArgMemPointerINTEL* if no devices support shared system allocations?
1244
1256
+
1245
1257
--
1246
-
*UNRESOLVED*:
1247
-
Returning an error for an unknown pointer is helpful to identify and diagnose possible programming errors sooner, but passing a pointer to arbitrary memory to a function on the host is not an error until the pointer is dereferenced.
1258
+
`RESOLVED`:
1259
+
The behavior of *clSetKernelArgMemPointerINTEL* was changed in version 1.1.0 of this extension.
1260
+
1261
+
Prior to version 1.1.0, it was considered an error to set an arbitrary pointer value as an argument to a kernel if no devices support system USM.
1262
+
This was helpful to identify possible programming errors, however it did not match the behavior of passing a pointer to a function on the host, where it is only a programming error if an invalid pointer is dereferenced.
1263
+
To provide a similar programming experience, the error condition was relaxed in version 1.1.0, and any arbitrary pointer value may be passed to a kernel.
1248
1264
1249
-
If we relax the error condition for *clSetKernelArgMemPointerINTEL* then we could also consider relaxing the error condition for *clSetKernelExecInfo*(`CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL`) similarly.
1265
+
The behavior was also changed for *clSetKernelExecInfo*(`CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL`), similarly.
1250
1266
1251
-
Note that if the error condition is removed we can still check for possible programming errors via optional USM checking layers, such as the https://github.com/intel/opencl-intercept-layer/blob/master/docs/controls.md#usmchecking-bool[USMChecking] functionality in the https://github.com/intel/opencl-intercept-layer[OpenCL Intercept Layer].
1267
+
If desired, additional checks to identify possible programming errors may still be provided via optional USM checking layers, such as the https://github.com/intel/opencl-intercept-layer/blob/master/docs/controls.md#usmchecking-bool[USMChecking] functionality in the https://github.com/intel/opencl-intercept-layer[OpenCL Intercept Layer].
1252
1268
--
1253
1269
1254
-
. Should we support a "rect" memcpy similar to *clEnqueueCopyBufferRect*?
1270
+
. Should we support a 2D "rect" memcpy similar to *clEnqueueCopyBufferRect*?
1255
1271
+
1256
1272
--
1257
1273
*UNRESOLVED*:
1258
1274
This would be a fairly straightforward addition if it is useful.
1259
1275
1260
-
Note that there is no similar SVM "rect" memcpy.
1276
+
Note that there is no similar 2D "rect" memcpy for SVM.
1277
+
1278
+
We could also support a 2D "rect" fill or memset, though there are no similar functions for `cl_mem` buffers or SVM.
1261
1279
--
1262
1280
1263
1281
. Should there be an upper limit on the size of an allocation using *clHostMemAllocINTEL*?
@@ -1301,35 +1319,28 @@ Possible resolutions:
1301
1319
* Do nothing and keep the existing error behavior.
1302
1320
--
1303
1321
1322
+
. Can a device USM allocation for a parent device be accessed by its sub-devices?
1323
+
Can a single device shared USM allocation associated with a parent device be accessed by its sub-devices?
1324
+
+
1325
+
--
1326
+
*UNRESOLVED*:
1327
+
Since a sub-device is a partition of a parent device a USM allocation against a parent device should be accessible by its sub-devices.
1328
+
We could document this expectation explicitly in this extension if it is not already covered by the main OpenCL specification.
1329
+
1330
+
Note that a USM allocation against a sub-device need not be accessible by its parent device or by other sibling sub-devices, though some implementations may support this, just like some implementations optionally support access to USM allocations from other devices.
1331
+
--
1332
+
1304
1333
== Revision History
1305
1334
1306
1335
[cols="5,15,15,70"]
1307
1336
[grid="rows"]
1308
1337
[options="header"]
1309
1338
|========================================
1310
1339
|Rev|Date|Author|Changes
1311
-
|A|2019-01-18|Ben Ashbaugh|*Initial revision*
1312
-
|B|2019-03-25|Ben Ashbaugh|Minor name changes.
1313
-
|C|2019-06-18|Ben Ashbaugh|Moved flags argument into properties.
1314
-
|D|2019-07-19|Ben Ashbaugh|Editorial fixes.
1315
-
|E|2019-07-22|Ben Ashbaugh|Allocation properties should be const.
1316
-
|F|2019-07-26|Ben Ashbaugh|Removed DEFAULT mem alloc flag.
1317
-
|G|2019-08-23|Ben Ashbaugh|Added mem alloc query for associated device.
1318
-
|H|2019-10-11|Ben Ashbaugh|Added initial list and description of error codes.
1319
-
|I|2019-11-14|Ben Ashbaugh|Switched from a memset to a memfill API.
1320
-
|J|2019-11-18|Ben Ashbaugh|Updated a few more error conditions.
0 commit comments