Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions kernels/common/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -665,31 +665,31 @@ namespace embree
bool ze_rtas_builder = false;
for (uint32_t i=0; i<extensions.size(); i++)
{
if (strncmp("ZE_experimental_rtas_builder",extensions[i].name,sizeof(extensions[i].name)) == 0)
if (strncmp("ZE_extension_rtas",extensions[i].name,sizeof(extensions[i].name)) == 0)
ze_rtas_builder = true;
}
if (!ze_rtas_builder)
throw_RTCError(RTC_ERROR_LEVEL_ZERO_RAYTRACING_SUPPORT_MISSING, "ZE_experimental_rtas_builder extension not found. Please install a recent driver. On Linux, make sure that the package intel-level-zero-gpu-raytracing is installed");
throw_RTCError(RTC_ERROR_LEVEL_ZERO_RAYTRACING_SUPPORT_MISSING, "ZE_extension_rtas extension not found. Please install a recent driver. On Linux, make sure that the package intel-level-zero-gpu-raytracing is installed");

result = ZeWrapper::initRTASBuilder(hDriver);
if (result == ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE) {
throw_RTCError(RTC_ERROR_LEVEL_ZERO_RAYTRACING_SUPPORT_MISSING, "cannot load ZE_experimental_rtas_builder extension. Please install a recent driver. On Linux, make sure that the package intel-level-zero-gpu-raytracing is installed");
throw_RTCError(RTC_ERROR_LEVEL_ZERO_RAYTRACING_SUPPORT_MISSING, "cannot load ZE_extension_rtas extension. Please install a recent driver. On Linux, make sure that the package intel-level-zero-gpu-raytracing is installed");
}
if (result != ZE_RESULT_SUCCESS)
throw_RTCError(RTC_ERROR_UNKNOWN, "cannot initialize ZE_experimental_rtas_builder extension");
throw_RTCError(RTC_ERROR_UNKNOWN, "cannot initialize ZE_extension_rtas extension");

if (State::verbosity(1))
{
std::cout << " Level Zero RTAS Builder" << std::endl;
}

/* check if extension library can get loaded */
ze_rtas_parallel_operation_exp_handle_t hParallelOperation;
result = ZeWrapper::zeRTASParallelOperationCreateExp(hDriver, &hParallelOperation);
ze_rtas_parallel_operation_ext_handle_t hParallelOperation;
result = ZeWrapper::zeRTASParallelOperationCreateExt(hDriver, &hParallelOperation);
if (result == ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE)
throw_RTCError(RTC_ERROR_UNKNOWN, "Level Zero RTAS Build Extension cannot get loaded");
if (result == ZE_RESULT_SUCCESS)
ZeWrapper::zeRTASParallelOperationDestroyExp(hParallelOperation);
ZeWrapper::zeRTASParallelOperationDestroyExt(hParallelOperation);

gpu_maxWorkGroupSize = getGPUDevice().get_info<sycl::info::device::max_work_group_size>();
gpu_maxComputeUnits = getGPUDevice().get_info<sycl::info::device::max_compute_units>();
Expand All @@ -704,7 +704,7 @@ namespace embree
std::cout << std::endl;
}

dispatchGlobalsPtr = zeRTASInitExp(gpu_device, gpu_context);
dispatchGlobalsPtr = zeRTASInit(gpu_device, gpu_context);
}

DeviceGPU::~DeviceGPU()
Expand Down
10,624 changes: 8,031 additions & 2,593 deletions kernels/level_zero/ze_api.h

Large diffs are not rendered by default.

122 changes: 61 additions & 61 deletions kernels/level_zero/ze_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,16 @@ static decltype(zeDriverGetExtensionProperties)* zeDriverGetExtensionPropertiesI
static decltype(zeDeviceGetProperties)* zeDeviceGetPropertiesInternal = nullptr;
static decltype(zeDeviceGetModuleProperties)* zeDeviceGetModulePropertiesInternal = nullptr;

