Skip to content

Commit 6fb8e26

Browse files
authored
Merge pull request #287 from veselypeta/petr/248/release-retain
[ur] CTS release/retain tests increment reference counts
2 parents a3f4258 + 28987ad commit 6fb8e26

File tree

19 files changed

+289
-78
lines changed

19 files changed

+289
-78
lines changed

include/ur.py

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,13 @@ class ur_rect_region_t(Structure):
250250
###############################################################################
251251
## @brief Supported context info
252252
class ur_context_info_v(IntEnum):
253-
NUM_DEVICES = 1 ## [uint32_t] The number of the devices in the context
254-
DEVICES = 2 ## [::ur_context_handle_t...] The array of the device handles in the
253+
NUM_DEVICES = 0 ## [uint32_t] The number of the devices in the context
254+
DEVICES = 1 ## [::ur_context_handle_t...] The array of the device handles in the
255255
## context
256+
REFERENCE_COUNT = 2 ## [uint32_t] Reference count of the context object.
257+
## The reference count returned should be considered immediately stale.
258+
## It is unsuitable for general use in applications. This feature is
259+
## provided for identifying memory leaks.
256260
USM_MEMCPY2D_SUPPORT = 3 ## [bool] to indicate if the ::urEnqueueUSMMemcpy2D entrypoint is
257261
## supported.
258262
USM_FILL2D_SUPPORT = 4 ## [bool] to indicate if the ::urEnqueueUSMFill2D entrypoint is
@@ -357,7 +361,10 @@ class ur_event_info_v(IntEnum):
357361
CONTEXT = 1 ## [::ur_context_handle_t] Context information of an event object
358362
COMMAND_TYPE = 2 ## [::ur_command_t] Command type information of an event object
359363
COMMAND_EXECUTION_STATUS = 3 ## [::ur_event_status_t] Command execution status of an event object
360-
REFERENCE_COUNT = 4 ## [uint32_t] Reference count of an event object
364+
REFERENCE_COUNT = 4 ## [uint32_t] Reference count of the event object.
365+
## The reference count returned should be considered immediately stale.
366+
## It is unsuitable for general use in applications. This feature is
367+
## provided for identifying memory leaks.
361368

362369
class ur_event_info_t(c_int):
363370
def __str__(self):
@@ -562,7 +569,10 @@ class ur_queue_info_v(IntEnum):
562569
## device.
563570
PROPERTIES = 3 ## ::ur_queue_flags_t: the properties associated with
564571
## ::UR_QUEUE_PROPERTIES_FLAGS.
565-
REFERENCE_COUNT = 4 ## Queue reference count
572+
REFERENCE_COUNT = 4 ## [uint32_t] Reference count of the queue object.
573+
## The reference count returned should be considered immediately stale.
574+
## It is unsuitable for general use in applications. This feature is
575+
## provided for identifying memory leaks.
566576
SIZE = 5 ## uint32_t: The size of the queue
567577

568578
class ur_queue_info_t(c_int):
@@ -605,7 +615,10 @@ def __str__(self):
605615
###############################################################################
606616
## @brief Get sample object information
607617
class ur_sampler_info_v(IntEnum):
608-
REFERENCE_COUNT = 0 ## Sampler reference count info
618+
REFERENCE_COUNT = 0 ## [uint32_t] Reference count of the sampler object.
619+
## The reference count returned should be considered immediately stale.
620+
## It is unsuitable for general use in applications. This feature is
621+
## provided for identifying memory leaks.
609622
CONTEXT = 1 ## Sampler context info
610623
NORMALIZED_COORDS = 2 ## Sampler normalized coordindate setting
611624
ADDRESSING_MODE = 3 ## Sampler addressing mode setting
@@ -777,7 +790,10 @@ class ur_device_info_v(IntEnum):
777790
QUEUE_ON_HOST_PROPERTIES = 61 ## ::ur_queue_flags_t: host queue property bit-field
778791
BUILT_IN_KERNELS = 62 ## char[]: a semi-colon separated list of built-in kernels
779792
PLATFORM = 63 ## ::ur_platform_handle_t: the platform associated with the device
780-
REFERENCE_COUNT = 64 ## uint32_t: reference count
793+
REFERENCE_COUNT = 64 ## [uint32_t] Reference count of the device object.
794+
## The reference count returned should be considered immediately stale.
795+
## It is unsuitable for general use in applications. This feature is
796+
## provided for identifying memory leaks.
781797
IL_VERSION = 65 ## char[]: IL version
782798
NAME = 66 ## char[]: Device name
783799
VENDOR = 67 ## char[]: Device vendor
@@ -942,7 +958,10 @@ def __str__(self):
942958
class ur_kernel_info_v(IntEnum):
943959
FUNCTION_NAME = 0 ## Return Kernel function name, return type char[]
944960
NUM_ARGS = 1 ## Return Kernel number of arguments
945-
REFERENCE_COUNT = 2 ## Return Kernel reference count
961+
REFERENCE_COUNT = 2 ## [uint32_t] Reference count of the kernel object.
962+
## The reference count returned should be considered immediately stale.
963+
## It is unsuitable for general use in applications. This feature is
964+
## provided for identifying memory leaks.
946965
CONTEXT = 3 ## Return Context object associated with Kernel
947966
PROGRAM = 4 ## Return Program object associated with Kernel
948967
ATTRIBUTES = 5 ## Return Kernel attributes, return type char[]
@@ -1090,7 +1109,10 @@ class ur_program_properties_t(Structure):
10901109
###############################################################################
10911110
## @brief Get Program object information
10921111
class ur_program_info_v(IntEnum):
1093-
REFERENCE_COUNT = 0 ## Program reference count info
1112+
REFERENCE_COUNT = 0 ## [uint32_t] Reference count of the program object.
1113+
## The reference count returned should be considered immediately stale.
1114+
## It is unsuitable for general use in applications. This feature is
1115+
## provided for identifying memory leaks.
10941116
CONTEXT = 1 ## Program context info
10951117
NUM_DEVICES = 2 ## Return number of devices associated with Program
10961118
DEVICES = 3 ## Return list of devices associated with Program, return type

