Skip to content

Commit 29aa7ba

Browse files
[SYCL] Revert #7496 (#7747)
We found some issues with this in our internal testing. Reverting until investigation is finished.
1 parent 4a9e9a0 commit 29aa7ba

File tree

1 file changed

+1
-24
lines changed

1 file changed

+1
-24
lines changed

sycl/plugins/level_zero/pi_level_zero.cpp

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8079,30 +8079,7 @@ static pi_result USMSharedAllocImpl(void **ResultPtr, pi_context Context,
80798079
reinterpret_cast<std::uintptr_t>(*ResultPtr) % Alignment == 0,
80808080
PI_ERROR_INVALID_VALUE);
80818081

8082-
// See if the memory is going to be read-only on the device.
8083-
bool DeviceReadOnly = false;
8084-
// Check that incorrect bits are not set in the properties.
8085-
if (Properties && *Properties != 0) {
8086-
PI_ASSERT(*(Properties) == PI_MEM_ALLOC_FLAGS && *(Properties + 2) == 0,
8087-
PI_ERROR_INVALID_VALUE);
8088-
DeviceReadOnly = *(Properties + 1) & PI_MEM_ALLOC_DEVICE_READ_ONLY;
8089-
}
8090-
if (!DeviceReadOnly)
8091-
return PI_SUCCESS;
8092-
8093-
// For read-only memory, let L0 know about that by using advises.
8094-
8095-
// zeCommandListAppendMemAdvise must not be called from simultaneous threads
8096-
// with the same command list handle.
8097-
std::scoped_lock<pi_mutex> Lock(Context->ImmediateCommandListMutex);
8098-
8099-
// TODO: Underlying Level Zero runtime doesn't have a way to communicate
8100-
// read-only property yet.
8101-
8102-
ZE_CALL(zeCommandListAppendMemAdvise,
8103-
(Context->ZeCommandListInit, Device->ZeDevice, *ResultPtr, Size,
8104-
ZE_MEMORY_ADVICE_SET_PREFERRED_LOCATION));
8105-
8082+
// TODO: Handle PI_MEM_ALLOC_DEVICE_READ_ONLY.
81068083
return PI_SUCCESS;
81078084
}
81088085

0 commit comments

Comments
 (0)