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