Add L0 API for querying hardware raytracing capabilities.

Related-To: NEO-5580

Signed-off-by: Jim Snow <jim.m.snow@intel.com>
This commit is contained in:
Jim Snow
2022-11-22 02:58:14 +00:00
committed by Compute-Runtime-Automation
parent 85da0ee184
commit ddf14290d4
13 changed files with 103 additions and 0 deletions

View File

@@ -20,6 +20,7 @@
#include "shared/source/helpers/constants.h"
#include "shared/source/helpers/engine_node_helper.h"
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/helpers/ray_tracing_helper.h"
#include "shared/source/helpers/string.h"
#include "shared/source/helpers/topology_map.h"
#include "shared/source/kernel/grf_config.h"
@@ -667,6 +668,18 @@ ze_result_t DeviceImp::getKernelProperties(ze_device_module_properties_t *pKerne
break;
}
}
} else if (extendedProperties->stype == ZE_STRUCTURE_TYPE_DEVICE_RAYTRACING_EXT_PROPERTIES) {
ze_device_raytracing_ext_properties_t *rtProperties =
reinterpret_cast<ze_device_raytracing_ext_properties_t *>(extendedProperties);
auto &l0HwHelper = L0HwHelper::get(hardwareInfo.platform.eRenderCoreFamily);
if (l0HwHelper.platformSupportsRayTracing()) {
rtProperties->flags = ZE_DEVICE_RAYTRACING_EXT_FLAG_RAYQUERY;
rtProperties->maxBVHLevels = NEO::RayTracingHelper::maxBvhLevels;
} else {
rtProperties->flags = 0;
rtProperties->maxBVHLevels = 0;
}
}
pNext = const_cast<void *>(extendedProperties->pNext);
}

View File

@@ -58,6 +58,7 @@ class L0HwHelper {
virtual bool platformSupportsStateComputeModeTracking() const = 0;
virtual bool platformSupportsFrontEndTracking() const = 0;
virtual bool platformSupportsPipelineSelectTracking() const = 0;
virtual bool platformSupportsRayTracing() const = 0;
virtual uint32_t getEventMaxKernelCount(const NEO::HardwareInfo &hwInfo) const = 0;
virtual uint32_t getEventBaseMaxPacketCount(const NEO::HardwareInfo &hwInfo) const = 0;
@@ -89,6 +90,7 @@ class L0HwHelperHw : public L0HwHelper {
bool platformSupportsStateComputeModeTracking() const override;
bool platformSupportsFrontEndTracking() const override;
bool platformSupportsPipelineSelectTracking() const override;
bool platformSupportsRayTracing() const override;
uint32_t getEventMaxKernelCount(const NEO::HardwareInfo &hwInfo) const override;
uint32_t getEventBaseMaxPacketCount(const NEO::HardwareInfo &hwInfo) const override;

View File

@@ -39,4 +39,9 @@ uint32_t L0HwHelperHw<Family>::getEventBaseMaxPacketCount(const NEO::HardwareInf
return 1u;
}
template <typename Family>
bool L0HwHelperHw<Family>::platformSupportsRayTracing() const {
return false;
}
} // namespace L0

View File

@@ -50,4 +50,9 @@ uint32_t L0HwHelperHw<Family>::getEventBaseMaxPacketCount(const NEO::HardwareInf
return basePackets;
}
template <typename Family>
bool L0HwHelperHw<Family>::platformSupportsRayTracing() const {
return true;
}
} // namespace L0

View File

@@ -33,6 +33,15 @@ bool L0HwHelperHw<Family>::multiTileCapablePlatform() const {
return true;
}
template <>
void L0HwHelperHw<Family>::setAdditionalGroupProperty(ze_command_queue_group_properties_t &groupProperty, NEO::EngineGroupT &group) const {
}
template <>
bool L0HwHelperHw<Family>::platformSupportsRayTracing() const {
return true;
}
template class L0HwHelperHw<Family>;
} // namespace L0

View File

@@ -33,6 +33,11 @@ bool L0HwHelperHw<Family>::alwaysAllocateEventInLocalMem() const {
return true;
}
template <>
bool L0HwHelperHw<Family>::platformSupportsRayTracing() const {
return true;
}
template class L0HwHelperHw<Family>;
} // namespace L0