static decltype(zeRTASBuilderCreateExp)* zeRTASBuilderCreateExpInternal = nullptr;
static decltype(zeRTASBuilderDestroyExp)* zeRTASBuilderDestroyExpInternal = nullptr;
static decltype(zeDriverRTASFormatCompatibilityCheckExp)* zeDriverRTASFormatCompatibilityCheckExpInternal = nullptr;
static decltype(zeRTASBuilderGetBuildPropertiesExp)* zeRTASBuilderGetBuildPropertiesExpInternal = nullptr;
static decltype(zeRTASBuilderBuildExp)* zeRTASBuilderBuildExpInternal = nullptr;
static decltype(zeRTASBuilderCreateExt)* zeRTASBuilderCreateExtInternal = nullptr;
static decltype(zeRTASBuilderDestroyExt)* zeRTASBuilderDestroyExtInternal = nullptr;
static decltype(zeDriverRTASFormatCompatibilityCheckExt)* zeDriverRTASFormatCompatibilityCheckExtInternal = nullptr;
static decltype(zeRTASBuilderGetBuildPropertiesExt)* zeRTASBuilderGetBuildPropertiesExtInternal = nullptr;
static decltype(zeRTASBuilderBuildExt)* zeRTASBuilderBuildExtInternal = nullptr;

static decltype(zeRTASParallelOperationCreateExp)* zeRTASParallelOperationCreateExpInternal = nullptr;
static decltype(zeRTASParallelOperationDestroyExp)* zeRTASParallelOperationDestroyExpInternal = nullptr;
static decltype(zeRTASParallelOperationGetPropertiesExp)* zeRTASParallelOperationGetPropertiesExpInternal = nullptr;
static decltype(zeRTASParallelOperationJoinExp)* zeRTASParallelOperationJoinExpInternal = nullptr;
static decltype(zeRTASParallelOperationCreateExt)* zeRTASParallelOperationCreateExtInternal = nullptr;
static decltype(zeRTASParallelOperationDestroyExt)* zeRTASParallelOperationDestroyExtInternal = nullptr;
static decltype(zeRTASParallelOperationGetPropertiesExt)* zeRTASParallelOperationGetPropertiesExtInternal = nullptr;
static decltype(zeRTASParallelOperationJoinExt)* zeRTASParallelOperationJoinExtInternal = nullptr;

