Skip to content

Commit 50c7c0f

Browse files
committed
Fix: use cuda_device_handle in cu_memory_provider_initialize
cu_provider->device is not set (equals 0) in this place yet, so we have to use cu_params->cuda_device_handle instead of cu_provider->device here. Signed-off-by: Lukasz Dorau <[email protected]>
1 parent 40d0ebe commit 50c7c0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/provider/provider_cuda.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ static umf_result_t cu_memory_provider_initialize(void *params,
313313
CUmemAllocationProp allocProps = {0};
314314
allocProps.location.type = CU_MEM_LOCATION_TYPE_DEVICE;
315315
allocProps.type = CU_MEM_ALLOCATION_TYPE_PINNED;
316-
allocProps.location.id = cu_provider->device;
316+
allocProps.location.id = cu_params->cuda_device_handle;
317317
CUresult cu_result = g_cu_ops.cuMemGetAllocationGranularity(
318318
&min_alignment, &allocProps, CU_MEM_ALLOC_GRANULARITY_MINIMUM);
319319
if (cu_result != CUDA_SUCCESS) {

0 commit comments

Comments
 (0)