mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
fix: correctly report support for SPIR-V 1.0 through 1.3
Related-To: NEO-10336 Signed-off-by: Ben Ashbaugh <ben.ashbaugh@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6dec2143df
commit
5120ec2f93
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -140,6 +140,7 @@ class ClDevice : public BaseObject<_cl_device_id> {
|
||||
void initializeCaps();
|
||||
void initializeExtensionsWithVersion();
|
||||
void initializeOpenclCAllVersions();
|
||||
void initializeILsWithVersion();
|
||||
void initializeOsSpecificCaps();
|
||||
void initGTPinHelper();
|
||||
void setupFp64Flags();
|
||||
|
||||
@@ -31,7 +31,6 @@ namespace NEO {
|
||||
static std::string vendor = "Intel(R) Corporation";
|
||||
static std::string profile = "FULL_PROFILE";
|
||||
static std::string spirVersions = "1.2 ";
|
||||
static std::string spirvName = "SPIR-V";
|
||||
const char *latestConformanceVersionPassed = "v2023-05-16-00";
|
||||
#define QTR(a) #a
|
||||
#define TOSTR(b) QTR(b)
|
||||
@@ -142,8 +141,7 @@ void ClDevice::initializeCaps() {
|
||||
initializeOpenclCAllVersions();
|
||||
deviceInfo.platformLP = (hwInfo.capabilityTable.supportsOcl21Features == false);
|
||||
deviceInfo.spirVersions = spirVersions.c_str();
|
||||
deviceInfo.ilsWithVersion[0].version = CL_MAKE_VERSION(1, 2, 0);
|
||||
strcpy_s(deviceInfo.ilsWithVersion[0].name, CL_NAME_VERSION_MAX_NAME_SIZE, spirvName.c_str());
|
||||
initializeILsWithVersion();
|
||||
|
||||
deviceInfo.independentForwardProgress = hwInfo.capabilityTable.supportsIndependentForwardProgress;
|
||||
deviceInfo.maxNumOfSubGroups = 0;
|
||||
@@ -458,6 +456,25 @@ void ClDevice::initializeOpenclCAllVersions() {
|
||||
}
|
||||
}
|
||||
|
||||
void ClDevice::initializeILsWithVersion() {
|
||||
std::stringstream ilsStringStream{device.getDeviceInfo().ilVersion};
|
||||
std::vector<std::string> ilsVector{
|
||||
std::istream_iterator<std::string>{ilsStringStream}, std::istream_iterator<std::string>{}};
|
||||
deviceInfo.ilsWithVersion.reserve(ilsVector.size());
|
||||
for (auto &il : ilsVector) {
|
||||
size_t majorVersionPos = il.find_last_of('_');
|
||||
size_t minorVersionPos = il.find_last_of('.');
|
||||
if (majorVersionPos != std::string::npos && minorVersionPos != std::string::npos) {
|
||||
cl_name_version ilWithVersion;
|
||||
uint32_t majorVersion = static_cast<uint32_t>(std::stoul(il.substr(majorVersionPos + 1)));
|
||||
uint32_t minorVersion = static_cast<uint32_t>(std::stoul(il.substr(minorVersionPos + 1)));
|
||||
strcpy_s(ilWithVersion.name, CL_NAME_VERSION_MAX_NAME_SIZE, il.substr(0, majorVersionPos).c_str());
|
||||
ilWithVersion.version = CL_MAKE_VERSION(majorVersion, minorVersion, 0);
|
||||
deviceInfo.ilsWithVersion.push_back(ilWithVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const std::string ClDevice::getClDeviceName() const {
|
||||
return this->getDevice().getDeviceInfo().name;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -106,7 +106,6 @@ cl_int ClDevice::getDeviceInfo(cl_device_info paramName,
|
||||
case CL_DEVICE_HALF_FP_CONFIG: getCap<CL_DEVICE_HALF_FP_CONFIG >(src, srcSize, retSize); break;
|
||||
case CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL: getCap<CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL >(src, srcSize, retSize); break;
|
||||
case CL_DEVICE_HOST_UNIFIED_MEMORY: getCap<CL_DEVICE_HOST_UNIFIED_MEMORY >(src, srcSize, retSize); break;
|
||||
case CL_DEVICE_ILS_WITH_VERSION: getCap<CL_DEVICE_ILS_WITH_VERSION >(src, srcSize, retSize); break;
|
||||
case CL_DEVICE_IL_VERSION: getStr<CL_DEVICE_IL_VERSION >(src, srcSize, retSize); break;
|
||||
case CL_DEVICE_IMAGE_SUPPORT: getCap<CL_DEVICE_IMAGE_SUPPORT >(src, srcSize, retSize); break;
|
||||
case CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED: getStr<CL_DEVICE_LATEST_CONFORMANCE_VERSION_PASSED >(src, srcSize, retSize); break;
|
||||
@@ -236,6 +235,10 @@ cl_int ClDevice::getDeviceInfo(cl_device_info paramName,
|
||||
src = deviceInfo.openclCFeatures.data();
|
||||
retSize = srcSize = deviceInfo.openclCFeatures.size() * sizeof(cl_name_version);
|
||||
break;
|
||||
case CL_DEVICE_ILS_WITH_VERSION:
|
||||
src = deviceInfo.ilsWithVersion.data();
|
||||
retSize = srcSize = deviceInfo.ilsWithVersion.size() * sizeof(cl_name_version);
|
||||
break;
|
||||
case CL_DEVICE_BUILT_IN_KERNELS_WITH_VERSION:
|
||||
src = deviceInfo.builtInKernelsWithVersion.data();
|
||||
retSize = srcSize = deviceInfo.builtInKernelsWithVersion.size() * sizeof(cl_name_version);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -26,7 +26,7 @@ struct ClDeviceInfoParam {
|
||||
|
||||
// clang-format off
|
||||
struct ClDeviceInfo {
|
||||
cl_name_version ilsWithVersion[1];
|
||||
std::vector<cl_name_version> ilsWithVersion;
|
||||
StackVec<cl_name_version, 3> builtInKernelsWithVersion;
|
||||
StackVec<cl_name_version, 5> openclCAllVersions;
|
||||
OpenClCFeaturesContainer openclCFeatures;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -100,7 +100,6 @@ template<> struct Map<CL_DEVICE_HALF_FP_ATOMIC_CAPABILITIES_EXT > :
|
||||
template<> struct Map<CL_DEVICE_HALF_FP_CONFIG > : public ClMapBase<CL_DEVICE_HALF_FP_CONFIG, uint64_t, &ClDeviceInfo::halfFpConfig> {};
|
||||
template<> struct Map<CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL > : public ClMapBase<CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL, uint64_t, &ClDeviceInfo::hostMemCapabilities> {};
|
||||
template<> struct Map<CL_DEVICE_HOST_UNIFIED_MEMORY > : public ClMapBase<CL_DEVICE_HOST_UNIFIED_MEMORY, uint32_t, &ClDeviceInfo::hostUnifiedMemory> {};
|
||||
template<> struct Map<CL_DEVICE_ILS_WITH_VERSION > : public ClMapBase<CL_DEVICE_ILS_WITH_VERSION, cl_name_version[1], &ClDeviceInfo::ilsWithVersion> {};
|
||||
template<> struct Map<CL_DEVICE_IMAGE3D_MAX_HEIGHT > : public ClMapBase<CL_DEVICE_IMAGE3D_MAX_HEIGHT, size_t, &ClDeviceInfo::image3DMaxHeight> {};
|
||||
template<> struct Map<CL_DEVICE_IMAGE3D_MAX_WIDTH > : public ClMapBase<CL_DEVICE_IMAGE3D_MAX_WIDTH, size_t, &ClDeviceInfo::image3DMaxWidth> {};
|
||||
template<> struct Map<CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT > : public ClMapBase<CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT, uint32_t, &ClDeviceInfo::imageBaseAddressAlignment> {};
|
||||
|
||||
Reference in New Issue
Block a user