mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 10:26:29 +08:00
fix: Add getDefaultDeviceHierarchy call to GfxCoreHelper
Added getDefaultDeviceHierarchy call that describes default device hierarchy for a gfx core. Refactored L0 and OCL paths to use this value by default and override this value when user sets ZE_FLAT_DEVICE_HIERARCHY environment variable or ReturnSubDevicesAsApiDevices debug key. Updated ReturnSubDevicesAsApiDevices to force COMPOSITE device hierarchy when set to 0. Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
238286d076
commit
08e92d154f
@@ -18,6 +18,10 @@ namespace NEO {
|
||||
|
||||
GfxCoreHelperCreateFunctionType gfxCoreHelperFactory[IGFX_MAX_CORE] = {};
|
||||
|
||||
const char *deviceHierarchyComposite = "COMPOSITE";
|
||||
const char *deviceHierarchyFlat = "FLAT";
|
||||
const char *deviceHierarchyUnk = "UNK";
|
||||
|
||||
std::unique_ptr<GfxCoreHelper> GfxCoreHelper::create(const GFXCORE_FAMILY gfxCoreFamily) {
|
||||
|
||||
auto createFunction = gfxCoreHelperFactory[gfxCoreFamily];
|
||||
|
||||
@@ -48,6 +48,10 @@ class GfxCoreHelper;
|
||||
using EngineInstancesContainer = StackVec<EngineTypeUsage, 32>;
|
||||
using GfxCoreHelperCreateFunctionType = std::unique_ptr<GfxCoreHelper> (*)();
|
||||
|
||||
extern const char *deviceHierarchyComposite;
|
||||
extern const char *deviceHierarchyFlat;
|
||||
extern const char *deviceHierarchyUnk;
|
||||
|
||||
class GfxCoreHelper {
|
||||
public:
|
||||
static std::unique_ptr<GfxCoreHelper> create(const GFXCORE_FAMILY gfxCoreFamily);
|
||||
@@ -168,6 +172,7 @@ class GfxCoreHelper {
|
||||
virtual bool isRelaxedOrderingSupported() const = 0;
|
||||
virtual uint32_t calculateNumThreadsPerThreadGroup(uint32_t simd, uint32_t totalWorkItems, uint32_t grfSize, bool isHwLocalIdGeneration) const = 0;
|
||||
virtual uint32_t overrideMaxWorkGroupSize(uint32_t maxWG) const = 0;
|
||||
virtual char const *getDefaultDeviceHierarchy() const = 0;
|
||||
static bool isWorkaroundRequired(uint32_t lowestSteppingWithBug, uint32_t steppingWithFix, const HardwareInfo &hwInfo, const ProductHelper &productHelper);
|
||||
virtual ~GfxCoreHelper() = default;
|
||||
|
||||
@@ -380,6 +385,7 @@ class GfxCoreHelperHw : public GfxCoreHelper {
|
||||
bool isRelaxedOrderingSupported() const override;
|
||||
uint32_t calculateNumThreadsPerThreadGroup(uint32_t simd, uint32_t totalWorkItems, uint32_t grfSize, bool isHwLocalIdGeneration) const override;
|
||||
uint32_t overrideMaxWorkGroupSize(uint32_t maxWG) const override;
|
||||
char const *getDefaultDeviceHierarchy() const override;
|
||||
~GfxCoreHelperHw() override = default;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -709,4 +709,10 @@ template <typename GfxFamily>
|
||||
uint32_t GfxCoreHelperHw<GfxFamily>::calculateNumThreadsPerThreadGroup(uint32_t simd, uint32_t totalWorkItems, uint32_t grfSize, bool isHwLocalIdGeneration) const {
|
||||
return getThreadsPerWG(simd, totalWorkItems);
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
char const *GfxCoreHelperHw<GfxFamily>::getDefaultDeviceHierarchy() const {
|
||||
return deviceHierarchyComposite;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user