Rename HwInfoConfig to ProductHelper

Related-To: NEO-6853
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2022-12-12 16:43:41 +00:00
committed by Compute-Runtime-Automation
parent a1cf7fb938
commit 232b886056
394 changed files with 1818 additions and 1787 deletions

View File

@@ -91,13 +91,13 @@ size_t CommandQueueHw<gfxCoreFamily>::estimateStateBaseAddressCmdSize() {
NEO::Device *neoDevice = device->getNEODevice();
auto &hwInfo = neoDevice->getHardwareInfo();
auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
auto &productHelper = *NEO::ProductHelper::get(hwInfo.platform.eProductFamily);
size_t size = 0;
if (NEO::ApiSpecificConfig::getBindlessConfiguration()) {
size += sizeof(STATE_BASE_ADDRESS) + NEO::MemorySynchronizationCommands<GfxFamily>::getSizeForSingleBarrier(false) + sizeof(_3DSTATE_BINDING_TABLE_POOL_ALLOC);
if (hwInfoConfig.isAdditionalStateBaseAddressWARequired(hwInfo)) {
if (productHelper.isAdditionalStateBaseAddressWARequired(hwInfo)) {
size += sizeof(STATE_BASE_ADDRESS);
}
}

View File

@@ -14,7 +14,7 @@
#include <level_zero/ze_api.h>
#include <level_zero/zet_api.h>
static_assert(NEO::HwInfoConfig::uuidSize == ZE_MAX_DEVICE_UUID_SIZE);
static_assert(NEO::ProductHelper::uuidSize == ZE_MAX_DEVICE_UUID_SIZE);
struct _ze_device_handle_t {};
namespace NEO {

View File

@@ -551,10 +551,10 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr
const auto &deviceInfo = this->neoDevice->getDeviceInfo();
auto &hwInfo = this->getHwInfo();
auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
strcpy_s(pMemProperties->name, ZE_MAX_DEVICE_NAME, hwInfoConfig.getDeviceMemoryName().c_str());
auto &productHelper = *NEO::ProductHelper::get(hwInfo.platform.eProductFamily);
strcpy_s(pMemProperties->name, ZE_MAX_DEVICE_NAME, productHelper.getDeviceMemoryName().c_str());
auto osInterface = neoDevice->getRootDeviceEnvironment().osInterface.get();
pMemProperties->maxClockRate = hwInfoConfig.getDeviceMemoryMaxClkRate(hwInfo, osInterface, 0);
pMemProperties->maxClockRate = productHelper.getDeviceMemoryMaxClkRate(hwInfo, osInterface, 0);
pMemProperties->maxBusWidth = deviceInfo.addressBits;
if (this->isImplicitScalingCapable() ||
@@ -587,8 +587,8 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr
if (this->isImplicitScalingCapable()) {
enabledSubDeviceCount = static_cast<uint32_t>(neoDevice->getDeviceBitfield().count());
}
extendedProperties->physicalSize = hwInfoConfig.getDeviceMemoryPhysicalSizeInBytes(osInterface, 0) * enabledSubDeviceCount;
const uint64_t bandwidthInBytesPerSecond = hwInfoConfig.getDeviceMemoryMaxBandWidthInBytesPerSecond(hwInfo, osInterface, 0) * enabledSubDeviceCount;
extendedProperties->physicalSize = productHelper.getDeviceMemoryPhysicalSizeInBytes(osInterface, 0) * enabledSubDeviceCount;
const uint64_t bandwidthInBytesPerSecond = productHelper.getDeviceMemoryMaxBandWidthInBytesPerSecond(hwInfo, osInterface, 0) * enabledSubDeviceCount;
// Convert to nano-seconds range
extendedProperties->readBandwidth = static_cast<uint32_t>(bandwidthInBytesPerSecond * 1e-9);
@@ -603,15 +603,15 @@ ze_result_t DeviceImp::getMemoryProperties(uint32_t *pCount, ze_device_memory_pr
ze_result_t DeviceImp::getMemoryAccessProperties(ze_device_memory_access_properties_t *pMemAccessProperties) {
auto &hwInfo = this->getHwInfo();
auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
auto &productHelper = *NEO::ProductHelper::get(hwInfo.platform.eProductFamily);
pMemAccessProperties->hostAllocCapabilities =
static_cast<ze_memory_access_cap_flags_t>(hwInfoConfig.getHostMemCapabilities(&hwInfo));
static_cast<ze_memory_access_cap_flags_t>(productHelper.getHostMemCapabilities(&hwInfo));
pMemAccessProperties->deviceAllocCapabilities =
static_cast<ze_memory_access_cap_flags_t>(hwInfoConfig.getDeviceMemCapabilities());
static_cast<ze_memory_access_cap_flags_t>(productHelper.getDeviceMemCapabilities());
pMemAccessProperties->sharedSingleDeviceAllocCapabilities =
static_cast<ze_memory_access_cap_flags_t>(hwInfoConfig.getSingleDeviceSharedMemCapabilities());
static_cast<ze_memory_access_cap_flags_t>(productHelper.getSingleDeviceSharedMemCapabilities());
pMemAccessProperties->sharedCrossDeviceAllocCapabilities = {};
if (this->getNEODevice()->getHardwareInfo().capabilityTable.p2pAccessSupported) {
@@ -628,7 +628,7 @@ ze_result_t DeviceImp::getMemoryAccessProperties(ze_device_memory_access_propert
}
pMemAccessProperties->sharedSystemAllocCapabilities =
static_cast<ze_memory_access_cap_flags_t>(hwInfoConfig.getSharedSystemMemCapabilities(&hwInfo));
static_cast<ze_memory_access_cap_flags_t>(productHelper.getSharedSystemMemCapabilities(&hwInfo));
return ZE_RESULT_SUCCESS;
}
@@ -690,7 +690,7 @@ ze_result_t DeviceImp::getKernelProperties(ze_device_module_properties_t *pKerne
pKernelProperties->printfBufferSize = static_cast<uint32_t>(this->neoDevice->getDeviceInfo().printfBufferSize);
auto &hwInfo = this->getHwInfo();
auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
auto &productHelper = *NEO::ProductHelper::get(hwInfo.platform.eProductFamily);
void *pNext = pKernelProperties->pNext;
while (pNext) {
@@ -698,13 +698,13 @@ ze_result_t DeviceImp::getKernelProperties(ze_device_module_properties_t *pKerne
if (extendedProperties->stype == ZE_STRUCTURE_TYPE_FLOAT_ATOMIC_EXT_PROPERTIES) {
ze_float_atomic_ext_properties_t *floatProperties =
reinterpret_cast<ze_float_atomic_ext_properties_t *>(extendedProperties);
hwInfoConfig.getKernelExtendedProperties(&floatProperties->fp16Flags,
&floatProperties->fp32Flags,
&floatProperties->fp64Flags);
productHelper.getKernelExtendedProperties(&floatProperties->fp16Flags,
&floatProperties->fp32Flags,
&floatProperties->fp64Flags);
} else if (extendedProperties->stype == ZE_STRUCTURE_TYPE_SCHEDULING_HINT_EXP_PROPERTIES) {
ze_scheduling_hint_exp_properties_t *hintProperties =
reinterpret_cast<ze_scheduling_hint_exp_properties_t *>(extendedProperties);
auto supportedThreadArbitrationPolicies = hwInfoConfig.getKernelSupportedThreadArbitrationPolicies();
auto supportedThreadArbitrationPolicies = productHelper.getKernelSupportedThreadArbitrationPolicies();
hintProperties->schedulingHintFlags = 0;
for (auto &p : supportedThreadArbitrationPolicies) {
switch (p) {
@@ -751,7 +751,7 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties)
pDeviceProperties->flags = 0u;
std::array<uint8_t, NEO::HwInfoConfig::uuidSize> deviceUuid;
std::array<uint8_t, NEO::ProductHelper::uuidSize> deviceUuid;
if (this->neoDevice->getUuid(deviceUuid) == false) {
this->neoDevice->generateUuid(deviceUuid);
}

View File

@@ -802,7 +802,7 @@ ze_result_t KernelImp::initialize(const ze_kernel_desc_t *desc) {
auto neoDevice = module->getDevice()->getNEODevice();
auto &hwInfo = neoDevice->getHardwareInfo();
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
const auto &productHelper = *NEO::ProductHelper::get(hwInfo.platform.eProductFamily);
auto &kernelDescriptor = kernelImmData->getDescriptor();
auto ret = NEO::KernelHelper::checkIfThereIsSpaceForScratchOrPrivate(kernelDescriptor.kernelAttributes, neoDevice);
if (ret == NEO::KernelHelper::ErrorCode::INVALID_KERNEL) {
@@ -814,7 +814,7 @@ ze_result_t KernelImp::initialize(const ze_kernel_desc_t *desc) {
UNRECOVERABLE_IF(!this->kernelImmData->getKernelInfo()->heapInfo.pKernelHeap);
if (isaAllocation->getAllocationType() == NEO::AllocationType::KERNEL_ISA_INTERNAL) {
NEO::MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *isaAllocation),
NEO::MemoryTransferHelper::transferMemoryToAllocation(productHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *isaAllocation),
*neoDevice,
isaAllocation,
0,

View File

@@ -625,14 +625,14 @@ ze_result_t ModuleImp::initialize(const ze_module_desc_t *desc, NEO::Device *neo
passDebugData();
}
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
const auto &productHelper = *NEO::ProductHelper::get(hwInfo.platform.eProductFamily);
if (this->isFullyLinked && this->type == ModuleType::User) {
for (auto &ki : kernelImmDatas) {
if (!ki->isIsaCopiedToAllocation()) {
NEO::MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *ki->getIsaGraphicsAllocation()),
NEO::MemoryTransferHelper::transferMemoryToAllocation(productHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *ki->getIsaGraphicsAllocation()),
*neoDevice, ki->getIsaGraphicsAllocation(), 0, ki->getKernelInfo()->heapInfo.pKernelHeap,
static_cast<size_t>(ki->getKernelInfo()->heapInfo.KernelHeapSize));
@@ -836,7 +836,7 @@ ze_result_t ModuleImp::getDebugInfo(size_t *pDebugDataSize, uint8_t *pDebugData)
void ModuleImp::copyPatchedSegments(const NEO::Linker::PatchableSegments &isaSegmentsForPatching) {
if (this->translationUnit->programInfo.linkerInput && this->translationUnit->programInfo.linkerInput->getTraits().requiresPatchingOfInstructionSegments) {
const auto &hwInfo = device->getNEODevice()->getHardwareInfo();
const auto &hwInfoConfig = *NEO::HwInfoConfig::get(hwInfo.platform.eProductFamily);
const auto &productHelper = *NEO::ProductHelper::get(hwInfo.platform.eProductFamily);
for (auto &kernelImmData : this->kernelImmDatas) {
if (nullptr == kernelImmData->getIsaGraphicsAllocation()) {
@@ -849,7 +849,7 @@ void ModuleImp::copyPatchedSegments(const NEO::Linker::PatchableSegments &isaSeg
kernelImmData->getIsaGraphicsAllocation()->setAubWritable(true, std::numeric_limits<uint32_t>::max());
auto segmentId = &kernelImmData - &this->kernelImmDatas[0];
NEO::MemoryTransferHelper::transferMemoryToAllocation(hwInfoConfig.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelImmData->getIsaGraphicsAllocation()),
NEO::MemoryTransferHelper::transferMemoryToAllocation(productHelper.isBlitCopyRequiredForLocalMemory(hwInfo, *kernelImmData->getIsaGraphicsAllocation()),
*device->getNEODevice(), kernelImmData->getIsaGraphicsAllocation(), 0, isaSegmentsForPatching[segmentId].hostPointer,
isaSegmentsForPatching[segmentId].segmentSize);