Skip to content

Commit d3b42cd

Browse files
authored
Merge pull request #1872 from npmiller/revert-access-by
Revert use of ACCESSED_BY for managed memory
2 parents 3fc52b2 + a3c2a85 commit d3b42cd

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

source/adapters/cuda/usm.cpp

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -150,27 +150,15 @@ ur_result_t USMDeviceAllocImpl(void **ResultPtr, ur_context_handle_t,
150150
return UR_RESULT_SUCCESS;
151151
}
152152

153-
ur_result_t USMSharedAllocImpl(void **ResultPtr, ur_context_handle_t Context,
154-
ur_device_handle_t CommandDevice,
153+
ur_result_t USMSharedAllocImpl(void **ResultPtr, ur_context_handle_t,
154+
ur_device_handle_t Device,
155155
ur_usm_host_mem_flags_t,
156156
ur_usm_device_mem_flags_t, size_t Size,
157157
uint32_t Alignment) {
158158
try {
159-
ScopedContext Active(CommandDevice);
159+
ScopedContext Active(Device);
160160
UR_CHECK_ERROR(cuMemAllocManaged((CUdeviceptr *)ResultPtr, Size,
161161
CU_MEM_ATTACH_GLOBAL));
162-
if (getAttribute(CommandDevice,
163-
CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS)) {
164-
UR_CHECK_ERROR(cuMemAdvise((CUdeviceptr)*ResultPtr, Size,
165-
CU_MEM_ADVISE_SET_ACCESSED_BY,
166-
CommandDevice->get()));
167-
}
168-
for (const auto &Dev : Context->getDevices()) {
169-
if (getAttribute(Dev, CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS)) {
170-
UR_CHECK_ERROR(cuMemAdvise((CUdeviceptr)*ResultPtr, Size,
171-
CU_MEM_ADVISE_SET_ACCESSED_BY, Dev->get()));
172-
}
173-
}
174162
} catch (ur_result_t Err) {
175163
return Err;
176164
}

0 commit comments

Comments
 (0)