Skip to content

Commit 3314e4e

Browse files
committed
Merge branch 'main' into sean/copy-const-qualifiers
2 parents 2c748b0 + 25157af commit 3314e4e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+208
-173
lines changed

CMakeLists.txt

+1-4
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,13 @@ include(Assertions)
7676
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
7777
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
7878
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
79-
if(MSVC)
80-
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/$<CONFIG>)
81-
endif()
8279

8380
# Define rpath for libraries so that adapters can be found automatically
8481
set(CMAKE_BUILD_RPATH "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
8582

8683
# Define a path for custom commands to work around MSVC
8784
set(CUSTOM_COMMAND_BINARY_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
88-
if(MSVC)
85+
if(CMAKE_SYSTEM_NAME STREQUAL Windows AND NOT CMAKE_GENERATOR STREQUAL Ninja)
8986
# MSVC implicitly adds $<CONFIG> to the output path
9087
set(CUSTOM_COMMAND_BINARY_DIR ${CUSTOM_COMMAND_BINARY_DIR}/$<CONFIG>)
9188
endif()

include/ur_api.h

+18-6
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,8 @@ typedef enum ur_result_t {
481481
UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT = 55, ///< [Validation] image format is not supported by the device
482482
UR_RESULT_ERROR_INVALID_NATIVE_BINARY = 56, ///< [Validation] native binary is not supported by the device
483483
UR_RESULT_ERROR_INVALID_GLOBAL_NAME = 57, ///< [Validation] global variable is not found in the program
484-
UR_RESULT_ERROR_INVALID_FUNCTION_NAME = 58, ///< [Validation] function name is not found in the program
484+
UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE = 58, ///< [Validation] function name is in the program but its address could not
485+
///< be determined
485486
UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION = 59, ///< [Validation] group size dimension is not valid for the kernel or
486487
///< device
487488
UR_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION = 60, ///< [Validation] global width dimension is not valid for the kernel or
@@ -1597,6 +1598,9 @@ typedef enum ur_device_info_t {
15971598
///< this composite device.
15981599
UR_DEVICE_INFO_COMPOSITE_DEVICE = 117, ///< [::ur_device_handle_t] The composite device containing this component
15991600
///< device.
1601+
UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT = 118, ///< [::ur_bool_t] return true if the device supports the
1602+
///< `EnqueueDeviceGlobalVariableWrite` and
1603+
///< `EnqueueDeviceGlobalVariableRead` entry points.
16001604
UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP = 0x1000, ///< [::ur_bool_t] Returns true if the device supports the use of
16011605
///< command-buffers.
16021606
UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_SUPPORT_EXP = 0x1001, ///< [::ur_bool_t] Returns true if the device supports updating the kernel
@@ -2556,8 +2560,8 @@ typedef struct ur_image_desc_t {
25562560
size_t arraySize; ///< [in] image array size
25572561
size_t rowPitch; ///< [in] image row pitch
25582562
size_t slicePitch; ///< [in] image slice pitch
2559-
uint32_t numMipLevel; ///< [in] number of MIP levels
2560-
uint32_t numSamples; ///< [in] number of samples
2563+
uint32_t numMipLevel; ///< [in] number of MIP levels, must be `0`
2564+
uint32_t numSamples; ///< [in] number of samples, must be `0`
25612565

25622566
} ur_image_desc_t;
25632567

@@ -2601,6 +2605,10 @@ typedef struct ur_image_desc_t {
26012605
/// - ::UR_RESULT_ERROR_INVALID_VALUE
26022606
/// - ::UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR
26032607
/// + `pImageDesc && UR_MEM_TYPE_IMAGE1D_ARRAY < pImageDesc->type`
2608+
/// + `pImageDesc && pImageDesc->numMipLevel != 0`
2609+
/// + `pImageDesc && pImageDesc->numSamples != 0`
2610+
/// + `pImageDesc && pImageDesc->rowPitch != 0 && pHost == nullptr`
2611+
/// + `pImageDesc && pImageDesc->slicePitch != 0 && pHost == nullptr`
26042612
/// - ::UR_RESULT_ERROR_INVALID_IMAGE_SIZE
26052613
/// - ::UR_RESULT_ERROR_INVALID_OPERATION
26062614
/// - ::UR_RESULT_ERROR_INVALID_HOST_PTR
@@ -4355,8 +4363,8 @@ urProgramRelease(
43554363
/// @details
43564364
/// - Retrieves a pointer to the functions with the given name and defined
43574365
/// in the given program.
4358-
/// - ::UR_RESULT_ERROR_INVALID_FUNCTION_NAME is returned if the function
4359-
/// can not be obtained.
4366+
/// - ::UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE is returned if the
4367+
/// function can not be obtained.
43604368
/// - The application may call this function from simultaneous threads for
43614369
/// the same device.
43624370
/// - The implementation of this function should be thread-safe.
@@ -4376,6 +4384,10 @@ urProgramRelease(
43764384
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
43774385
/// + `NULL == pFunctionName`
43784386
/// + `NULL == ppFunctionPointer`
4387+
/// - ::UR_RESULT_ERROR_INVALID_KERNEL_NAME
4388+
/// + If `pFunctionName` couldn't be found in `hProgram`.
4389+
/// - ::UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE
4390+
/// + If `pFunctionName` could be located, but its address couldn't be retrieved.
43794391
UR_APIEXPORT ur_result_t UR_APICALL
43804392
urProgramGetFunctionPointer(
43814393
ur_device_handle_t hDevice, ///< [in] handle of the device to retrieve pointer for.
@@ -4777,7 +4789,7 @@ urKernelSetArgLocal(
47774789
/// @brief Get Kernel object information
47784790
typedef enum ur_kernel_info_t {
47794791
UR_KERNEL_INFO_FUNCTION_NAME = 0, ///< [char[]] Return null-terminated kernel function name.
4780-
UR_KERNEL_INFO_NUM_ARGS = 1, ///< [size_t] Return Kernel number of arguments.
4792+
UR_KERNEL_INFO_NUM_ARGS = 1, ///< [uint32_t] Return Kernel number of arguments.
47814793
UR_KERNEL_INFO_REFERENCE_COUNT = 2, ///< [uint32_t] Reference count of the kernel object.
47824794
///< The reference count returned should be considered immediately stale.
47834795
///< It is unsuitable for general use in applications. This feature is

include/ur_print.hpp

+20-5
Original file line numberDiff line numberDiff line change
@@ -1541,8 +1541,8 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_result_t value) {
15411541
case UR_RESULT_ERROR_INVALID_GLOBAL_NAME:
15421542
os << "UR_RESULT_ERROR_INVALID_GLOBAL_NAME";
15431543
break;
1544-
case UR_RESULT_ERROR_INVALID_FUNCTION_NAME:
1545-
os << "UR_RESULT_ERROR_INVALID_FUNCTION_NAME";
1544+
case UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE:
1545+
os << "UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE";
15461546
break;
15471547
case UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION:
15481548
os << "UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION";
@@ -2524,6 +2524,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) {
25242524
case UR_DEVICE_INFO_COMPOSITE_DEVICE:
25252525
os << "UR_DEVICE_INFO_COMPOSITE_DEVICE";
25262526
break;
2527+
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
2528+
os << "UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT";
2529+
break;
25272530
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP:
25282531
os << "UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP";
25292532
break;
@@ -4008,6 +4011,18 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info
40084011

40094012
os << ")";
40104013
} break;
4014+
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT: {
4015+
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
4016+
if (sizeof(ur_bool_t) > size) {
4017+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")";
4018+
return UR_RESULT_ERROR_INVALID_SIZE;
4019+
}
4020+
os << (const void *)(tptr) << " (";
4021+
4022+
os << *tptr;
4023+
4024+
os << ")";
4025+
} break;
40114026
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP: {
40124027
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
40134028
if (sizeof(ur_bool_t) > size) {
@@ -7855,9 +7870,9 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_kernel_info
78557870
printPtr(os, tptr);
78567871
} break;
78577872
case UR_KERNEL_INFO_NUM_ARGS: {
7858-
const size_t *tptr = (const size_t *)ptr;
7859-
if (sizeof(size_t) > size) {
7860-
os << "invalid size (is: " << size << ", expected: >=" << sizeof(size_t) << ")";
7873+
const uint32_t *tptr = (const uint32_t *)ptr;
7874+
if (sizeof(uint32_t) > size) {
7875+
os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t) << ")";
78617876
return UR_RESULT_ERROR_INVALID_SIZE;
78627877
}
78637878
os << (const void *)(tptr) << " (";

scripts/core/CONTRIB.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ Adapter Change Process
127127
.. _intel/llvm:
128128
https://github.com/intel/llvm
129129
.. _UNIFIED_RUNTIME_REPO:
130-
https://github.com/intel/llvm/blob/sycl/sycl/plugins/unified_runtime/CMakeLists.txt#L7
130+
https://github.com/intel/llvm/blob/sycl/sycl/plugins/unified_runtime/CMakeLists.txt#L102
131131
.. _UNIFIED_RUNTIME_TAG:
132-
https://github.com/intel/llvm/blob/sycl/sycl/plugins/unified_runtime/CMakeLists.txt#L8
132+
https://github.com/intel/llvm/blob/sycl/sycl/plugins/unified_runtime/CMakeLists.txt#L109
133133

134134
Build Environment
135135
=================

scripts/core/common.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ etors:
251251
desc: "[Validation] native binary is not supported by the device"
252252
- name: ERROR_INVALID_GLOBAL_NAME
253253
desc: "[Validation] global variable is not found in the program"
254-
- name: ERROR_INVALID_FUNCTION_NAME
255-
desc: "[Validation] function name is not found in the program"
254+
- name: ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE
255+
desc: "[Validation] function name is in the program but its address could not be determined"
256256
- name: ERROR_INVALID_GROUP_SIZE_DIMENSION
257257
desc: "[Validation] group size dimension is not valid for the kernel or device"
258258
- name: ERROR_INVALID_GLOBAL_WIDTH_DIMENSION

scripts/core/device.yml

+2
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,8 @@ etors:
439439
desc: "[$x_device_handle_t[]] The set of component devices contained by this composite device."
440440
- name: COMPOSITE_DEVICE
441441
desc: "[$x_device_handle_t] The composite device containing this component device."
442+
- name: GLOBAL_VARIABLE_SUPPORT
443+
desc: "[$x_bool_t] return true if the device supports the `EnqueueDeviceGlobalVariableWrite` and `EnqueueDeviceGlobalVariableRead` entry points."
442444
--- #--------------------------------------------------------------------------
443445
type: function
444446
desc: "Retrieves various information about device"

scripts/core/kernel.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ etors:
109109
- name: FUNCTION_NAME
110110
desc: "[char[]] Return null-terminated kernel function name."
111111
- name: NUM_ARGS
112-
desc: "[size_t] Return Kernel number of arguments."
112+
desc: "[uint32_t] Return Kernel number of arguments."
113113
- name: REFERENCE_COUNT
114114
desc: |
115115
[uint32_t] Reference count of the kernel object.

scripts/core/memory.yml

+6-2
Original file line numberDiff line numberDiff line change
@@ -197,10 +197,10 @@ members:
197197
desc: "[in] image slice pitch"
198198
- type: uint32_t
199199
name: numMipLevel
200-
desc: "[in] number of MIP levels"
200+
desc: "[in] number of MIP levels, must be `0`"
201201
- type: uint32_t
202202
name: numSamples
203-
desc: "[in] number of samples"
203+
desc: "[in] number of samples, must be `0`"
204204
--- #--------------------------------------------------------------------------
205205
type: function
206206
desc: "Create an image object"
@@ -242,6 +242,10 @@ returns:
242242
- $X_RESULT_ERROR_INVALID_VALUE
243243
- $X_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR:
244244
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_ARRAY < pImageDesc->type`"
245+
- "`pImageDesc && pImageDesc->numMipLevel != 0`"
246+
- "`pImageDesc && pImageDesc->numSamples != 0`"
247+
- "`pImageDesc && pImageDesc->rowPitch != 0 && pHost == nullptr`"
248+
- "`pImageDesc && pImageDesc->slicePitch != 0 && pHost == nullptr`"
245249
- $X_RESULT_ERROR_INVALID_IMAGE_SIZE
246250
- $X_RESULT_ERROR_INVALID_OPERATION
247251
- $X_RESULT_ERROR_INVALID_HOST_PTR:

scripts/core/program.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ analogue:
291291
- "**clGetDeviceFunctionPointerINTEL**"
292292
details:
293293
- "Retrieves a pointer to the functions with the given name and defined in the given program."
294-
- "$X_RESULT_ERROR_INVALID_FUNCTION_NAME is returned if the function can not be obtained."
294+
- "$X_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE is returned if the function can not be obtained."
295295
- "The application may call this function from simultaneous threads for the same device."
296296
- "The implementation of this function should be thread-safe."
297297
params:
@@ -313,6 +313,11 @@ params:
313313
name: ppFunctionPointer
314314
desc: |
315315
[out] Returns the pointer to the function if it is found in the program.
316+
returns:
317+
- $X_RESULT_ERROR_INVALID_KERNEL_NAME:
318+
- "If `pFunctionName` couldn't be found in `hProgram`."
319+
- $X_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE:
320+
- "If `pFunctionName` could be located, but its address couldn't be retrieved."
316321
--- #--------------------------------------------------------------------------
317322
type: function
318323
desc: "Retrieves a pointer to a device global variable."

source/adapters/cuda/device.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1075,6 +1075,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
10751075
return ReturnValue(true);
10761076
case UR_DEVICE_INFO_ESIMD_SUPPORT:
10771077
return ReturnValue(false);
1078+
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
1079+
return ReturnValue(true);
10781080
case UR_DEVICE_INFO_COMPONENT_DEVICES:
10791081
case UR_DEVICE_INFO_COMPOSITE_DEVICE:
10801082
case UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS:

source/adapters/cuda/kernel.hpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,9 @@ struct ur_kernel_handle_t_ {
204204
/// Note this only returns the current known number of arguments, not the
205205
/// real one required by the kernel, since this cannot be queried from
206206
/// the CUDA Driver API
207-
size_t getNumArgs() const noexcept { return Args.Indices.size() - 1; }
207+
uint32_t getNumArgs() const noexcept {
208+
return static_cast<uint32_t>(Args.Indices.size() - 1);
209+
}
208210

209211
void setKernelArg(int Index, size_t Size, const void *Arg) {
210212
Args.addArg(Index, Size, Arg);

source/adapters/cuda/memory.cpp

-10
Original file line numberDiff line numberDiff line change
@@ -208,16 +208,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreate(
208208
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
209209
UR_ASSERT(pImageDesc->type <= UR_MEM_TYPE_IMAGE1D_ARRAY,
210210
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
211-
UR_ASSERT(pImageDesc->numMipLevel == 0,
212-
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
213-
UR_ASSERT(pImageDesc->numSamples == 0,
214-
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
215-
if (!pHost) {
216-
UR_ASSERT(pImageDesc->rowPitch == 0,
217-
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
218-
UR_ASSERT(pImageDesc->slicePitch == 0,
219-
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
220-
}
221211

222212
// We only support RBGA channel order
223213
// TODO: check SYCL CTS and spec. May also have to support BGRA

source/adapters/cuda/program.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramGetFunctionPointer(
503503
UR_CHECK_ERROR(Ret);
504504
if (Ret == CUDA_ERROR_NOT_FOUND) {
505505
*ppFunctionPointer = 0;
506-
Result = UR_RESULT_ERROR_INVALID_FUNCTION_NAME;
506+
Result = UR_RESULT_ERROR_INVALID_KERNEL_NAME;
507507
}
508508

509509
return Result;

source/adapters/hip/device.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -886,6 +886,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
886886
return ReturnValue(true);
887887
}
888888

889+
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
890+
return ReturnValue(false);
889891
// TODO: Investigate if this information is available on HIP.
890892
case UR_DEVICE_INFO_COMPONENT_DEVICES:
891893
case UR_DEVICE_INFO_COMPOSITE_DEVICE:

source/adapters/hip/kernel.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ struct ur_kernel_handle_t_ {
201201
/// offset. Note this only returns the current known number of arguments,
202202
/// not the real one required by the kernel, since this cannot be queried
203203
/// from the HIP Driver API
204-
size_t getNumArgs() const noexcept { return Args.Indices.size() - 1; }
204+
uint32_t getNumArgs() const noexcept { return Args.Indices.size() - 1; }
205205

206206
void setKernelArg(int Index, size_t Size, const void *Arg) {
207207
Args.addArg(Index, Size, Arg);

source/adapters/hip/memory.cpp

-10
Original file line numberDiff line numberDiff line change
@@ -361,16 +361,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreate(
361361
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
362362
UR_ASSERT(pImageDesc->type <= UR_MEM_TYPE_IMAGE1D_ARRAY,
363363
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
364-
UR_ASSERT(pImageDesc->numMipLevel == 0,
365-
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
366-
UR_ASSERT(pImageDesc->numSamples == 0,
367-
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
368-
if (!pHost) {
369-
UR_ASSERT(pImageDesc->rowPitch == 0,
370-
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
371-
UR_ASSERT(pImageDesc->slicePitch == 0,
372-
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
373-
}
374364

375365
// We only support RBGA channel order
376366
// TODO: check SYCL CTS and spec. May also have to support BGRA

source/adapters/hip/program.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramGetFunctionPointer(
539539
UR_CHECK_ERROR(Ret);
540540
if (Ret == hipErrorNotFound) {
541541
*ppFunctionPointer = 0;
542-
Result = UR_RESULT_ERROR_INVALID_FUNCTION_NAME;
542+
Result = UR_RESULT_ERROR_INVALID_KERNEL_NAME;
543543
}
544544

545545
return Result;

source/adapters/level_zero/common.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ ur_result_t ze2urResult(ze_result_t ZeResult) {
4646
case ZE_RESULT_ERROR_INVALID_NATIVE_BINARY:
4747
return UR_RESULT_ERROR_INVALID_BINARY;
4848
case ZE_RESULT_ERROR_INVALID_KERNEL_NAME:
49-
return UR_RESULT_ERROR_INVALID_KERNEL_NAME;
5049
case ZE_RESULT_ERROR_INVALID_FUNCTION_NAME:
51-
return UR_RESULT_ERROR_INVALID_FUNCTION_NAME;
50+
return UR_RESULT_ERROR_INVALID_KERNEL_NAME;
5251
case ZE_RESULT_ERROR_OVERLAPPING_REGIONS:
5352
return UR_RESULT_ERROR_INVALID_OPERATION;
5453
case ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION:

source/adapters/level_zero/common.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ static auto getUrResultString = [](ur_result_t Result) {
145145
return "UR_RESULT_ERROR_INVALID_NATIVE_BINARY";
146146
case UR_RESULT_ERROR_INVALID_GLOBAL_NAME:
147147
return "UR_RESULT_ERROR_INVALID_GLOBAL_NAME";
148-
case UR_RESULT_ERROR_INVALID_FUNCTION_NAME:
149-
return "UR_RESULT_ERROR_INVALID_FUNCTION_NAME";
148+
case UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE:
149+
return "UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE";
150150
case UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION:
151151
return "UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION";
152152
case UR_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION:

source/adapters/level_zero/device.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -987,6 +987,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
987987
case UR_DEVICE_INFO_INTEROP_MEMORY_EXPORT_SUPPORT_EXP:
988988
case UR_DEVICE_INFO_INTEROP_SEMAPHORE_IMPORT_SUPPORT_EXP:
989989
case UR_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP:
990+
case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS:
991+
return ReturnValue(false);
992+
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
993+
return ReturnValue(true);
994+
990995
default:
991996
logger::error("Unsupported ParamName in urGetDeviceInfo");
992997
logger::error("ParamNameParamName={}(0x{})", ParamName,

source/adapters/level_zero/program.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -570,7 +570,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramGetFunctionPointer(
570570
// exists
571571
ClResult.pop_back();
572572
if (is_in_separated_string(ClResult, ';', std::string(FunctionName)))
573-
return UR_RESULT_ERROR_INVALID_FUNCTION_NAME;
573+
return UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE;
574574

575575
return UR_RESULT_ERROR_INVALID_KERNEL_NAME;
576576
}

source/adapters/opencl/common.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ ur_result_t mapCLErrorToUR(cl_int Result) {
9393
return UR_RESULT_ERROR_INVALID_KERNEL_ARGS;
9494
case CL_INVALID_COMMAND_QUEUE:
9595
return UR_RESULT_ERROR_INVALID_QUEUE;
96+
case CL_INVALID_ARG_SIZE:
97+
return UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE;
9698
default:
9799
return UR_RESULT_ERROR_UNKNOWN;
98100
}

0 commit comments

Comments
 (0)