Skip to content

Commit 695d371

Browse files
committed
Moved check for relaxed allocation limit extension to DeviceGPU constructor.
1 parent 9587110 commit 695d371

3 files changed

Lines changed: 16 additions & 4 deletions

File tree

kernels/common/device.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -665,8 +665,12 @@ namespace embree
665665
bool ze_rtas_builder = false;
666666
for (uint32_t i=0; i<extensions.size(); i++)
667667
{
668-
if (strncmp("ZE_extension_rtas",extensions[i].name,sizeof(extensions[i].name)) == 0)
668+
if (strncmp("ZE_extension_rtas",extensions[i].name,sizeof(extensions[i].name)) == 0) {
669669
ze_rtas_builder = true;
670+
}
671+
if (strncmp("ZE_experimental_relaxed_allocation_limits", extensions[i].name, sizeof(extensions[i].name)) == 0) {
672+
hasRelaxedAllocationLimits = true;
673+
}
670674
}
671675
if (!ze_rtas_builder)
672676
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");

kernels/common/device.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,8 @@ namespace embree
209209

210210
unsigned int gpu_maxWorkGroupSize;
211211
unsigned int gpu_maxComputeUnits;
212-
212+
bool hasRelaxedAllocationLimits = false;
213+
213214
public:
214215
void* dispatchGlobalsPtr = nullptr;
215216

@@ -218,6 +219,8 @@ namespace embree
218219
inline sycl::context &getGPUContext() { return gpu_context; }
219220

220221
inline unsigned int getGPUMaxWorkGroupSize() { return gpu_maxWorkGroupSize; }
222+
inline bool relaxedAllocationLimitsSupported() const { return hasRelaxedAllocationLimits; }
223+
221224

222225
void init_rthw_level_zero();
223226
void init_rthw_opencl();

kernels/sycl/rthwif_embree_builder.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,13 @@ namespace embree
214214
relaxed.stype = ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC;
215215
relaxed.pNext = &rt_desc;
216216
relaxed.flags = ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE;
217-
218-
const bool hasRelaxedAllocationLimits = hasDriverExtension(hDriver, ZE_RELAXED_ALLOCATION_LIMITS_EXP_NAME);
217+
218+
bool hasRelaxedAllocationLimits = false;
219+
if (embree_device) {
220+
DeviceGPU* gpu_device = dynamic_cast<DeviceGPU*>(embree_device);
221+
if (gpu_device)
222+
hasRelaxedAllocationLimits = gpu_device->relaxedAllocationLimitsSupported();
223+
}
219224

220225
ze_memory_compression_hints_ext_desc_t compressed;
221226
compressed.stype = ZE_STRUCTURE_TYPE_MEMORY_COMPRESSION_HINTS_EXT_DESC;

0 commit comments

Comments
 (0)