template<typename T>
T find_symbol(void* handle, std::string const& symbol) {
Expand Down Expand Up @@ -94,31 +94,31 @@ ze_result_t selectLevelZeroRTASBuilder(ze_driver_handle_t hDriver)
if (ZeWrapper::rtas_builder_selected)
return ZE_RESULT_SUCCESS;

auto zeRTASBuilderCreateExpTemp = find_symbol<decltype(zeRTASBuilderCreateExp)*>(handle,"zeRTASBuilderCreateExp");
auto zeRTASBuilderDestroyExpTemp = find_symbol<decltype(zeRTASBuilderDestroyExp)*>(handle,"zeRTASBuilderDestroyExp");
auto zeRTASBuilderCreateExtTemp = find_symbol<decltype(zeRTASBuilderCreateExt)*>(handle,"zeRTASBuilderCreateExt");
auto zeRTASBuilderDestroyExtTemp = find_symbol<decltype(zeRTASBuilderDestroyExt)*>(handle,"zeRTASBuilderDestroyExt");

ze_rtas_builder_exp_desc_t builderDesc = { ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXP_DESC };
ze_rtas_builder_exp_handle_t hBuilder = nullptr;
ze_result_t err = zeRTASBuilderCreateExpTemp(hDriver, &builderDesc, &hBuilder);
ze_rtas_builder_ext_desc_t builderDesc = { ZE_STRUCTURE_TYPE_RTAS_BUILDER_EXT_DESC, nullptr, ZE_RTAS_BUILDER_EXT_VERSION_CURRENT };
ze_rtas_builder_ext_handle_t hBuilder = nullptr;
ze_result_t err = zeRTASBuilderCreateExtTemp(hDriver, &builderDesc, &hBuilder);

/* when ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE is reported extension cannot get loaded */
if (err == ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE)
return err;

if (err == ZE_RESULT_SUCCESS)
zeRTASBuilderDestroyExpTemp(hBuilder);
zeRTASBuilderDestroyExtTemp(hBuilder);

zeRTASBuilderCreateExpInternal = zeRTASBuilderCreateExpTemp;
zeRTASBuilderDestroyExpInternal = zeRTASBuilderDestroyExpTemp;
zeRTASBuilderCreateExtInternal = zeRTASBuilderCreateExtTemp;
zeRTASBuilderDestroyExtInternal = zeRTASBuilderDestroyExtTemp;

zeDriverRTASFormatCompatibilityCheckExpInternal = find_symbol<decltype(zeDriverRTASFormatCompatibilityCheckExp)*>(handle,"zeDriverRTASFormatCompatibilityCheckExp");
zeRTASBuilderGetBuildPropertiesExpInternal = find_symbol<decltype(zeRTASBuilderGetBuildPropertiesExp)*>(handle,"zeRTASBuilderGetBuildPropertiesExp");
zeRTASBuilderBuildExpInternal = find_symbol<decltype(zeRTASBuilderBuildExp)*>(handle,"zeRTASBuilderBuildExp");
zeDriverRTASFormatCompatibilityCheckExtInternal = find_symbol<decltype(zeDriverRTASFormatCompatibilityCheckExt)*>(handle,"zeDriverRTASFormatCompatibilityCheckExt");
zeRTASBuilderGetBuildPropertiesExtInternal = find_symbol<decltype(zeRTASBuilderGetBuildPropertiesExt)*>(handle,"zeRTASBuilderGetBuildPropertiesExt");
zeRTASBuilderBuildExtInternal = find_symbol<decltype(zeRTASBuilderBuildExt)*>(handle,"zeRTASBuilderBuildExt");

zeRTASParallelOperationCreateExpInternal = find_symbol<decltype(zeRTASParallelOperationCreateExp)*>(handle,"zeRTASParallelOperationCreateExp");
zeRTASParallelOperationDestroyExpInternal = find_symbol<decltype(zeRTASParallelOperationDestroyExp)*>(handle,"zeRTASParallelOperationDestroyExp");
zeRTASParallelOperationGetPropertiesExpInternal = find_symbol<decltype(zeRTASParallelOperationGetPropertiesExp)*>(handle,"zeRTASParallelOperationGetPropertiesExp");
zeRTASParallelOperationJoinExpInternal = find_symbol<decltype(zeRTASParallelOperationJoinExp)*>(handle,"zeRTASParallelOperationJoinExp");
zeRTASParallelOperationCreateExtInternal = find_symbol<decltype(zeRTASParallelOperationCreateExt)*>(handle,"zeRTASParallelOperationCreateExt");
zeRTASParallelOperationDestroyExtInternal = find_symbol<decltype(zeRTASParallelOperationDestroyExt)*>(handle,"zeRTASParallelOperationDestroyExt");
zeRTASParallelOperationGetPropertiesExtInternal = find_symbol<decltype(zeRTASParallelOperationGetPropertiesExt)*>(handle,"zeRTASParallelOperationGetPropertiesExt");
zeRTASParallelOperationJoinExtInternal = find_symbol<decltype(zeRTASParallelOperationJoinExt)*>(handle,"zeRTASParallelOperationJoinExt");

ZeWrapper::rtas_builder_selected = true;
return ZE_RESULT_SUCCESS;
Expand Down Expand Up @@ -214,12 +214,12 @@ ze_result_t validate(ze_device_handle_t hDevice)
return ZE_RESULT_SUCCESS;
}

