Skip to content

Commit 601f60c

Browse files
authored
Merge pull request #2601 from RossBrunton/ross/allocdoc
In docs, mark "allocating" functions as such
2 parents 2be5c71 + d68d54b commit 601f60c

29 files changed

+1320
-1249
lines changed

include/ur_api.h

+176-166
Large diffs are not rendered by default.

scripts/YaML.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -621,12 +621,13 @@ class ur_name_t(Structure):
621621
- `out` is used for params that are write-only; if the param is a pointer, then the memory being pointed to is also write-only
622622
- `in,out` is used for params that are both read and write; typically this is used for pointers to other data structures that contain both read and write params
623623
- `nocheck` is used to specify that no additional validation checks will be generated.
624-
+ `desc` may include one the following annotations: {`"[optional]"`, `"[range(start,end)]"`, `"[retain]"`, `"[release]"`, `"[typename(typeVarName)]"`, `"[bounds(offset,size)]"`}
624+
+ `desc` may include one or more of the following annotations: {`"[optional]"`, `"[range(start,end)]"`, `"[alloc]"`, `"[retain]"`, `"[release]"`, `"[typename(typeVarName)]"`, `"[bounds(offset,size)]"`}
625625
- `optional` is used for params that are handles or pointers where it is legal for the value to be `nullptr`
626626
- `range` is used for params that are array pointers to specify the valid range that the is valid to read
627627
+ `start` and `end` must be an ISO-C standard identifier or literal
628628
+ `start` is inclusive and `end` is exclusive
629-
- `retain` is used for params that are handles or pointers to handles where the function will increment the reference counter associated with the handle(s).
629+
- `alloc` is used for output params that are handles or pointers to handles where the function will either increase the reference count by one or create a new handle with an initial reference count of one.
630+
- `retain` is used for params that are handles or pointers to handles where the function will increment the reference counter associated with the handle(s). The handle will not be created and must be valid.
630631
- `release` is used for params that are handles or pointers to handles where the function will decrement the handle's reference count, potentially leaving it in an invalid state if the reference count reaches zero.
631632
- `typename` is used to denote the type enum for params that are opaque pointers to values of tagged data types.
632633
- `bounds` is used for params that are memory objects or USM allocations. It specifies the range within the memory allocation represented by the param that will be accessed by the operation.

scripts/core/adapter.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ params:
3434
- type: "$x_adapter_handle_t*"
3535
name: phAdapters
3636
desc: |
37-
[out][optional][range(0, NumEntries)] array of handle of adapters.
37+
[out][optional][range(0, NumEntries)][alloc] array of handle of adapters.
3838
If NumEntries is less than the number of adapters available, then $xAdapterGet shall only retrieve that number of adapters.
3939
- type: "uint32_t*"
4040
name: "pNumAdapters"

scripts/core/context.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ params:
5959
[in][optional] pointer to context creation properties.
6060
- type: $x_context_handle_t*
6161
name: phContext
62-
desc: "[out] pointer to handle of context object created"
62+
desc: "[out][alloc] pointer to handle of context object created"
6363
returns:
6464
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
6565
- $X_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
@@ -243,7 +243,7 @@ params:
243243
- type: "$x_context_handle_t*"
244244
name: phContext
245245
desc: |
246-
[out] pointer to the handle of the context object created.
246+
[out][alloc] pointer to the handle of the context object created.
247247
returns:
248248
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
249249
- "If the adapter has no underlying equivalent handle."

scripts/core/device.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ params:
136136
- type: "$x_device_handle_t*"
137137
name: phDevices
138138
desc: |
139-
[out][optional][range(0, NumEntries)] array of handle of devices.
139+
[out][optional][range(0, NumEntries)][alloc] array of handle of devices.
140140
If NumEntries is less than the number of devices available, then platform shall only retrieve that number of devices.
141141
- type: "uint32_t*"
142142
name: pNumDevices
@@ -834,7 +834,7 @@ params:
834834
desc: "[in][optional] pointer to native device properties struct."
835835
- type: "$x_device_handle_t*"
836836
name: phDevice
837-
desc: "[out] pointer to the handle of the device object created."
837+
desc: "[out][alloc] pointer to the handle of the device object created."
838838
returns:
839839
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
840840
- "If the adapter has no underlying equivalent handle."

