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
#define CL_MEM_ALLOC_INFO_TBD0_INTEL 0x419D /* reserved for future */
219
-
#define CL_MEM_ALLOC_INFO_TBD1_INTEL 0x419E /* reserved for future */
220
-
#define CL_MEM_ALLOC_INFO_TBD2_INTEL 0x419F /* reserved for future */
217
+
#define CL_MEM_ALLOC_INFO_DEVICE_INTEL 0x419D
218
+
/* CL_MEM_ALLOC_FLAGS_INTEL - defined above */
219
+
#define CL_MEM_ALLOC_INFO_TBD0_INTEL 0x419E /* reserved for future */
220
+
#define CL_MEM_ALLOC_INFO_TBD1_INTEL 0x419F /* reserved for future */
221
221
----
222
222
223
223
Enumeration type and values describing the type of Unified Shared Memory allocation. Returned by *clGetMemAllocInfoINTEL* when _param_name_ is `CL_MEM_ALLOC_TYPE_INTEL`:
allocates Unified Shared Memory with shared ownership between the host and the specified OpenCL device.
509
-
If the specified OpenCL device supports cross-device access capabilities, the allocation is also accessible to other OpenCL devices in the context that have the same cross-device access capabilities.
509
+
If the specified OpenCL device supports cross-device access capabilities, the allocation is also accessible by other OpenCL devices in the context that have the same cross-device access capabilities.
510
510
511
511
_context_ is a valid OpenCL context used to allocate the Unified Shared Memory.
512
512
513
-
_device_ is a valid OpenCL device ID to associate with the allocation.
513
+
_device_ is an optional OpenCL device ID to associate with the allocation.
514
+
If _device_ is `NULL` then the allocation is not associated with any device.
515
+
Allocations with no associated device are accessible by the host and OpenCL devices in the context that have cross-device access capabilities.
514
516
515
517
_properties_ is an optional list of allocation properties and their corresponding values.
516
518
The list is terminated with the special property `0`.
@@ -575,9 +577,6 @@ The table below describes allocation properties that may be passed to control al
575
577
| Flags specifying allocation and usage information.
576
578
This is a bitfield type that may be set to any combination of the following values:
577
579
578
-
`CL_MEM_ALLOC_DEFAULT_INTEL`:
579
-
Use the default allocation behavior.
580
-
581
580
`CL_MEM_ALLOC_WRITE_COMBINED_INTEL`:
582
581
Request write combined (WC) memory.
583
582
Write combined memory may improve performance in some cases, however write combined memory must be used with care since it may hurt performance in other cases or use different coherency protocols than non-write combined memory.
@@ -605,7 +604,6 @@ _context_ is a valid OpenCL context to query for information about the Unified S
605
604
606
605
_ptr_ is a pointer into a Unified Shared Memory allocation to query.
607
606
_ptr_ need not be a value returned by *clHostMemAllocINTEL*, *clDeviceMemAllocINTEL*, or *clSharedMemAllocINTEL*, but the query may be faster if it is.
608
-
TBD: What if _ptr_ is `NULL` or is not a pointer into a Unified Shared Memory allocation?
609
607
610
608
_param_name_ specifies the information to query.
611
609
The list of supported _param_name_ values and the information returned in _param_value_ is described in the <<cl_mem_info_intel,Unified Memory Allocation Queries>> table.
@@ -637,17 +635,28 @@ Otherwise, it will return one of the following error values:
637
635
Returns `CL_MEM_TYPE_HOST_INTEL` for allocations made by *clHostMemAllocINTEL* .
638
636
Returns `CL_MEM_TYPE_DEVICE_INTEL` for allocations made by *clDeviceMemAllocINTEL*.
639
637
Returns `CL_MEM_TYPE_SHARED_INTEL` for allocations made by *clSharedMemAllocINTEL*.
640
-
Returns `CL_MEM_TYPE_UNKNOWN_INTEL` if the type of the Unified Shared Memory allocation cannot be determined, or if _ptr_ does not point into a Unified Shared Memory Allocation.
641
-
| `CL_MEM_ALLOC_FLAGS_INTEL`
642
-
| cl_mem_alloc_flags_intel
643
-
| Returns allocation flags for the Unified Shared Memory allocation.
638
+
Returns `CL_MEM_TYPE_UNKNOWN_INTEL` if the type of the Unified Shared Memory allocation cannot be determined or if _ptr_ does not point into a Unified Shared Memory allocation.
644
639
| `CL_MEM_ALLOC_BASE_PTR_INTEL`
645
640
| void*
646
641
| Returns the base address of the Unified Shared Memory allocation.
642
+
643
+
Returns `NULL` for `CL_MEM_TYPE_UNKNOWN_INTEL` allocations.
647
644
| `CL_MEM_ALLOC_SIZE_INTEL`
648
645
| size_t
649
646
| Returns the size in bytes of the Unified Shared Memory allocation.
650
647
648
+
Returns `0` for `CL_MEM_TYPE_UNKNOWN_INTEL` allocations.
649
+
| `CL_MEM_ALLOC_DEVICE_INTEL`
650
+
| cl_device_id
651
+
| Returns the device associated with the Unified Shared Memory allocation.
652
+
653
+
Returns `NULL` for `CL_MEM_TYPE_HOST_INTEL` allocations, for `CL_MEM_TYPE_SHARED_INTEL` allocations with no associated device, and for `CL_MEM_TYPE_UNKNOWN_INTEL` allocations.
654
+
| `CL_MEM_ALLOC_FLAGS_INTEL`
655
+
| cl_mem_alloc_flags_intel
656
+
| Returns allocation flags for the Unified Shared Memory allocation.
657
+
658
+
Returns `0` if no allocation flags were specified for the Unified Shared Memory allocation and for `CL_MEM_TYPE_UNKNOWN_INTEL` allocations.
659
+
651
660
|====
652
661
653
662
==== Using Unified Shared Memory with Kernels
@@ -952,10 +961,8 @@ The _flags_ argument was folded into the _properties_ in revision C.
952
961
. What should behavior be for `clGetMemAllocInfoINTEL` if the passed-in _ptr_ is `NULL` or doesn't point into a USM allocation?
953
962
+
954
963
--
955
-
*UNRESOLVED*:
956
-
This could be an error, either `CL_INVALID_MEM_OBJECT` or some new error code.
957
-
This could be valid when querying for `CL_MEM_ALLOC_TYPE_INTEL` (returning `CL_MEM_TYPE_UNKNOWN_INTEL`), but an error for other queries.
958
-
We could spec behavior for all queries, meaning this is not an error.
964
+
`RESOLVED`:
965
+
The behavior was defined for all queries for this case in revision G.
959
966
--
960
967
961
968
. Do we want separate "memset" APIs to set to different sized "value", such as 8-bits, 16-bits?, 32-bits, or others? Do we want to go back to a "fill" API?
@@ -1010,14 +1017,27 @@ This depends how frequently the migrate APIs are called.
1010
1017
. Could the _device_ argument to *clSharedMemAllocINTEL* be `NULL` if there is no need to associate the shared allocation to a specific device?
1011
1018
+
1012
1019
--
1013
-
*UNRESOLVED*:
1020
+
`RESOLVED`:
1021
+
Yes, this case is documented in revision G.
1014
1022
--
1015
1023
1016
1024
. Should we allow querying the associated device for a USM allocation using *clGetMemAllocInfoINTEL*?
1017
1025
+
1018
1026
--
1027
+
`RESOLVED`:
1028
+
This query was added in revision G.
1029
+
--
1030
+
1031
+
. Should we add explicit mem alloc flags for `CACHED` and `UNCACHED`?
1032
+
+
1033
+
--
1034
+
*UNRESOLVED*:
1035
+
--
1036
+
1037
+
. At least for HOST and SHARED allocations, should have separate mem alloc flags for the host and the device?
1038
+
+
1039
+
--
1019
1040
*UNRESOLVED*:
1020
-
If we added this we'd need to specify what happens for host allocations or shared allocations with no associated device.
1021
1041
--
1022
1042
1023
1043
== TODO
@@ -1040,6 +1060,8 @@ If we added this we'd need to specify what happens for host allocations or share
1040
1060
|C|2019-06-18|Ben Ashbaugh|Moved flags argument into properties.
1041
1061
|D|2019-07-19|Ben Ashbaugh|Editorial fixes.
1042
1062
|E|2019-07-22|Ben Ashbaugh|Allocation properties should be const.
1063
+
|F|2019-07-26|Ben Ashbaugh|Removed DEFAULT mem alloc flag.
1064
+
|G|2019-08-23|Ben Ashbaugh|Added mem alloc query for associated device.
0 commit comments