refactor: add wrapper for max product enum value

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2025-11-19 14:05:39 +00:00
committed by Compute-Runtime-Automation
parent 794798d858
commit 8db92240fc
35 changed files with 69 additions and 68 deletions

View File

@@ -39,8 +39,8 @@ void CommandList::setPatchingPreamble(bool patching, bool saveWait) {
}
}
CommandListAllocatorFn commandListFactory[IGFX_MAX_PRODUCT] = {};
CommandListAllocatorFn commandListFactoryImmediate[IGFX_MAX_PRODUCT] = {};
CommandListAllocatorFn commandListFactory[NEO::maxProductEnumValue] = {};
CommandListAllocatorFn commandListFactoryImmediate[NEO::maxProductEnumValue] = {};
ze_result_t CommandListImp::destroy() {
if (this->isBcsSplitNeeded) {
@@ -104,7 +104,7 @@ CommandList *CommandList::create(uint32_t productFamily, Device *device, NEO::En
ze_command_list_flags_t flags, ze_result_t &returnValue,
bool internalUsage) {
CommandListAllocatorFn allocator = nullptr;
if (productFamily < IGFX_MAX_PRODUCT) {
if (productFamily < NEO::maxProductEnumValue) {
allocator = commandListFactory[productFamily];
}
@@ -170,7 +170,7 @@ CommandList *CommandList::createImmediate(uint32_t productFamily, Device *device
cmdQdesc.mode = static_cast<ze_command_queue_mode_t>(overrideImmediateCmdListSyncMode);
}
CommandListAllocatorFn allocator = nullptr;
if (productFamily < IGFX_MAX_PRODUCT) {
if (productFamily < NEO::maxProductEnumValue) {
allocator = commandListFactoryImmediate[productFamily];
}

View File

@@ -33,7 +33,7 @@
namespace L0 {
CommandQueueAllocatorFn commandQueueFactory[IGFX_MAX_PRODUCT] = {};
CommandQueueAllocatorFn commandQueueFactory[NEO::maxProductEnumValue] = {};
bool CommandQueue::frontEndTrackingEnabled() const {
return NEO::debugManager.flags.AllowPatchingVfeStateInCommandLists.get() || this->frontEndStateTracking;
@@ -234,7 +234,7 @@ void CommandQueueImp::postSyncOperations(bool hangDetected) {
CommandQueue *CommandQueue::create(uint32_t productFamily, Device *device, NEO::CommandStreamReceiver *csr,
const ze_command_queue_desc_t *desc, bool isCopyOnly, bool isInternal, bool immediateCmdListQueue, ze_result_t &returnValue) {
CommandQueueAllocatorFn allocator = nullptr;
if (productFamily < IGFX_MAX_PRODUCT) {
if (productFamily < NEO::maxProductEnumValue) {
allocator = commandQueueFactory[productFamily];
}

View File

@@ -25,7 +25,7 @@
#include "neo_igfxfmid.h"
namespace L0 {
ImageAllocatorFn imageFactory[IGFX_MAX_PRODUCT] = {};
ImageAllocatorFn imageFactory[NEO::maxProductEnumValue] = {};
bool isImportedWin32Handle(const ze_image_desc_t *imgDesc) {
const ze_base_desc_t *extendedDesc = reinterpret_cast<const ze_base_desc_t *>(imgDesc->pNext);
@@ -178,7 +178,7 @@ NEO::SurfaceStateInHeapInfo *ImageImp::getBindlessSlot() {
ze_result_t Image::create(uint32_t productFamily, Device *device, const ze_image_desc_t *desc, Image **pImage) {
ze_result_t result = ZE_RESULT_SUCCESS;
ImageAllocatorFn allocator = nullptr;
if (productFamily < IGFX_MAX_PRODUCT) {
if (productFamily < NEO::maxProductEnumValue) {
allocator = imageFactory[productFamily];
}

View File

@@ -11,6 +11,6 @@
namespace L0 {
KernelAllocatorFn kernelFactory[IGFX_MAX_PRODUCT] = {};
KernelAllocatorFn kernelFactory[NEO::maxProductEnumValue] = {};
} // namespace L0

View File

@@ -1457,7 +1457,7 @@ void KernelImp::patchGlobalOffset() {
Kernel *Kernel::create(uint32_t productFamily, Module *module,
const ze_kernel_desc_t *desc, ze_result_t *res) {
UNRECOVERABLE_IF(productFamily >= IGFX_MAX_PRODUCT);
UNRECOVERABLE_IF(productFamily >= NEO::maxProductEnumValue);
KernelAllocatorFn allocator = kernelFactory[productFamily];
auto kernel = static_cast<KernelImp *>(allocator(module));
*res = kernel->initialize(desc);

View File

@@ -82,7 +82,7 @@ void MutableResidencyAllocations::cleanResidencyContainer() {
immutableResidencySize = 0;
}
MutableCommandListAllocFn mutableCommandListFactory[IGFX_MAX_PRODUCT] = {};
MutableCommandListAllocFn mutableCommandListFactory[NEO::maxProductEnumValue] = {};
MutableCommandList *MutableCommandList::fromHandle(ze_command_list_handle_t handle) {
return static_cast<MutableCommandList *>(L0::CommandList::fromHandle(handle)->asMutable());
@@ -91,7 +91,7 @@ MutableCommandList *MutableCommandList::fromHandle(ze_command_list_handle_t hand
CommandList *MutableCommandList::create(uint32_t productFamily, Device *device, NEO::EngineGroupType engineGroupType,
ze_command_list_flags_t flags, ze_result_t &resultValue, bool useInternalEngineType) {
MutableCommandListAllocFn allocator = nullptr;
if (productFamily < IGFX_MAX_PRODUCT) {
if (productFamily < NEO::maxProductEnumValue) {
allocator = mutableCommandListFactory[productFamily];
}
if (allocator == nullptr) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2021 Intel Corporation
* Copyright (C) 2020-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -11,7 +11,7 @@
namespace L0 {
SamplerAllocatorFn samplerFactory[IGFX_MAX_PRODUCT] = {};
SamplerAllocatorFn samplerFactory[NEO::maxProductEnumValue] = {};
ze_result_t SamplerImp::destroy() {
delete this;
@@ -25,7 +25,7 @@ ze_result_t SamplerImp::initialize(Device *device, const ze_sampler_desc_t *desc
Sampler *Sampler::create(uint32_t productFamily, Device *device, const ze_sampler_desc_t *desc) {
SamplerAllocatorFn allocator = nullptr;
if (productFamily < IGFX_MAX_PRODUCT) {
if (productFamily < NEO::maxProductEnumValue) {
allocator = samplerFactory[productFamily];
}

View File

@@ -125,7 +125,7 @@ TEST_F(DefaultDescriptorWithoutBlitterTest, givenDeviceWithoutBlitterSupportWhen
TEST_F(CommandListCreateTests, whenCommandListIsCreatedWithInvalidProductFamilyThenFailureIsReturned) {
ze_result_t returnValue;
std::unique_ptr<L0::CommandList> commandList(CommandList::create(PRODUCT_FAMILY::IGFX_MAX_PRODUCT, device, NEO::EngineGroupType::renderCompute, 0u, returnValue, false));
std::unique_ptr<L0::CommandList> commandList(CommandList::create(NEO::maxProductEnumValue, device, NEO::EngineGroupType::renderCompute, 0u, returnValue, false));
EXPECT_EQ(ZE_RESULT_ERROR_UNINITIALIZED, returnValue);
ASSERT_EQ(nullptr, commandList);
}
@@ -134,7 +134,7 @@ TEST_F(CommandListCreateTests, whenCommandListImmediateIsCreatedWithInvalidProdu
ze_result_t returnValue;
const ze_command_queue_desc_t desc = {};
bool internalEngine = true;
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(PRODUCT_FAMILY::IGFX_MAX_PRODUCT,
std::unique_ptr<L0::CommandList> commandList(CommandList::createImmediate(NEO::maxProductEnumValue,
device,
&desc,
internalEngine,

View File

@@ -291,7 +291,7 @@ TEST_F(CommandQueueCreate, whenCreatingCommandQueueWithInvalidProductFamilyThenF
ze_result_t returnValue;
auto csr = std::unique_ptr<NEO::CommandStreamReceiver>(neoDevice->createCommandStreamReceiver());
csr->setupContext(*neoDevice->getDefaultEngine().osContext);
L0::CommandQueue *commandQueue = CommandQueue::create(PRODUCT_FAMILY::IGFX_MAX_PRODUCT,
L0::CommandQueue *commandQueue = CommandQueue::create(NEO::maxProductEnumValue,
device,
csr.get(),
&desc,

View File

@@ -30,7 +30,7 @@ HWCMDTEST_F(IGFX_XE_HP_CORE,
givenInvalidProductWhenCreatingCommandListThenNoObjectCreated) {
ze_result_t returnValue;
auto mcl = MutableCommandList::create(IGFX_MAX_PRODUCT, device, this->engineGroupType, 0, returnValue, false);
auto mcl = MutableCommandList::create(NEO::maxProductEnumValue, device, this->engineGroupType, 0, returnValue, false);
EXPECT_EQ(nullptr, mcl);
EXPECT_EQ(ZE_RESULT_ERROR_UNSUPPORTED_FEATURE, returnValue);
}

View File

@@ -184,7 +184,7 @@ HWTEST2_F(ContextCreateSamplerTest, givenInvalidHardwareFamilyThenSamplerIsNotCr
desc.filterMode = filterMode;
desc.isNormalized = isNormalized;
L0::Sampler *sampler = Sampler::create(IGFX_MAX_PRODUCT, device, &desc);
L0::Sampler *sampler = Sampler::create(NEO::maxProductEnumValue, device, &desc);
EXPECT_EQ(nullptr, sampler);
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2023 Intel Corporation
* Copyright (C) 2023-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -10,7 +10,7 @@
namespace L0 {
namespace Sysman {
SysmanProductHelperCreateFunctionType sysmanProductHelperFactory[IGFX_MAX_PRODUCT] = {};
SysmanProductHelperCreateFunctionType sysmanProductHelperFactory[NEO::maxProductEnumValue] = {};
}
} // namespace L0

View File

@@ -35,7 +35,7 @@ enum class RasInterfaceType;
enum class SysfsValueUnit;
using SysmanProductHelperCreateFunctionType = std::unique_ptr<SysmanProductHelper> (*)();
extern SysmanProductHelperCreateFunctionType sysmanProductHelperFactory[IGFX_MAX_PRODUCT];
extern SysmanProductHelperCreateFunctionType sysmanProductHelperFactory[NEO::maxProductEnumValue];
class SysmanProductHelper {
public:

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Intel Corporation
* Copyright (C) 2024-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -10,7 +10,7 @@
namespace L0 {
namespace Sysman {
SysmanProductHelperCreateFunctionType sysmanProductHelperFactory[IGFX_MAX_PRODUCT] = {};
SysmanProductHelperCreateFunctionType sysmanProductHelperFactory[NEO::maxProductEnumValue] = {};
}
} // namespace L0

View File

@@ -29,7 +29,7 @@ class SysmanProductHelper;
class WddmSysmanImp;
using SysmanProductHelperCreateFunctionType = std::unique_ptr<SysmanProductHelper> (*)();
extern SysmanProductHelperCreateFunctionType sysmanProductHelperFactory[IGFX_MAX_PRODUCT];
extern SysmanProductHelperCreateFunctionType sysmanProductHelperFactory[NEO::maxProductEnumValue];
static const std::map<zes_power_domain_t, KmdSysman::PowerDomainsType> powerGroupToDomainTypeMap = {
{ZES_POWER_DOMAIN_CARD, KmdSysman::PowerDomainsType::powerDomainCard},
{ZES_POWER_DOMAIN_PACKAGE, KmdSysman::PowerDomainsType::powerDomainPackage},

View File

@@ -307,7 +307,7 @@ TEST_F(IgaWrapperTest, GivenIgcWrapperWhenCallingSetGfxCoreMultipleTimesThenFirs
TEST_F(IgaWrapperTest, GivenIgcWrapperWhenCallingSetProductFamilyMultipleTimesThenFirstValidProductFamilyIsPreserved) {
ASSERT_FALSE(testedIgaWrapper.isKnownPlatform());
constexpr auto invalidProductFamily = IGFX_MAX_PRODUCT;
constexpr auto invalidProductFamily = NEO::maxProductEnumValue;
testedIgaWrapper.setProductFamily(invalidProductFamily);
EXPECT_FALSE(testedIgaWrapper.isKnownPlatform());

View File

@@ -136,7 +136,7 @@ int main(int argc, char **argv) {
}
uint16_t revision = 0;
for (unsigned int productId = 0; productId < IGFX_MAX_PRODUCT; ++productId) {
for (unsigned int productId = 0; productId < NEO::maxProductEnumValue; ++productId) {
if (NEO::hardwarePrefix[productId] && (0 == strcmp(devicePrefix.c_str(), NEO::hardwarePrefix[productId]))) {
if (NEO::hardwareInfoTable[productId]) {
renderCoreFamily = NEO::hardwareInfoTable[productId]->platform.eRenderCoreFamily;

View File

@@ -92,7 +92,7 @@ size_t findPos(const std::vector<std::string> &lines, const std::string &whatToF
}
PRODUCT_FAMILY getProductFamilyFromDeviceName(const std::string &deviceName) {
for (unsigned int productId = 0; productId < IGFX_MAX_PRODUCT; ++productId) {
for (unsigned int productId = 0; productId < NEO::maxProductEnumValue; ++productId) {
if (NEO::hardwarePrefix[productId] != nullptr &&
deviceName == NEO::hardwarePrefix[productId]) {
return static_cast<PRODUCT_FAMILY>(productId);

View File

@@ -51,7 +51,7 @@ enum class AILEnumeration : uint32_t {
class AILConfiguration;
using AILConfigurationCreateFunctionType = std::unique_ptr<AILConfiguration> (*)();
extern AILConfigurationCreateFunctionType ailConfigurationFactory[IGFX_MAX_PRODUCT];
extern AILConfigurationCreateFunctionType ailConfigurationFactory[NEO::maxProductEnumValue];
class AILConfiguration {
public:

View File

@@ -46,7 +46,7 @@ const std::set<std::string_view> applicationsMicrosecontResolutionAdjustment = {
const uint32_t microsecondAdjustment = 1000;
AILConfigurationCreateFunctionType ailConfigurationFactory[IGFX_MAX_PRODUCT];
AILConfigurationCreateFunctionType ailConfigurationFactory[NEO::maxProductEnumValue];
void AILConfiguration::apply(HardwareInfo &hwInfo) {
auto search = applicationMap.find(processName);

View File

@@ -11,4 +11,5 @@
namespace NEO {
constexpr GFXCORE_FAMILY xe3pCoreEnumValue = static_cast<GFXCORE_FAMILY>(0x2300); // NOLINT(clang-analyzer-optin.core.EnumCastOutOfRange), NEO-16649
}
constexpr PRODUCT_FAMILY maxProductEnumValue = IGFX_MAX_PRODUCT;
} // namespace NEO

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -11,7 +11,7 @@
namespace NEO {
CompilerProductHelperCreateFunctionType compilerProductHelperFactory[IGFX_MAX_PRODUCT] = {};
CompilerProductHelperCreateFunctionType compilerProductHelperFactory[NEO::maxProductEnumValue] = {};
uint32_t CompilerProductHelper::getHwIpVersion(const HardwareInfo &hwInfo) const {
if (debugManager.flags.OverrideHwIpVersion.get() != -1) {

View File

@@ -41,7 +41,7 @@ constexpr bool operator>=(OclCVersion lhs, OclCVersion rhs) {
}
using CompilerProductHelperCreateFunctionType = std::unique_ptr<CompilerProductHelper> (*)();
extern CompilerProductHelperCreateFunctionType compilerProductHelperFactory[IGFX_MAX_PRODUCT];
extern CompilerProductHelperCreateFunctionType compilerProductHelperFactory[NEO::maxProductEnumValue];
class CompilerProductHelper {
public:

View File

@@ -22,7 +22,7 @@ HardwareInfo::HardwareInfo(const PLATFORM *platform, const FeatureTable *feature
}
// Global table of hardware prefixes
const char *hardwarePrefix[IGFX_MAX_PRODUCT] = {
const char *hardwarePrefix[NEO::maxProductEnumValue] = {
nullptr,
};
@@ -31,12 +31,12 @@ bool familyEnabled[IGFX_MAX_CORE] = {
false,
};
const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT] = {};
void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(HardwareInfo *, bool, uint64_t, const ReleaseHelper *) = {
const HardwareInfo *hardwareInfoTable[NEO::maxProductEnumValue] = {};
void (*hardwareInfoSetup[NEO::maxProductEnumValue])(HardwareInfo *, bool, uint64_t, const ReleaseHelper *) = {
0x0,
};
void (*hardwareInfoBaseSetup[IGFX_MAX_PRODUCT])(HardwareInfo *, bool, const ReleaseHelper *) = {
void (*hardwareInfoBaseSetup[NEO::maxProductEnumValue])(HardwareInfo *, bool, const ReleaseHelper *) = {
0x0,
};
@@ -47,7 +47,7 @@ bool getHwInfoForPlatformString(std::string &platform, const HardwareInfo *&hwIn
return true;
}
bool ret = false;
for (int j = 0; j < IGFX_MAX_PRODUCT; j++) {
for (int j = 0; j < NEO::maxProductEnumValue; j++) {
if (hardwarePrefix[j] == nullptr) {
continue;
}

View File

@@ -71,10 +71,10 @@ struct HardwareInfo { // NOLINT(clang-analyzer-optin.performance.Padding)
// Global table of hardware prefixes
extern bool familyEnabled[IGFX_MAX_CORE];
extern const char *hardwarePrefix[IGFX_MAX_PRODUCT];
extern const HardwareInfo *hardwareInfoTable[IGFX_MAX_PRODUCT];
extern void (*hardwareInfoSetup[IGFX_MAX_PRODUCT])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const ReleaseHelper *releaseHelper);
extern void (*hardwareInfoBaseSetup[IGFX_MAX_PRODUCT])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper);
extern const char *hardwarePrefix[NEO::maxProductEnumValue];
extern const HardwareInfo *hardwareInfoTable[NEO::maxProductEnumValue];
extern void (*hardwareInfoSetup[NEO::maxProductEnumValue])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, uint64_t hwInfoConfig, const ReleaseHelper *releaseHelper);
extern void (*hardwareInfoBaseSetup[NEO::maxProductEnumValue])(HardwareInfo *hwInfo, bool setupFeatureTableAndWorkaroundTable, const ReleaseHelper *releaseHelper);
template <GFXCORE_FAMILY gfxFamily>
struct EnableGfxFamilyHw {

View File

@@ -251,7 +251,7 @@ PRODUCT_FAMILY ProductConfigHelper::getProductFamilyFromDeviceName(const std::st
std::vector<NEO::ConstStringRef> ProductConfigHelper::getDeprecatedAcronyms() {
std::vector<NEO::ConstStringRef> prefixes{}, deprecatedAcronyms{};
for (int j = 0; j < IGFX_MAX_PRODUCT; j++) {
for (int j = 0; j < NEO::maxProductEnumValue; j++) {
if (NEO::hardwarePrefix[j] == nullptr) {
continue;
}

View File

@@ -28,7 +28,7 @@
namespace NEO {
std::optional<std::function<std::unique_ptr<IoctlHelper>(Drm &drm)>> ioctlHelperFactory[IGFX_MAX_PRODUCT] = {};
std::optional<std::function<std::unique_ptr<IoctlHelper>(Drm &drm)>> ioctlHelperFactory[NEO::maxProductEnumValue] = {};
void IoctlHelper::setExternalContext(ExternalCtx *ctx) {
externalCtx = ctx;
}

View File

@@ -475,5 +475,5 @@ class IoctlHelperPrelim20 : public IoctlHelperI915 {
uint64_t uuid = 0;
};
extern std::optional<std::function<std::unique_ptr<IoctlHelper>(Drm &drm)>> ioctlHelperFactory[IGFX_MAX_PRODUCT];
extern std::optional<std::function<std::unique_ptr<IoctlHelper>(Drm &drm)>> ioctlHelperFactory[NEO::maxProductEnumValue];
} // namespace NEO

View File

@@ -18,7 +18,7 @@
namespace NEO {
ProductHelperCreateFunctionType productHelperFactory[IGFX_MAX_PRODUCT] = {};
ProductHelperCreateFunctionType productHelperFactory[NEO::maxProductEnumValue] = {};
void ProductHelper::setupPreemptionSurfaceSize(HardwareInfo &hwInfo, const RootDeviceEnvironment &rootDeviceEnvironment) {
if (debugManager.flags.OverridePreemptionSurfaceSizeInMb.get() >= 0) {

View File

@@ -10,8 +10,8 @@
#include "shared/source/helpers/common_types.h"
#include "aubstream/engine_node.h"
#include "neo_igfxfmid.h"
#include <igfxfmid.h>
#include <memory>
#include <optional>
#include <string>
@@ -56,7 +56,7 @@ enum class CachePolicy : uint32_t;
enum class LocalMemAllocationMode : uint32_t;
using ProductHelperCreateFunctionType = std::unique_ptr<ProductHelper> (*)();
extern ProductHelperCreateFunctionType productHelperFactory[IGFX_MAX_PRODUCT];
extern ProductHelperCreateFunctionType productHelperFactory[NEO::maxProductEnumValue];
enum class UsmAccessCapabilities {
host = 0,

View File

@@ -237,7 +237,7 @@ int main(int argc, char **argv) {
if (i < argc) {
if (::isdigit(argv[i][0])) {
int productValue = atoi(argv[i]);
if (productValue > 0 && productValue < IGFX_MAX_PRODUCT && hardwarePrefix[productValue] != nullptr) {
if (productValue > 0 && productValue < NEO::maxProductEnumValue && hardwarePrefix[productValue] != nullptr) {
productFamily = static_cast<PRODUCT_FAMILY>(productValue);
} else {
productFamily = IGFX_UNKNOWN;
@@ -245,7 +245,7 @@ int main(int argc, char **argv) {
} else {
bool selectAllProducts = (strcmp("*", argv[i]) == 0);
productFamily = IGFX_UNKNOWN;
for (int j = 0; j < IGFX_MAX_PRODUCT; j++) {
for (int j = 0; j < NEO::maxProductEnumValue; j++) {
if (hardwarePrefix[j] == nullptr) {
continue;
}

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -12,7 +12,7 @@
#include "shared/source/os_interface/product_helper.h"
namespace NEO {
extern ProductHelperCreateFunctionType productHelperFactory[IGFX_MAX_PRODUCT];
extern ProductHelperCreateFunctionType productHelperFactory[NEO::maxProductEnumValue];
template <typename MockProductHelper>
class RAIIProductHelperFactory {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2024 Intel Corporation
* Copyright (C) 2021-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -37,17 +37,17 @@ constexpr bool ignoreInvalidTestExcludes = false;
auto matchCore = match_core; \
auto matchProduct = match_product; \
if ((::renderCoreFamily == matchCore) && \
(IGFX_MAX_PRODUCT == matchProduct || ::productFamily == matchProduct)) { \
(NEO::maxProductEnumValue == matchProduct || ::productFamily == matchProduct)) { \
expr; \
}
#define GENTEST_F(gfx_core, test_fixture, test_name) \
FAMILYTEST_TEST_(test_fixture, test_name, test_fixture, \
::testing::internal::GetTypeId<test_fixture>(), \
gfx_core, IGFX_MAX_PRODUCT)
gfx_core, NEO::maxProductEnumValue)
#define GENTEST_P(gfx_core, test_suite_name, test_name) \
FAMILYTEST_TEST_P(test_suite_name, test_name, gfx_core, IGFX_MAX_PRODUCT)
FAMILYTEST_TEST_P(test_suite_name, test_name, gfx_core, NEO::maxProductEnumValue)
#define FAMILYTEST_TEST_(test_suite_name, test_name, parent_class, parent_id, match_core, match_product) \
CHECK_TEST_NAME_LENGTH(test_suite_name, test_name) \

View File

@@ -197,7 +197,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsForDepreca
EXPECT_TRUE(ret);
EXPECT_NE(nullptr, hwInfo);
for (i = 0; i < IGFX_MAX_PRODUCT; i++) {
for (i = 0; i < NEO::maxProductEnumValue; i++) {
auto hardwareInfo = hardwareInfoTable[i];
if (hardwareInfo == nullptr) {
continue;
@@ -207,7 +207,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsForDepreca
}
}
EXPECT_TRUE(i < IGFX_MAX_PRODUCT);
EXPECT_TRUE(i < NEO::maxProductEnumValue);
ASSERT_NE(nullptr, hardwarePrefix[i]);
HardwareInfo hwInfoFromTable = *hardwareInfoTable[i];
@@ -379,7 +379,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsAndUnknown
case CommandStreamReceiverType::tbxWithAub: {
EXPECT_TRUE(ret);
EXPECT_NE(nullptr, hwInfo);
for (i = 0; i < IGFX_MAX_PRODUCT; i++) {
for (i = 0; i < NEO::maxProductEnumValue; i++) {
auto hardwareInfo = hardwareInfoTable[i];
if (hardwareInfo == nullptr) {
continue;
@@ -388,7 +388,7 @@ HWTEST_F(PrepareDeviceEnvironmentsTest, givenPrepareDeviceEnvironmentsAndUnknown
break;
}
}
EXPECT_TRUE(i < IGFX_MAX_PRODUCT);
EXPECT_TRUE(i < NEO::maxProductEnumValue);
ASSERT_NE(nullptr, hardwarePrefix[i]);
HardwareInfo baseHwInfo = *defaultHwInfo;
baseHwInfo.featureTable = {};

View File

@@ -6931,7 +6931,7 @@ TEST(ValidateTargetDeviceTests, givenMismatchedProductFamilyWhenValidatingTarget
Zebin::Elf::ZebinTargetFlags targetMetadata;
auto mismatchedPlatformFamily = IGFX_UNKNOWN;
for (int i = 0; i < IGFX_MAX_PRODUCT; i++) {
for (int i = 0; i < NEO::maxProductEnumValue; i++) {
const auto hwInfo = NEO::hardwareInfoTable[i];
if (nullptr != hwInfo && hwInfo->platform.eRenderCoreFamily != renderCoreFamily) {
mismatchedPlatformFamily = hwInfo->platform.eProductFamily;