/* * Copyright (C) 2017-2018 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once #include "igfxfmid.h" #include "runtime/helpers/hw_info.h" namespace OCLRT { struct HardwareInfo; class OSInterface; class HwInfoConfig; extern HwInfoConfig *hwInfoConfigFactory[IGFX_MAX_PRODUCT]; class HwInfoConfig { public: static HwInfoConfig *get(PRODUCT_FAMILY product) { return hwInfoConfigFactory[product]; } int configureHwInfo(const HardwareInfo *inHwInfo, HardwareInfo *outHwInfo, OSInterface *osIface); virtual int configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) = 0; virtual void adjustPlatformForProductFamily(HardwareInfo *hwInfo) = 0; uint32_t threadsPerEu; }; template class HwInfoConfigHw : public HwInfoConfig { public: static HwInfoConfig *get() { static HwInfoConfigHw instance; return &instance; } int configureHardwareCustom(HardwareInfo *hwInfo, OSInterface *osIface) override; void adjustPlatformForProductFamily(HardwareInfo *hwInfo) override; protected: HwInfoConfigHw() {} }; template struct EnableProductHwInfoConfig { typedef typename HwMapper::GfxProduct GfxProduct; EnableProductHwInfoConfig() { HwInfoConfig *pHwInfoConfig = HwInfoConfigHw::get(); hwInfoConfigFactory[gfxProduct] = pHwInfoConfig; pHwInfoConfig->threadsPerEu = GfxProduct::threadsPerEu; } }; } // namespace OCLRT