/* * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once #include "shared/source/helpers/hw_mapper.h" #include "test_traits_common.h" template struct IsGfxCore { template static constexpr bool isMatched() { return NEO::ToGfxCoreFamily::get() == gfxCoreFamily; } }; template struct IsNotGfxCore { template static constexpr bool isMatched() { return NEO::ToGfxCoreFamily::get() != gfxCoreFamily; } }; template struct AreNotGfxCores { template static constexpr bool isMatched() { return NEO::ToGfxCoreFamily::get() != gfxCoreFamily && NEO::ToGfxCoreFamily::get() != gfxCoreFamily2; } }; template struct IsAtMostGfxCore { template static constexpr bool isMatched() { return NEO::ToGfxCoreFamily::get() <= gfxCoreFamily; } }; template struct IsAtLeastGfxCore { template static constexpr bool isMatched() { return NEO::ToGfxCoreFamily::get() >= gfxCoreFamily; } }; template struct IsWithinGfxCore { template static constexpr bool isMatched() { return NEO::ToGfxCoreFamily::get() >= gfxCoreFamilyMin && NEO::ToGfxCoreFamily::get() <= gfxCoreFamilyMax; } }; template struct IsNotWithinGfxCore { template static constexpr bool isMatched() { return NEO::ToGfxCoreFamily::get() < gfxCoreFamilyMin || NEO::ToGfxCoreFamily::get() > gfxCoreFamilyMax; } }; template struct IsAnyGfxCores { template static constexpr bool isMatched() { return (... || IsGfxCore::template isMatched()); } }; template struct IsNotAnyGfxCores { template static constexpr bool isMatched() { return (... && IsNotGfxCore::template isMatched()); } }; template struct IsProduct { template static constexpr bool isMatched() { return productFamily == product; } }; template struct IsAtMostProduct { template static constexpr bool isMatched() { return productFamily <= productFamilyMax; } }; template struct IsAtLeastProduct { template static constexpr bool isMatched() { return productFamily >= productFamilyMin; } }; template struct IsWithinProducts { template static constexpr bool isMatched() { return productFamily >= productFamilyMin && productFamily <= productFamilyMax; } }; template struct IsNotWithinProducts { template static constexpr bool isMatched() { return (productFamily < productFamilyMin) || (productFamily > productFamilyMax); } }; template struct IsAnyProducts { template static constexpr bool isMatched() { return (... || IsProduct::template isMatched()); } }; template struct IsNoneProducts { template static constexpr bool isMatched() { return (... && !(IsProduct::template isMatched())); } }; struct MatchAny { template static constexpr bool isMatched() { return true; } }; struct SupportsSampler { template static constexpr bool isMatched() { return NEO::HwMapper::GfxProduct::supportsSampler; } }; struct HeapfulSupportedMatch { template static constexpr bool isMatched() { [[maybe_unused]] const GFXCORE_FAMILY gfxCoreFamily = NEO::ToGfxCoreFamily::get(); using FamilyType = typename NEO::GfxFamilyMapper::GfxFamily; using DefaultWalkerType = typename FamilyType::DefaultWalkerType; constexpr bool heaplessModeEnabled = FamilyType::template isHeaplessMode(); return !heaplessModeEnabled; } }; using IsGen12LP = IsGfxCore; using IsXeCore = IsWithinGfxCore; using IsNotXeCore = IsNotWithinGfxCore; using IsXeHpgCore = IsGfxCore; using IsNotXeHpgCore = IsNotGfxCore; using IsXeHpcCore = IsGfxCore; using IsNotXeHpcCore = IsNotGfxCore; using IsXe2HpgCore = IsGfxCore; using IsXe3Core = IsGfxCore; using IsAtLeastXeCore = IsAtLeastGfxCore; using IsAtMostXeHpgCore = IsAtMostGfxCore; using IsAtLeastXeHpcCore = IsAtLeastGfxCore; using IsAtMostXeCore = IsAtMostGfxCore; using IsAtLeastXe2HpgCore = IsAtLeastGfxCore; using IsAtMostXe2HpgCore = IsAtMostGfxCore; using IsAtLeastXe3Core = IsAtLeastGfxCore; using IsAtMostXe3Core = IsAtMostGfxCore; using IsWithinXeCoreAndXe2HpgCore = IsWithinGfxCore; using IsWithinXeCoreAndXe3Core = IsWithinGfxCore; using IsWithinXeHpcCoreAndXe2HpgCore = IsWithinGfxCore; using IsWithinXe2HpgCoreAndXe3Core = IsWithinGfxCore; using IsWithinXeHpcCoreAndXe3Core = IsWithinGfxCore; using IsTGLLP = IsProduct; using IsRKL = IsProduct; using IsADLS = IsProduct; using IsADLP = IsProduct; using IsDG1 = IsProduct; using IsNotDG1 = IsNotWithinProducts; using IsDG2 = IsProduct; using IsNotDG2 = IsNotWithinProducts; using IsPVC = IsProduct; using IsNotPVC = IsNotWithinProducts; using IsMTL = IsProduct; using IsNotMTL = IsNotWithinProducts; using IsARL = IsProduct; using IsBMG = IsProduct; using IsNotBMG = IsNotWithinProducts; using IsLNL = IsProduct; using IsPTL = IsProduct; using IsNVLS = IsProduct; using IsAtMostDg2 = IsAtMostProduct; using IsAtLeastPVC = IsAtLeastProduct; using IsAtMostPVC = IsAtMostProduct; using IsAtLeastMtl = IsAtLeastProduct; using IsNotPvcOrDg2 = IsNotWithinProducts; using HasStatefulSupport = IsNotAnyGfxCores; using HasNoStatefulSupport = IsAnyGfxCores; struct HasDispatchAllSupport { template static constexpr bool isMatched() { return IsPVC::isMatched() || IsAtLeastXe2HpgCore::isMatched(); } }; struct DoesNotHaveDispatchAllSupport { template static constexpr bool isMatched() { return !IsPVC::isMatched() && IsAtMostXeCore::isMatched(); } }; struct IsXeLpg { template static constexpr bool isMatched() { return IsXeHpgCore::isMatched() && !IsDG2::isMatched(); } }; struct IsStatefulBufferPreferredForProduct { template static constexpr bool isMatched() { return IsGen12LP::isMatched() || IsXeHpgCore::isMatched(); } }; struct IsStatelessBufferPreferredForProduct { template static constexpr bool isMatched() { return !IsStatefulBufferPreferredForProduct::isMatched(); } }; struct HeaplessSupport { template static consteval bool isMatched() { using T = TestTraits::get()>; if constexpr (requires { T::heaplessAllowed; }) { return static_cast(T::heaplessAllowed); } else { return false; } } }; struct ImageSupport { template static constexpr bool isMatched() { return TestTraits::get()>::imagesSupported; } };