Skip to content

Commit 5ba0d57

Browse files
committed
Revert use of ACCESSED_BY for managed memory
This reverts commits: * d49cc0f * 76c9653 * 11bd103 * e18cf57 While this is beneficial in some cases it causes very important slow downs when using atomcis in some cases, so reverting this until we can figure out what's going on.
1 parent 29c29e9 commit 5ba0d57

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)