Skip to content

Commit 81b09d0

Browse files
authored
[UR][CUDA][HIP] Remove umf pool tracking ifdefs (#17997)
Pool tracking is now always enabled for UMF and cannot be disabled, so we can remove these ifdefs.
1 parent c11bb9c commit 81b09d0

File tree

5 files changed

+0
-30
lines changed

5 files changed

+0
-30
lines changed

unified-runtime/source/adapters/cuda/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,6 @@ else()
7373
)
7474
endif()
7575

76-
if(UMF_ENABLE_POOL_TRACKING)
77-
target_compile_definitions("ur_adapter_cuda" PRIVATE UMF_ENABLE_POOL_TRACKING)
78-
else()
79-
message(WARNING "CUDA adapter USM pools are disabled, set UMF_ENABLE_POOL_TRACKING to enable them")
80-
endif()
81-
8276
# Only enable xpti tracing on Linux as tracing tools aren't available on
8377
# Windows yet.
8478
if (UR_ENABLE_TRACING AND UNIX)

unified-runtime/source/adapters/cuda/usm.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolCreate(
347347
/// [out] pointer to USM memory pool
348348
ur_usm_pool_handle_t *Pool) {
349349
// Without pool tracking we can't free pool allocations.
350-
#ifdef UMF_ENABLE_POOL_TRACKING
351350
if (PoolDesc->flags & UR_USM_POOL_FLAG_ZERO_INITIALIZE_BLOCK) {
352351
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
353352
}
@@ -362,12 +361,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolCreate(
362361
return UR_RESULT_ERROR_UNKNOWN;
363362
}
364363
return UR_RESULT_SUCCESS;
365-
#else
366-
std::ignore = Context;
367-
std::ignore = PoolDesc;
368-
std::ignore = Pool;
369-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
370-
#endif
371364
}
372365

373366
UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolRetain(

unified-runtime/source/adapters/hip/CMakeLists.txt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,6 @@ else()
203203
message(FATAL_ERROR "Unspecified UR HIP platform please set UR_HIP_PLATFORM to 'AMD' or 'NVIDIA'")
204204
endif()
205205

206-
if(UMF_ENABLE_POOL_TRACKING)
207-
target_compile_definitions(${TARGET_NAME} PRIVATE UMF_ENABLE_POOL_TRACKING)
208-
else()
209-
message(WARNING "HIP adapter USM pools are disabled, set UMF_ENABLE_POOL_TRACKING to enable them")
210-
endif()
211-
212206
target_include_directories(${TARGET_NAME} PRIVATE
213207
"${CMAKE_CURRENT_SOURCE_DIR}/../../"
214208
)

unified-runtime/source/adapters/hip/device.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,11 +1018,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
10181018
case UR_DEVICE_INFO_GLOBAL_VARIABLE_SUPPORT:
10191019
return ReturnValue(ur_bool_t{false});
10201020
case UR_DEVICE_INFO_USM_POOL_SUPPORT:
1021-
#ifdef UMF_ENABLE_POOL_TRACKING
10221021
return ReturnValue(ur_bool_t{true});
1023-
#else
1024-
return ReturnValue(ur_bool_t{false});
1025-
#endif
10261022
case UR_DEVICE_INFO_BFLOAT16_CONVERSIONS_NATIVE:
10271023
return ReturnValue(false);
10281024
case UR_DEVICE_INFO_ASYNC_BARRIER:

unified-runtime/source/adapters/hip/usm.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolCreate(
418418
/// [out] pointer to USM memory pool
419419
ur_usm_pool_handle_t *Pool) {
420420
// Without pool tracking we can't free pool allocations.
421-
#ifdef UMF_ENABLE_POOL_TRACKING
422421
if (PoolDesc->flags & UR_USM_POOL_FLAG_ZERO_INITIALIZE_BLOCK) {
423422
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
424423
}
@@ -433,12 +432,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolCreate(
433432
return UR_RESULT_ERROR_UNKNOWN;
434433
}
435434
return UR_RESULT_SUCCESS;
436-
#else
437-
std::ignore = Context;
438-
std::ignore = PoolDesc;
439-
std::ignore = Pool;
440-
return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
441-
#endif
442435
}
443436

444437
UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolRetain(

0 commit comments

Comments
 (0)