Skip to content
Merged
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
4 changes: 3 additions & 1 deletion unified-runtime/source/adapters/cuda/enqueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueMemUnmap(
BufferImpl.MemAllocMode == BufferMem::AllocMode::AllocHostPtr;

ur_result_t Result = UR_RESULT_SUCCESS;
if (!IsPinned && (Map->getMapFlags() & UR_MAP_FLAG_WRITE)) {
if (!IsPinned &&
(Map->getMapFlags() &
(UR_MAP_FLAG_WRITE | UR_MAP_FLAG_WRITE_INVALIDATE_REGION))) {
// Pinned host memory is only on host so it doesn't need to be written to.
Result = urEnqueueMemBufferWrite(
hQueue, hMem, true, Map->getMapOffset(), Map->getMapSize(), pMappedPtr,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,6 @@ UUR_DEVICE_TEST_SUITE_WITH_PARAM(
TEST_P(urEnqueueMemBufferMapTestWithWriteFlagParam, SuccessWrite) {
UUR_KNOWN_FAILURE_ON(uur::LevelZero{});

if (getParam().map_flag == UR_MAP_FLAG_WRITE_INVALIDATE_REGION) {
UUR_KNOWN_FAILURE_ON(uur::CUDA{});
}

const std::vector<uint32_t> input(count, 0);
ASSERT_SUCCESS(urEnqueueMemBufferWrite(queue, buffer, true, 0, size,
input.data(), 0, nullptr, nullptr));
Expand Down