2019-05-16 09:52:28 +02:00
|
|
|
/*
|
2022-01-11 19:41:57 +00:00
|
|
|
* Copyright (C) 2019-2022 Intel Corporation
|
2019-05-16 09:52:28 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2020-10-22 11:25:32 +02:00
|
|
|
#include "shared/source/helpers/hw_helper.h"
|
|
|
|
|
#include "shared/source/helpers/hw_info.h"
|
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>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isLocalMemoryEnabled(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;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-09 11:59:52 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isTimestampWaitSupported() const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2022-03-25 13:00:53 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isUpdateTaskCountFromWaitSupported() const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-12 11:02:17 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isAssignEngineRoundRobinSupported() const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-16 09:52:28 +02:00
|
|
|
template <typename GfxFamily>
|
2021-08-18 15:34:29 +00:00
|
|
|
const EngineInstancesContainer HwHelperHw<GfxFamily>::getGpgpuEngineInstances(const HardwareInfo &hwInfo) const {
|
2020-10-23 07:11:02 -07:00
|
|
|
return {
|
|
|
|
|
{aub_stream::ENGINE_RCS, EngineUsage::Regular},
|
|
|
|
|
{aub_stream::ENGINE_RCS, EngineUsage::LowPriority},
|
|
|
|
|
{aub_stream::ENGINE_RCS, EngineUsage::Internal},
|
|
|
|
|
};
|
2019-05-16 09:52:28 +02:00
|
|
|
}
|
|
|
|
|
|
2020-07-28 01:36:52 -07:00
|
|
|
template <typename GfxFamily>
|
2021-08-16 18:24:13 +00:00
|
|
|
EngineGroupType HwHelperHw<GfxFamily>::getEngineGroupType(aub_stream::EngineType engineType, EngineUsage engineUsage, const HardwareInfo &hwInfo) const {
|
2020-12-15 16:37:05 +00:00
|
|
|
switch (engineType) {
|
|
|
|
|
case aub_stream::ENGINE_RCS:
|
|
|
|
|
return EngineGroupType::RenderCompute;
|
|
|
|
|
default:
|
|
|
|
|
UNRECOVERABLE_IF(true);
|
|
|
|
|
}
|
2020-07-28 01:36:52 -07:00
|
|
|
}
|
|
|
|
|
|
2019-05-16 09:52:28 +02:00
|
|
|
template <typename GfxFamily>
|
2021-08-27 01:39:31 +02:00
|
|
|
std::string HwHelperHw<GfxFamily>::getExtensions() const {
|
2019-05-16 09:52:28 +02:00
|
|
|
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);
|
|
|
|
|
}
|
2021-04-06 18:12:10 +00:00
|
|
|
|
2021-05-20 11:06:19 +00:00
|
|
|
template <typename GfxFamily>
|
2021-05-26 10:38:32 +00:00
|
|
|
inline bool HwHelperHw<GfxFamily>::preferSmallWorkgroupSizeForKernel(const size_t size, const HardwareInfo &hwInfo) const {
|
2021-05-20 11:06:19 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-04-06 18:12:10 +00:00
|
|
|
constexpr uint32_t planarYuvMaxHeight = 16352;
|
|
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
uint32_t HwHelperHw<GfxFamily>::getPlanarYuvMaxHeight() const {
|
|
|
|
|
return planarYuvMaxHeight;
|
|
|
|
|
}
|
2020-03-25 13:06:45 +01:00
|
|
|
|
2021-02-08 11:46:03 +00:00
|
|
|
template <typename GfxFamily>
|
2021-03-05 11:14:21 +00:00
|
|
|
aub_stream::MMIOList HwHelperHw<GfxFamily>::getExtraMmioList(const HardwareInfo &hwInfo, const GmmHelper &gmmHelper) const {
|
2021-02-08 11:46:03 +00:00
|
|
|
return {};
|
|
|
|
|
}
|
|
|
|
|
|
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; }
|
|
|
|
|
|
2021-11-10 15:17:52 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
inline void MemorySynchronizationCommands<GfxFamily>::setPipeControlWAFlags(PIPE_CONTROL &pipeControl) {
|
|
|
|
|
pipeControl.setCommandStreamerStallEnable(true);
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-22 15:35:42 +00:00
|
|
|
template <typename GfxFamily>
|
2021-12-09 12:09:57 +00:00
|
|
|
bool HwHelperHw<GfxFamily>::unTypedDataPortCacheFlushRequired() const {
|
2021-07-22 15:35:42 +00:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 17:24:29 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
bool HwHelperHw<GfxFamily>::isScratchSpaceSurfaceStateAccessible() const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
2022-01-11 19:41:57 +00:00
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
|
inline bool HwHelperHw<GfxFamily>::platformSupportsImplicitScaling(const NEO::HardwareInfo &hwInfo) const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-20 18:13:07 +00:00
|
|
|
template <typename GfxFamily>
|
|
|
|
|
inline bool HwHelperHw<GfxFamily>::isLinuxCompletionFenceSupported() const {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
2019-05-16 09:52:28 +02:00
|
|
|
} // namespace NEO
|