From 67127a581ae59fd233e2a87c862b4ebca9530a28 Mon Sep 17 00:00:00 2001 From: "Vinogradov, Sergei" Date: Wed, 27 Nov 2024 02:08:36 -0800 Subject: [PATCH 1/2] Fix failure with destructor order in CUDA params --- src/provider/provider_cuda.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/provider/provider_cuda.c b/src/provider/provider_cuda.c index 3c4e39451..baccbd023 100644 --- a/src/provider/provider_cuda.c +++ b/src/provider/provider_cuda.c @@ -68,6 +68,7 @@ umf_memory_provider_ops_t *umfCUDAMemoryProviderOps(void) { #endif // _MSC_VER #include "base_alloc_global.h" +#include "libumf.h" #include "utils_assert.h" #include "utils_common.h" #include "utils_concurrency.h" @@ -201,6 +202,7 @@ static void init_cu_global_state(void) { umf_result_t umfCUDAMemoryProviderParamsCreate( umf_cuda_memory_provider_params_handle_t *hParams) { + libumfInit(); if (!hParams) { LOG_ERR("CUDA Memory Provider params handle is NULL"); return UMF_RESULT_ERROR_INVALID_ARGUMENT; From 109cc50f7c9552622c5e2490e1bd0860ef6d823f Mon Sep 17 00:00:00 2001 From: "Vinogradov, Sergei" Date: Wed, 27 Nov 2024 04:43:55 -0800 Subject: [PATCH 2/2] Add libumfInit call to the umfScalablePoolParamsCreate --- src/pool/pool_scalable.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pool/pool_scalable.c b/src/pool/pool_scalable.c index 7f355161c..6ee364344 100644 --- a/src/pool/pool_scalable.c +++ b/src/pool/pool_scalable.c @@ -19,6 +19,7 @@ #include #include "base_alloc_global.h" +#include "libumf.h" #include "utils_common.h" #include "utils_concurrency.h" #include "utils_load_library.h" @@ -175,6 +176,7 @@ static void tbb_raw_free_wrapper(intptr_t pool_id, void *ptr, size_t bytes) { umf_result_t umfScalablePoolParamsCreate(umf_scalable_pool_params_handle_t *hParams) { + libumfInit(); if (!hParams) { LOG_ERR("scalable pool params handle is NULL"); return UMF_RESULT_ERROR_INVALID_ARGUMENT;