Skip to content

Commit 86e2fb3

Browse files
aarongreigkbenzie
authored andcommitted
Correct level of indirection used in KernelSetArgPointer calls.
Also attempt to clarify the wording around this a bit. Addresses #558
1 parent a1094cd commit 86e2fb3

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
@@ -5023,8 +5023,8 @@ urKernelSetArgPointer(
50235023
ur_kernel_handle_t hKernel, ///< [in] handle of the kernel object
50245024
uint32_t argIndex, ///< [in] argument index in range [0, num args - 1]
50255025
const ur_kernel_arg_pointer_properties_t *pProperties, ///< [in][optional] pointer to USM pointer properties.
5026-
const void *pArgValue ///< [in][optional] USM pointer to memory location holding the argument
5027-
///< value. If null then argument value is considered null.
5026+
const void *pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
5027+
///< mapping operation. If null then argument value is considered null.
50285028
);
50295029

50305030
///////////////////////////////////////////////////////////////////////////////

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
@@ -2446,8 +2446,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer(
24462446
const ur_kernel_arg_pointer_properties_t
24472447
*pProperties, ///< [in][optional] pointer to USM pointer properties.
24482448
const void *
2449-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
2450-
///< value. If null then argument value is considered null.
2449+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
2450+
///< mapping operation. If null then argument value is considered null.
24512451
) try {
24522452
ur_result_t result = UR_RESULT_SUCCESS;
24532453

source/loader/layers/tracing/ur_trcddi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3167,8 +3167,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer(
31673167
const ur_kernel_arg_pointer_properties_t
31683168
*pProperties, ///< [in][optional] pointer to USM pointer properties.
31693169
const void *
3170-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
3171-
///< value. If null then argument value is considered null.
3170+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
3171+
///< mapping operation. If null then argument value is considered null.
31723172
) {
31733173
auto pfnSetArgPointer = context.urDdiTable.Kernel.pfnSetArgPointer;
31743174

source/loader/layers/validation/ur_valddi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3589,8 +3589,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer(
35893589
const ur_kernel_arg_pointer_properties_t
35903590
*pProperties, ///< [in][optional] pointer to USM pointer properties.
35913591
const void *
3592-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
3593-
///< value. If null then argument value is considered null.
3592+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
3593+
///< mapping operation. If null then argument value is considered null.
35943594
) {
35953595
auto pfnSetArgPointer = context.urDdiTable.Kernel.pfnSetArgPointer;
35963596

source/loader/ur_ldrddi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3230,8 +3230,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer(
32303230
const ur_kernel_arg_pointer_properties_t
32313231
*pProperties, ///< [in][optional] pointer to USM pointer properties.
32323232
const void *
3233-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
3234-
///< value. If null then argument value is considered null.
3233+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
3234+
///< mapping operation. If null then argument value is considered null.
32353235
) {
32363236
ur_result_t result = UR_RESULT_SUCCESS;
32373237

source/loader/ur_libapi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3863,8 +3863,8 @@ ur_result_t UR_APICALL urKernelSetArgPointer(
38633863
const ur_kernel_arg_pointer_properties_t
38643864
*pProperties, ///< [in][optional] pointer to USM pointer properties.
38653865
const void *
3866-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
3867-
///< value. If null then argument value is considered null.
3866+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
3867+
///< mapping operation. If null then argument value is considered null.
38683868
) try {
38693869
auto pfnSetArgPointer = ur_lib::context->urDdiTable.Kernel.pfnSetArgPointer;
38703870
if (nullptr == pfnSetArgPointer) {

source/ur_api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3284,8 +3284,8 @@ ur_result_t UR_APICALL urKernelSetArgPointer(
32843284
const ur_kernel_arg_pointer_properties_t
32853285
*pProperties, ///< [in][optional] pointer to USM pointer properties.
32863286
const void *
3287-
pArgValue ///< [in][optional] USM pointer to memory location holding the argument
3288-
///< value. If null then argument value is considered null.
3287+
pArgValue ///< [in][optional] Pointer obtained by USM allocation or virtual memory
3288+
///< mapping operation. If null then argument value is considered null.
32893289
) {
32903290
ur_result_t result = UR_RESULT_SUCCESS;
32913291
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)