mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
Related-To: NEO-4724 Change-Id: I85c2effea8a99bebaf9e3db33129641f37dcabe5 Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
122 lines
4.0 KiB
C++
122 lines
4.0 KiB
C++
/*
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "shared/source/gmm_helper/gmm_helper.h"
|
|
#include "shared/source/helpers/hw_helper_base.inl"
|
|
|
|
namespace NEO {
|
|
|
|
template <typename GfxFamily>
|
|
void HwHelperHw<GfxFamily>::adjustDefaultEngineType(HardwareInfo *pHwInfo) {
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
uint32_t HwHelperHw<GfxFamily>::getComputeUnitsUsedForScratch(const HardwareInfo *pHwInfo) const {
|
|
return pHwInfo->gtSystemInfo.MaxSubSlicesSupported * pHwInfo->gtSystemInfo.MaxEuPerSubSlice *
|
|
pHwInfo->gtSystemInfo.ThreadCount / pHwInfo->gtSystemInfo.EUCount;
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
inline uint32_t HwHelperHw<GfxFamily>::getGlobalTimeStampBits() const {
|
|
return 36;
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
void HwHelperHw<GfxFamily>::setCapabilityCoherencyFlag(const HardwareInfo *pHwInfo, bool &coherencyFlag) {
|
|
coherencyFlag = true;
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
bool HwHelperHw<GfxFamily>::isLocalMemoryEnabled(const HardwareInfo &hwInfo) const {
|
|
return false;
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
bool HwHelperHw<GfxFamily>::heapInLocalMem(const HardwareInfo &hwInfo) const {
|
|
return false;
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
bool HwHelperHw<GfxFamily>::hvAlign4Required() const {
|
|
return true;
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
bool HwHelperHw<GfxFamily>::timestampPacketWriteSupported() const {
|
|
return false;
|
|
}
|
|
|
|
template <typename Family>
|
|
bool HwHelperHw<Family>::obtainBlitterPreference(const HardwareInfo &hwInfo) const {
|
|
return false;
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
const HwHelper::EngineInstancesContainer HwHelperHw<GfxFamily>::getGpgpuEngineInstances(const HardwareInfo &hwInfo) const {
|
|
return {aub_stream::ENGINE_RCS,
|
|
aub_stream::ENGINE_RCS, // low priority
|
|
aub_stream::ENGINE_RCS}; // internal usage
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
void HwHelperHw<GfxFamily>::addEngineToEngineGroup(std::vector<std::vector<EngineControl>> &engineGroups,
|
|
EngineControl &engine, const HardwareInfo &hwInfo) const {
|
|
engineGroups[static_cast<uint32_t>(EngineGroupType::RenderCompute)].push_back(engine);
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
std::string HwHelperHw<GfxFamily>::getExtensions() const {
|
|
return "";
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
uint32_t HwHelperHw<GfxFamily>::getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const {
|
|
if (l3enabled) {
|
|
return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1;
|
|
}
|
|
return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1;
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
uint32_t HwHelperHw<GfxFamily>::calculateAvailableThreadCount(PRODUCT_FAMILY family, uint32_t grfCount, uint32_t euCount,
|
|
uint32_t threadsPerEu) {
|
|
return threadsPerEu * euCount;
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
uint64_t HwHelperHw<GfxFamily>::getGpuTimeStampInNS(uint64_t timeStamp, double frequency) const {
|
|
return static_cast<uint64_t>(timeStamp * frequency);
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
inline void MemorySynchronizationCommands<GfxFamily>::addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
inline void MemorySynchronizationCommands<GfxFamily>::setPostSyncExtraProperties(PIPE_CONTROL &pipeControl, const HardwareInfo &hwInfo) {
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
inline void MemorySynchronizationCommands<GfxFamily>::setCacheFlushExtraProperties(PIPE_CONTROL &pipeControl) {
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
inline void MemorySynchronizationCommands<GfxFamily>::setPipeControlExtraProperties(typename GfxFamily::PIPE_CONTROL &pipeControl, PipeControlArgs &args) {
|
|
}
|
|
|
|
template <typename GfxFamily>
|
|
void LriHelper<GfxFamily>::program(LinearStream *cmdStream, uint32_t address, uint32_t value, bool remap) {
|
|
MI_LOAD_REGISTER_IMM cmd = GfxFamily::cmdInitLoadRegisterImm;
|
|
cmd.setRegisterOffset(address);
|
|
cmd.setDataDword(value);
|
|
|
|
auto lri = cmdStream->getSpaceForCmd<MI_LOAD_REGISTER_IMM>();
|
|
*lri = cmd;
|
|
}
|
|
|
|
} // namespace NEO
|