diff --git a/opencl/source/api/api.cpp b/opencl/source/api/api.cpp index ec0c336055..5c495cf0e1 100644 --- a/opencl/source/api/api.cpp +++ b/opencl/source/api/api.cpp @@ -3485,7 +3485,7 @@ void *clHostMemAllocINTEL( return nullptr; } - if (size > neoContext->getDevice(0u)->getDeviceInfo().maxMemAllocSize && !unifiedMemoryProperties.allocationFlags.flags.allowUnrestrictedSize) { + if (size > neoContext->getDevice(0u)->getSharedDeviceInfo().maxMemAllocSize && !unifiedMemoryProperties.allocationFlags.flags.allowUnrestrictedSize) { err.set(CL_INVALID_BUFFER_SIZE); return nullptr; } @@ -3521,7 +3521,7 @@ void *clDeviceMemAllocINTEL( return nullptr; } - if (size > neoContext->getDevice(0u)->getDeviceInfo().maxMemAllocSize && !unifiedMemoryProperties.allocationFlags.flags.allowUnrestrictedSize) { + if (size > neoContext->getDevice(0u)->getSharedDeviceInfo().maxMemAllocSize && !unifiedMemoryProperties.allocationFlags.flags.allowUnrestrictedSize) { err.set(CL_INVALID_BUFFER_SIZE); return nullptr; } @@ -3560,7 +3560,7 @@ void *clSharedMemAllocINTEL( return nullptr; } - if (size > neoContext->getDevice(0u)->getDeviceInfo().maxMemAllocSize && !unifiedMemoryProperties.allocationFlags.flags.allowUnrestrictedSize) { + if (size > neoContext->getDevice(0u)->getSharedDeviceInfo().maxMemAllocSize && !unifiedMemoryProperties.allocationFlags.flags.allowUnrestrictedSize) { err.set(CL_INVALID_BUFFER_SIZE); return nullptr; } @@ -4088,7 +4088,7 @@ void *CL_API_CALL clSVMAlloc(cl_context context, } auto pDevice = pContext->getDevice(0); - if ((size == 0) || (size > pDevice->getDeviceInfo().maxMemAllocSize)) { + if ((size == 0) || (size > pDevice->getSharedDeviceInfo().maxMemAllocSize)) { TRACING_EXIT(clSVMAlloc, &pAlloc); return pAlloc; } @@ -4731,7 +4731,7 @@ cl_command_queue CL_API_CALL clCreateCommandQueueWithProperties(cl_context conte auto commandQueueProperties = getCmdQueueProperties(properties); uint32_t maxOnDeviceQueueSize = pDevice->getDeviceInfo().queueOnDeviceMaxSize; - uint32_t maxOnDeviceQueues = pDevice->getDeviceInfo().maxOnDeviceQueues; + uint32_t maxOnDeviceQueues = pDevice->getSharedDeviceInfo().maxOnDeviceQueues; if (commandQueueProperties & static_cast(CL_QUEUE_ON_DEVICE)) { if (!(commandQueueProperties & static_cast(CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE))) { diff --git a/opencl/source/device/CMakeLists.txt b/opencl/source/device/CMakeLists.txt index 456e18d99f..aec331016c 100644 --- a/opencl/source/device/CMakeLists.txt +++ b/opencl/source/device/CMakeLists.txt @@ -8,6 +8,7 @@ set(RUNTIME_SRCS_DEVICE ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/cl_device.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cl_device.h + ${CMAKE_CURRENT_SOURCE_DIR}/cl_device_get_cap.inl ${CMAKE_CURRENT_SOURCE_DIR}/cl_device_vector.h ${CMAKE_CURRENT_SOURCE_DIR}/device_caps.cpp ${CMAKE_CURRENT_SOURCE_DIR}/device_info.cpp diff --git a/opencl/source/device/cl_device.cpp b/opencl/source/device/cl_device.cpp index 2e445a04c1..7d172a6754 100644 --- a/opencl/source/device/cl_device.cpp +++ b/opencl/source/device/cl_device.cpp @@ -50,7 +50,7 @@ ClDevice::ClDevice(Device &device, Platform *platform) : device(device), platfor subDevices.push_back(std::move(pClSubDevice)); } } - if (deviceInfo.debuggerActive) { + if (getSharedDeviceInfo().debuggerActive) { auto osInterface = device.getRootDeviceEnvironment().osInterface.get(); getSourceLevelDebugger()->notifyNewDevice(osInterface ? osInterface->getDeviceHandle() : 0); } @@ -58,7 +58,7 @@ ClDevice::ClDevice(Device &device, Platform *platform) : device(device), platfor ClDevice::~ClDevice() { - if (deviceInfo.debuggerActive) { + if (getSharedDeviceInfo().debuggerActive) { getSourceLevelDebugger()->notifyDeviceDestruction(); } @@ -97,6 +97,10 @@ unique_ptr_if_unused ClDevice::releaseApi() { return this->decRefApi(); } +const DeviceInfo &ClDevice::getSharedDeviceInfo() const { + return device.getDeviceInfo(); +} + ClDevice *ClDevice::getDeviceById(uint32_t deviceId) { UNRECOVERABLE_IF(deviceId >= getNumAvailableDevices()); if (subDevices.empty()) { diff --git a/opencl/source/device/cl_device.h b/opencl/source/device/cl_device.h index 4156922e74..62ce1fbe59 100644 --- a/opencl/source/device/cl_device.h +++ b/opencl/source/device/cl_device.h @@ -10,7 +10,7 @@ #include "shared/source/utilities/reference_tracked_object.h" #include "opencl/source/api/cl_types.h" -#include "opencl/source/device/device_info_map.h" +#include "opencl/source/device/device_info.h" #include "opencl/source/helpers/base_object.h" #include "engine_node.h" @@ -108,12 +108,12 @@ class ClDevice : public BaseObject<_cl_device_id> { Device &getDevice() const noexcept { return device; } const ClDeviceInfo &getDeviceInfo() const { return deviceInfo; } + const DeviceInfo &getSharedDeviceInfo() const; ClDevice *getDeviceById(uint32_t deviceId); const std::string &peekCompilerExtensions() const; std::unique_ptr syncBufferHandler; protected: - void copyCommonCapsFromDevice(); void initializeCaps(); void initializeExtraCaps(); void setupFp64Flags(); @@ -134,12 +134,4 @@ class ClDevice : public BaseObject<_cl_device_id> { std::string compilerExtensions; }; -template -inline void ClDevice::getCap(const void *&src, - size_t &size, - size_t &retSize) { - src = &DeviceInfoTable::Map::getValue(deviceInfo); - retSize = size = DeviceInfoTable::Map::size; -} - } // namespace NEO diff --git a/opencl/source/device/cl_device_get_cap.inl b/opencl/source/device/cl_device_get_cap.inl new file mode 100644 index 0000000000..755135c2c9 --- /dev/null +++ b/opencl/source/device/cl_device_get_cap.inl @@ -0,0 +1,21 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "opencl/source/device/cl_device.h" +#include "opencl/source/device/device_info_map.h" + +namespace NEO { + +template +inline void ClDevice::getCap(const void *&src, + size_t &size, + size_t &retSize) { + src = &DeviceInfoTable::Map::getValue(*this); + retSize = size = DeviceInfoTable::Map::size; +} + +} // namespace NEO diff --git a/opencl/source/device/device_caps.cpp b/opencl/source/device/device_caps.cpp index 21c9cf0b00..208071f8d8 100644 --- a/opencl/source/device/device_caps.cpp +++ b/opencl/source/device/device_caps.cpp @@ -179,51 +179,10 @@ void Device::initializeCaps() { } } -void ClDevice::copyCommonCapsFromDevice() { - auto &sourceDeviceInfo = device.getDeviceInfo(); - - deviceInfo.maxSubGroups = sourceDeviceInfo.maxSubGroups; - deviceInfo.debuggerActive = sourceDeviceInfo.debuggerActive; - deviceInfo.errorCorrectionSupport = sourceDeviceInfo.errorCorrectionSupport; - deviceInfo.force32BitAddressess = sourceDeviceInfo.force32BitAddressess; - deviceInfo.imageSupport = sourceDeviceInfo.imageSupport; - deviceInfo.vmeAvcSupportsPreemption = sourceDeviceInfo.vmeAvcSupportsPreemption; - deviceInfo.ilVersion = sourceDeviceInfo.ilVersion; - deviceInfo.profilingTimerResolution = sourceDeviceInfo.profilingTimerResolution; - deviceInfo.addressBits = sourceDeviceInfo.addressBits; - deviceInfo.computeUnitsUsedForScratch = sourceDeviceInfo.computeUnitsUsedForScratch; - deviceInfo.globalMemCachelineSize = sourceDeviceInfo.globalMemCachelineSize; - deviceInfo.maxClockFrequency = sourceDeviceInfo.maxClockFrequency; - deviceInfo.maxFrontEndThreads = sourceDeviceInfo.maxFrontEndThreads; - deviceInfo.maxOnDeviceQueues = sourceDeviceInfo.maxOnDeviceQueues; - deviceInfo.maxReadImageArgs = sourceDeviceInfo.maxReadImageArgs; - deviceInfo.maxSamplers = sourceDeviceInfo.maxSamplers; - deviceInfo.maxWriteImageArgs = sourceDeviceInfo.maxWriteImageArgs; - deviceInfo.numThreadsPerEU = sourceDeviceInfo.numThreadsPerEU; - deviceInfo.vendorId = sourceDeviceInfo.vendorId; - deviceInfo.globalMemSize = sourceDeviceInfo.globalMemSize; - deviceInfo.image2DMaxHeight = static_cast(sourceDeviceInfo.image2DMaxHeight); - deviceInfo.image2DMaxWidth = static_cast(sourceDeviceInfo.image2DMaxWidth); - deviceInfo.image3DMaxDepth = static_cast(sourceDeviceInfo.image3DMaxDepth); - deviceInfo.imageMaxArraySize = static_cast(sourceDeviceInfo.imageMaxArraySize); - deviceInfo.imageMaxBufferSize = static_cast(sourceDeviceInfo.imageMaxBufferSize); - deviceInfo.localMemSize = sourceDeviceInfo.localMemSize; - deviceInfo.maxMemAllocSize = sourceDeviceInfo.maxMemAllocSize; - deviceInfo.maxNumEUsPerSubSlice = static_cast(sourceDeviceInfo.maxNumEUsPerSubSlice); - deviceInfo.maxParameterSize = static_cast(sourceDeviceInfo.maxParameterSize); - deviceInfo.maxWorkGroupSize = static_cast(sourceDeviceInfo.maxWorkGroupSize); - deviceInfo.maxWorkItemSizes[0] = static_cast(sourceDeviceInfo.maxWorkItemSizes[0]); - deviceInfo.maxWorkItemSizes[1] = static_cast(sourceDeviceInfo.maxWorkItemSizes[1]); - deviceInfo.maxWorkItemSizes[2] = static_cast(sourceDeviceInfo.maxWorkItemSizes[2]); - deviceInfo.outProfilingTimerResolution = static_cast(sourceDeviceInfo.outProfilingTimerResolution); - deviceInfo.printfBufferSize = static_cast(sourceDeviceInfo.printfBufferSize); -} - void ClDevice::initializeCaps() { - copyCommonCapsFromDevice(); - auto &hwInfo = getHardwareInfo(); auto hwInfoConfig = HwInfoConfig::get(hwInfo.platform.eProductFamily); + auto &sharedDeviceInfo = getSharedDeviceInfo(); deviceExtensions.clear(); deviceExtensions.append(deviceExtensionsList); @@ -405,7 +364,7 @@ void ClDevice::initializeCaps() { // OpenCL 1.2 requires 128MB minimum - deviceInfo.maxConstantBufferSize = deviceInfo.maxMemAllocSize; + deviceInfo.maxConstantBufferSize = sharedDeviceInfo.maxMemAllocSize; deviceInfo.maxWorkItemDimensions = 3; @@ -415,13 +374,13 @@ void ClDevice::initializeCaps() { auto simdSizeUsed = DebugManager.flags.UseMaxSimdSizeToDeduceMaxWorkgroupSize.get() ? 32u : hwHelper.getMinimalSIMDSize(); // calculate a maximum number of subgroups in a workgroup (for the required SIMD size) - deviceInfo.maxNumOfSubGroups = static_cast(deviceInfo.maxWorkGroupSize / simdSizeUsed); + deviceInfo.maxNumOfSubGroups = static_cast(sharedDeviceInfo.maxWorkGroupSize / simdSizeUsed); deviceInfo.singleFpConfig |= defaultFpFlags; deviceInfo.halfFpConfig = defaultFpFlags; - printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "computeUnitsUsedForScratch: %d\n", deviceInfo.computeUnitsUsedForScratch); + printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "computeUnitsUsedForScratch: %d\n", sharedDeviceInfo.computeUnitsUsedForScratch); printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "hwInfo: {%d, %d}: (%d, %d, %d)\n", systemInfo.EUCount, @@ -450,7 +409,7 @@ void ClDevice::initializeCaps() { (CL_DEVICE_SVM_FINE_GRAIN_BUFFER | CL_DEVICE_SVM_ATOMICS)); deviceInfo.preemptionSupported = false; deviceInfo.maxGlobalVariableSize = 64 * 1024; - deviceInfo.globalVariablePreferredTotalSize = static_cast(deviceInfo.maxMemAllocSize); + deviceInfo.globalVariablePreferredTotalSize = static_cast(sharedDeviceInfo.maxMemAllocSize); deviceInfo.planarYuvMaxWidth = 16384; deviceInfo.planarYuvMaxHeight = 16352; diff --git a/opencl/source/device/device_info.cpp b/opencl/source/device/device_info.cpp index c62bfd6d2f..1f027cf58a 100644 --- a/opencl/source/device/device_info.cpp +++ b/opencl/source/device/device_info.cpp @@ -12,6 +12,7 @@ #include "shared/source/os_interface/os_time.h" #include "opencl/source/device/cl_device.h" +#include "opencl/source/device/cl_device_get_cap.inl" #include "opencl/source/device/cl_device_vector.h" #include "opencl/source/device/device_info_map.h" #include "opencl/source/helpers/cl_device_helpers.h" @@ -26,16 +27,16 @@ template inline void ClDevice::getStr(const void *&src, size_t &size, size_t &retSize) { - src = Map::getValue(deviceInfo); - retSize = size = strlen(Map::getValue(deviceInfo)) + 1; + src = Map::getValue(*this); + retSize = size = strlen(Map::getValue(*this)) + 1; } template <> inline void ClDevice::getCap(const void *&src, size_t &size, size_t &retSize) { - src = deviceInfo.maxWorkItemSizes; - retSize = size = sizeof(deviceInfo.maxWorkItemSizes); + src = getSharedDeviceInfo().maxWorkItemSizes; + retSize = size = sizeof(getSharedDeviceInfo().maxWorkItemSizes); } template <> @@ -50,8 +51,8 @@ template <> inline void ClDevice::getCap(const void *&src, size_t &size, size_t &retSize) { - src = device.getDeviceInfo().maxSubGroups.begin(); - retSize = size = (device.getDeviceInfo().maxSubGroups.size() * sizeof(size_t)); + src = getSharedDeviceInfo().maxSubGroups.begin(); + retSize = size = (getSharedDeviceInfo().maxSubGroups.size() * sizeof(size_t)); } cl_int ClDevice::getDeviceInfo(cl_device_info paramName, @@ -184,7 +185,7 @@ cl_int ClDevice::getDeviceInfo(cl_device_info paramName, break; } default: - if (getDeviceInfoForImage(paramName, src, srcSize, retSize) && !deviceInfo.imageSupport) { + if (getDeviceInfoForImage(paramName, src, srcSize, retSize) && !getSharedDeviceInfo().imageSupport) { src = &value; break; } diff --git a/opencl/source/device/device_info.h b/opencl/source/device/device_info.h index 400c912222..c8e9e693b4 100644 --- a/opencl/source/device/device_info.h +++ b/opencl/source/device/device_info.h @@ -17,33 +17,19 @@ // clang-format off struct ClDeviceInfo { - StackVec maxSubGroups; cl_device_type deviceType; - size_t maxWorkGroupSize; - size_t maxNumEUsPerSubSlice; size_t maxSliceCount; - cl_ulong maxMemAllocSize; - size_t imageMaxBufferSize; - size_t image2DMaxWidth; - size_t image2DMaxHeight; size_t image3DMaxWidth; size_t image3DMaxHeight; - size_t image3DMaxDepth; - size_t imageMaxArraySize; size_t maxBufferSize; size_t maxArraySize; - size_t maxParameterSize; cl_device_fp_config singleFpConfig; cl_device_fp_config halfFpConfig; cl_device_fp_config doubleFpConfig; cl_ulong globalMemCacheSize; - cl_ulong globalMemSize; cl_ulong maxConstantBufferSize; size_t maxGlobalVariableSize; size_t globalVariablePreferredTotalSize; - cl_ulong localMemSize; - double profilingTimerResolution; - size_t outProfilingTimerResolution; cl_device_exec_capabilities executionCapabilities; cl_command_queue_properties queueOnHostProperties; cl_command_queue_properties queueOnDeviceProperties; @@ -57,19 +43,15 @@ struct ClDeviceInfo { const char *clCVersion; const char *spirVersions; const char *deviceExtensions; - size_t printfBufferSize; cl_device_id parentDevice; cl_device_affinity_domain partitionAffinityDomain; cl_uint partitionMaxSubDevices; cl_device_partition_property partitionProperties[2]; cl_device_partition_property partitionType[3]; cl_device_svm_capabilities svmCapabilities; - const char *ilVersion; double platformHostTimerResolution; size_t planarYuvMaxWidth; size_t planarYuvMaxHeight; - size_t maxWorkItemSizes[3]; - cl_uint vendorId; cl_uint maxComputUnits; cl_uint maxWorkItemDimensions; cl_uint maxNumOfSubGroups; @@ -88,14 +70,7 @@ struct ClDeviceInfo { cl_uint nativeVectorWidthFloat; cl_uint nativeVectorWidthDouble; cl_uint nativeVectorWidthHalf; - cl_uint numThreadsPerEU; - cl_uint maxClockFrequency; - cl_uint addressBits; - cl_bool imageSupport; - cl_uint maxReadImageArgs; - cl_uint maxWriteImageArgs; cl_uint maxReadWriteImageArgs; - cl_uint maxSamplers; cl_uint imagePitchAlignment; cl_uint imageBaseAddressAlignment; cl_uint maxPipeArgs; @@ -104,17 +79,14 @@ struct ClDeviceInfo { cl_uint memBaseAddressAlign; cl_uint minDataTypeAlignSize; cl_device_mem_cache_type globalMemCacheType; - cl_uint globalMemCachelineSize; cl_uint maxConstantArgs; cl_device_local_mem_type localMemType; - cl_bool errorCorrectionSupport; cl_bool endianLittle; cl_bool deviceAvailable; cl_bool compilerAvailable; cl_bool linkerAvailable; cl_uint queueOnDevicePreferredSize; cl_uint queueOnDeviceMaxSize; - cl_uint maxOnDeviceQueues; cl_uint maxOnDeviceEvents; cl_bool preferredInteropUserSync; cl_uint referenceCount; @@ -122,22 +94,17 @@ struct ClDeviceInfo { cl_uint preferredGlobalAtomicAlignment; cl_uint preferredLocalAtomicAlignment; cl_bool hostUnifiedMemory; - uint32_t computeUnitsUsedForScratch; - uint32_t maxFrontEndThreads; - cl_bool vmeAvcSupportsPreemption; cl_bool vmeAvcSupportsTextureSampler; cl_uint vmeAvcVersion; cl_uint vmeVersion; cl_uint internalDriverVersion; cl_uint grfSize; - bool force32BitAddressess; bool preemptionSupported; /* Extensions supported */ bool nv12Extension; bool vmeExtension; bool platformLP; bool packedYuvExtension; - bool debuggerActive; /*Unified Shared Memory Capabilites*/ cl_unified_shared_memory_capabilities_intel hostMemCapabilities; cl_unified_shared_memory_capabilities_intel deviceMemCapabilities; @@ -149,17 +116,27 @@ struct ClDeviceInfo { struct DeviceInfo { StackVec maxSubGroups; - bool debuggerActive; - bool errorCorrectionSupport; - bool force32BitAddressess; - bool imageSupport; - bool sharedSystemAllocationsSupport; - bool vmeAvcSupportsPreemption; - const char *ilVersion; double profilingTimerResolution; + uint64_t globalMemSize; + uint64_t localMemSize; + uint64_t maxMemAllocSize; + const char *ilVersion; + size_t image2DMaxHeight; + size_t image2DMaxWidth; + size_t image3DMaxDepth; + size_t imageMaxArraySize; + size_t imageMaxBufferSize; + size_t maxNumEUsPerSubSlice; + size_t maxParameterSize; + size_t maxWorkGroupSize; + size_t maxWorkItemSizes[3]; + size_t outProfilingTimerResolution; + size_t printfBufferSize; uint32_t addressBits; uint32_t computeUnitsUsedForScratch; + uint32_t errorCorrectionSupport; uint32_t globalMemCachelineSize; + uint32_t imageSupport; uint32_t maxClockFrequency; uint32_t maxFrontEndThreads; uint32_t maxOnDeviceQueues; @@ -168,18 +145,8 @@ struct DeviceInfo { uint32_t maxWriteImageArgs; uint32_t numThreadsPerEU; uint32_t vendorId; - uint64_t globalMemSize; - uint64_t image2DMaxHeight; - uint64_t image2DMaxWidth; - uint64_t image3DMaxDepth; - uint64_t imageMaxArraySize; - uint64_t imageMaxBufferSize; - uint64_t localMemSize; - uint64_t maxMemAllocSize; - uint64_t maxNumEUsPerSubSlice; - uint64_t maxParameterSize; - uint64_t maxWorkGroupSize; - uint64_t maxWorkItemSizes[3]; - uint64_t outProfilingTimerResolution; - uint64_t printfBufferSize; + uint32_t vmeAvcSupportsPreemption; + bool debuggerActive; + bool force32BitAddressess; + bool sharedSystemAllocationsSupport; }; diff --git a/opencl/source/device/device_info_map.h b/opencl/source/device/device_info_map.h index 49e2ea5122..9f0b2575a9 100644 --- a/opencl/source/device/device_info_map.h +++ b/opencl/source/device/device_info_map.h @@ -7,6 +7,7 @@ #pragma once #include "opencl/extensions/public/cl_ext_private.h" +#include "opencl/source/device/cl_device.h" #include "opencl/source/device/device_info.h" #include "CL/cl_ext_intel.h" @@ -14,14 +15,26 @@ #include namespace DeviceInfoTable { + template +struct ClMapBase { + enum { param = Param }; + typedef _Type Type; + enum { size = sizeof(Type) }; + + static const Type &getValue(const NEO::ClDevice &clDevice) { + return clDevice.getDeviceInfo().*val; + } +}; + +template struct MapBase { enum { param = Param }; typedef _Type Type; enum { size = sizeof(Type) }; - static const Type &getValue(const ClDeviceInfo &deviceInfo) { - return deviceInfo.*val; + static const Type &getValue(const NEO::ClDevice &clDevice) { + return clDevice.getSharedDeviceInfo().*val; } }; @@ -37,110 +50,112 @@ struct Map {}; ////////////////////////////////////////////////////// // clang-format off // please keep alphabetical order -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; -template<> struct Map : public MapBase {}; + +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; +template<> struct Map : public MapBase {}; + +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; +template<> struct Map : public ClMapBase {}; // clang-format on } // namespace DeviceInfoTable diff --git a/opencl/source/device_queue/device_queue_hw_bdw_plus.inl b/opencl/source/device_queue/device_queue_hw_bdw_plus.inl index d1191d6adc..2bd78acab0 100644 --- a/opencl/source/device_queue/device_queue_hw_bdw_plus.inl +++ b/opencl/source/device_queue/device_queue_hw_bdw_plus.inl @@ -128,7 +128,7 @@ void DeviceQueueHw::addMediaStateClearCmds() { addDcFlushToPipeControlWa(pipeControl); - PreambleHelper::programVFEState(&slbCS, device->getHardwareInfo(), 0, 0, device->getDeviceInfo().maxFrontEndThreads, aub_stream::EngineType::ENGINE_RCS); + PreambleHelper::programVFEState(&slbCS, device->getHardwareInfo(), 0, 0, device->getSharedDeviceInfo().maxFrontEndThreads, aub_stream::EngineType::ENGINE_RCS); } template diff --git a/opencl/source/kernel/kernel.cpp b/opencl/source/kernel/kernel.cpp index e3a5bff2a3..7831c4b27c 100644 --- a/opencl/source/kernel/kernel.cpp +++ b/opencl/source/kernel/kernel.cpp @@ -105,7 +105,7 @@ Kernel::Kernel(Program *programArg, const KernelInfo &kernelInfoArg, const ClDev program->retain(); imageTransformer.reset(new ImageTransformer); - maxKernelWorkGroupSize = static_cast(device.getDeviceInfo().maxWorkGroupSize); + maxKernelWorkGroupSize = static_cast(device.getSharedDeviceInfo().maxWorkGroupSize); } Kernel::~Kernel() { @@ -276,7 +276,7 @@ cl_int Kernel::initialize() { : 0; if (privateSurfaceSize) { - privateSurfaceSize *= device.getDeviceInfo().computeUnitsUsedForScratch * getKernelInfo().getMaxSimdSize(); + privateSurfaceSize *= device.getSharedDeviceInfo().computeUnitsUsedForScratch * getKernelInfo().getMaxSimdSize(); DEBUG_BREAK_IF(privateSurfaceSize == 0); if ((is32Bit() || device.getMemoryManager()->peekForce32BitAllocations()) && (privateSurfaceSize > std::numeric_limits::max())) { retVal = CL_OUT_OF_RESOURCES; @@ -2215,7 +2215,7 @@ void Kernel::provideInitializationHints() { } if (patchInfo.mediavfestate) { auto scratchSize = patchInfo.mediavfestate->PerThreadScratchSpace; - scratchSize *= device.getDeviceInfo().computeUnitsUsedForScratch * getKernelInfo().getMaxSimdSize(); + scratchSize *= device.getSharedDeviceInfo().computeUnitsUsedForScratch * getKernelInfo().getMaxSimdSize(); if (scratchSize > 0) { context->providePerformanceHint(CL_CONTEXT_DIAGNOSTICS_LEVEL_BAD_INTEL, REGISTER_PRESSURE_TOO_HIGH, kernelInfo.name.c_str(), scratchSize); diff --git a/opencl/source/mem_obj/image.cpp b/opencl/source/mem_obj/image.cpp index cfc210beb9..16a373f893 100644 --- a/opencl/source/mem_obj/image.cpp +++ b/opencl/source/mem_obj/image.cpp @@ -23,6 +23,7 @@ #include "opencl/source/command_queue/command_queue.h" #include "opencl/source/context/context.h" #include "opencl/source/device/cl_device.h" +#include "opencl/source/device/cl_device_get_cap.inl" #include "opencl/source/helpers/get_info_status_mapper.h" #include "opencl/source/helpers/gmm_types_converter.h" #include "opencl/source/helpers/memory_properties_flags_helpers.h" @@ -198,7 +199,7 @@ Image *Image::create(Context *context, *context, true); imgInfo.preferRenderCompression &= !Image::isFormatRedescribable(surfaceFormat->OCLImageFormat); - if (!context->getDevice(0)->getDeviceInfo().imageSupport && !imgInfo.linearStorage) { + if (!context->getDevice(0)->getSharedDeviceInfo().imageSupport && !imgInfo.linearStorage) { errcodeRet = CL_INVALID_OPERATION; return nullptr; } diff --git a/opencl/source/program/kernel_info.cpp b/opencl/source/program/kernel_info.cpp index 34288d2418..1815211e1a 100644 --- a/opencl/source/program/kernel_info.cpp +++ b/opencl/source/program/kernel_info.cpp @@ -134,8 +134,9 @@ WorkSizeInfo::WorkSizeInfo(const DispatchInfo &dispatchInfo) { this->simdSize = (uint32_t)dispatchInfo.getKernel()->getKernelInfo().getMaxSimdSize(); this->slmTotalSize = (uint32_t)dispatchInfo.getKernel()->slmTotalSize; this->coreFamily = dispatchInfo.getKernel()->getDevice().getHardwareInfo().platform.eRenderCoreFamily; - this->numThreadsPerSubSlice = (uint32_t)dispatchInfo.getKernel()->getDevice().getDeviceInfo().maxNumEUsPerSubSlice * dispatchInfo.getKernel()->getDevice().getDeviceInfo().numThreadsPerEU; - this->localMemSize = (uint32_t)dispatchInfo.getKernel()->getDevice().getDeviceInfo().localMemSize; + this->numThreadsPerSubSlice = (uint32_t)dispatchInfo.getKernel()->getDevice().getSharedDeviceInfo().maxNumEUsPerSubSlice * + dispatchInfo.getKernel()->getDevice().getSharedDeviceInfo().numThreadsPerEU; + this->localMemSize = (uint32_t)dispatchInfo.getKernel()->getDevice().getSharedDeviceInfo().localMemSize; setIfUseImg(dispatchInfo.getKernel()); setMinWorkGroupSize(); } diff --git a/opencl/source/program/printf_handler.cpp b/opencl/source/program/printf_handler.cpp index 724559fb8f..d4dbf666ae 100644 --- a/opencl/source/program/printf_handler.cpp +++ b/opencl/source/program/printf_handler.cpp @@ -38,7 +38,7 @@ PrintfHandler *PrintfHandler::create(const MultiDispatchInfo &multiDispatchInfo, } void PrintfHandler::prepareDispatch(const MultiDispatchInfo &multiDispatchInfo) { - auto printfSurfaceSize = device.getDeviceInfo().printfBufferSize; + auto printfSurfaceSize = device.getSharedDeviceInfo().printfBufferSize; if (printfSurfaceSize == 0) { return; } diff --git a/opencl/source/program/program.cpp b/opencl/source/program/program.cpp index 349013f396..52beda8f73 100644 --- a/opencl/source/program/program.cpp +++ b/opencl/source/program/program.cpp @@ -72,7 +72,7 @@ Program::Program(ExecutionEnvironment &executionEnvironment, Context *context, b } else if (strstr(paramValue, "1.2")) { internalOptions = "-ocl-version=120 "; } - force32BitAddressess = pClDevice->getDeviceInfo().force32BitAddressess; + force32BitAddressess = pClDevice->getSharedDeviceInfo().force32BitAddressess; if (force32BitAddressess) { CompilerOptions::concatenateAppend(internalOptions, CompilerOptions::arch32bit); diff --git a/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp b/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp index 7da7f7c116..2f163365a5 100644 --- a/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp +++ b/opencl/test/unit_test/api/cl_create_command_queue_with_properties_tests.cpp @@ -276,7 +276,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, clCreateCommandQueueWithPropertiesApi, GivenNumberOf EXPECT_EQ(retVal, CL_SUCCESS); auto cmdq2 = clCreateCommandQueueWithProperties(pContext, devices[testedRootDeviceIndex], odq, &retVal); - if (pDevice->getDeviceInfo().maxOnDeviceQueues > 1) { + if (pDevice->getSharedDeviceInfo().maxOnDeviceQueues > 1) { EXPECT_NE(nullptr, cmdq2); EXPECT_EQ(retVal, CL_SUCCESS); } else { diff --git a/opencl/test/unit_test/api/cl_create_image_tests.cpp b/opencl/test/unit_test/api/cl_create_image_tests.cpp index 1870d43ee3..df77c1fb27 100644 --- a/opencl/test/unit_test/api/cl_create_image_tests.cpp +++ b/opencl/test/unit_test/api/cl_create_image_tests.cpp @@ -67,15 +67,17 @@ TEST_F(clCreateImageTest, GivenNullHostPtrWhenCreatingImageThenImageIsCreatedAnd } HWTEST_F(clCreateImageTest, GivenDeviceThatDoesntSupportImagesWhenCreatingTiledImageThenInvalidOperationErrorIsReturned) { - auto device = static_cast(pContext->getDevice(0)); - device->deviceInfo.imageSupport = CL_FALSE; + MockClDevice mockClDevice{MockDevice::createWithNewExecutionEnvironment(platformDevices[0], 0)}; + MockContext mockContext{&mockClDevice}; + + mockClDevice.sharedDeviceInfo.imageSupport = CL_FALSE; cl_bool imageSupportInfo = CL_TRUE; - auto status = clGetDeviceInfo(devices[testedRootDeviceIndex], CL_DEVICE_IMAGE_SUPPORT, sizeof(imageSupportInfo), &imageSupportInfo, nullptr); + auto status = clGetDeviceInfo(&mockClDevice, CL_DEVICE_IMAGE_SUPPORT, sizeof(imageSupportInfo), &imageSupportInfo, nullptr); EXPECT_EQ(CL_SUCCESS, status); cl_bool expectedValue = CL_FALSE; EXPECT_EQ(expectedValue, imageSupportInfo); auto image = clCreateImage( - pContext, + &mockContext, CL_MEM_READ_WRITE, &imageFormat, &imageDesc, @@ -94,10 +96,12 @@ HWTEST_F(clCreateImageTest, GivenDeviceThatDoesntSupportImagesWhenCreatingTiledI } HWTEST_F(clCreateImageTest, GivenDeviceThatDoesntSupportImagesWhenCreatingNonTiledImageThenCreate) { - auto device = static_cast(pContext->getDevice(0)); - device->deviceInfo.imageSupport = CL_FALSE; + MockClDevice mockClDevice{MockDevice::createWithNewExecutionEnvironment(platformDevices[0], 0)}; + MockContext mockContext{&mockClDevice}; + + mockClDevice.sharedDeviceInfo.imageSupport = CL_FALSE; cl_bool imageSupportInfo = CL_TRUE; - auto status = clGetDeviceInfo(devices[testedRootDeviceIndex], CL_DEVICE_IMAGE_SUPPORT, sizeof(imageSupportInfo), &imageSupportInfo, nullptr); + auto status = clGetDeviceInfo(&mockClDevice, CL_DEVICE_IMAGE_SUPPORT, sizeof(imageSupportInfo), &imageSupportInfo, nullptr); EXPECT_EQ(CL_SUCCESS, status); cl_bool expectedValue = CL_FALSE; EXPECT_EQ(expectedValue, imageSupportInfo); @@ -106,7 +110,7 @@ HWTEST_F(clCreateImageTest, GivenDeviceThatDoesntSupportImagesWhenCreatingNonTil imageDesc.image_height = 1; auto image = clCreateImage( - pContext, + &mockContext, CL_MEM_READ_WRITE, &imageFormat, &imageDesc, diff --git a/opencl/test/unit_test/api/cl_get_supported_image_formats_tests.inl b/opencl/test/unit_test/api/cl_get_supported_image_formats_tests.inl index 0c7062674a..e69b158ca6 100644 --- a/opencl/test/unit_test/api/cl_get_supported_image_formats_tests.inl +++ b/opencl/test/unit_test/api/cl_get_supported_image_formats_tests.inl @@ -18,7 +18,7 @@ using namespace NEO; typedef api_tests clGetSupportedImageFormatsTests; TEST_F(clGetSupportedImageFormatsTests, GivenValidParamsWhenGettingSupportImageFormatsThenNumImageFormatsIsGreaterThanZero) { - if (!pContext->getDevice(0)->getDeviceInfo().imageSupport) { + if (!pContext->getDevice(0)->getSharedDeviceInfo().imageSupport) { GTEST_SKIP(); } cl_uint numImageFormats = 0; @@ -97,7 +97,7 @@ TEST(clGetSupportedImageFormatsTest, givenPlatformWithoutDevicesWhenClGetSupport executionEnvironment->initializeMemoryManager(); executionEnvironment->prepareRootDeviceEnvironments(1); auto device = std::make_unique(*Device::create(executionEnvironment, 0u), platform()); - const ClDeviceInfo &devInfo = device->getDeviceInfo(); + const DeviceInfo &devInfo = device->getSharedDeviceInfo(); if (!devInfo.imageSupport) { GTEST_SKIP(); } diff --git a/opencl/test/unit_test/api/cl_set_default_device_command_queue_tests.inl b/opencl/test/unit_test/api/cl_set_default_device_command_queue_tests.inl index 782eb5749d..78274a7697 100644 --- a/opencl/test/unit_test/api/cl_set_default_device_command_queue_tests.inl +++ b/opencl/test/unit_test/api/cl_set_default_device_command_queue_tests.inl @@ -64,7 +64,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, clSetDefaultDeviceCommandQueueApiTest, GivenValidPar 0}; auto pDevice = castToObject(devices[testedRootDeviceIndex]); - if (pDevice->getDeviceInfo().maxOnDeviceQueues > 1) { + if (pDevice->getSharedDeviceInfo().maxOnDeviceQueues > 1) { auto newDeviceQueue = clCreateCommandQueueWithProperties(pContext, devices[testedRootDeviceIndex], properties, &retVal); ASSERT_NE(nullptr, newDeviceQueue); ASSERT_EQ(CL_SUCCESS, retVal); diff --git a/opencl/test/unit_test/api/cl_set_kernel_arg_svm_pointer_tests.inl b/opencl/test/unit_test/api/cl_set_kernel_arg_svm_pointer_tests.inl index b13cf40e83..f373796b43 100644 --- a/opencl/test/unit_test/api/cl_set_kernel_arg_svm_pointer_tests.inl +++ b/opencl/test/unit_test/api/cl_set_kernel_arg_svm_pointer_tests.inl @@ -100,7 +100,7 @@ TEST_F(clSetKernelArgSVMPointerTests, GivenLocalAddressAndNullArgValueWhenSettin TEST_F(clSetKernelArgSVMPointerTests, GivenInvalidArgValueWhenSettingKernelArgThenInvalidArgValueErrorIsReturned) { pClDevice->deviceInfo.sharedSystemMemCapabilities = 0u; - pClDevice->device.deviceInfo.sharedSystemAllocationsSupport = false; + pClDevice->sharedDeviceInfo.sharedSystemAllocationsSupport = false; void *ptrHost = malloc(256); EXPECT_NE(nullptr, ptrHost); @@ -182,7 +182,7 @@ TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndPointerWithOffsetWhenSettingKer TEST_F(clSetKernelArgSVMPointerTests, GivenSvmAndPointerWithInvalidOffsetWhenSettingKernelArgThenInvalidArgValueErrorIsReturned) { pClDevice->deviceInfo.sharedSystemMemCapabilities = 0u; - pClDevice->device.deviceInfo.sharedSystemAllocationsSupport = false; + pClDevice->sharedDeviceInfo.sharedSystemAllocationsSupport = false; const ClDeviceInfo &devInfo = pClDevice->getDeviceInfo(); if (devInfo.svmCapabilities != 0) { void *ptrSvm = clSVMAlloc(pContext, CL_MEM_READ_WRITE, 256, 4); diff --git a/opencl/test/unit_test/api/cl_unified_shared_memory_tests.inl b/opencl/test/unit_test/api/cl_unified_shared_memory_tests.inl index 70508941e3..0b61b5ddac 100644 --- a/opencl/test/unit_test/api/cl_unified_shared_memory_tests.inl +++ b/opencl/test/unit_test/api/cl_unified_shared_memory_tests.inl @@ -84,7 +84,7 @@ TEST(clUnifiedSharedMemoryTests, whenClDeviceMemAllocIntelIsCalledThenItAllocate TEST(clUnifiedSharedMemoryTests, whenUnifiedSharedMemoryAllocationCallsAreCalledWithSizeGreaterThenMaxMemAllocSizeThenErrorIsReturned) { MockContext mockContext; cl_int retVal = CL_SUCCESS; - auto maxMemAllocSize = mockContext.getDevice(0u)->getDeviceInfo().maxMemAllocSize; + auto maxMemAllocSize = mockContext.getDevice(0u)->getSharedDeviceInfo().maxMemAllocSize; size_t requestedSize = static_cast(maxMemAllocSize) + 1u; auto unfiedMemoryDeviceAllocation = clDeviceMemAllocINTEL(&mockContext, mockContext.getDevice(0u), nullptr, requestedSize, 0, &retVal); diff --git a/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp b/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp index 9bf7fa91d8..3ec6af4d31 100644 --- a/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp +++ b/opencl/test/unit_test/aub_tests/command_queue/enqueue_kernel_aub_tests.cpp @@ -511,7 +511,7 @@ HWTEST_F(AUBSimpleKernelStatelessTest, givenSimpleKernelWhenStatelessPathIsUsedT EXPECT_THAT(this->pProgram->getInternalOptions(), testing::HasSubstr(std::string(NEO::CompilerOptions::greaterThan4gbBuffersRequired))); - if (this->device->getDeviceInfo().force32BitAddressess) { + if (this->device->getSharedDeviceInfo().force32BitAddressess) { EXPECT_THAT(this->pProgram->getInternalOptions(), testing::HasSubstr(std::string(NEO::CompilerOptions::arch32bit))); } diff --git a/opencl/test/unit_test/command_queue/enqueue_debug_kernel_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_debug_kernel_tests.cpp index 8318a1ca39..f0e8d27654 100644 --- a/opencl/test/unit_test/command_queue/enqueue_debug_kernel_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_debug_kernel_tests.cpp @@ -37,7 +37,6 @@ class EnqueueDebugKernelTest : public ProgramSimpleFixture, if (pDevice->getHardwareInfo().platform.eRenderCoreFamily >= IGFX_GEN9_CORE) { pDevice->deviceInfo.debuggerActive = true; - pClDevice->deviceInfo.debuggerActive = true; std::string filename; std::string kernelOption(CompilerOptions::debugKernelEnable); KernelFilenameHelper::getKernelFilenameFromInternalOption(kernelOption, filename); diff --git a/opencl/test/unit_test/command_queue/local_work_size_tests.cpp b/opencl/test/unit_test/command_queue/local_work_size_tests.cpp index 07e7f198a3..648d6907d8 100644 --- a/opencl/test/unit_test/command_queue/local_work_size_tests.cpp +++ b/opencl/test/unit_test/command_queue/local_work_size_tests.cpp @@ -633,7 +633,7 @@ TEST(localWorkSizeTest, givenDispatchInfoWhenWorkSizeInfoIsCreatedThenItHasCorre auto threadsPerEu = platformDevices[0]->gtSystemInfo.ThreadCount / platformDevices[0]->gtSystemInfo.EUCount; auto euPerSubSlice = platformDevices[0]->gtSystemInfo.ThreadCount / platformDevices[0]->gtSystemInfo.MaxEuPerSubSlice; - auto &deviceInfo = device.deviceInfo; + auto &deviceInfo = device.sharedDeviceInfo; deviceInfo.maxNumEUsPerSubSlice = euPerSubSlice; deviceInfo.numThreadsPerEU = threadsPerEu; diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp index 6f1398fa31..53f591b6d4 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_2_tests.cpp @@ -583,13 +583,14 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenTwoConsecu EXPECT_EQ(false, kernel.mockKernel->isBuiltIn); auto deviceInfo = pClDevice->getDeviceInfo(); - if (deviceInfo.force32BitAddressess) { + auto sharedDeviceInfo = pDevice->getDeviceInfo(); + if (sharedDeviceInfo.force32BitAddressess) { EXPECT_FALSE(commandStreamReceiver->getGSBAFor32BitProgrammed()); } commandQueue.enqueueKernel(kernel, 1, nullptr, &GWS, nullptr, 0, nullptr, nullptr); - if (deviceInfo.force32BitAddressess) { + if (sharedDeviceInfo.force32BitAddressess) { EXPECT_TRUE(commandStreamReceiver->getGSBAFor32BitProgrammed()); } @@ -611,7 +612,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenTwoConsecu // Get address ( offset in 32 bit addressing ) of sratch graphicsAddress = (uint64_t)graphicsAllocationScratch->getGpuAddressToPatch(); - if (deviceInfo.force32BitAddressess && is64bit) { + if (sharedDeviceInfo.force32BitAddressess && is64bit) { EXPECT_TRUE(graphicsAllocationScratch->is32BitAllocation()); EXPECT_EQ(GmmHelper::decanonize(graphicsAllocationScratch->getGpuAddress()) - GSHaddress, graphicsAddress); } else if (!deviceInfo.svmCapabilities && is64bit) { @@ -627,7 +628,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenTwoConsecu uint64_t scratchBaseLowPart = (uint64_t)mediaVfeState->getScratchSpaceBasePointer(); uint64_t scratchBaseHighPart = (uint64_t)mediaVfeState->getScratchSpaceBasePointerHigh(); - if (is64bit && !deviceInfo.force32BitAddressess) { + if (is64bit && !sharedDeviceInfo.force32BitAddressess) { uint64_t expectedAddress = ScratchSpaceConstants::scratchSpaceOffsetFor64Bit; EXPECT_EQ(expectedAddress, scratchBaseLowPart); EXPECT_EQ(0u, scratchBaseHighPart); @@ -636,7 +637,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenTwoConsecu EXPECT_EQ(highPartGraphicsAddress, scratchBaseHighPart); } - if (deviceInfo.force32BitAddressess) { + if (sharedDeviceInfo.force32BitAddressess) { EXPECT_EQ(pDevice->getMemoryManager()->getExternalHeapBaseAddress(graphicsAllocationScratch->getRootDeviceIndex()), GSHaddress); } else { if (is64bit) { @@ -658,7 +659,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenTwoConsecu itorCmdForStateBase = find(itorWalker, cmdList.end()); // In 32 Bit addressing sba shouldn't be reprogrammed - if (pDevice->getDeviceInfo().force32BitAddressess == true) { + if (sharedDeviceInfo.force32BitAddressess == true) { EXPECT_EQ(itorCmdForStateBase, cmdList.end()); } @@ -670,7 +671,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenTwoConsecu uint64_t oldScratchAddr = ((uint64_t)scratchBaseHighPart << 32u) | scratchBaseLowPart; uint64_t newScratchAddr = ((uint64_t)cmdMediaVfeStateSecond->getScratchSpaceBasePointerHigh() << 32u) | cmdMediaVfeStateSecond->getScratchSpaceBasePointer(); - if (pDevice->getDeviceInfo().force32BitAddressess == true) { + if (sharedDeviceInfo.force32BitAddressess == true) { EXPECT_NE(oldScratchAddr, newScratchAddr); } } @@ -697,13 +698,14 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenNDRangeKer EXPECT_EQ(false, kernel.mockKernel->isBuiltIn); auto deviceInfo = pClDevice->getDeviceInfo(); - if (deviceInfo.force32BitAddressess) { + auto sharedDeviceInfo = pDevice->getDeviceInfo(); + if (sharedDeviceInfo.force32BitAddressess) { EXPECT_FALSE(commandStreamReceiver->getGSBAFor32BitProgrammed()); } commandQueue.enqueueKernel(kernel, 1, nullptr, &GWS, nullptr, 0, nullptr, nullptr); - if (deviceInfo.force32BitAddressess) { + if (sharedDeviceInfo.force32BitAddressess) { EXPECT_TRUE(commandStreamReceiver->getGSBAFor32BitProgrammed()); } @@ -725,7 +727,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenNDRangeKer // Get address ( offset in 32 bit addressing ) of sratch graphicsAddress = (uint64_t)graphicsAllocationScratch->getGpuAddressToPatch(); - if (deviceInfo.force32BitAddressess && is64bit) { + if (sharedDeviceInfo.force32BitAddressess && is64bit) { EXPECT_TRUE(graphicsAllocationScratch->is32BitAllocation()); EXPECT_EQ(GmmHelper::decanonize(graphicsAllocationScratch->getGpuAddress()) - GSHaddress, graphicsAddress); } else if (!deviceInfo.svmCapabilities && is64bit) { @@ -741,7 +743,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenNDRangeKer uint64_t scratchBaseLowPart = (uint64_t)mediaVfeState->getScratchSpaceBasePointer(); uint64_t scratchBaseHighPart = (uint64_t)mediaVfeState->getScratchSpaceBasePointerHigh(); - if (is64bit && !deviceInfo.force32BitAddressess) { + if (is64bit && !sharedDeviceInfo.force32BitAddressess) { lowPartGraphicsAddress = ScratchSpaceConstants::scratchSpaceOffsetFor64Bit; highPartGraphicsAddress = 0u; } @@ -749,7 +751,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenNDRangeKer EXPECT_EQ(lowPartGraphicsAddress, scratchBaseLowPart); EXPECT_EQ(highPartGraphicsAddress, scratchBaseHighPart); - if (deviceInfo.force32BitAddressess) { + if (sharedDeviceInfo.force32BitAddressess) { EXPECT_EQ(pDevice->getMemoryManager()->getExternalHeapBaseAddress(graphicsAllocationScratch->getRootDeviceIndex()), GSHaddress); } else { if (is64bit) { @@ -772,7 +774,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenNDRangeKer itorCmdForStateBase = find(itorWalker, cmdList.end()); - if (deviceInfo.force32BitAddressess) { + if (sharedDeviceInfo.force32BitAddressess) { EXPECT_NE(itorWalker, itorCmdForStateBase); if (itorCmdForStateBase != cmdList.end()) { @@ -783,14 +785,14 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandStreamReceiverFlushTaskTests, givenNDRangeKer EXPECT_NE(sba, sba2); EXPECT_EQ(0u, GSHaddress2); - if (deviceInfo.force32BitAddressess) { + if (sharedDeviceInfo.force32BitAddressess) { EXPECT_FALSE(commandStreamReceiver->getGSBAFor32BitProgrammed()); } } } delete buffer; - if (deviceInfo.force32BitAddressess) { + if (sharedDeviceInfo.force32BitAddressess) { // Asserts placed after restoring old CSR to avoid heap corruption ASSERT_NE(itorCmdForStateBase, cmdList.end()); } diff --git a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.cpp b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.cpp index 5fd6173533..5b36ced0f3 100644 --- a/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.cpp +++ b/opencl/test/unit_test/command_stream/command_stream_receiver_hw_tests.cpp @@ -142,6 +142,7 @@ HWTEST_F(UltCommandStreamReceiverTest, givenSentStateSipFlagSetAndSourceLevelDeb auto sizeForStateSip = PreemptionHelper::getRequiredStateSipCmdSize(*pDevice); EXPECT_EQ(sizeForStateSip, sizeWithSourceKernelDebugging - sizeWithoutSourceKernelDebugging - PreambleHelper::getKernelDebuggingCommandsSize(true)); + pDevice->setDebuggerActive(false); } HWTEST_F(UltCommandStreamReceiverTest, givenPreambleSentAndThreadArbitrationPolicyChangedWhenEstimatingPreambleCmdSizeThenResultDependsOnPolicyProgrammingCmdSize) { diff --git a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp index 968eaac7c5..95b3c2afa2 100644 --- a/opencl/test/unit_test/context/driver_diagnostics_tests.cpp +++ b/opencl/test/unit_test/context/driver_diagnostics_tests.cpp @@ -711,7 +711,7 @@ TEST_P(PerformanceHintKernelTest, GivenSpillFillWhenKernelIsInitializedThenConte mediaVFEstate.PerThreadScratchSpace = size; mockKernel.kernelInfo.patchInfo.mediavfestate = &mediaVFEstate; - size *= pDevice->getDeviceInfo().computeUnitsUsedForScratch * mockKernel.mockKernel->getKernelInfo().getMaxSimdSize(); + size *= pDevice->getSharedDeviceInfo().computeUnitsUsedForScratch * mockKernel.mockKernel->getKernelInfo().getMaxSimdSize(); mockKernel.mockKernel->initialize(); @@ -733,7 +733,7 @@ TEST_P(PerformanceHintKernelTest, GivenPrivateSurfaceWhenKernelIsInitializedThen allocateStatelessPrivateMemorySurface.DataParamSize = 8; mockKernel.kernelInfo.patchInfo.pAllocateStatelessPrivateSurface = &allocateStatelessPrivateMemorySurface; - size *= pDevice->getDeviceInfo().computeUnitsUsedForScratch * mockKernel.mockKernel->getKernelInfo().getMaxSimdSize(); + size *= pDevice->getSharedDeviceInfo().computeUnitsUsedForScratch * mockKernel.mockKernel->getKernelInfo().getMaxSimdSize(); mockKernel.mockKernel->initialize(); diff --git a/opencl/test/unit_test/device/device_caps_tests.cpp b/opencl/test/unit_test/device/device_caps_tests.cpp index 6cbe0ac0a9..2114506fad 100644 --- a/opencl/test/unit_test/device/device_caps_tests.cpp +++ b/opencl/test/unit_test/device/device_caps_tests.cpp @@ -45,6 +45,7 @@ struct DeviceGetCapsTest : public ::testing::Test { TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(platformDevices[0])); const auto &caps = device->getDeviceInfo(); + const auto &sharedCaps = device->getSharedDeviceInfo(); const auto &sysInfo = platformDevices[0]->gtSystemInfo; auto &hwHelper = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily); @@ -81,11 +82,11 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) { EXPECT_EQ(1u, caps.nativeVectorWidthDouble); EXPECT_EQ(8u, caps.nativeVectorWidthHalf); EXPECT_EQ(1u, caps.linkerAvailable); - EXPECT_NE(0u, caps.globalMemCachelineSize); + EXPECT_NE(0u, sharedCaps.globalMemCachelineSize); EXPECT_NE(0u, caps.globalMemCacheSize); - EXPECT_LT(0u, caps.globalMemSize); - EXPECT_EQ(caps.maxMemAllocSize, caps.maxConstantBufferSize); - EXPECT_NE(nullptr, caps.ilVersion); + EXPECT_LT(0u, sharedCaps.globalMemSize); + EXPECT_EQ(sharedCaps.maxMemAllocSize, caps.maxConstantBufferSize); + EXPECT_NE(nullptr, sharedCaps.ilVersion); EXPECT_EQ(static_cast(CL_TRUE), caps.deviceAvailable); EXPECT_EQ(static_cast(CL_READ_WRITE_CACHE), caps.globalMemCacheType); @@ -93,21 +94,21 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) { EXPECT_EQ(sysInfo.EUCount, caps.maxComputUnits); EXPECT_LT(0u, caps.maxConstantArgs); - EXPECT_LE(128u, caps.maxReadImageArgs); - EXPECT_LE(128u, caps.maxWriteImageArgs); + EXPECT_LE(128u, sharedCaps.maxReadImageArgs); + EXPECT_LE(128u, sharedCaps.maxWriteImageArgs); EXPECT_EQ(128u, caps.maxReadWriteImageArgs); - EXPECT_LE(caps.maxReadImageArgs * sizeof(cl_mem), caps.maxParameterSize); - EXPECT_LE(caps.maxWriteImageArgs * sizeof(cl_mem), caps.maxParameterSize); - EXPECT_LE(128u * MB, caps.maxMemAllocSize); - EXPECT_GE((4 * GB) - (8 * KB), caps.maxMemAllocSize); - EXPECT_LE(65536u, caps.imageMaxBufferSize); + EXPECT_LE(sharedCaps.maxReadImageArgs * sizeof(cl_mem), sharedCaps.maxParameterSize); + EXPECT_LE(sharedCaps.maxWriteImageArgs * sizeof(cl_mem), sharedCaps.maxParameterSize); + EXPECT_LE(128u * MB, sharedCaps.maxMemAllocSize); + EXPECT_GE((4 * GB) - (8 * KB), sharedCaps.maxMemAllocSize); + EXPECT_LE(65536u, sharedCaps.imageMaxBufferSize); - EXPECT_GT(caps.maxWorkGroupSize, 0u); - EXPECT_EQ(caps.maxWorkItemSizes[0], caps.maxWorkGroupSize); - EXPECT_EQ(caps.maxWorkItemSizes[1], caps.maxWorkGroupSize); - EXPECT_EQ(caps.maxWorkItemSizes[2], caps.maxWorkGroupSize); - EXPECT_LT(0u, caps.maxSamplers); + EXPECT_GT(sharedCaps.maxWorkGroupSize, 0u); + EXPECT_EQ(sharedCaps.maxWorkItemSizes[0], sharedCaps.maxWorkGroupSize); + EXPECT_EQ(sharedCaps.maxWorkItemSizes[1], sharedCaps.maxWorkGroupSize); + EXPECT_EQ(sharedCaps.maxWorkItemSizes[2], sharedCaps.maxWorkGroupSize); + EXPECT_LT(0u, sharedCaps.maxSamplers); // Minimum requirements for OpenCL 1.x EXPECT_EQ(static_cast(CL_FP_ROUND_TO_NEAREST), CL_FP_ROUND_TO_NEAREST & caps.singleFpConfig); @@ -132,10 +133,10 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) { EXPECT_EQ(1u, caps.endianLittle); auto expectedDeviceSubgroups = hwHelper.getDeviceSubGroupSizes(); - EXPECT_EQ(expectedDeviceSubgroups.size(), caps.maxSubGroups.size()); + EXPECT_EQ(expectedDeviceSubgroups.size(), sharedCaps.maxSubGroups.size()); for (uint32_t i = 0; i < expectedDeviceSubgroups.size(); i++) { - EXPECT_EQ(expectedDeviceSubgroups[i], caps.maxSubGroups[i]); + EXPECT_EQ(expectedDeviceSubgroups[i], sharedCaps.maxSubGroups[i]); } if (device->getEnabledClVersion() >= 21) { @@ -144,10 +145,10 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) { EXPECT_FALSE(caps.independentForwardProgress != 0); } - EXPECT_EQ(caps.maxWorkGroupSize / hwHelper.getMinimalSIMDSize(), caps.maxNumOfSubGroups); + EXPECT_EQ(sharedCaps.maxWorkGroupSize / hwHelper.getMinimalSIMDSize(), caps.maxNumOfSubGroups); EXPECT_EQ(1024u, caps.maxOnDeviceEvents); - EXPECT_EQ(1u, caps.maxOnDeviceQueues); + EXPECT_EQ(1u, sharedCaps.maxOnDeviceQueues); EXPECT_EQ(64u * MB, caps.queueOnDeviceMaxSize); EXPECT_EQ(128 * KB, caps.queueOnDevicePreferredSize); EXPECT_EQ(static_cast(CL_QUEUE_PROFILING_ENABLE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE), @@ -157,12 +158,12 @@ TEST_F(DeviceGetCapsTest, WhenCreatingDeviceThenCapsArePopulatedCorrectly) { EXPECT_EQ(64u, caps.preferredLocalAtomicAlignment); EXPECT_EQ(64u, caps.preferredPlatformAtomicAlignment); - EXPECT_EQ(static_cast(device->getHardwareInfo().capabilityTable.supportsImages), caps.imageSupport); - EXPECT_EQ(16384u, caps.image2DMaxWidth); - EXPECT_EQ(16384u, caps.image2DMaxHeight); - EXPECT_EQ(2048u, caps.imageMaxArraySize); + EXPECT_EQ(static_cast(device->getHardwareInfo().capabilityTable.supportsImages), sharedCaps.imageSupport); + EXPECT_EQ(16384u, sharedCaps.image2DMaxWidth); + EXPECT_EQ(16384u, sharedCaps.image2DMaxHeight); + EXPECT_EQ(2048u, sharedCaps.imageMaxArraySize); if (device->getHardwareInfo().capabilityTable.clVersionSupport == 12 && is64bit) { - EXPECT_TRUE(caps.force32BitAddressess); + EXPECT_TRUE(sharedCaps.force32BitAddressess); } } @@ -181,6 +182,7 @@ HWTEST_F(DeviceGetCapsTest, givenDeviceWhenAskingForSubGroupSizesThenReturnCorre TEST_F(DeviceGetCapsTest, GivenPlatformWhenGettingHwInfoThenImage3dDimensionsAreCorrect) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(platformDevices[0])); const auto &caps = device->getDeviceInfo(); + const auto &sharedCaps = device->getSharedDeviceInfo(); if (device->getHardwareInfo().platform.eRenderCoreFamily > IGFX_GEN8_CORE) { EXPECT_EQ(16384u, caps.image3DMaxWidth); @@ -190,7 +192,7 @@ TEST_F(DeviceGetCapsTest, GivenPlatformWhenGettingHwInfoThenImage3dDimensionsAre EXPECT_EQ(2048u, caps.image3DMaxHeight); } - EXPECT_EQ(2048u, caps.image3DMaxDepth); + EXPECT_EQ(2048u, sharedCaps.image3DMaxDepth); } TEST_F(DeviceGetCapsTest, givenDontForcePreemptionModeDebugVariableWhenCreateDeviceThenSetDefaultHwPreemptionMode) { @@ -289,31 +291,32 @@ TEST_F(DeviceGetCapsTest, givenForce32bitAddressingWhenCapsAreCreatedThenDeviceR DebugManager.flags.Force32bitAddressing.set(true); auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(platformDevices[0])); const auto &caps = device->getDeviceInfo(); + const auto &sharedCaps = device->getSharedDeviceInfo(); if (is64bit) { - EXPECT_TRUE(caps.force32BitAddressess); + EXPECT_TRUE(sharedCaps.force32BitAddressess); } else { - EXPECT_FALSE(caps.force32BitAddressess); + EXPECT_FALSE(sharedCaps.force32BitAddressess); } auto expectedSize = (cl_ulong)(4 * 0.8 * GB); - EXPECT_LE(caps.globalMemSize, expectedSize); - EXPECT_LE(caps.maxMemAllocSize, expectedSize); + EXPECT_LE(sharedCaps.globalMemSize, expectedSize); + EXPECT_LE(sharedCaps.maxMemAllocSize, expectedSize); EXPECT_LE(caps.maxConstantBufferSize, expectedSize); - EXPECT_EQ(caps.addressBits, 32u); + EXPECT_EQ(sharedCaps.addressBits, 32u); } } TEST_F(DeviceGetCapsTest, WhenDeviceIsCreatedThenGlobalMemSizeIsAlignedDownToPageSize) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(platformDevices[0])); - const auto &caps = device->getDeviceInfo(); + const auto &sharedCaps = device->getSharedDeviceInfo(); - auto expectedSize = alignDown(caps.globalMemSize, MemoryConstants::pageSize); + auto expectedSize = alignDown(sharedCaps.globalMemSize, MemoryConstants::pageSize); - EXPECT_EQ(caps.globalMemSize, expectedSize); + EXPECT_EQ(sharedCaps.globalMemSize, expectedSize); } TEST_F(DeviceGetCapsTest, Given32bitAddressingWhenDeviceIsCreatedThenGlobalMemSizeIsAlignedDownToPageSize) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(platformDevices[0])); - const auto &caps = device->getDeviceInfo(); + const auto &sharedCaps = device->getSharedDeviceInfo(); auto pMemManager = device->getMemoryManager(); unsigned int enabledCLVer = device->getEnabledClVersion(); bool addressing32Bit = is32bit || (is64bit && (enabledCLVer < 20)) || DebugManager.flags.Force32bitAddressing.get(); @@ -327,7 +330,7 @@ TEST_F(DeviceGetCapsTest, Given32bitAddressingWhenDeviceIsCreatedThenGlobalMemSi } cl_ulong expectedSize = alignDown(memSize, MemoryConstants::pageSize); - EXPECT_EQ(caps.globalMemSize, expectedSize); + EXPECT_EQ(sharedCaps.globalMemSize, expectedSize); } TEST_F(DeviceGetCapsTest, givenDeviceCapsWhenLocalMemoryIsEnabledThenCalculateGlobalMemSizeBasedOnLocalMemory) { @@ -335,7 +338,7 @@ TEST_F(DeviceGetCapsTest, givenDeviceCapsWhenLocalMemoryIsEnabledThenCalculateGl DebugManager.flags.EnableLocalMemory.set(true); auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(platformDevices[0])); - const auto &caps = device->getDeviceInfo(); + const auto &sharedCaps = device->getSharedDeviceInfo(); auto pMemManager = device->getMemoryManager(); auto enabledCLVer = device->getEnabledClVersion(); bool addressing32Bit = is32bit || (is64bit && (enabledCLVer < 20)) || DebugManager.flags.Force32bitAddressing.get(); @@ -349,7 +352,7 @@ TEST_F(DeviceGetCapsTest, givenDeviceCapsWhenLocalMemoryIsEnabledThenCalculateGl } cl_ulong expectedSize = alignDown(memSize, MemoryConstants::pageSize); - EXPECT_EQ(caps.globalMemSize, expectedSize); + EXPECT_EQ(sharedCaps.globalMemSize, expectedSize); } TEST_F(DeviceGetCapsTest, givenGlobalMemSizeWhenCalculatingMaxAllocSizeThenAdjustToHWCap) { @@ -940,8 +943,8 @@ TEST(DeviceGetCaps, givenDebugFlagToUseMaxSimdSizeForWkgCalculationWhenDeviceCap mySysInfo.ThreadCount = 24 * 7; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&myHwInfo)); - EXPECT_EQ(1024u, device->getDeviceInfo().maxWorkGroupSize); - EXPECT_EQ(device->getDeviceInfo().maxWorkGroupSize / 32, device->getDeviceInfo().maxNumOfSubGroups); + EXPECT_EQ(1024u, device->getSharedDeviceInfo().maxWorkGroupSize); + EXPECT_EQ(device->getSharedDeviceInfo().maxWorkGroupSize / 32, device->getDeviceInfo().maxNumOfSubGroups); } TEST(DeviceGetCaps, givenDebugFlagToUseCertainWorkgroupSizeWhenDeviceIsCreatedItHasCeratinWorkgroupSize) { @@ -969,8 +972,8 @@ HWTEST_F(DeviceGetCapsTest, givenDeviceThatHasHighNumberOfExecutionUnitsWhenMaxW mySysInfo.ThreadCount = 32 * hwHelper.getMinimalSIMDSize(); // 128 threads per subslice, in simd 8 gives 1024 auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&myHwInfo)); - EXPECT_EQ(1024u, device->getDeviceInfo().maxWorkGroupSize); - EXPECT_EQ(device->getDeviceInfo().maxWorkGroupSize / hwHelper.getMinimalSIMDSize(), device->getDeviceInfo().maxNumOfSubGroups); + EXPECT_EQ(1024u, device->getSharedDeviceInfo().maxWorkGroupSize); + EXPECT_EQ(device->getSharedDeviceInfo().maxWorkGroupSize / hwHelper.getMinimalSIMDSize(), device->getDeviceInfo().maxNumOfSubGroups); } class DriverInfoMock : public DriverInfo { @@ -1097,24 +1100,30 @@ TEST(Device_UseCaps, givenCapabilityTableWhenDeviceInitializeCapsThenVmeVersions hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption = 0; auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(&hwInfo)); - device->initializeCaps(); - EXPECT_EQ(0u, device->getDeviceInfo().vmeVersion); - EXPECT_EQ(0u, device->getDeviceInfo().vmeAvcVersion); - EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption, device->getDeviceInfo().vmeAvcSupportsPreemption); - EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler, device->getDeviceInfo().vmeAvcSupportsTextureSampler); + { + auto &caps = device->getDeviceInfo(); + auto &sharedCaps = device->getSharedDeviceInfo(); + EXPECT_EQ(0u, caps.vmeVersion); + EXPECT_EQ(0u, caps.vmeAvcVersion); + EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption, sharedCaps.vmeAvcSupportsPreemption); + EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler, caps.vmeAvcSupportsTextureSampler); + } hwInfo.capabilityTable.supportsVme = 1; hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler = 1; hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption = 1; device.reset(new MockClDevice{MockDevice::createWithNewExecutionEnvironment(&hwInfo)}); - device->initializeCaps(); - EXPECT_EQ(expectedVmeVersion, device->getDeviceInfo().vmeVersion); - EXPECT_EQ(expectedVmeAvcVersion, device->getDeviceInfo().vmeAvcVersion); - EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption, device->getDeviceInfo().vmeAvcSupportsPreemption); - EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler, device->getDeviceInfo().vmeAvcSupportsTextureSampler); + { + auto &caps = device->getDeviceInfo(); + auto &sharedCaps = device->getSharedDeviceInfo(); + EXPECT_EQ(expectedVmeVersion, caps.vmeVersion); + EXPECT_EQ(expectedVmeAvcVersion, caps.vmeAvcVersion); + EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcPreemption, sharedCaps.vmeAvcSupportsPreemption); + EXPECT_EQ(hwInfo.capabilityTable.ftrSupportsVmeAvcTextureSampler, caps.vmeAvcSupportsTextureSampler); + } } typedef HwHelperTest DeviceCapsWithModifiedHwInfoTest; diff --git a/opencl/test/unit_test/device/device_tests.cpp b/opencl/test/unit_test/device/device_tests.cpp index 948443de19..054ff63084 100644 --- a/opencl/test/unit_test/device/device_tests.cpp +++ b/opencl/test/unit_test/device/device_tests.cpp @@ -106,49 +106,6 @@ TEST_F(DeviceTest, WhenRetainingThenReferenceIsOneAndApiIsUsed) { ASSERT_EQ(1, pClDevice->getReference()); } -TEST_F(DeviceTest, WhenCreatingClDeviceThenDeviceInfoIsCopiedFromDevice) { - auto &deviceInfo = pDevice->getDeviceInfo(); - auto &clDeviceInfo = pClDevice->getDeviceInfo(); - - EXPECT_EQ(deviceInfo.maxSubGroups, clDeviceInfo.maxSubGroups); - EXPECT_EQ(deviceInfo.debuggerActive, clDeviceInfo.debuggerActive); - EXPECT_EQ(deviceInfo.errorCorrectionSupport, clDeviceInfo.errorCorrectionSupport); - EXPECT_EQ(deviceInfo.force32BitAddressess, clDeviceInfo.force32BitAddressess); - EXPECT_EQ(deviceInfo.imageSupport, clDeviceInfo.imageSupport); - EXPECT_EQ(deviceInfo.vmeAvcSupportsPreemption, clDeviceInfo.vmeAvcSupportsPreemption); - EXPECT_EQ(deviceInfo.ilVersion, clDeviceInfo.ilVersion); - EXPECT_EQ(deviceInfo.profilingTimerResolution, clDeviceInfo.profilingTimerResolution); - EXPECT_EQ(deviceInfo.addressBits, clDeviceInfo.addressBits); - EXPECT_EQ(deviceInfo.computeUnitsUsedForScratch, clDeviceInfo.computeUnitsUsedForScratch); - EXPECT_EQ(deviceInfo.globalMemCachelineSize, clDeviceInfo.globalMemCachelineSize); - EXPECT_EQ(deviceInfo.maxClockFrequency, clDeviceInfo.maxClockFrequency); - EXPECT_EQ(deviceInfo.maxFrontEndThreads, clDeviceInfo.maxFrontEndThreads); - EXPECT_EQ(deviceInfo.maxOnDeviceQueues, clDeviceInfo.maxOnDeviceQueues); - EXPECT_EQ(deviceInfo.maxReadImageArgs, clDeviceInfo.maxReadImageArgs); - EXPECT_EQ(deviceInfo.maxSamplers, clDeviceInfo.maxSamplers); - EXPECT_EQ(deviceInfo.maxWriteImageArgs, clDeviceInfo.maxWriteImageArgs); - EXPECT_EQ(deviceInfo.numThreadsPerEU, clDeviceInfo.numThreadsPerEU); - EXPECT_EQ(deviceInfo.vendorId, clDeviceInfo.vendorId); - EXPECT_EQ(deviceInfo.globalMemSize, clDeviceInfo.globalMemSize); - EXPECT_EQ(deviceInfo.image2DMaxHeight, clDeviceInfo.image2DMaxHeight); - EXPECT_EQ(deviceInfo.image2DMaxWidth, clDeviceInfo.image2DMaxWidth); - EXPECT_EQ(deviceInfo.image3DMaxDepth, clDeviceInfo.image3DMaxDepth); - EXPECT_EQ(deviceInfo.imageMaxArraySize, clDeviceInfo.imageMaxArraySize); - EXPECT_EQ(deviceInfo.imageMaxBufferSize, clDeviceInfo.imageMaxBufferSize); - EXPECT_EQ(deviceInfo.localMemSize, clDeviceInfo.localMemSize); - EXPECT_EQ(deviceInfo.maxMemAllocSize, clDeviceInfo.maxMemAllocSize); - EXPECT_EQ(deviceInfo.maxNumEUsPerSubSlice, clDeviceInfo.maxNumEUsPerSubSlice); - EXPECT_EQ(deviceInfo.maxParameterSize, clDeviceInfo.maxParameterSize); - EXPECT_EQ(deviceInfo.maxWorkGroupSize, clDeviceInfo.maxWorkGroupSize); - EXPECT_EQ(deviceInfo.maxWorkItemSizes[0], clDeviceInfo.maxWorkItemSizes[0]); - EXPECT_EQ(deviceInfo.maxWorkItemSizes[1], clDeviceInfo.maxWorkItemSizes[1]); - EXPECT_EQ(deviceInfo.maxWorkItemSizes[2], clDeviceInfo.maxWorkItemSizes[2]); - EXPECT_EQ(deviceInfo.outProfilingTimerResolution, clDeviceInfo.outProfilingTimerResolution); - EXPECT_EQ(deviceInfo.printfBufferSize, clDeviceInfo.printfBufferSize); - - EXPECT_EQ(deviceInfo.sharedSystemAllocationsSupport, (clDeviceInfo.sharedSystemMemCapabilities != 0)); -} - HWTEST_F(DeviceTest, WhenDeviceIsCreatedThenActualEngineTypeIsSameAsDefault) { HardwareInfo hwInfo = *platformDevices[0]; if (hwInfo.capabilityTable.defaultEngineType == aub_stream::EngineType::ENGINE_CCS) { diff --git a/opencl/test/unit_test/device/get_device_info_size_tests.cpp b/opencl/test/unit_test/device/get_device_info_size_tests.cpp index 402277e004..5ff6be3741 100644 --- a/opencl/test/unit_test/device/get_device_info_size_tests.cpp +++ b/opencl/test/unit_test/device/get_device_info_size_tests.cpp @@ -130,7 +130,7 @@ struct GetDeviceInfoForImage : public GetDeviceInfoSize {}; TEST_P(GetDeviceInfoForImage, imageInfoSizeIsValid) { auto device = std::make_unique(*MockDevice::createWithNewExecutionEnvironment(nullptr), platform()); - if (!device->getDeviceInfo().imageSupport) { + if (!device->getSharedDeviceInfo().imageSupport) { GTEST_SKIP(); } size_t sizeReturned = 0; @@ -148,7 +148,7 @@ TEST_P(GetDeviceInfoForImage, imageInfoSizeIsValid) { TEST_P(GetDeviceInfoForImage, whenImageAreNotSupportedThenClSuccessAndSizeofCluintIsReturned) { auto device = std::make_unique(*MockDevice::createWithNewExecutionEnvironment(nullptr), platform()); - if (device->getDeviceInfo().imageSupport) { + if (device->getSharedDeviceInfo().imageSupport) { GTEST_SKIP(); } size_t sizeReturned = 0; diff --git a/opencl/test/unit_test/device/get_device_info_tests.cpp b/opencl/test/unit_test/device/get_device_info_tests.cpp index 4601cf2e15..e4ed6efde8 100644 --- a/opencl/test/unit_test/device/get_device_info_tests.cpp +++ b/opencl/test/unit_test/device/get_device_info_tests.cpp @@ -44,7 +44,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, GetDeviceInfoMemCapabilitiesTest, GivenValidParamete TEST(GetDeviceInfo, GivenPlanarYuvExtensionDisabledAndSupportImageEnabledWhenGettingPlanarYuvMaxWidthHeightThenInvalidValueErrorIsReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = true; + device->sharedDeviceInfo.imageSupport = true; device->deviceInfo.nv12Extension = false; uint32_t value; @@ -67,7 +67,7 @@ TEST(GetDeviceInfo, GivenPlanarYuvExtensionDisabledAndSupportImageEnabledWhenGet TEST(GetDeviceInfo, GivenPlanarYuvExtensionEnabledAndSupportImageEnabledWhenGettingPlanarYuvMaxWidthHeightThenCorrectValuesAreReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = true; + device->sharedDeviceInfo.imageSupport = true; device->deviceInfo.nv12Extension = true; size_t value = 0; @@ -92,7 +92,7 @@ TEST(GetDeviceInfo, GivenPlanarYuvExtensionEnabledAndSupportImageEnabledWhenGett TEST(GetDeviceInfo, GivenPlanarYuvExtensionDisabledAndSupportImageDisabledWhenGettingPlanarYuvMaxWidthHeightThenInvalidValueErrorIsReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = false; + device->sharedDeviceInfo.imageSupport = false; device->deviceInfo.nv12Extension = false; uint32_t value; @@ -115,7 +115,7 @@ TEST(GetDeviceInfo, GivenPlanarYuvExtensionDisabledAndSupportImageDisabledWhenGe TEST(GetDeviceInfo, GivenPlanarYuvExtensionEnabledAndSupportImageDisabledWhenGettingPlanarYuvMaxWidthHeightThenZeroIsReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = false; + device->sharedDeviceInfo.imageSupport = false; device->deviceInfo.nv12Extension = true; size_t value = 0; @@ -141,7 +141,7 @@ TEST(GetDeviceInfo, GivenPlanarYuvExtensionEnabledAndSupportImageDisabledWhenGet TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImage2dMaxWidthHeightThenZeroIsReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = false; + device->sharedDeviceInfo.imageSupport = false; size_t value = 0; auto retVal = device->getDeviceInfo( @@ -166,7 +166,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImage2dMaxWidthHeightThe TEST(GetDeviceInfo, GivenImageSupportEnabledWhenGettingImage2dMaxWidthHeightThenCorrectValuesAreReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = true; + device->sharedDeviceInfo.imageSupport = true; size_t value = 0; auto retVal = device->getDeviceInfo( @@ -190,7 +190,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImage3dMaxWidthHeightDep auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); size_t value = 0; - device->deviceInfo.imageSupport = false; + device->sharedDeviceInfo.imageSupport = false; auto retVal = device->getDeviceInfo( CL_DEVICE_IMAGE3D_MAX_WIDTH, @@ -223,7 +223,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImage3dMaxWidthHeightDep TEST(GetDeviceInfo, GivenImageSupportEnabledWhenGettingImage3dMaxWidthHeightDepthThenCorrectValuesAreReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = true; + device->sharedDeviceInfo.imageSupport = true; size_t value = 0; auto retVal = device->getDeviceInfo( @@ -254,7 +254,7 @@ TEST(GetDeviceInfo, GivenImageSupportEnabledWhenGettingImage3dMaxWidthHeightDept TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImageMaxArgsThenZeroIsReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = false; + device->sharedDeviceInfo.imageSupport = false; uint32_t value; auto retVal = device->getDeviceInfo( @@ -288,7 +288,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImageMaxArgsThenZeroIsRe TEST(GetDeviceInfo, GivenImageSupportEnabledWhenGettingImageMaxArgsThenCorrectValuesAreReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = true; + device->sharedDeviceInfo.imageSupport = true; size_t value = 0; auto retVal = device->getDeviceInfo( @@ -320,7 +320,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImageBaseAddressAlignmen auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); size_t value = 0; - device->deviceInfo.imageSupport = false; + device->sharedDeviceInfo.imageSupport = false; auto retVal = device->getDeviceInfo( CL_DEVICE_IMAGE_BASE_ADDRESS_ALIGNMENT, @@ -335,7 +335,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImageBaseAddressAlignmen TEST(GetDeviceInfo, GivenImageSupportEnabledWhenGettingImageBaseAddressAlignmentThenCorrectValuesAreReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = true; + device->sharedDeviceInfo.imageSupport = true; size_t value = 0; auto retVal = device->getDeviceInfo( @@ -351,7 +351,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImageMaxArraySizeThenZer auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); size_t value = 0; - device->deviceInfo.imageSupport = false; + device->sharedDeviceInfo.imageSupport = false; auto retVal = device->getDeviceInfo( CL_DEVICE_IMAGE_MAX_ARRAY_SIZE, @@ -366,7 +366,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImageMaxArraySizeThenZer TEST(GetDeviceInfo, GivenImageSupportEnabledWhenGettingImageMaxArraySizeThenCorrectValuesAreReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = true; + device->sharedDeviceInfo.imageSupport = true; size_t value = 0; auto retVal = device->getDeviceInfo( @@ -382,7 +382,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImageMaxBufferSizeThenZe auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); size_t value = 0; - device->deviceInfo.imageSupport = false; + device->sharedDeviceInfo.imageSupport = false; auto retVal = device->getDeviceInfo( CL_DEVICE_IMAGE_MAX_BUFFER_SIZE, @@ -397,7 +397,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImageMaxBufferSizeThenZe TEST(GetDeviceInfo, GivenImageSupportEnabledWhenGettingImageMaxBufferSizeThenCorrectValuesAreReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = true; + device->sharedDeviceInfo.imageSupport = true; size_t value = 0; auto retVal = device->getDeviceInfo( @@ -413,7 +413,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImagePitchAlignmentThenZ auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); size_t value = 0; - device->deviceInfo.imageSupport = false; + device->sharedDeviceInfo.imageSupport = false; auto retVal = device->getDeviceInfo( CL_DEVICE_IMAGE_PITCH_ALIGNMENT, @@ -428,7 +428,7 @@ TEST(GetDeviceInfo, GivenImageSupportDisabledWhenGettingImagePitchAlignmentThenZ TEST(GetDeviceInfo, GivenImageSupportEnabledWhenGettingImagePitchAlignmentThenCorrectValuesAreReturned) { auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(nullptr)); - device->deviceInfo.imageSupport = true; + device->sharedDeviceInfo.imageSupport = true; size_t value = 0; auto retVal = device->getDeviceInfo( diff --git a/opencl/test/unit_test/device_queue/device_queue_tests.cpp b/opencl/test/unit_test/device_queue/device_queue_tests.cpp index d2ea34ba34..1568838527 100644 --- a/opencl/test/unit_test/device_queue/device_queue_tests.cpp +++ b/opencl/test/unit_test/device_queue/device_queue_tests.cpp @@ -71,18 +71,18 @@ class DeviceQueueTest : public DeviceHostQueueFixture { }; HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueueWhenNoDeviceQueueIsSupported) { - auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues; - const_cast(&device->getDeviceInfo())->maxOnDeviceQueues = 0; + auto maxOnDeviceQueues = device->getSharedDeviceInfo().maxOnDeviceQueues; + const_cast(&device->getSharedDeviceInfo())->maxOnDeviceQueues = 0; auto deviceQueue = createQueueObject(); EXPECT_EQ(deviceQueue, nullptr); - const_cast(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues; + const_cast(&device->getSharedDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues; } HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueuesWhenSingleDeviceQueueIsSupported) { - auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues; - const_cast(&device->getDeviceInfo())->maxOnDeviceQueues = 1; + auto maxOnDeviceQueues = device->getSharedDeviceInfo().maxOnDeviceQueues; + const_cast(&device->getSharedDeviceInfo())->maxOnDeviceQueues = 1; auto deviceQueue1 = createQueueObject(); ASSERT_NE(deviceQueue1, nullptr); @@ -93,12 +93,12 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueuesWhenSingleDeviceQ delete deviceQueue1; - const_cast(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues; + const_cast(&device->getSharedDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues; } HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueuesWhenMultipleDeviceQueuesAreSupported) { - auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues; - const_cast(&device->getDeviceInfo())->maxOnDeviceQueues = 2; + auto maxOnDeviceQueues = device->getSharedDeviceInfo().maxOnDeviceQueues; + const_cast(&device->getSharedDeviceInfo())->maxOnDeviceQueues = 2; auto deviceQueue1 = createQueueObject(); ASSERT_NE(deviceQueue1, nullptr); @@ -113,7 +113,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, createDeviceQueuesWhenMultipleDevic delete deviceQueue1; delete deviceQueue2; - const_cast(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues; + const_cast(&device->getSharedDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues; } HWCMDTEST_F(IGFX_GEN8_CORE, DeviceQueueTest, GivenDeviceQueueWhenEventPoolIsCreatedThenTimestampResolutionIsSet) { @@ -237,8 +237,8 @@ typedef DeviceQueueTest DefaultDeviceQueue; HWCMDTEST_F(IGFX_GEN8_CORE, DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueWhenSingleDeviceQueueIsSupported) { cl_queue_properties properties[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_ON_DEVICE_DEFAULT, 0, 0, 0}; - auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues; - const_cast(&device->getDeviceInfo())->maxOnDeviceQueues = 1; + auto maxOnDeviceQueues = device->getSharedDeviceInfo().maxOnDeviceQueues; + const_cast(&device->getSharedDeviceInfo())->maxOnDeviceQueues = 1; auto deviceQueue1 = createQueueObject(properties); ASSERT_NE(deviceQueue1, nullptr); @@ -257,14 +257,14 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueW deviceQueue1->release(); deviceQueue2->release(); - const_cast(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues; + const_cast(&device->getSharedDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues; } HWCMDTEST_F(IGFX_GEN8_CORE, DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueWhenMultipleDeviceQueuesAreSupported) { cl_queue_properties properties[] = {CL_QUEUE_PROPERTIES, CL_QUEUE_ON_DEVICE_DEFAULT, 0, 0, 0}; - auto maxOnDeviceQueues = device->getDeviceInfo().maxOnDeviceQueues; - const_cast(&device->getDeviceInfo())->maxOnDeviceQueues = 2; + auto maxOnDeviceQueues = device->getSharedDeviceInfo().maxOnDeviceQueues; + const_cast(&device->getSharedDeviceInfo())->maxOnDeviceQueues = 2; auto deviceQueue1 = createQueueObject(properties); ASSERT_NE(deviceQueue1, nullptr); @@ -283,7 +283,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, DefaultDeviceQueue, createOnlyOneDefaultDeviceQueueW deviceQueue1->release(); deviceQueue2->release(); - const_cast(&device->getDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues; + const_cast(&device->getSharedDeviceInfo())->maxOnDeviceQueues = maxOnDeviceQueues; } typedef DeviceQueueTest DeviceQueueEventPool; diff --git a/opencl/test/unit_test/gen12lp/test_device_caps_gen12lp.inl b/opencl/test/unit_test/gen12lp/test_device_caps_gen12lp.inl index 8e65989281..aa08d86846 100644 --- a/opencl/test/unit_test/gen12lp/test_device_caps_gen12lp.inl +++ b/opencl/test/unit_test/gen12lp/test_device_caps_gen12lp.inl @@ -44,7 +44,7 @@ GEN12LPTEST_F(Gen12LpDeviceCaps, defaultPreemptionMode) { } GEN12LPTEST_F(Gen12LpDeviceCaps, profilingTimerResolution) { - const auto &caps = pClDevice->getDeviceInfo(); + const auto &caps = pClDevice->getSharedDeviceInfo(); EXPECT_EQ(83u, caps.outProfilingTimerResolution); } diff --git a/opencl/test/unit_test/gen8/test_device_caps_gen8.cpp b/opencl/test/unit_test/gen8/test_device_caps_gen8.cpp index 401ab04325..302e4ea12f 100644 --- a/opencl/test/unit_test/gen8/test_device_caps_gen8.cpp +++ b/opencl/test/unit_test/gen8/test_device_caps_gen8.cpp @@ -34,8 +34,9 @@ GEN8TEST_F(Gen8DeviceCaps, compression) { GEN8TEST_F(Gen8DeviceCaps, image3DDimensions) { const auto &caps = pClDevice->getDeviceInfo(); + const auto &sharedCaps = pDevice->getDeviceInfo(); EXPECT_EQ(2048u, caps.image3DMaxWidth); - EXPECT_EQ(2048u, caps.image3DMaxDepth); + EXPECT_EQ(2048u, sharedCaps.image3DMaxDepth); EXPECT_EQ(2048u, caps.image3DMaxHeight); } diff --git a/opencl/test/unit_test/gen9/bxt/test_device_caps_bxt.cpp b/opencl/test/unit_test/gen9/bxt/test_device_caps_bxt.cpp index 354e48eef4..218d661869 100644 --- a/opencl/test/unit_test/gen9/bxt/test_device_caps_bxt.cpp +++ b/opencl/test/unit_test/gen9/bxt/test_device_caps_bxt.cpp @@ -25,16 +25,17 @@ BXTTEST_F(BxtDeviceCaps, BxtProfilingTimerResolution) { BXTTEST_F(BxtDeviceCaps, BxtClVersionSupport) { const auto &caps = pClDevice->getDeviceInfo(); + const auto &sharedCaps = pDevice->getDeviceInfo(); EXPECT_STREQ("OpenCL 1.2 NEO ", caps.clVersion); EXPECT_STREQ("OpenCL C 1.2 ", caps.clCVersion); auto memoryManager = pDevice->getMemoryManager(); if (is64bit) { EXPECT_TRUE(memoryManager->peekForce32BitAllocations()); - EXPECT_TRUE(caps.force32BitAddressess); + EXPECT_TRUE(sharedCaps.force32BitAddressess); } else { EXPECT_FALSE(memoryManager->peekForce32BitAllocations()); - EXPECT_FALSE(caps.force32BitAddressess); + EXPECT_FALSE(sharedCaps.force32BitAddressess); } } diff --git a/opencl/test/unit_test/gen9/command_stream_receiver_hw_tests_gen9.cpp b/opencl/test/unit_test/gen9/command_stream_receiver_hw_tests_gen9.cpp index 25308a80c2..d12314ff28 100644 --- a/opencl/test/unit_test/gen9/command_stream_receiver_hw_tests_gen9.cpp +++ b/opencl/test/unit_test/gen9/command_stream_receiver_hw_tests_gen9.cpp @@ -52,6 +52,7 @@ GEN9TEST_F(UltCommandStreamReceiverTest, whenPreambleIsProgrammedThenStateSipCmd this->parseCommands(preambleStream); auto itorStateSip = find(this->cmdList.begin(), this->cmdList.end()); EXPECT_EQ(this->cmdList.end(), itorStateSip); + pDevice->setDebuggerActive(false); } GEN9TEST_F(CommandStreamReceiverHwTestGen9, GivenKernelWithSlmWhenPreviousNOSLML3WasSentThenProgramL3WithSLML3Config) { diff --git a/opencl/test/unit_test/gen9/glk/test_device_caps_glk.cpp b/opencl/test/unit_test/gen9/glk/test_device_caps_glk.cpp index ab86db8fc3..6ef9640330 100644 --- a/opencl/test/unit_test/gen9/glk/test_device_caps_glk.cpp +++ b/opencl/test/unit_test/gen9/glk/test_device_caps_glk.cpp @@ -13,7 +13,7 @@ using namespace NEO; typedef Test Gen9DeviceCaps; GLKTEST_F(Gen9DeviceCaps, GlkProfilingTimerResolution) { - const auto &caps = pClDevice->getDeviceInfo(); + const auto &caps = pDevice->getDeviceInfo(); EXPECT_EQ(52u, caps.outProfilingTimerResolution); } diff --git a/opencl/test/unit_test/gen9/skl/test_device_caps_skl.cpp b/opencl/test/unit_test/gen9/skl/test_device_caps_skl.cpp index 2e3b1bbaa9..13e2615551 100644 --- a/opencl/test/unit_test/gen9/skl/test_device_caps_skl.cpp +++ b/opencl/test/unit_test/gen9/skl/test_device_caps_skl.cpp @@ -25,12 +25,13 @@ SKLTEST_F(SklDeviceCaps, SklProfilingTimerResolution) { SKLTEST_F(SklDeviceCaps, givenSklDeviceWhenAskedFor32BitSupportThenFalseIsReturned) { const auto &caps = pClDevice->getDeviceInfo(); + const auto &sharedCaps = pDevice->getDeviceInfo(); EXPECT_STREQ("OpenCL 2.1 NEO ", caps.clVersion); EXPECT_STREQ("OpenCL C 2.0 ", caps.clCVersion); auto memoryManager = pDevice->getMemoryManager(); EXPECT_FALSE(memoryManager->peekForce32BitAllocations()); - EXPECT_FALSE(caps.force32BitAddressess); + EXPECT_FALSE(sharedCaps.force32BitAddressess); } SKLTEST_F(SklDeviceCaps, SklSvmCapabilities) { diff --git a/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp b/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp index 59b8a29b73..7207077de1 100644 --- a/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image2d_from_buffer_tests.cpp @@ -8,6 +8,7 @@ #include "shared/source/helpers/aligned_memory.h" #include "shared/source/helpers/hw_helper.h" +#include "opencl/source/device/device_info_map.h" #include "opencl/source/helpers/memory_properties_flags_helpers.h" #include "opencl/source/mem_obj/buffer.h" #include "opencl/source/mem_obj/image.h" @@ -206,7 +207,7 @@ TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndNotTooLargeRowPitchSp } TEST_F(Image2dFromBufferTest, givenFourChannel8BitColorsAndTooLargeRowPitchSpecifiedWhenValidatingSurfaceFormatThenReturnError) { - const auto pitchAlignment = &DeviceInfoTable::Map::getValue(context.getDevice(0u)->getDeviceInfo()); + const auto pitchAlignment = &DeviceInfoTable::Map::getValue(*context.getDevice(0u)); imageDesc.image_height = castToObject(imageDesc.mem_object)->getSize() / imageDesc.image_width; imageDesc.image_row_pitch = imageDesc.image_width + *pitchAlignment; cl_mem_flags flags = CL_MEM_READ_ONLY; diff --git a/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp b/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp index 924e9c7b6b..10d42cddd7 100644 --- a/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp +++ b/opencl/test/unit_test/mem_obj/image_redescribe_tests.cpp @@ -146,6 +146,7 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag auto device = std::make_unique(MockDevice::createWithNewExecutionEnvironment(platformDevices[0])); const auto &caps = device->getDeviceInfo(); + const auto &sharedCaps = device->getSharedDeviceInfo(); auto memoryManager = (OsAgnosticMemoryManager *)context.getMemoryManager(); memoryManager->turnOnFakingBigAllocations(); @@ -164,14 +165,14 @@ TEST_P(ImageRedescribeTest, givenImageWithMaxSizesWhenItIsRedescribedThenNewImag case CL_MEM_OBJECT_IMAGE1D: case CL_MEM_OBJECT_IMAGE1D_ARRAY: imageWidth = 16384; - maxImageWidth = static_cast(caps.maxMemAllocSize); + maxImageWidth = static_cast(sharedCaps.maxMemAllocSize); maxImageHeight = 1; break; case CL_MEM_OBJECT_IMAGE2D: case CL_MEM_OBJECT_IMAGE2D_ARRAY: imageHeight = 16384; - maxImageWidth = caps.image2DMaxWidth; - maxImageHeight = caps.image2DMaxHeight; + maxImageWidth = sharedCaps.image2DMaxWidth; + maxImageHeight = sharedCaps.image2DMaxHeight; break; case CL_MEM_OBJECT_IMAGE3D: imageHeight = 16384; diff --git a/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp b/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp index d4baa55844..900c8cb778 100644 --- a/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp +++ b/opencl/test/unit_test/mem_obj/nv12_image_tests.cpp @@ -9,6 +9,7 @@ #include "shared/source/helpers/aligned_memory.h" #include "shared/test/unit_test/helpers/debug_manager_state_restore.h" +#include "opencl/source/device/cl_device_get_cap.inl" #include "opencl/source/helpers/memory_properties_flags_helpers.h" #include "opencl/source/helpers/surface_formats.h" #include "opencl/source/mem_obj/image.h" diff --git a/opencl/test/unit_test/mocks/mock_device.cpp b/opencl/test/unit_test/mocks/mock_device.cpp index 5687152670..1955c19048 100644 --- a/opencl/test/unit_test/mocks/mock_device.cpp +++ b/opencl/test/unit_test/mocks/mock_device.cpp @@ -26,8 +26,9 @@ decltype(&createCommandStream) MockDevice::createCommandStreamReceiverFunc = cre decltype(&createCommandStream) &MockClDevice::createCommandStreamReceiverFunc = MockDevice::createCommandStreamReceiverFunc; MockClDevice::MockClDevice(MockDevice *pMockDevice) - : ClDevice(*pMockDevice, platform()), device(*pMockDevice), executionEnvironment(pMockDevice->executionEnvironment), - subdevices(pMockDevice->subdevices), mockMemoryManager(pMockDevice->mockMemoryManager), engines(pMockDevice->engines) { + : ClDevice(*pMockDevice, platform()), device(*pMockDevice), sharedDeviceInfo(device.deviceInfo), + executionEnvironment(pMockDevice->executionEnvironment), subdevices(pMockDevice->subdevices), + mockMemoryManager(pMockDevice->mockMemoryManager), engines(pMockDevice->engines) { } MockDevice::MockDevice() diff --git a/opencl/test/unit_test/mocks/mock_device.h b/opencl/test/unit_test/mocks/mock_device.h index a3adb6b263..384866753e 100644 --- a/opencl/test/unit_test/mocks/mock_device.h +++ b/opencl/test/unit_test/mocks/mock_device.h @@ -161,11 +161,11 @@ class MockClDevice : public ClDevice { BuiltIns *getBuiltIns() const { return getDevice().getBuiltIns(); } void setDebuggerActive(bool active) { - this->deviceInfo.debuggerActive = active; - device.deviceInfo.debuggerActive = active; + sharedDeviceInfo.debuggerActive = active; } MockDevice &device; + DeviceInfo &sharedDeviceInfo; ExecutionEnvironment *&executionEnvironment; static bool &createSingleDevice; static decltype(&createCommandStream) &createCommandStreamReceiverFunc; diff --git a/opencl/test/unit_test/program/program_tests.cpp b/opencl/test/unit_test/program/program_tests.cpp index 12b9dbcaa6..04f1f1608a 100644 --- a/opencl/test/unit_test/program/program_tests.cpp +++ b/opencl/test/unit_test/program/program_tests.cpp @@ -1653,7 +1653,7 @@ TEST_F(ProgramTests, WhenCreatingProgramThenBindlessIsEnabledOnlyIfDebugFlagIsEn TEST_F(ProgramTests, givenDeviceThatSupportsSharedSystemMemoryAllocationWhenProgramIsCompiledThenItForcesStatelessCompilation) { pClDevice->deviceInfo.sharedSystemMemCapabilities = CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL | CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL | CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS_INTEL | CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS_INTEL; - pClDevice->device.deviceInfo.sharedSystemAllocationsSupport = true; + pClDevice->sharedDeviceInfo.sharedSystemAllocationsSupport = true; MockProgram program(*pDevice->getExecutionEnvironment(), pContext, false, pDevice); EXPECT_TRUE(CompilerOptions::contains(program.getInternalOptions().c_str(), CompilerOptions::greaterThan4gbBuffersRequired)) << program.getInternalOptions(); } @@ -2655,8 +2655,7 @@ TEST_F(ProgramTests, WhenProgramIsCreatedThenItsDeviceIsProperlySet) { EXPECT_FALSE(wasValidClDeviceUsed(programWithDeviceWithInvalidSpecializedDevice)); MockClDevice validClDevice{new MockDevice}; - validClDevice.deviceInfo.force32BitAddressess = true; - validClDevice.device.deviceInfo.force32BitAddressess = true; + validClDevice.sharedDeviceInfo.force32BitAddressess = true; MockProgram programWithDeviceWithValidSpecializedDevice{executionEnvironment, nullptr, false, &validClDevice.getDevice()}; EXPECT_TRUE(wasValidClDeviceUsed(programWithDeviceWithValidSpecializedDevice)); } diff --git a/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp b/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp index 3d91da7841..a3fdc9b118 100644 --- a/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp +++ b/opencl/test/unit_test/source_level_debugger/source_level_debugger_csr_tests.cpp @@ -41,6 +41,10 @@ class CommandStreamReceiverWithActiveDebuggerTest : public ::testing::Test { return static_cast *>(device->getDefaultEngine().commandStreamReceiver); } + void TearDown() override { + device->setSourceLevelDebuggerActive(false); + } + std::unique_ptr device; ExecutionEnvironment *executionEnvironment = nullptr; HardwareInfo *hwInfo = nullptr; diff --git a/shared/test/unit_test/preemption/preemption_tests.cpp b/shared/test/unit_test/preemption/preemption_tests.cpp index f56b3a9fbf..ed2e351b33 100644 --- a/shared/test/unit_test/preemption/preemption_tests.cpp +++ b/shared/test/unit_test/preemption/preemption_tests.cpp @@ -191,8 +191,7 @@ TEST_F(MidThreadPreemptionTests, allowMidThreadPreemptionNullKernel) { TEST_F(MidThreadPreemptionTests, allowMidThreadPreemptionDeviceSupportPreemptionOnVmeKernel) { PreemptionFlags flags = {}; device->setPreemptionMode(PreemptionMode::MidThread); - device->deviceInfo.vmeAvcSupportsPreemption = true; - device->device.deviceInfo.vmeAvcSupportsPreemption = true; + device->sharedDeviceInfo.vmeAvcSupportsPreemption = true; kernelInfo->isVmeWorkload = true; kernel.reset(new MockKernel(program.get(), *kernelInfo, *device)); PreemptionHelper::setPreemptionLevelFlags(flags, device->getDevice(), kernel.get()); @@ -219,8 +218,7 @@ TEST_F(MidThreadPreemptionTests, disallowMidThreadPreemptionByKernel) { TEST_F(MidThreadPreemptionTests, disallowMidThreadPreemptionByVmeKernel) { PreemptionFlags flags = {}; device->setPreemptionMode(PreemptionMode::MidThread); - device->deviceInfo.vmeAvcSupportsPreemption = false; - device->device.deviceInfo.vmeAvcSupportsPreemption = false; + device->sharedDeviceInfo.vmeAvcSupportsPreemption = false; kernelInfo->isVmeWorkload = true; kernel.reset(new MockKernel(program.get(), *kernelInfo, *device)); PreemptionHelper::setPreemptionLevelFlags(flags, device->getDevice(), kernel.get()); @@ -248,8 +246,7 @@ TEST_F(MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByKernel) { TEST_F(MidThreadPreemptionTests, taskPreemptionDisallowMidThreadByVmeKernel) { PreemptionFlags flags = {}; kernelInfo->isVmeWorkload = true; - device->deviceInfo.vmeAvcSupportsPreemption = false; - device->device.deviceInfo.vmeAvcSupportsPreemption = false; + device->sharedDeviceInfo.vmeAvcSupportsPreemption = false; kernel.reset(new MockKernel(program.get(), *kernelInfo, *device)); device->setPreemptionMode(PreemptionMode::MidThread); PreemptionHelper::setPreemptionLevelFlags(flags, device->getDevice(), kernel.get()); @@ -272,8 +269,7 @@ TEST_F(MidThreadPreemptionTests, taskPreemptionAllowDeviceSupportsPreemptionOnVm executionEnvironment->DisableMidThreadPreemption = 0; kernelInfo->isVmeWorkload = true; kernel.reset(new MockKernel(program.get(), *kernelInfo, *device)); - device->deviceInfo.vmeAvcSupportsPreemption = true; - device->device.deviceInfo.vmeAvcSupportsPreemption = true; + device->sharedDeviceInfo.vmeAvcSupportsPreemption = true; device->setPreemptionMode(PreemptionMode::MidThread); PreemptionHelper::setPreemptionLevelFlags(flags, device->getDevice(), kernel.get()); PreemptionMode outMode = PreemptionHelper::taskPreemptionMode(device->getPreemptionMode(), flags);