Skip to content

Commit 1f56a85

Browse files
authored
Merge pull request #10673 from rakhmets/topic/rm-check-vmm-debug-log
UCT/CUDA/CUDA_COPY: Removed redundant log message from memory query.
2 parents af2acaa + e2fed0e commit 1f56a85

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/uct/cuda/cuda_copy/cuda_copy_md.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -571,20 +571,20 @@ uct_cuda_copy_mem_release_fabric(uct_cuda_copy_alloc_handle_t *alloc_handle)
571571
#endif
572572
}
573573

574-
static int uct_cuda_copy_detect_vmm(void *address,
574+
static int uct_cuda_copy_detect_vmm(const void *address,
575575
ucs_memory_type_t *vmm_mem_type,
576576
CUdevice *cuda_device)
577577
{
578578
#ifdef HAVE_CUMEMRETAINALLOCATIONHANDLE
579-
ucs_status_t status = UCS_OK;
580-
CUmemAllocationProp prop = {};
581579
CUmemGenericAllocationHandle alloc_handle;
580+
CUresult cu_result;
581+
CUmemAllocationProp prop;
582+
ucs_status_t status;
582583

583584
/* Check if memory is allocated using VMM API and see if host memory needs
584585
* to be treated as pinned device memory */
585-
status = UCT_CUDADRV_FUNC_LOG_DEBUG(
586-
cuMemRetainAllocationHandle(&alloc_handle, (void*)address));
587-
if (status != UCS_OK) {
586+
cu_result = cuMemRetainAllocationHandle(&alloc_handle, (void*)address);
587+
if (cu_result != CUDA_SUCCESS) {
588588
return 0;
589589
}
590590

@@ -594,7 +594,7 @@ static int uct_cuda_copy_detect_vmm(void *address,
594594
status = UCT_CUDADRV_FUNC_LOG_DEBUG(
595595
cuMemGetAllocationPropertiesFromHandle(&prop, alloc_handle));
596596
if (status != UCS_OK) {
597-
goto err;
597+
goto out;
598598
}
599599

600600
*cuda_device = (CUdevice)prop.location.id;
@@ -610,8 +610,8 @@ static int uct_cuda_copy_detect_vmm(void *address,
610610
*vmm_mem_type = UCS_MEMORY_TYPE_CUDA;
611611
}
612612

613-
err:
614-
UCT_CUDADRV_FUNC_LOG_DEBUG(cuMemRelease(alloc_handle));
613+
out:
614+
UCT_CUDADRV_FUNC_LOG_WARN(cuMemRelease(alloc_handle));
615615
return 1;
616616
#else
617617
return 0;
@@ -738,23 +738,23 @@ static void uct_cuda_copy_md_sync_memops_get_address_range(
738738
}
739739

740740
static ucs_status_t
741-
uct_cuda_copy_md_query_attributes(uct_cuda_copy_md_t *md, const void *address,
742-
size_t length, ucs_memory_info_t *mem_info)
741+
uct_cuda_copy_md_query_attributes(const uct_cuda_copy_md_t *md,
742+
const void *address, size_t length,
743+
ucs_memory_info_t *mem_info)
743744
{
744745
#define UCT_CUDA_MEM_QUERY_NUM_ATTRS 4
745746
CUmemorytype cuda_mem_type = CU_MEMORYTYPE_HOST;
746747
uint32_t is_managed = 0;
747-
CUdevice cuda_device = -1;
748748
CUcontext cuda_mem_ctx = NULL;
749749
CUpointer_attribute attr_type[UCT_CUDA_MEM_QUERY_NUM_ATTRS];
750750
void *attr_data[UCT_CUDA_MEM_QUERY_NUM_ATTRS];
751+
CUdevice cuda_device;
751752
int32_t pref_loc;
752753
int is_vmm;
753754
CUresult cu_err;
754755
ucs_status_t status;
755756

756-
is_vmm = uct_cuda_copy_detect_vmm((void*)address, &mem_info->type,
757-
&cuda_device);
757+
is_vmm = uct_cuda_copy_detect_vmm(address, &mem_info->type, &cuda_device);
758758
if (is_vmm) {
759759
if (mem_info->type == UCS_MEMORY_TYPE_UNKNOWN) {
760760
return UCS_ERR_INVALID_ADDR;

0 commit comments

Comments
 (0)