ze_result_t validate(ze_rtas_device_exp_properties_t* pProperties)
{
ze_result_t validate(ze_rtas_device_ext_properties_t* pProperties)
{
if (pProperties == nullptr)
return ZE_RESULT_ERROR_INVALID_NULL_POINTER;

if (pProperties->stype != ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXP_PROPERTIES)
if (pProperties->stype != ZE_STRUCTURE_TYPE_RTAS_DEVICE_EXT_PROPERTIES)
return ZE_RESULT_ERROR_INVALID_ENUMERATION;

//if (!checkDescChain((zet_base_desc_t_*)pProperties))
Expand All @@ -244,84 +244,84 @@ ze_result_t ZeWrapper::zeDeviceGetModuleProperties(ze_device_handle_t ze_handle,
return zeDeviceGetModulePropertiesInternal(ze_handle, props);
}

ze_result_t ZeWrapper::zeRTASBuilderCreateExp(ze_driver_handle_t hDriver, const ze_rtas_builder_exp_desc_t *pDescriptor, ze_rtas_builder_exp_handle_t *phBuilder)
ze_result_t ZeWrapper::zeRTASBuilderCreateExt(ze_driver_handle_t hDriver, const ze_rtas_builder_ext_desc_t *pDescriptor, ze_rtas_builder_ext_handle_t *phBuilder)
{
if (!handle || !zeRTASBuilderCreateExpInternal)
if (!handle || !zeRTASBuilderCreateExtInternal)
throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first.");

return zeRTASBuilderCreateExpInternal(hDriver,pDescriptor,phBuilder);
return zeRTASBuilderCreateExtInternal(hDriver,pDescriptor,phBuilder);
}

ze_result_t ZeWrapper::zeRTASBuilderDestroyExp(ze_rtas_builder_exp_handle_t hBuilder)
ze_result_t ZeWrapper::zeRTASBuilderDestroyExt(ze_rtas_builder_ext_handle_t hBuilder)
{
if (!handle || !zeRTASBuilderDestroyExpInternal)
if (!handle || !zeRTASBuilderDestroyExtInternal)
throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first.");

return zeRTASBuilderDestroyExpInternal(hBuilder);
return zeRTASBuilderDestroyExtInternal(hBuilder);
}

ze_result_t ZeWrapper::zeDriverRTASFormatCompatibilityCheckExp( ze_driver_handle_t hDriver,
const ze_rtas_format_exp_t accelFormat,
const ze_rtas_format_exp_t otherAccelFormat)
ze_result_t ZeWrapper::zeDriverRTASFormatCompatibilityCheckExt(ze_driver_handle_t hDriver,
const ze_rtas_format_ext_t accelFormat,
const ze_rtas_format_ext_t otherAccelFormat)
{
if (!handle || !zeDriverRTASFormatCompatibilityCheckExpInternal)
if (!handle || !zeDriverRTASFormatCompatibilityCheckExtInternal)
throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first.");

return zeDriverRTASFormatCompatibilityCheckExpInternal( hDriver, accelFormat, otherAccelFormat);
return zeDriverRTASFormatCompatibilityCheckExtInternal(hDriver, accelFormat, otherAccelFormat);
}

ze_result_t ZeWrapper::zeRTASBuilderGetBuildPropertiesExp(ze_rtas_builder_exp_handle_t hBuilder,
const ze_rtas_builder_build_op_exp_desc_t* args,
ze_rtas_builder_exp_properties_t* pProp)
ze_result_t ZeWrapper::zeRTASBuilderGetBuildPropertiesExt(ze_rtas_builder_ext_handle_t hBuilder,
const ze_rtas_builder_build_op_ext_desc_t* args,
ze_rtas_builder_ext_properties_t* pProp)
{
if (!handle || !zeRTASBuilderGetBuildPropertiesExpInternal)
if (!handle || !zeRTASBuilderGetBuildPropertiesExtInternal)
throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first.");

return zeRTASBuilderGetBuildPropertiesExpInternal(hBuilder, args, pProp);
return zeRTASBuilderGetBuildPropertiesExtInternal(hBuilder, args, pProp);
}

ze_result_t ZeWrapper::zeRTASBuilderBuildExp(ze_rtas_builder_exp_handle_t hBuilder,
const ze_rtas_builder_build_op_exp_desc_t* args,
ze_result_t ZeWrapper::zeRTASBuilderBuildExt(ze_rtas_builder_ext_handle_t hBuilder,
const ze_rtas_builder_build_op_ext_desc_t* args,
void *pScratchBuffer, size_t scratchBufferSizeBytes,
void *pRtasBuffer, size_t rtasBufferSizeBytes,
ze_rtas_parallel_operation_exp_handle_t hParallelOperation,
void *pBuildUserPtr, ze_rtas_aabb_exp_t *pBounds, size_t *pRtasBufferSizeBytes)
ze_rtas_parallel_operation_ext_handle_t hParallelOperation,
void *pBuildUserPtr, ze_rtas_aabb_ext_t *pBounds, size_t *pRtasBufferSizeBytes)
{
if (!handle || !zeRTASBuilderBuildExpInternal)
if (!handle || !zeRTASBuilderBuildExtInternal)
throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first.");

return zeRTASBuilderBuildExpInternal(hBuilder, args, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes,
return zeRTASBuilderBuildExtInternal(hBuilder, args, pScratchBuffer, scratchBufferSizeBytes, pRtasBuffer, rtasBufferSizeBytes,
hParallelOperation, pBuildUserPtr, pBounds, pRtasBufferSizeBytes);
}

ze_result_t ZeWrapper::zeRTASParallelOperationCreateExp(ze_driver_handle_t hDriver, ze_rtas_parallel_operation_exp_handle_t* phParallelOperation)
ze_result_t ZeWrapper::zeRTASParallelOperationCreateExt(ze_driver_handle_t hDriver, ze_rtas_parallel_operation_ext_handle_t* phParallelOperation)
{
if (!handle || !zeRTASParallelOperationCreateExpInternal)
if (!handle || !zeRTASParallelOperationCreateExtInternal)
throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first.");

return zeRTASParallelOperationCreateExpInternal(hDriver, phParallelOperation);
return zeRTASParallelOperationCreateExtInternal(hDriver, phParallelOperation);
}

ze_result_t ZeWrapper::zeRTASParallelOperationDestroyExp( ze_rtas_parallel_operation_exp_handle_t hParallelOperation )
ze_result_t ZeWrapper::zeRTASParallelOperationDestroyExt(ze_rtas_parallel_operation_ext_handle_t hParallelOperation)
{
if (!handle || !zeRTASParallelOperationDestroyExpInternal)
if (!handle || !zeRTASParallelOperationDestroyExtInternal)
throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first.");

return zeRTASParallelOperationDestroyExpInternal( hParallelOperation );
return zeRTASParallelOperationDestroyExtInternal(hParallelOperation);
};

ze_result_t ZeWrapper::zeRTASParallelOperationGetPropertiesExp( ze_rtas_parallel_operation_exp_handle_t hParallelOperation, ze_rtas_parallel_operation_exp_properties_t* pProperties )
ze_result_t ZeWrapper::zeRTASParallelOperationGetPropertiesExt(ze_rtas_parallel_operation_ext_handle_t hParallelOperation, ze_rtas_parallel_operation_ext_properties_t* pProperties)
{
if (!handle || !zeRTASParallelOperationGetPropertiesExpInternal)
if (!handle || !zeRTASParallelOperationGetPropertiesExtInternal)
throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first.");

return zeRTASParallelOperationGetPropertiesExpInternal( hParallelOperation, pProperties );
return zeRTASParallelOperationGetPropertiesExtInternal(hParallelOperation, pProperties);
}

ze_result_t ZeWrapper::zeRTASParallelOperationJoinExp( ze_rtas_parallel_operation_exp_handle_t hParallelOperation)
ze_result_t ZeWrapper::zeRTASParallelOperationJoinExt(ze_rtas_parallel_operation_ext_handle_t hParallelOperation)
{
if (!handle || !zeRTASParallelOperationJoinExpInternal)
if (!handle || !zeRTASParallelOperationJoinExtInternal)
throw std::runtime_error("ZeWrapper not initialized, call ZeWrapper::init() first.");

return zeRTASParallelOperationJoinExpInternal(hParallelOperation);
return zeRTASParallelOperationJoinExtInternal(hParallelOperation);
}
Loading
Loading