scripts/core/enqueue.yml

+27-27
Large diffs are not rendered by default.

scripts/core/event.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ params:
317317
- type: "$x_event_handle_t*"
318318
name: phEvent
319319
desc: |
320-
[out] pointer to the handle of the event object created.
320+
[out][alloc] pointer to the handle of the event object created.
321321
returns:
322322
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
323323
- "If the adapter has no underlying equivalent handle."

scripts/core/exp-bindless-images.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ params:
429429
desc: "[in] pointer to image description"
430430
- type: $x_exp_image_mem_native_handle_t*
431431
name: phImageMem
432-
desc: "[out] pointer to handle of image memory allocated"
432+
desc: "[out][alloc] pointer to handle of image memory allocated"
433433
returns:
434434
- $X_RESULT_ERROR_INVALID_CONTEXT
435435
- $X_RESULT_ERROR_INVALID_VALUE
@@ -484,7 +484,7 @@ params:
484484
desc: "[in] pointer to image description"
485485
- type: $x_exp_image_native_handle_t*
486486
name: phImage
487-
desc: "[out] pointer to handle of image object created"
487+
desc: "[out][alloc] pointer to handle of image object created"
488488
returns:
489489
- $X_RESULT_ERROR_INVALID_CONTEXT
490490
- $X_RESULT_ERROR_INVALID_VALUE
@@ -522,7 +522,7 @@ params:
522522
desc: "[in] sampler to be used"
523523
- type: $x_exp_image_native_handle_t*
524524
name: phImage
525-
desc: "[out] pointer to handle of image object created"
525+
desc: "[out][alloc] pointer to handle of image object created"
526526
returns:
527527
- $X_RESULT_ERROR_INVALID_CONTEXT
528528
- $X_RESULT_ERROR_INVALID_VALUE
@@ -583,7 +583,7 @@ params:
583583
- type: $x_event_handle_t*
584584
name: phEvent
585585
desc: |
586-
[out][optional] return an event object that identifies this particular command instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array.
586+
[out][optional][alloc] return an event object that identifies this particular command instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array.
587587
returns:
588588
- $X_RESULT_ERROR_INVALID_QUEUE
589589
- $X_RESULT_ERROR_INVALID_VALUE
@@ -699,7 +699,7 @@ params:
699699
desc: "[in] the external memory descriptor"
700700
- type: $x_exp_external_mem_handle_t*
701701
name: phExternalMem
702-
desc: "[out] external memory handle to the external memory"
702+
desc: "[out][alloc] external memory handle to the external memory"
703703
returns:
704704
- $X_RESULT_ERROR_INVALID_CONTEXT
705705
- $X_RESULT_ERROR_INVALID_VALUE
@@ -812,7 +812,7 @@ params:
812812
desc: "[in] the external semaphore descriptor"
813813
- type: $x_exp_external_semaphore_handle_t*
814814
name: phExternalSemaphore
815-
desc: "[out] external semaphore handle to the external semaphore"
815+
desc: "[out][alloc] external semaphore handle to the external semaphore"
816816
returns:
817817
- $X_RESULT_ERROR_INVALID_CONTEXT
818818
- $X_RESULT_ERROR_INVALID_VALUE
@@ -872,7 +872,7 @@ params:
872872
- type: $x_event_handle_t*
873873
name: phEvent
874874
desc: |
875-
[out][optional] return an event object that identifies this particular command instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array.
875+
[out][optional][alloc] return an event object that identifies this particular command instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array.
876876
returns:
877877
- $X_RESULT_ERROR_INVALID_QUEUE
878878
- $X_RESULT_ERROR_INVALID_VALUE
@@ -911,7 +911,7 @@ params:
911911
- type: $x_event_handle_t*
912912
name: phEvent
913913
desc: |
914-
[out][optional] return an event object that identifies this particular command instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array.
914+
[out][optional][alloc] return an event object that identifies this particular command instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array.
915915
returns:
916916
- $X_RESULT_ERROR_INVALID_QUEUE
917917
- $X_RESULT_ERROR_INVALID_VALUE

scripts/core/exp-command-buffer.yml

