2019-05-16 15:52:28 +08:00
|
|
|
/*
|
2023-01-26 00:13:28 +08:00
|
|
|
* Copyright (C) 2019-2023 Intel Corporation
|
2019-05-16 15:52:28 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2023-01-26 22:33:36 +08:00
|
|
|
#include "shared/source/helpers/engine_node_helper.h"
|
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>
|
2023-01-30 08:53:04 +08:00
|
|
|
void GfxCoreHelperHw<GfxFamily>::adjustDefaultEngineType(HardwareInfo *pHwInfo, const ProductHelper &productHelper) {
|
2019-05-16 15:52:28 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
uint32_t GfxCoreHelperHw<GfxFamily>::getComputeUnitsUsedForScratch(const RootDeviceEnvironment &rootDeviceEnvironment) const {
|
2022-11-10 21:56:53 +08:00
|
|
|
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
|
|
|
return hwInfo->gtSystemInfo.MaxSubSlicesSupported * hwInfo->gtSystemInfo.MaxEuPerSubSlice *
|
|
|
|
hwInfo->gtSystemInfo.ThreadCount / hwInfo->gtSystemInfo.EUCount;
|
2019-05-16 15:52:28 +08:00
|
|
|
}
|
|
|
|
|
2020-05-12 18:50:20 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
inline uint32_t GfxCoreHelperHw<GfxFamily>::getGlobalTimeStampBits() const {
|
2020-05-12 18:50:20 +08:00
|
|
|
return 36;
|
|
|
|
}
|
|
|
|
|
2019-05-16 15:52:28 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
bool GfxCoreHelperHw<GfxFamily>::isLocalMemoryEnabled(const HardwareInfo &hwInfo) const {
|
2019-05-16 15:52:28 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-08-22 21:21:02 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
bool GfxCoreHelperHw<GfxFamily>::hvAlign4Required() const {
|
2019-08-22 21:21:02 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2019-05-16 15:52:28 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
bool GfxCoreHelperHw<GfxFamily>::timestampPacketWriteSupported() const {
|
2019-05-16 15:52:28 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-12-09 19:59:52 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
bool GfxCoreHelperHw<GfxFamily>::isTimestampWaitSupportedForQueues() const {
|
2022-05-05 22:26:03 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-03-25 21:00:53 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
bool GfxCoreHelperHw<GfxFamily>::isUpdateTaskCountFromWaitSupported() const {
|
2022-03-25 21:00:53 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2019-05-16 15:52:28 +08:00
|
|
|
template <typename GfxFamily>
|
2023-01-26 00:13:28 +08:00
|
|
|
const EngineInstancesContainer GfxCoreHelperHw<GfxFamily>::getGpgpuEngineInstances(const RootDeviceEnvironment &rootDeviceEnvironment) 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>
|
2022-12-08 20:22:35 +08:00
|
|
|
EngineGroupType GfxCoreHelperHw<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>
|
2023-01-30 08:53:04 +08:00
|
|
|
std::string GfxCoreHelperHw<GfxFamily>::getExtensions(const RootDeviceEnvironment &rootDeviceEnvironment) const {
|
2019-05-16 15:52:28 +08:00
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2019-08-26 19:02:47 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
uint32_t GfxCoreHelperHw<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>
|
2022-12-09 23:11:27 +08:00
|
|
|
uint32_t GfxCoreHelperHw<GfxFamily>::calculateAvailableThreadCount(const HardwareInfo &hwInfo, uint32_t grfCount) const {
|
2022-07-26 19:10:43 +08:00
|
|
|
return hwInfo.gtSystemInfo.ThreadCount;
|
2019-11-08 01:49:46 +08:00
|
|
|
}
|
|
|
|
|
2020-04-21 18:51:00 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
uint64_t GfxCoreHelperHw<GfxFamily>::getGpuTimeStampInNS(uint64_t timeStamp, double frequency) const {
|
2020-04-21 18:51:00 +08:00
|
|
|
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>
|
2023-01-28 00:02:13 +08:00
|
|
|
inline bool GfxCoreHelperHw<GfxFamily>::preferSmallWorkgroupSizeForKernel(const size_t size, const RootDeviceEnvironment &rootDeviceEnvironment) 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>
|
2022-12-08 20:22:35 +08:00
|
|
|
uint32_t GfxCoreHelperHw<GfxFamily>::getPlanarYuvMaxHeight() const {
|
2021-04-07 02:12:10 +08:00
|
|
|
return planarYuvMaxHeight;
|
|
|
|
}
|
2020-03-25 20:06:45 +08:00
|
|
|
|
2021-02-08 19:46:03 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
aub_stream::MMIOList GfxCoreHelperHw<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>
|
2023-01-26 11:58:18 +08:00
|
|
|
bool MemorySynchronizationCommands<GfxFamily>::isBarrierWaRequired(const RootDeviceEnvironment &rootDeviceEnvironment) { 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>
|
2022-12-08 20:22:35 +08:00
|
|
|
bool GfxCoreHelperHw<GfxFamily>::unTypedDataPortCacheFlushRequired() const {
|
2021-07-22 23:35:42 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2021-09-23 01:24:29 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
bool GfxCoreHelperHw<GfxFamily>::isScratchSpaceSurfaceStateAccessible() const {
|
2021-09-23 01:24:29 +08:00
|
|
|
return false;
|
|
|
|
}
|
2022-01-12 03:41:57 +08:00
|
|
|
|
2022-11-17 22:27:52 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
uint32_t GfxCoreHelperHw<GfxFamily>::getMaxScratchSize() const {
|
2022-11-17 22:27:52 +08:00
|
|
|
return 2 * MB;
|
|
|
|
}
|
|
|
|
|
2022-01-12 03:41:57 +08:00
|
|
|
template <typename GfxFamily>
|
2023-01-30 08:09:45 +08:00
|
|
|
inline bool GfxCoreHelperHw<GfxFamily>::platformSupportsImplicitScaling(const NEO::RootDeviceEnvironment &rootDeviceEnvironment) const {
|
2022-01-12 03:41:57 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-04-27 19:06:16 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
inline bool GfxCoreHelperHw<GfxFamily>::preferInternalBcsEngine() const {
|
2022-04-27 19:06:16 +08:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2022-09-08 19:12:08 +08:00
|
|
|
template <typename GfxFamily>
|
2022-12-08 20:22:35 +08:00
|
|
|
uint32_t GfxCoreHelperHw<GfxFamily>::getMinimalScratchSpaceSize() const {
|
2022-09-08 19:12:08 +08:00
|
|
|
return 1024U;
|
|
|
|
}
|
2019-05-16 15:52:28 +08:00
|
|
|
} // namespace NEO
|