Skip to content

Commit 226dfa7

Browse files
committed
Correct level of indirection used in KernelSetArgPointer calls.
Also attempt to clarify the wording around this a bit. Addresses #558
1 parent fb83446 commit 226dfa7

File tree

9 files changed

+20
-20
lines changed

9 files changed

+20
-20
lines changed

include/ur_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4865,8 +4865,8 @@ urKernelSetArgPointer(
48654865
ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object
48664866
uint32_t argIndex, ///< [in] argument index in range [0, num args - 1]
48674867
const ur_kernel_arg_pointer_properties_t *pProperties, ///< [in][optional] pointer to USM pointer properties.
4868-
const void *pArgValue ///< [in][optional] USM pointer to memory location holding the argument
4869-
///< value. If null then argument value is considered null.
4868+
const void *pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
4869+
///< mapping operation. If null then argument value is considered null.
48704870
);
48714871

48724872
///////////////////////////////////////////////////////////////////////////////

scripts/core/kernel.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ params:
339339
desc: "[in][optional] pointer to USM pointer properties."
340340
- type: "const void*"
341341
name: pArgValue
342-
desc: "[in][optional] USM pointer to memory location holding the argument value. If null then argument value is considered null."
342+
desc: "[in][optional] Pointer obtained by USM allocation or virtual memory mapping operation. If null then argument value is considered null."
343343
returns:
344344
- $X_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX
345345
- $X_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE

source/adapters/null/ur_nullddi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2235,8 +2235,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer(
22352235
const ur_kernel_arg_pointer_properties_t
22362236
*pProperties, ///< [in][optional] pointer to USM pointer properties.
22372237
const void *
2238-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
2239-
///< value. If null then argument value is considered null.
2238+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
2239+
///< mapping operation. If null then argument value is considered null.
22402240
) try {
22412241
ur_result_t result = UR_RESULT_SUCCESS;
22422242

source/loader/layers/tracing/ur_trcddi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2540,8 +2540,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer(
25402540
const ur_kernel_arg_pointer_properties_t
25412541
*pProperties, ///< [in][optional] pointer to USM pointer properties.
25422542
const void *
2543-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
2544-
///< value. If null then argument value is considered null.
2543+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
2544+
///< mapping operation. If null then argument value is considered null.
25452545
) {
25462546
auto pfnSetArgPointer = context.urDdiTable.Kernel.pfnSetArgPointer;
25472547

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3132,8 +3132,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer(
31323132
const ur_kernel_arg_pointer_properties_t
31333133
*pProperties, ///< [in][optional] pointer to USM pointer properties.
31343134
const void *
3135-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
3136-
///< value. If null then argument value is considered null.
3135+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
3136+
///< mapping operation. If null then argument value is considered null.
31373137
) {
31383138
auto pfnSetArgPointer = context.urDdiTable.Kernel.pfnSetArgPointer;
31393139

source/loader/ur_ldrddi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,8 +2847,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer(
28472847
const ur_kernel_arg_pointer_properties_t
28482848
*pProperties, ///< [in][optional] pointer to USM pointer properties.
28492849
const void *
2850-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
2851-
///< value. If null then argument value is considered null.
2850+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
2851+
///< mapping operation. If null then argument value is considered null.
28522852
) {
28532853
ur_result_t result = UR_RESULT_SUCCESS;
28542854

source/loader/ur_libapi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3728,8 +3728,8 @@ ur_result_t UR_APICALL urKernelSetArgPointer(
37283728
const ur_kernel_arg_pointer_properties_t
37293729
*pProperties, ///< [in][optional] pointer to USM pointer properties.
37303730
const void *
3731-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
3732-
///< value. If null then argument value is considered null.
3731+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
3732+
///< mapping operation. If null then argument value is considered null.
37333733
) try {
37343734
auto pfnSetArgPointer = ur_lib::context->urDdiTable.Kernel.pfnSetArgPointer;
37353735
if (nullptr == pfnSetArgPointer) {

source/ur_api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3161,8 +3161,8 @@ ur_result_t UR_APICALL urKernelSetArgPointer(
31613161
const ur_kernel_arg_pointer_properties_t
31623162
*pProperties, ///< [in][optional] pointer to USM pointer properties.
31633163
const void *
3164-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
3165-
///< value. If null then argument value is considered null.
3164+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
3165+
///< mapping operation. If null then argument value is considered null.
31663166
) {
31673167
ur_result_t result = UR_RESULT_SUCCESS;
31683168
return result;

test/conformance/kernel/urKernelSetArgPointer.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ TEST_P(urKernelSetArgPointerTest, SuccessHost) {
4242
&allocation));
4343
ASSERT_NE(allocation, nullptr);
4444

45-
ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 0, nullptr, &allocation));
45+
ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 0, nullptr, allocation));
4646
ASSERT_SUCCESS(
4747
urKernelSetArgValue(kernel, 1, sizeof(data), nullptr, &data));
4848
Launch1DRange(array_size);
@@ -60,7 +60,7 @@ TEST_P(urKernelSetArgPointerTest, SuccessDevice) {
6060
allocation_size, &allocation));
6161
ASSERT_NE(allocation, nullptr);
6262

63-
ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 0, nullptr, &allocation));
63+
ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 0, nullptr, allocation));
6464
ASSERT_SUCCESS(
6565
urKernelSetArgValue(kernel, 1, sizeof(data), nullptr, &data));
6666
Launch1DRange(array_size);
@@ -87,7 +87,7 @@ TEST_P(urKernelSetArgPointerTest, SuccessShared) {
8787
allocation_size, &allocation));
8888
ASSERT_NE(allocation, nullptr);
8989

90-
ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 0, nullptr, &allocation));
90+
ASSERT_SUCCESS(urKernelSetArgPointer(kernel, 0, nullptr, allocation));
9191
ASSERT_SUCCESS(
9292
urKernelSetArgValue(kernel, 1, sizeof(data), nullptr, &data));
9393
Launch1DRange(array_size);
@@ -138,7 +138,7 @@ UUR_INSTANTIATE_KERNEL_TEST_SUITE_P(urKernelSetArgPointerNegativeTest);
138138

139139
TEST_P(urKernelSetArgPointerNegativeTest, InvalidNullHandleKernel) {
140140
ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_NULL_HANDLE,
141-
urKernelSetArgPointer(nullptr, 0, nullptr, &allocation));
141+
urKernelSetArgPointer(nullptr, 0, nullptr, allocation));
142142
}
143143

144144
TEST_P(urKernelSetArgPointerNegativeTest, InvalidKernelArgumentIndex) {
@@ -149,5 +149,5 @@ TEST_P(urKernelSetArgPointerNegativeTest, InvalidKernelArgumentIndex) {
149149

150150
ASSERT_EQ_RESULT(UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_INDEX,
151151
urKernelSetArgPointer(kernel, num_kernel_args + 1, nullptr,
152-
&allocation));
152+
allocation));
153153
}

0 commit comments

Comments
 (0)