+25-25
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ params:
285285
desc: "[in][optional] command-buffer descriptor."
286286
- type: "$x_exp_command_buffer_handle_t*"
287287
name: phCommandBuffer
288-
desc: "[out] Pointer to command-Buffer handle."
288+
desc: "[out][alloc] Pointer to command-Buffer handle."
289289
returns:
290290
- $X_RESULT_ERROR_INVALID_CONTEXT
291291
- $X_RESULT_ERROR_INVALID_DEVICE
@@ -386,10 +386,10 @@ params:
386386
desc: "[out][optional] Sync point associated with this command."
387387
- type: $x_event_handle_t*
388388
name: phEvent
389-
desc: "[out][optional] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
389+
desc: "[out][optional][alloc] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
390390
- type: "$x_exp_command_buffer_command_handle_t*"
391391
name: phCommand
392-
desc: "[out][optional] Handle to this command. Only available if the
392+
desc: "[out][optional][alloc] Handle to this command. Only available if the
393393
command-buffer is updatable."
394394
returns:
395395
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
@@ -451,10 +451,10 @@ params:
451451
desc: "[out][optional] Sync point associated with this command."
452452
- type: $x_event_handle_t*
453453
name: phEvent
454-
desc: "[out][optional] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
454+
desc: "[out][optional][alloc] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
455455
- type: "$x_exp_command_buffer_command_handle_t*"
456456
name: phCommand
457-
desc: "[out][optional] Handle to this command."
457+
desc: "[out][optional][alloc] Handle to this command."
458458
returns:
459459
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
460460
- $X_RESULT_ERROR_INVALID_SIZE:
@@ -513,10 +513,10 @@ params:
513513
desc: "[out][optional] sync point associated with this command."
514514
- type: $x_event_handle_t*
515515
name: phEvent
516-
desc: "[out][optional] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
516+
desc: "[out][optional][alloc] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
517517
- type: "$x_exp_command_buffer_command_handle_t*"
518518
name: phCommand
519-
desc: "[out][optional] Handle to this command."
519+
desc: "[out][optional][alloc] Handle to this command."
520520
returns:
521521
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
522522
- $X_RESULT_ERROR_INVALID_SIZE:
@@ -580,10 +580,10 @@ params:
580580
desc: "[out][optional] Sync point associated with this command."
581581
- type: $x_event_handle_t*
582582
name: phEvent
583-
desc: "[out][optional] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
583+
desc: "[out][optional][alloc] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
584584
- type: "$x_exp_command_buffer_command_handle_t*"
585585
name: phCommand
586-
desc: "[out][optional] Handle to this command."
586+
desc: "[out][optional][alloc] Handle to this command."
587587
returns:
588588
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
589589
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
@@ -639,10 +639,10 @@ params:
639639
desc: "[out][optional] Sync point associated with this command."
640640
- type: $x_event_handle_t*
641641
name: phEvent
642-
desc: "[out][optional] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
642+
desc: "[out][optional][alloc] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
643643
- type: "$x_exp_command_buffer_command_handle_t*"
644644
name: phCommand
645-
desc: "[out][optional] Handle to this command."
645+
desc: "[out][optional][alloc] Handle to this command."
646646
returns:
647647
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
648648
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
@@ -698,10 +698,10 @@ params:
698698
desc: "[out][optional] Sync point associated with this command."
699699
- type: $x_event_handle_t*
700700
name: phEvent
701-
desc: "[out][optional] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
701+
desc: "[out][optional][alloc] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
702702
- type: "$x_exp_command_buffer_command_handle_t*"
703703
name: phCommand
704-
desc: "[out][optional] Handle to this command."
704+
desc: "[out][optional][alloc] Handle to this command."
705705
returns:
706706
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
707707
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
@@ -772,10 +772,10 @@ params:
772772
desc: "[out][optional] Sync point associated with this command."
773773
- type: $x_event_handle_t*
774774
name: phEvent
775-
desc: "[out][optional] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
775+
desc: "[out][optional][alloc] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
776776
- type: "$x_exp_command_buffer_command_handle_t*"
777777
name: phCommand
778-
desc: "[out][optional] Handle to this command."
778+
desc: "[out][optional][alloc] Handle to this command."
779779
returns:
780780
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
781781
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
@@ -846,10 +846,10 @@ params:
846846
desc: "[out][optional] Sync point associated with this command."
847847
- type: $x_event_handle_t*
848848
name: phEvent
849-
desc: "[out][optional] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
849+
desc: "[out][optional][alloc] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
850850
- type: "$x_exp_command_buffer_command_handle_t*"
851851
name: phCommand
852-
desc: "[out][optional] Handle to this command."
852+
desc: "[out][optional][alloc] Handle to this command."
853853
returns:
854854
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
855855
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
@@ -982,10 +982,10 @@ params:
982982
desc: "[out][optional] sync point associated with this command."
983983
- type: $x_event_handle_t*
984984
name: phEvent
985-
desc: "[out][optional] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
985+
desc: "[out][optional][alloc] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
986986
- type: "$x_exp_command_buffer_command_handle_t*"
987987
name: phCommand
988-
desc: "[out][optional] Handle to this command."
988+
desc: "[out][optional][alloc] Handle to this command."
989989
returns:
990990
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
991991
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
@@ -1043,10 +1043,10 @@ params:
10431043
desc: "[out][optional] sync point associated with this command."
10441044
- type: $x_event_handle_t*
10451045
name: phEvent
1046-
desc: "[out][optional] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
1046+
desc: "[out][optional][alloc] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
10471047
- type: "$x_exp_command_buffer_command_handle_t*"
10481048
name: phCommand
1049-
desc: "[out][optional] Handle to this command."
1049+
desc: "[out][optional][alloc] Handle to this command."
10501050
returns:
10511051
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
10521052
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
@@ -1106,10 +1106,10 @@ params:
11061106
desc: "[out][optional] sync point associated with this command."
11071107
- type: $x_event_handle_t*
11081108
name: phEvent
1109-
desc: "[out][optional] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
1109+
desc: "[out][optional][alloc] return an event object that will be signaled by the completion of this command in the next execution of the command-buffer."
11101110
- type: "$x_exp_command_buffer_command_handle_t*"
11111111
name: phCommand
1112-
desc: "[out][optional] Handle to this command."
1112+
desc: "[out][optional][alloc] Handle to this command."
11131113
returns:
11141114
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
11151115
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
@@ -1152,7 +1152,7 @@ params:
11521152
- type: $x_event_handle_t*
11531153
name: phEvent
11541154
desc: |
1155-
[out][optional] return an event object that identifies this particular command-buffer execution instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array.
1155+
[out][optional][alloc] return an event object that identifies this particular command-buffer execution instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array.
11561156
returns:
11571157
- $X_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
11581158
- $X_RESULT_ERROR_INVALID_QUEUE
@@ -1213,7 +1213,7 @@ params:
12131213
desc: "[in] Handle of the command-buffer command to update."
12141214
- type: "$x_event_handle_t*"
12151215
name: phSignalEvent
1216-
desc: "[out] Event to be signaled."
1216+
desc: "[out][alloc] Event to be signaled."
12171217
returns:
12181218
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
12191219
- "If $X_DEVICE_COMMAND_BUFFER_UPDATE_CAPABILITY_FLAG_EVENTS is not supported by the device associated with `hCommand`."

scripts/core/exp-cooperative-kernels.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ params:
5555
- type: $x_event_handle_t*
5656
name: phEvent
5757
desc: |
58-
[out][optional] return an event object that identifies this particular kernel execution instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array.
58+
[out][optional][alloc] return an event object that identifies this particular kernel execution instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array.
5959
returns:
6060
- $X_RESULT_ERROR_INVALID_QUEUE
6161
- $X_RESULT_ERROR_INVALID_KERNEL

scripts/core/exp-launch-properties.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ params:
111111
desc: "[in][optional][range(0, numEventsInWaitList)] pointer to a list of events that must be complete before the kernel execution. If nullptr, the numEventsInWaitList must be 0, indicating that no wait event. "
112112
- type: $x_event_handle_t*
113113
name: phEvent
114-
desc: "[out][optional] return an event object that identifies this particular kernel execution instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array."
114+
desc: "[out][optional][alloc] return an event object that identifies this particular kernel execution instance. If phEventWaitList and phEvent are not NULL, phEvent must not refer to an element of the phEventWaitList array."
115115
returns:
116116
- $X_RESULT_SUCCESS
117117
- $X_RESULT_ERROR_UNINITIALIZED

0 commit comments

Comments
 (0)