2019-05-16 09:52:28 +02:00
|
|
|
/*
|
2019-12-23 14:28:33 +01:00
|
|
|
* Copyright (C) 2019-2020 Intel Corporation
|
2019-05-16 09:52:28 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/gmm_helper/gmm_helper.h"
|
|
|
|
|
#include "shared/source/helpers/hw_helper_base.inl"
|
2019-05-16 09:52:28 +02: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 12:50:20 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
inline uint32_t HwHelperHw<GfxFamily>::getGlobalTimeStampBits() const {
|
|
|
|
|
return 36;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-16 09:52:28 +02: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 08:55:09 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::heapInLocalMem(const HardwareInfo &hwInfo) const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-22 15:21:02 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::hvAlign4Required() const {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-16 09:52:28 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::timestampPacketWriteSupported() const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2020-05-04 16:34:13 +02:00
|
|
|
template <typename Family>
|
|
|
|
|
bool HwHelperHw<Family>::obtainBlitterPreference(const HardwareInfo &hwInfo) const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-16 09:52:28 +02:00
|
|
|
template <typename GfxFamily>
|
2020-02-21 15:25:04 +01:00
|
|
|
const HwHelper::EngineInstancesContainer HwHelperHw<GfxFamily>::getGpgpuEngineInstances(const HardwareInfo &hwInfo) const {
|
2020-10-20 15:55:59 +02:00
|
|
|
EngineInstancesContainer engines;
|
|
|
|
|
|
|
|
|
|
engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::Regular});
|
|
|
|
|
engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::LowPriority});
|
|
|
|
|
engines.push_back({aub_stream::ENGINE_RCS, EngineUsage::Internal});
|
|
|
|
|
|
|
|
|
|
if (hwInfo.featureTable.ftrBcsInfo.test(0)) {
|
|
|
|
|
engines.push_back({aub_stream::ENGINE_BCS, EngineUsage::Regular});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return engines;
|
2019-05-16 09:52:28 +02:00
|
|
|
}
|
|
|
|
|
|
2020-07-28 01:36:52 -07:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
void HwHelperHw<GfxFamily>::addEngineToEngineGroup(std::vector<std::vector<EngineControl>> &engineGroups,
|
|
|
|
|
EngineControl &engine, const HardwareInfo &hwInfo) const {
|
2020-10-20 15:55:59 +02:00
|
|
|
if (engine.getEngineType() == aub_stream::ENGINE_RCS) {
|
|
|
|
|
engineGroups[static_cast<uint32_t>(EngineGroupType::RenderCompute)].push_back(engine);
|
|
|
|
|
}
|
|
|
|
|
if (engine.getEngineType() == aub_stream::ENGINE_BCS && DebugManager.flags.EnableBlitterOperationsSupport.get() != 0) {
|
|
|
|
|
engineGroups[static_cast<uint32_t>(EngineGroupType::Copy)].push_back(engine);
|
|
|
|
|
}
|
2020-07-28 01:36:52 -07:00
|
|
|
}
|
|
|
|
|
|
2019-05-16 09:52:28 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
std::string HwHelperHw<GfxFamily>::getExtensions() const {
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
2019-08-26 13:02:47 +02:00
|
|
|
template <typename GfxFamily>
|
2020-02-04 12:13:57 +01:00
|
|
|
uint32_t HwHelperHw<GfxFamily>::getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const {
|
2019-08-26 13:02:47 +02: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-07 18:49:46 +01: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 12:51:00 +02: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 13:06:45 +01:00
|
|
|
|
2020-02-07 22:48:09 +01:00
|
|
|
template <typename GfxFamily>
|
2020-04-26 21:48:59 +02:00
|
|
|
inline void MemorySynchronizationCommands<GfxFamily>::addPipeControlWA(LinearStream &commandStream, uint64_t gpuAddress, const HardwareInfo &hwInfo) {
|
2020-02-07 22:48:09 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2020-09-07 16:30:58 +02:00
|
|
|
inline void MemorySynchronizationCommands<GfxFamily>::setPostSyncExtraProperties(PipeControlArgs &args, const HardwareInfo &hwInfo) {
|
2020-02-07 22:48:09 +01:00
|
|
|
}
|
|
|
|
|
|
2020-02-10 11:02:21 +01:00
|
|
|
template <typename GfxFamily>
|
2020-09-30 15:06:42 +02:00
|
|
|
inline void MemorySynchronizationCommands<GfxFamily>::setCacheFlushExtraProperties(PipeControlArgs &args) {
|
2020-02-10 11:02:21 +01:00
|
|
|
}
|
|
|
|
|
|
2020-04-26 21:48:59 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
inline void MemorySynchronizationCommands<GfxFamily>::setPipeControlExtraProperties(typename GfxFamily::PIPE_CONTROL &pipeControl, PipeControlArgs &args) {
|
|
|
|
|
}
|
2020-04-28 16:48:23 +02:00
|
|
|
|
2020-10-05 18:32:55 +02:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool MemorySynchronizationCommands<GfxFamily>::isPipeControlWArequired(const HardwareInfo &hwInfo) { return false; }
|
|
|
|
|
|
2020-04-28 16:48:23 +02: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 09:52:28 +02:00
|
|
|
} // namespace NEO
|