include/ur_api.h

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -340,9 +340,13 @@ urContextRetain(
340340
///////////////////////////////////////////////////////////////////////////////
341341
/// @brief Supported context info
342342
typedef enum ur_context_info_t {
343-
UR_CONTEXT_INFO_NUM_DEVICES = 1, ///< [uint32_t] The number of the devices in the context
344-
UR_CONTEXT_INFO_DEVICES = 2, ///< [::ur_context_handle_t...] The array of the device handles in the
343+
UR_CONTEXT_INFO_NUM_DEVICES = 0, ///< [uint32_t] The number of the devices in the context
344+
UR_CONTEXT_INFO_DEVICES = 1, ///< [::ur_context_handle_t...] The array of the device handles in the
345345
///< context
346+
UR_CONTEXT_INFO_REFERENCE_COUNT = 2, ///< [uint32_t] Reference count of the context object.
347+
///< The reference count returned should be considered immediately stale.
348+
///< It is unsuitable for general use in applications. This feature is
349+
///< provided for identifying memory leaks.
346350
UR_CONTEXT_INFO_USM_MEMCPY2D_SUPPORT = 3, ///< [bool] to indicate if the ::urEnqueueUSMMemcpy2D entrypoint is
347351
///< supported.
348352
UR_CONTEXT_INFO_USM_FILL2D_SUPPORT = 4, ///< [bool] to indicate if the ::urEnqueueUSMFill2D entrypoint is
@@ -1660,7 +1664,10 @@ typedef enum ur_event_info_t {
16601664
UR_EVENT_INFO_CONTEXT = 1, ///< [::ur_context_handle_t] Context information of an event object
16611665
UR_EVENT_INFO_COMMAND_TYPE = 2, ///< [::ur_command_t] Command type information of an event object
16621666
UR_EVENT_INFO_COMMAND_EXECUTION_STATUS = 3, ///< [::ur_event_status_t] Command execution status of an event object
1663-
UR_EVENT_INFO_REFERENCE_COUNT = 4, ///< [uint32_t] Reference count of an event object
1667+
UR_EVENT_INFO_REFERENCE_COUNT = 4, ///< [uint32_t] Reference count of the event object.
1668+
///< The reference count returned should be considered immediately stale.
1669+
///< It is unsuitable for general use in applications. This feature is
1670+
///< provided for identifying memory leaks.
16641671
/// @cond
16651672
UR_EVENT_INFO_FORCE_UINT32 = 0x7fffffff
16661673
/// @endcond
@@ -2374,7 +2381,10 @@ typedef enum ur_queue_info_t {
23742381
///< device.
23752382
UR_QUEUE_INFO_PROPERTIES = 3, ///< ::ur_queue_flags_t: the properties associated with
23762383
///< ::UR_QUEUE_PROPERTIES_FLAGS.
2377-
UR_QUEUE_INFO_REFERENCE_COUNT = 4, ///< Queue reference count
2384+
UR_QUEUE_INFO_REFERENCE_COUNT = 4, ///< [uint32_t] Reference count of the queue object.
2385+
///< The reference count returned should be considered immediately stale.
2386+
///< It is unsuitable for general use in applications. This feature is
2387+
///< provided for identifying memory leaks.
23782388
UR_QUEUE_INFO_SIZE = 5, ///< uint32_t: The size of the queue
23792389
/// @cond
23802390
UR_QUEUE_INFO_FORCE_UINT32 = 0x7fffffff
@@ -2647,7 +2657,10 @@ urQueueFlush(
26472657
///////////////////////////////////////////////////////////////////////////////
26482658
/// @brief Get sample object information
26492659
typedef enum ur_sampler_info_t {
2650-
UR_SAMPLER_INFO_REFERENCE_COUNT = 0, ///< Sampler reference count info
2660+
UR_SAMPLER_INFO_REFERENCE_COUNT = 0, ///< [uint32_t] Reference count of the sampler object.
2661+
///< The reference count returned should be considered immediately stale.
2662+
///< It is unsuitable for general use in applications. This feature is
2663+
///< provided for identifying memory leaks.
26512664
UR_SAMPLER_INFO_CONTEXT = 1, ///< Sampler context info
26522665
UR_SAMPLER_INFO_NORMALIZED_COORDS = 2, ///< Sampler normalized coordindate setting
26532666
UR_SAMPLER_INFO_ADDRESSING_MODE = 3, ///< Sampler addressing mode setting
@@ -3164,7 +3177,10 @@ typedef enum ur_device_info_t {
31643177
UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES = 61, ///< ::ur_queue_flags_t: host queue property bit-field
31653178
UR_DEVICE_INFO_BUILT_IN_KERNELS = 62, ///< char[]: a semi-colon separated list of built-in kernels
31663179
UR_DEVICE_INFO_PLATFORM = 63, ///< ::ur_platform_handle_t: the platform associated with the device
3167-
UR_DEVICE_INFO_REFERENCE_COUNT = 64, ///< uint32_t: reference count
3180+
UR_DEVICE_INFO_REFERENCE_COUNT = 64, ///< [uint32_t] Reference count of the device object.
3181+
///< The reference count returned should be considered immediately stale.
3182+
///< It is unsuitable for general use in applications. This feature is
3183+
///< provided for identifying memory leaks.
31683184
UR_DEVICE_INFO_IL_VERSION = 65, ///< char[]: IL version
31693185
UR_DEVICE_INFO_NAME = 66, ///< char[]: Device name
31703186
UR_DEVICE_INFO_VENDOR = 67, ///< char[]: Device vendor
@@ -3647,7 +3663,10 @@ urKernelSetArgLocal(
36473663
typedef enum ur_kernel_info_t {
36483664
UR_KERNEL_INFO_FUNCTION_NAME = 0, ///< Return Kernel function name, return type char[]
36493665
UR_KERNEL_INFO_NUM_ARGS = 1, ///< Return Kernel number of arguments
3650-
UR_KERNEL_INFO_REFERENCE_COUNT = 2, ///< Return Kernel reference count
3666+
UR_KERNEL_INFO_REFERENCE_COUNT = 2, ///< [uint32_t] Reference count of the kernel object.
3667+
///< The reference count returned should be considered immediately stale.
3668+
///< It is unsuitable for general use in applications. This feature is
3669+
///< provided for identifying memory leaks.
36513670
UR_KERNEL_INFO_CONTEXT = 3, ///< Return Context object associated with Kernel
36523671
UR_KERNEL_INFO_PROGRAM = 4, ///< Return Program object associated with Kernel
36533672
UR_KERNEL_INFO_ATTRIBUTES = 5, ///< Return Kernel attributes, return type char[]
@@ -4535,7 +4554,10 @@ urProgramGetFunctionPointer(
45354554
///////////////////////////////////////////////////////////////////////////////
45364555
/// @brief Get Program object information
45374556
typedef enum ur_program_info_t {
4538-
UR_PROGRAM_INFO_REFERENCE_COUNT = 0, ///< Program reference count info
4557+
UR_PROGRAM_INFO_REFERENCE_COUNT = 0, ///< [uint32_t] Reference count of the program object.
4558+
///< The reference count returned should be considered immediately stale.
4559+
///< It is unsuitable for general use in applications. This feature is
4560+
///< provided for identifying memory leaks.
45394561
UR_PROGRAM_INFO_CONTEXT = 1, ///< Program context info
45404562
UR_PROGRAM_INFO_NUM_DEVICES = 2, ///< Return number of devices associated with Program
45414563
UR_PROGRAM_INFO_DEVICES = 3, ///< Return list of devices associated with Program, return type

scripts/core/context.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,19 @@ class: $xContext
6565
name: $x_context_info_t
6666
etors:
6767
- name: NUM_DEVICES
68-
value: "1"
6968
desc: "[uint32_t] The number of the devices in the context"
7069
- name: DEVICES
71-
value: "2"
7270
desc: "[$x_context_handle_t...] The array of the device handles in the context"
71+
- name: REFERENCE_COUNT
72+
desc: |
73+
[uint32_t] Reference count of the context object.
74+
The reference count returned should be considered immediately stale.
75+
It is unsuitable for general use in applications. This feature is provided for identifying memory leaks.
7376
- name: USM_MEMCPY2D_SUPPORT
74-
value: "3"
7577
desc: "[bool] to indicate if the $xEnqueueUSMMemcpy2D entrypoint is supported."
7678
- name: USM_FILL2D_SUPPORT
77-
value: "4"
7879
desc: "[bool] to indicate if the $xEnqueueUSMFill2D entrypoint is supported."
7980
- name: USM_MEMSET2D_SUPPORT
80-
value: "5"
8181
desc: "[bool] to indicate if the $xEnqueueUSMMemset2D entrypoint is supported."
8282
--- #--------------------------------------------------------------------------
8383
type: function

scripts/core/device.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,10 @@ etors:
206206
- name: PLATFORM
207207
desc: "$x_platform_handle_t: the platform associated with the device"
208208
- name: REFERENCE_COUNT
209-
desc: "uint32_t: reference count"
209+
desc: |
210+
[uint32_t] Reference count of the device object.
211+
The reference count returned should be considered immediately stale.
212+
It is unsuitable for general use in applications. This feature is provided for identifying memory leaks.
210213
- name: IL_VERSION
211214
desc: "char[]: IL version"
212215
- name: NAME

scripts/core/event.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,10 @@ etors:
9898
- name: COMMAND_EXECUTION_STATUS
9999
desc: "[$x_event_status_t] Command execution status of an event object"
100100
- name: REFERENCE_COUNT
101-
desc: "[uint32_t] Reference count of an event object"
101+
desc: |
102+
[uint32_t] Reference count of the event object.
103+
The reference count returned should be considered immediately stale.
104+
It is unsuitable for general use in applications. This feature is provided for identifying memory leaks.
102105
--- #--------------------------------------------------------------------------
103106
type: enum
104107
desc: "Profiling query information type"

scripts/core/kernel.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ etors:
8686
- name: NUM_ARGS
8787
desc: "Return Kernel number of arguments"
8888
- name: REFERENCE_COUNT
89-
desc: "Return Kernel reference count"
89+
desc: |
90+
[uint32_t] Reference count of the kernel object.
91+
The reference count returned should be considered immediately stale.
92+
It is unsuitable for general use in applications. This feature is provided for identifying memory leaks.
9093
- name: CONTEXT
9194
desc: "Return Context object associated with Kernel"
9295
- name: PROGRAM

scripts/core/program.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,10 @@ class: $xProgram
215215
name: $x_program_info_t
216216
etors:
217217
- name: REFERENCE_COUNT
218-
desc: "Program reference count info"
218+
desc: |
219+
[uint32_t] Reference count of the program object.
220+
The reference count returned should be considered immediately stale.
221+
It is unsuitable for general use in applications. This feature is provided for identifying memory leaks.
219222
- name: CONTEXT
220223
desc: "Program context info"
221224
- name: NUM_DEVICES

scripts/core/queue.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,10 @@ etors:
2424
- name: PROPERTIES
2525
desc: "$x_queue_flags_t: the properties associated with $X_QUEUE_PROPERTIES_FLAGS."
2626
- name: REFERENCE_COUNT
27-
desc: "Queue reference count"
27+
desc: |
28+
[uint32_t] Reference count of the queue object.
29+
The reference count returned should be considered immediately stale.
30+
It is unsuitable for general use in applications. This feature is provided for identifying memory leaks.
2831
- name: SIZE
2932
desc: "uint32_t: The size of the queue"
3033
--- #--------------------------------------------------------------------------

scripts/core/sampler.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ class: $xSampler
1616
name: $x_sampler_info_t
1717
etors:
1818
- name: REFERENCE_COUNT
19-
desc: "Sampler reference count info"
19+
desc: |
20+
[uint32_t] Reference count of the sampler object.
21+
The reference count returned should be considered immediately stale.
22+
It is unsuitable for general use in applications. This feature is provided for identifying memory leaks.
2023
- name: CONTEXT
2124
desc: "Sampler context info"
2225
- name: NORMALIZED_COORDS

0 commit comments

Comments
 (0)