mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
Move GfxCoreHelper ownership to RootDeviceEnvironment
Related-To: NEO-6853 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
d32a7ee7d0
commit
eb63f36108
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -15,10 +15,14 @@
|
||||
#include <algorithm>
|
||||
|
||||
namespace NEO {
|
||||
GfxCoreHelper *gfxCoreHelperFactory[IGFX_MAX_CORE] = {};
|
||||
|
||||
GfxCoreHelper &GfxCoreHelper::get(GFXCORE_FAMILY gfxCore) {
|
||||
return *gfxCoreHelperFactory[gfxCore];
|
||||
GfxCoreHelperCreateFunctionType gfxCoreHelperFactory[IGFX_MAX_CORE] = {};
|
||||
|
||||
std::unique_ptr<GfxCoreHelper> GfxCoreHelper::create(const GFXCORE_FAMILY gfxCoreFamily) {
|
||||
|
||||
auto createFunction = gfxCoreHelperFactory[gfxCoreFamily];
|
||||
auto gfxCoreHelper = createFunction();
|
||||
return gfxCoreHelper;
|
||||
}
|
||||
|
||||
bool GfxCoreHelper::compressedBuffersSupported(const HardwareInfo &hwInfo) {
|
||||
|
||||
@@ -41,10 +41,12 @@ struct EncodeSurfaceStateArgs;
|
||||
struct RootDeviceEnvironment;
|
||||
struct PipeControlArgs;
|
||||
class ProductHelper;
|
||||
class GfxCoreHelper;
|
||||
using GfxCoreHelperCreateFunctionType = std::unique_ptr<GfxCoreHelper> (*)();
|
||||
|
||||
class GfxCoreHelper {
|
||||
public:
|
||||
static GfxCoreHelper &get(GFXCORE_FAMILY gfxCore);
|
||||
static std::unique_ptr<GfxCoreHelper> create(const GFXCORE_FAMILY gfxCoreFamily);
|
||||
virtual size_t getMaxBarrierRegisterPerSlice() const = 0;
|
||||
virtual size_t getPaddingForISAAllocation() const = 0;
|
||||
virtual uint32_t getComputeUnitsUsedForScratch(const RootDeviceEnvironment &rootDeviceEnvironment) const = 0;
|
||||
@@ -164,6 +166,8 @@ class GfxCoreHelper {
|
||||
virtual bool isRelaxedOrderingSupported() const = 0;
|
||||
static bool isWorkaroundRequired(uint32_t lowestSteppingWithBug, uint32_t steppingWithFix, const HardwareInfo &hwInfo, const ProductHelper &productHelper);
|
||||
|
||||
virtual ~GfxCoreHelper() = default;
|
||||
|
||||
protected:
|
||||
GfxCoreHelper() = default;
|
||||
};
|
||||
@@ -171,8 +175,8 @@ class GfxCoreHelper {
|
||||
template <typename GfxFamily>
|
||||
class GfxCoreHelperHw : public GfxCoreHelper {
|
||||
public:
|
||||
static GfxCoreHelperHw<GfxFamily> &get() {
|
||||
static GfxCoreHelperHw<GfxFamily> gfxCoreHelper;
|
||||
static std::unique_ptr<GfxCoreHelper> create() {
|
||||
auto gfxCoreHelper = std::unique_ptr<GfxCoreHelper>(new GfxCoreHelperHw<GfxFamily>());
|
||||
return gfxCoreHelper;
|
||||
}
|
||||
|
||||
@@ -378,6 +382,8 @@ class GfxCoreHelperHw : public GfxCoreHelper {
|
||||
bool isTimestampShiftRequired() const override;
|
||||
bool isRelaxedOrderingSupported() const override;
|
||||
|
||||
~GfxCoreHelperHw() override = default;
|
||||
|
||||
protected:
|
||||
static const AuxTranslationMode defaultAuxTranslationMode;
|
||||
GfxCoreHelperHw() = default;
|
||||
|
||||
Reference in New Issue
Block a user