Skip to content
Merged
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
18 changes: 18 additions & 0 deletions sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5683,6 +5683,15 @@ static pi_result USMDeviceAllocImpl(void **ResultPtr, pi_context Context,
ze_device_mem_alloc_desc_t ZeDesc = {};
ZeDesc.flags = 0;
ZeDesc.ordinal = 0;

ze_relaxed_allocation_limits_exp_desc_t RelaxedDesc = {};
if (Size > Device->ZeDeviceProperties.maxMemAllocSize) {
// Tell Level-Zero to accept Size > maxMemAllocSize
RelaxedDesc.stype = ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC;
RelaxedDesc.flags = ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE;
ZeDesc.pNext = &RelaxedDesc;
}

ZE_CALL(zeMemAllocDevice, (Context->ZeContext, &ZeDesc, Size, Alignment,
Device->ZeDevice, ResultPtr));

Expand Down Expand Up @@ -5710,6 +5719,15 @@ static pi_result USMSharedAllocImpl(void **ResultPtr, pi_context Context,
ze_device_mem_alloc_desc_t ZeDevDesc = {};
ZeDevDesc.flags = 0;
ZeDevDesc.ordinal = 0;

ze_relaxed_allocation_limits_exp_desc_t RelaxedDesc = {};
if (Size > Device->ZeDeviceProperties.maxMemAllocSize) {
// Tell Level-Zero to accept Size > maxMemAllocSize
RelaxedDesc.stype = ZE_STRUCTURE_TYPE_RELAXED_ALLOCATION_LIMITS_EXP_DESC;
RelaxedDesc.flags = ZE_RELAXED_ALLOCATION_LIMITS_EXP_FLAG_MAX_SIZE;
ZeDevDesc.pNext = &RelaxedDesc;
}

ZE_CALL(zeMemAllocShared, (Context->ZeContext, &ZeDevDesc, &ZeHostDesc, Size,
Alignment, Device->ZeDevice, ResultPtr));

Expand Down