2019-05-16 15:52:28 +08:00
|
|
|
/*
|
2019-12-23 21:28:33 +08:00
|
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
2019-05-16 15:52:28 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/gmm_helper/gmm_helper.h"
|
|
|
|
#include "shared/source/helpers/hw_helper_base.inl"
|
2019-05-16 15:52:28 +08:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-05-12 18:50:20 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
inline uint32_t HwHelperHw<GfxFamily>::getGlobalTimeStampBits() const {
|
|
|
|
return 36;
|
|
|
|
}
|
|
|
|
|
2019-05-16 15:52:28 +08:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2020-08-27 14:55:09 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
bool HwHelperHw<GfxFamily>::heapInLocalMem(const HardwareInfo &hwInfo) const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-08-22 21:21:02 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
bool HwHelperHw<GfxFamily>::hvAlign4Required() const {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-05-16 15:52:28 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
bool HwHelperHw<GfxFamily>::timestampPacketWriteSupported() const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2020-05-04 22:34:13 +08:00
|
|
|
template <typename Family>
|
|
|
|
bool HwHelperHw<Family>::obtainBlitterPreference(const HardwareInfo &hwInfo) const {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-05-16 15:52:28 +08:00
|
|
|
template <typename GfxFamily>
|
2020-02-21 22:25:04 +08:00
|
|
|
const HwHelper::EngineInstancesContainer HwHelperHw<GfxFamily>::getGpgpuEngineInstances(const HardwareInfo &hwInfo) const {
|
2020-09-15 23:29:02 +08:00
|
|
|
return {
|
|
|
|
{aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
|
|
|
{aub_stream::ENGINE_RCS, EngineUsage::LowPriority},
|
|
|
|
{aub_stream::ENGINE_RCS, EngineUsage::Internal},
|
|
|
|
};
|
2019-05-16 15:52:28 +08:00
|
|
|
}
|
|
|
|
|
2020-07-28 16:36:52 +08:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2019-05-16 15:52:28 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
std::string HwHelperHw<GfxFamily>::getExtensions() const {
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2019-08-26 19:02:47 +08:00
|
|
|
template <typename GfxFamily>
|
2020-02-04 19:13:57 +08:00
|
|
|
uint32_t HwHelperHw<GfxFamily>::getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const {
|
2019-08-26 19:02:47 +08:00
|
|
|
if (l3enabled) {
|
|
|
|
return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER) >> 1;
|
|
|
|
}
|
|
|
|
return gmmHelper.getMOCS(GMM_RESOURCE_USAGE_OCL_BUFFER_CACHELINE_MISALIGNED) >> 1;
|
|
|
|
}
|
|
|
|
|
2019-11-08 01:49:46 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
uint32_t HwHelperHw<GfxFamily>::calculateAvailableThreadCount(PRODUCT_FAMILY family, uint32_t grfCount, uint32_t euCount,
|
|
|
|
uint32_t threadsPerEu) {
|
|
|
|
return threadsPerEu * euCount;
|
|
|
|
}
|
|
|
|
|
2020-04-21 18:51:00 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
uint64_t HwHelperHw<GfxFamily>::getGpuTimeStampInNS(uint64_t timeStamp, double frequency) const {
|
|
|
|
return static_cast<uint64_t>(timeStamp * frequency);
|
|
|
|
}
|
2020-03-25 20:06:45 +08:00
|
|
|
|
2020-02-08 05:48:09 +08:00
|
|
|
template <typename GfxFamily>
|
2020-04-27 03:48:59 +08:00
|
|
|
inline void MemorySynchronizationCommands<GfxFamily>::addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
|
2020-02-08 05:48:09 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2020-09-07 22:30:58 +08:00
|
|
|
inline void MemorySynchronizationCommands<GfxFamily>::setPostSyncExtraProperties(PipeControlArgs &args, const HardwareInfo &hwInfo) {
|
2020-02-08 05:48:09 +08:00
|
|
|
}
|
|
|
|
|
2020-02-10 18:02:21 +08:00
|
|
|
template <typename GfxFamily>
|
2020-09-30 21:06:42 +08:00
|
|
|
inline void MemorySynchronizationCommands<GfxFamily>::setCacheFlushExtraProperties(PipeControlArgs &args) {
|
2020-02-10 18:02:21 +08:00
|
|
|
}
|
|
|
|
|
2020-04-27 03:48:59 +08:00
|
|
|
template <typename GfxFamily>
|
|
|
|
inline void MemorySynchronizationCommands<GfxFamily>::setPipeControlExtraProperties(typename GfxFamily::PIPE_CONTROL &pipeControl, PipeControlArgs &args) {
|
|
|
|
}
|
2020-04-28 22:48:23 +08:00
|
|
|
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2019-05-16 15:52:28 +08:00
|
|
|
} // namespace NEO
|