Skip to content

Commit

Permalink
Merge pull request #1212 from aarongreig/aaron/specMotivatedRefactors
Browse files Browse the repository at this point in the history
Batch adapter changes: spec motivated refactors
  • Loading branch information
kbenzie authored Jul 4, 2024
2 parents 022df8a + 2f121cd commit 0cbacd8
Show file tree
Hide file tree
Showing 47 changed files with 205 additions and 167 deletions.
24 changes: 18 additions & 6 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,8 @@ typedef enum ur_result_t {
UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT = 55, ///< [Validation] image format is not supported by the device
UR_RESULT_ERROR_INVALID_NATIVE_BINARY = 56, ///< [Validation] native binary is not supported by the device
UR_RESULT_ERROR_INVALID_GLOBAL_NAME = 57, ///< [Validation] global variable is not found in the program
UR_RESULT_ERROR_INVALID_FUNCTION_NAME = 58, ///< [Validation] function name is not found in the program
UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE = 58, ///< [Validation] function name is in the program but its address could not
///< be determined
UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION = 59, ///< [Validation] group size dimension is not valid for the kernel or
///< device
UR_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION = 60, ///< [Validation] global width dimension is not valid for the kernel or
Expand Down Expand Up @@ -1597,6 +1598,9 @@ typedef enum ur_device_info_t {
///< this composite device.
UR_DEVICE_INFO_COMPOSITE_DEVICE = 117, ///< [::ur_device_handle_t] The composite device containing this component
///< device.
UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT = 118, ///< [::ur_bool_t] return true if the device supports the
///< `EnqueueDeviceGlobalVariableWrite` and
///< `EnqueueDeviceGlobalVariableRead` entry points.
UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP = 0x1000, ///< [::ur_bool_t] Returns true if the device supports the use of
///< command-buffers.
UR_DEVICE_INFO_COMMAND_BUFFER_UPDATE_SUPPORT_EXP = 0x1001, ///< [::ur_bool_t] Returns true if the device supports updating the kernel
Expand Down Expand Up @@ -2556,8 +2560,8 @@ typedef struct ur_image_desc_t {
size_t arraySize; ///< [in] image array size
size_t rowPitch; ///< [in] image row pitch
size_t slicePitch; ///< [in] image slice pitch
uint32_t numMipLevel; ///< [in] number of MIP levels
uint32_t numSamples; ///< [in] number of samples
uint32_t numMipLevel; ///< [in] number of MIP levels, must be `0`
uint32_t numSamples; ///< [in] number of samples, must be `0`

} ur_image_desc_t;

Expand Down Expand Up @@ -2601,6 +2605,10 @@ typedef struct ur_image_desc_t {
/// - ::UR_RESULT_ERROR_INVALID_VALUE
/// - ::UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR
/// + `pImageDesc && UR_MEM_TYPE_IMAGE1D_ARRAY < pImageDesc->type`
/// + `pImageDesc && pImageDesc->numMipLevel != 0`
/// + `pImageDesc && pImageDesc->numSamples != 0`
/// + `pImageDesc && pImageDesc->rowPitch != 0 && pHost == nullptr`
/// + `pImageDesc && pImageDesc->slicePitch != 0 && pHost == nullptr`
/// - ::UR_RESULT_ERROR_INVALID_IMAGE_SIZE
/// - ::UR_RESULT_ERROR_INVALID_OPERATION
/// - ::UR_RESULT_ERROR_INVALID_HOST_PTR
Expand Down Expand Up @@ -4355,8 +4363,8 @@ urProgramRelease(
/// @details
/// - Retrieves a pointer to the functions with the given name and defined
/// in the given program.
/// - ::UR_RESULT_ERROR_INVALID_FUNCTION_NAME is returned if the function
/// can not be obtained.
/// - ::UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE is returned if the
/// function can not be obtained.
/// - The application may call this function from simultaneous threads for
/// the same device.
/// - The implementation of this function should be thread-safe.
Expand All @@ -4376,6 +4384,10 @@ urProgramRelease(
/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
/// + `NULL == pFunctionName`
/// + `NULL == ppFunctionPointer`
/// - ::UR_RESULT_ERROR_INVALID_KERNEL_NAME
/// + If `pFunctionName` couldn't be found in `hProgram`.
/// - ::UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE
/// + If `pFunctionName` could be located, but its address couldn't be retrieved.
UR_APIEXPORT ur_result_t UR_APICALL
urProgramGetFunctionPointer(
ur_device_handle_t hDevice, ///< [in] handle of the device to retrieve pointer for.
Expand Down Expand Up @@ -4777,7 +4789,7 @@ urKernelSetArgLocal(
/// @brief Get Kernel object information
typedef enum ur_kernel_info_t {
UR_KERNEL_INFO_FUNCTION_NAME = 0, ///< [char[]] Return null-terminated kernel function name.
UR_KERNEL_INFO_NUM_ARGS = 1, ///< [size_t] Return Kernel number of arguments.
UR_KERNEL_INFO_NUM_ARGS = 1, ///< [uint32_t] Return Kernel number of arguments.
UR_KERNEL_INFO_REFERENCE_COUNT = 2, ///< [uint32_t] Reference count of the kernel object.
///< The reference count returned should be considered immediately stale.
///< It is unsuitable for general use in applications. This feature is
Expand Down
25 changes: 20 additions & 5 deletions include/ur_print.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1541,8 +1541,8 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_result_t value) {
case UR_RESULT_ERROR_INVALID_GLOBAL_NAME:
os << "UR_RESULT_ERROR_INVALID_GLOBAL_NAME";
break;
case UR_RESULT_ERROR_INVALID_FUNCTION_NAME:
os << "UR_RESULT_ERROR_INVALID_FUNCTION_NAME";
case UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE:
os << "UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE";
break;
case UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION:
os << "UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION";
Expand Down Expand Up @@ -2524,6 +2524,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_device_info_t value) {
case UR_DEVICE_INFO_COMPOSITE_DEVICE:
os << "UR_DEVICE_INFO_COMPOSITE_DEVICE";
break;
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
os << "UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT";
break;
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP:
os << "UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP";
break;
Expand Down Expand Up @@ -4008,6 +4011,18 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_device_info

os << ")";
} break;
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT: {
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
if (sizeof(ur_bool_t) > size) {
os << "invalid size (is: " << size << ", expected: >=" << sizeof(ur_bool_t) << ")";
return UR_RESULT_ERROR_INVALID_SIZE;
}
os << (const void *)(tptr) << " (";

os << *tptr;

os << ")";
} break;
case UR_DEVICE_INFO_COMMAND_BUFFER_SUPPORT_EXP: {
const ur_bool_t *tptr = (const ur_bool_t *)ptr;
if (sizeof(ur_bool_t) > size) {
Expand Down Expand Up @@ -7855,9 +7870,9 @@ inline ur_result_t printTagged(std::ostream &os, const void *ptr, ur_kernel_info
printPtr(os, tptr);
} break;
case UR_KERNEL_INFO_NUM_ARGS: {
const size_t *tptr = (const size_t *)ptr;
if (sizeof(size_t) > size) {
os << "invalid size (is: " << size << ", expected: >=" << sizeof(size_t) << ")";
const uint32_t *tptr = (const uint32_t *)ptr;
if (sizeof(uint32_t) > size) {
os << "invalid size (is: " << size << ", expected: >=" << sizeof(uint32_t) << ")";
return UR_RESULT_ERROR_INVALID_SIZE;
}
os << (const void *)(tptr) << " (";
Expand Down
4 changes: 2 additions & 2 deletions scripts/core/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -251,8 +251,8 @@ etors:
desc: "[Validation] native binary is not supported by the device"
- name: ERROR_INVALID_GLOBAL_NAME
desc: "[Validation] global variable is not found in the program"
- name: ERROR_INVALID_FUNCTION_NAME
desc: "[Validation] function name is not found in the program"
- name: ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE
desc: "[Validation] function name is in the program but its address could not be determined"
- name: ERROR_INVALID_GROUP_SIZE_DIMENSION
desc: "[Validation] group size dimension is not valid for the kernel or device"
- name: ERROR_INVALID_GLOBAL_WIDTH_DIMENSION
Expand Down
2 changes: 2 additions & 0 deletions scripts/core/device.yml
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,8 @@ etors:
desc: "[$x_device_handle_t[]] The set of component devices contained by this composite device."
- name: COMPOSITE_DEVICE
desc: "[$x_device_handle_t] The composite device containing this component device."
- name: GLOBAL_VARIABLE_SUPPORT
desc: "[$x_bool_t] return true if the device supports the `EnqueueDeviceGlobalVariableWrite` and `EnqueueDeviceGlobalVariableRead` entry points."
--- #--------------------------------------------------------------------------
type: function
desc: "Retrieves various information about device"
Expand Down
2 changes: 1 addition & 1 deletion scripts/core/kernel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ etors:
- name: FUNCTION_NAME
desc: "[char[]] Return null-terminated kernel function name."
- name: NUM_ARGS
desc: "[size_t] Return Kernel number of arguments."
desc: "[uint32_t] Return Kernel number of arguments."
- name: REFERENCE_COUNT
desc: |
[uint32_t] Reference count of the kernel object.
Expand Down
8 changes: 6 additions & 2 deletions scripts/core/memory.yml
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,10 @@ members:
desc: "[in] image slice pitch"
- type: uint32_t
name: numMipLevel
desc: "[in] number of MIP levels"
desc: "[in] number of MIP levels, must be `0`"
- type: uint32_t
name: numSamples
desc: "[in] number of samples"
desc: "[in] number of samples, must be `0`"
--- #--------------------------------------------------------------------------
type: function
desc: "Create an image object"
Expand Down Expand Up @@ -242,6 +242,10 @@ returns:
- $X_RESULT_ERROR_INVALID_VALUE
- $X_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR:
- "`pImageDesc && UR_MEM_TYPE_IMAGE1D_ARRAY < pImageDesc->type`"
- "`pImageDesc && pImageDesc->numMipLevel != 0`"
- "`pImageDesc && pImageDesc->numSamples != 0`"
- "`pImageDesc && pImageDesc->rowPitch != 0 && pHost == nullptr`"
- "`pImageDesc && pImageDesc->slicePitch != 0 && pHost == nullptr`"
- $X_RESULT_ERROR_INVALID_IMAGE_SIZE
- $X_RESULT_ERROR_INVALID_OPERATION
- $X_RESULT_ERROR_INVALID_HOST_PTR:
Expand Down
7 changes: 6 additions & 1 deletion scripts/core/program.yml
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ analogue:
- "**clGetDeviceFunctionPointerINTEL**"
details:
- "Retrieves a pointer to the functions with the given name and defined in the given program."
- "$X_RESULT_ERROR_INVALID_FUNCTION_NAME is returned if the function can not be obtained."
- "$X_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE is returned if the function can not be obtained."
- "The application may call this function from simultaneous threads for the same device."
- "The implementation of this function should be thread-safe."
params:
Expand All @@ -313,6 +313,11 @@ params:
name: ppFunctionPointer
desc: |
[out] Returns the pointer to the function if it is found in the program.
returns:
- $X_RESULT_ERROR_INVALID_KERNEL_NAME:
- "If `pFunctionName` couldn't be found in `hProgram`."
- $X_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE:
- "If `pFunctionName` could be located, but its address couldn't be retrieved."
--- #--------------------------------------------------------------------------
type: function
desc: "Retrieves a pointer to a device global variable."
Expand Down
2 changes: 2 additions & 0 deletions source/adapters/cuda/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1075,6 +1075,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
return ReturnValue(true);
case UR_DEVICE_INFO_ESIMD_SUPPORT:
return ReturnValue(false);
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
return ReturnValue(true);
case UR_DEVICE_INFO_COMPONENT_DEVICES:
case UR_DEVICE_INFO_COMPOSITE_DEVICE:
case UR_DEVICE_INFO_MAX_READ_WRITE_IMAGE_ARGS:
Expand Down
4 changes: 3 additions & 1 deletion source/adapters/cuda/kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,9 @@ struct ur_kernel_handle_t_ {
/// Note this only returns the current known number of arguments, not the
/// real one required by the kernel, since this cannot be queried from
/// the CUDA Driver API
size_t getNumArgs() const noexcept { return Args.Indices.size() - 1; }
uint32_t getNumArgs() const noexcept {
return static_cast<uint32_t>(Args.Indices.size() - 1);
}

void setKernelArg(int Index, size_t Size, const void *Arg) {
Args.addArg(Index, Size, Arg);
Expand Down
10 changes: 0 additions & 10 deletions source/adapters/cuda/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,16 +208,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreate(
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
UR_ASSERT(pImageDesc->type <= UR_MEM_TYPE_IMAGE1D_ARRAY,
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
UR_ASSERT(pImageDesc->numMipLevel == 0,
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
UR_ASSERT(pImageDesc->numSamples == 0,
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
if (!pHost) {
UR_ASSERT(pImageDesc->rowPitch == 0,
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
UR_ASSERT(pImageDesc->slicePitch == 0,
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
}

// We only support RBGA channel order
// TODO: check SYCL CTS and spec. May also have to support BGRA
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/cuda/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramGetFunctionPointer(
UR_CHECK_ERROR(Ret);
if (Ret == CUDA_ERROR_NOT_FOUND) {
*ppFunctionPointer = 0;
Result = UR_RESULT_ERROR_INVALID_FUNCTION_NAME;
Result = UR_RESULT_ERROR_INVALID_KERNEL_NAME;
}

return Result;
Expand Down
2 changes: 2 additions & 0 deletions source/adapters/hip/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
return ReturnValue(true);
}

case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
return ReturnValue(false);
// TODO: Investigate if this information is available on HIP.
case UR_DEVICE_INFO_COMPONENT_DEVICES:
case UR_DEVICE_INFO_COMPOSITE_DEVICE:
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/hip/kernel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ struct ur_kernel_handle_t_ {
/// offset. Note this only returns the current known number of arguments,
/// not the real one required by the kernel, since this cannot be queried
/// from the HIP Driver API
size_t getNumArgs() const noexcept { return Args.Indices.size() - 1; }
uint32_t getNumArgs() const noexcept { return Args.Indices.size() - 1; }

void setKernelArg(int Index, size_t Size, const void *Arg) {
Args.addArg(Index, Size, Arg);
Expand Down
10 changes: 0 additions & 10 deletions source/adapters/hip/memory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -361,16 +361,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageCreate(
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
UR_ASSERT(pImageDesc->type <= UR_MEM_TYPE_IMAGE1D_ARRAY,
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
UR_ASSERT(pImageDesc->numMipLevel == 0,
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
UR_ASSERT(pImageDesc->numSamples == 0,
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
if (!pHost) {
UR_ASSERT(pImageDesc->rowPitch == 0,
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
UR_ASSERT(pImageDesc->slicePitch == 0,
UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR);
}

// We only support RBGA channel order
// TODO: check SYCL CTS and spec. May also have to support BGRA
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/hip/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramGetFunctionPointer(
UR_CHECK_ERROR(Ret);
if (Ret == hipErrorNotFound) {
*ppFunctionPointer = 0;
Result = UR_RESULT_ERROR_INVALID_FUNCTION_NAME;
Result = UR_RESULT_ERROR_INVALID_KERNEL_NAME;
}

return Result;
Expand Down
3 changes: 1 addition & 2 deletions source/adapters/level_zero/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,8 @@ ur_result_t ze2urResult(ze_result_t ZeResult) {
case ZE_RESULT_ERROR_INVALID_NATIVE_BINARY:
return UR_RESULT_ERROR_INVALID_BINARY;
case ZE_RESULT_ERROR_INVALID_KERNEL_NAME:
return UR_RESULT_ERROR_INVALID_KERNEL_NAME;
case ZE_RESULT_ERROR_INVALID_FUNCTION_NAME:
return UR_RESULT_ERROR_INVALID_FUNCTION_NAME;
return UR_RESULT_ERROR_INVALID_KERNEL_NAME;
case ZE_RESULT_ERROR_OVERLAPPING_REGIONS:
return UR_RESULT_ERROR_INVALID_OPERATION;
case ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION:
Expand Down
4 changes: 2 additions & 2 deletions source/adapters/level_zero/common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ static auto getUrResultString = [](ur_result_t Result) {
return "UR_RESULT_ERROR_INVALID_NATIVE_BINARY";
case UR_RESULT_ERROR_INVALID_GLOBAL_NAME:
return "UR_RESULT_ERROR_INVALID_GLOBAL_NAME";
case UR_RESULT_ERROR_INVALID_FUNCTION_NAME:
return "UR_RESULT_ERROR_INVALID_FUNCTION_NAME";
case UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE:
return "UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE";
case UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION:
return "UR_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION";
case UR_RESULT_ERROR_INVALID_GLOBAL_WIDTH_DIMENSION:
Expand Down
5 changes: 5 additions & 0 deletions source/adapters/level_zero/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -987,6 +987,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
case UR_DEVICE_INFO_INTEROP_MEMORY_EXPORT_SUPPORT_EXP:
case UR_DEVICE_INFO_INTEROP_SEMAPHORE_IMPORT_SUPPORT_EXP:
case UR_DEVICE_INFO_INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP:
case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS:
return ReturnValue(false);
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
return ReturnValue(true);

default:
logger::error("Unsupported ParamName in urGetDeviceInfo");
logger::error("ParamNameParamName={}(0x{})", ParamName,
Expand Down
2 changes: 1 addition & 1 deletion source/adapters/level_zero/program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urProgramGetFunctionPointer(
// exists
ClResult.pop_back();
if (is_in_separated_string(ClResult, ';', std::string(FunctionName)))
return UR_RESULT_ERROR_INVALID_FUNCTION_NAME;
return UR_RESULT_ERROR_FUNCTION_ADDRESS_NOT_AVAILABLE;

return UR_RESULT_ERROR_INVALID_KERNEL_NAME;
}
Expand Down
2 changes: 2 additions & 0 deletions source/adapters/opencl/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ ur_result_t mapCLErrorToUR(cl_int Result) {
return UR_RESULT_ERROR_INVALID_KERNEL_ARGS;
case CL_INVALID_COMMAND_QUEUE:
return UR_RESULT_ERROR_INVALID_QUEUE;
case CL_INVALID_ARG_SIZE:
return UR_RESULT_ERROR_INVALID_KERNEL_ARGUMENT_SIZE;
default:
return UR_RESULT_ERROR_UNKNOWN;
}
Expand Down
11 changes: 10 additions & 1 deletion source/adapters/opencl/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,13 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
{"cl_intel_program_scope_host_pipe"}, Supported));
return ReturnValue(Supported);
}
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT: {
bool Supported = false;
CL_RETURN_ON_FAILURE(cl_adapter::checkDeviceExtensions(
cl_adapter::cast<cl_device_id>(hDevice),
{"cl_intel_global_variable_access"}, Supported));
return ReturnValue(Supported);
}
case UR_DEVICE_INFO_QUEUE_PROPERTIES:
case UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES:
case UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES:
Expand Down Expand Up @@ -845,7 +852,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
case UR_DEVICE_INFO_COMPILER_AVAILABLE:
case UR_DEVICE_INFO_LINKER_AVAILABLE:
case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC:
case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS:
case UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: {
/* CL type: cl_bool
* UR type: ur_bool_t */
Expand Down Expand Up @@ -978,6 +984,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
return ReturnValue(UUID);
}

case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS: {
return ReturnValue(false);
}
/* TODO: Check regularly to see if support is enabled in OpenCL. Intel GPU
* EU device-specific information extensions. Some of the queries are
* enabled by cl_intel_device_attribute_query extension, but it's not yet in
Expand Down
Loading

0 comments on commit 0cbacd8

Please sign in to comment.