Skip to content

Commit b09b243

Browse files
committed
Add error messages when CUDA provider is disabled
Add error messages when CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF). Signed-off-by: Lukasz Dorau <[email protected]>
1 parent ac9094d commit b09b243

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/provider/provider_cuda.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,37 @@
1212
#include <umf.h>
1313
#include <umf/providers/provider_cuda.h>
1414

15+
#include "utils_log.h"
16+
1517
#if defined(UMF_NO_CUDA_PROVIDER)
1618

1719
umf_result_t umfCUDAMemoryProviderParamsCreate(
1820
umf_cuda_memory_provider_params_handle_t *hParams) {
1921
(void)hParams;
22+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
2023
return UMF_RESULT_ERROR_NOT_SUPPORTED;
2124
}
2225

2326
umf_result_t umfCUDAMemoryProviderParamsDestroy(
2427
umf_cuda_memory_provider_params_handle_t hParams) {
2528
(void)hParams;
29+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
2630
return UMF_RESULT_ERROR_NOT_SUPPORTED;
2731
}
2832

2933
umf_result_t umfCUDAMemoryProviderParamsSetContext(
3034
umf_cuda_memory_provider_params_handle_t hParams, void *hContext) {
3135
(void)hParams;
3236
(void)hContext;
37+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
3338
return UMF_RESULT_ERROR_NOT_SUPPORTED;
3439
}
3540

3641
umf_result_t umfCUDAMemoryProviderParamsSetDevice(
3742
umf_cuda_memory_provider_params_handle_t hParams, int hDevice) {
3843
(void)hParams;
3944
(void)hDevice;
45+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
4046
return UMF_RESULT_ERROR_NOT_SUPPORTED;
4147
}
4248

@@ -45,11 +51,13 @@ umf_result_t umfCUDAMemoryProviderParamsSetMemoryType(
4551
umf_usm_memory_type_t memoryType) {
4652
(void)hParams;
4753
(void)memoryType;
54+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
4855
return UMF_RESULT_ERROR_NOT_SUPPORTED;
4956
}
5057

5158
umf_memory_provider_ops_t *umfCUDAMemoryProviderOps(void) {
5259
// not supported
60+
LOG_ERR("CUDA provider is disabled (UMF_BUILD_CUDA_PROVIDER is OFF)!");
5361
return NULL;
5462
}
5563

0 commit comments

Comments
 (0)