From 05f5666ccb15a1c8de44ec4538f4a46774bb151d Mon Sep 17 00:00:00 2001 From: Lukasz Dorau Date: Thu, 19 Dec 2024 15:14:39 +0100 Subject: [PATCH] Add debug prints --- source/adapters/cuda/platform.cpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/source/adapters/cuda/platform.cpp b/source/adapters/cuda/platform.cpp index 0bbc67f420..38869258f1 100644 --- a/source/adapters/cuda/platform.cpp +++ b/source/adapters/cuda/platform.cpp @@ -118,6 +118,9 @@ urPlatformGet(ur_adapter_handle_t *, uint32_t, uint32_t NumEntries, } try { + fprintf(stderr, + "DEBUG_UMF >>> Creating CUDA memory provider (line %i)\n", + __LINE__); umf_cuda_memory_provider_params_handle_t cu_memory_provider_params = nullptr; umf_result_t umf_result = @@ -127,6 +130,10 @@ urPlatformGet(ur_adapter_handle_t *, uint32_t, uint32_t NumEntries, throw Result; } + fprintf(stderr, + "DEBUG_UMF >>> Creating CUDA memory provider (line %i, " + "NumDevices=%i)\n", + __LINE__, NumDevices); for (int i = 0; i < NumDevices; ++i) { ur_device_handle_t_ *device_handle = Platform.Devices[i].get(); CUdevice device = device_handle->get(); @@ -156,20 +163,40 @@ urPlatformGet(ur_adapter_handle_t *, uint32_t, uint32_t NumEntries, } umf_memory_provider_handle_t umfCUDAprovider = nullptr; + fprintf(stderr, + "DEBUG_UMF >>> Creating CUDA memory provider (line %i, " + "i=%i, NumDevices=%i)\n", + __LINE__, i, NumDevices); umf_result = umfMemoryProviderCreate(umfCUDAMemoryProviderOps(), cu_memory_provider_params, &umfCUDAprovider); + fprintf(stderr, + "DEBUG_UMF >>> Creating CUDA memory provider (line %i, " + "i=%i, NumDevices=%i)\n", + __LINE__, i, NumDevices); if (umf_result != UMF_RESULT_SUCCESS) { Result = umf::umf2urResult(umf_result); throw Result; } + fprintf(stderr, + "DEBUG_UMF >>> Creating CUDA memory provider (line %i, " + "i=%i, NumDevices=%i)\n", + __LINE__, i, NumDevices); device_handle->setUmfCUDAprovider( (umf_usm_memory_type_t)memType, umfCUDAprovider); } } + fprintf(stderr, + "DEBUG_UMF >>> Creating CUDA memory provider (line %i, " + "NumDevices=%i)\n", + __LINE__, NumDevices); umfCUDAMemoryProviderParamsDestroy(cu_memory_provider_params); + fprintf(stderr, + "DEBUG_UMF >>> Creating CUDA memory provider (line %i, " + "NumDevices=%i)\n", + __LINE__, NumDevices); } catch (ur_result_t Err) { Result = Err; throw Err;