From 5e1d65961ca204aca8815d0b5182c9d4d7322b1a Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Thu, 27 Mar 2025 15:31:15 +0000 Subject: [PATCH 01/16] [UR] added filename and line number to logs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Łukasz Ślusarczyk Co-authored-by: Mateusz P. Nowak --- .../scripts/templates/valddi.cpp.mako | 2 +- unified-runtime/source/CMakeLists.txt | 3 + .../source/adapters/cuda/command_buffer.hpp | 4 +- .../source/adapters/cuda/common.cpp | 6 +- .../source/adapters/cuda/device.cpp | 2 +- .../source/adapters/cuda/image.cpp | 4 +- .../source/adapters/hip/common.cpp | 8 +- unified-runtime/source/adapters/hip/image.cpp | 4 +- .../source/adapters/level_zero/adapter.cpp | 41 +- .../adapters/level_zero/async_alloc.cpp | 2 +- .../adapters/level_zero/command_buffer.cpp | 23 +- .../source/adapters/level_zero/common.cpp | 8 +- .../source/adapters/level_zero/common.hpp | 38 +- .../source/adapters/level_zero/context.cpp | 44 +- .../source/adapters/level_zero/device.cpp | 63 +- .../source/adapters/level_zero/event.cpp | 33 +- .../level_zero/helpers/image_helpers.cpp | 86 +- .../level_zero/helpers/kernel_helpers.cpp | 26 +- .../source/adapters/level_zero/image.cpp | 59 +- .../source/adapters/level_zero/kernel.cpp | 62 +- .../source/adapters/level_zero/memory.cpp | 58 +- .../source/adapters/level_zero/platform.cpp | 2 +- .../source/adapters/level_zero/program.cpp | 14 +- .../source/adapters/level_zero/queue.cpp | 74 +- .../source/adapters/level_zero/sampler.cpp | 26 +- .../source/adapters/level_zero/usm.cpp | 24 +- .../source/adapters/level_zero/v2/api.cpp | 60 +- .../adapters/level_zero/v2/command_buffer.cpp | 5 +- .../level_zero/v2/command_list_cache.cpp | 20 +- .../source/adapters/level_zero/v2/event.cpp | 9 +- .../level_zero/v2/event_provider_normal.cpp | 2 +- .../source/adapters/level_zero/v2/kernel.cpp | 12 +- .../source/adapters/level_zero/v2/memory.cpp | 8 +- .../v2/queue_immediate_in_order.cpp | 9 +- .../source/adapters/level_zero/v2/usm.cpp | 8 +- .../adapters/level_zero/virtual_mem.cpp | 8 +- .../source/adapters/native_cpu/common.cpp | 2 +- .../source/adapters/native_cpu/common.hpp | 12 +- .../source/adapters/native_cpu/device.cpp | 2 +- .../source/adapters/native_cpu/platform.cpp | 2 +- .../source/adapters/opencl/common.cpp | 2 +- .../source/adapters/opencl/context.cpp | 6 +- .../source/common/latency_tracker.hpp | 6 +- .../source/common/linux/ur_lib_loader.cpp | 26 +- .../source/common/logger/ur_logger.hpp | 99 +- .../common/logger/ur_logger_details.hpp | 111 +- .../source/common/logger/ur_sinks.hpp | 45 +- unified-runtime/source/common/umf_helpers.hpp | 2 +- .../source/common/ur_pool_manager.hpp | 5 +- unified-runtime/source/common/ur_util.cpp | 6 +- .../source/common/windows/ur_lib_loader.cpp | 13 +- .../layers/sanitizer/asan/asan_allocator.cpp | 8 +- .../layers/sanitizer/asan/asan_buffer.cpp | 23 +- .../loader/layers/sanitizer/asan/asan_ddi.cpp | 103 +- .../sanitizer/asan/asan_interceptor.cpp | 110 +- .../sanitizer/asan/asan_interceptor.hpp | 4 +- .../layers/sanitizer/asan/asan_report.cpp | 115 +- .../layers/sanitizer/asan/asan_shadow.cpp | 41 +- .../layers/sanitizer/asan/asan_statistics.cpp | 27 +- .../layers/sanitizer/msan/msan_allocator.cpp | 5 +- .../layers/sanitizer/msan/msan_buffer.cpp | 24 +- .../loader/layers/sanitizer/msan/msan_ddi.cpp | 102 +- .../sanitizer/msan/msan_interceptor.cpp | 109 +- .../layers/sanitizer/msan/msan_report.cpp | 16 +- .../layers/sanitizer/msan/msan_shadow.cpp | 37 +- .../linux/sanitizer_utils.cpp | 4 +- .../sanitizer_common/sanitizer_common.hpp | 4 +- .../sanitizer_common/sanitizer_options.cpp | 2 +- .../sanitizer_options_impl.hpp | 23 +- .../sanitizer_common/sanitizer_stacktrace.cpp | 16 +- .../sanitizer_common/sanitizer_utils.cpp | 8 +- .../loader/layers/sanitizer/tsan/tsan_ddi.cpp | 26 +- .../sanitizer/tsan/tsan_interceptor.cpp | 18 +- .../layers/sanitizer/tsan/tsan_report.cpp | 6 +- .../layers/sanitizer/tsan/tsan_shadow.cpp | 29 +- .../loader/layers/sanitizer/ur_sanddi.cpp | 5 +- .../loader/layers/tracing/ur_trcddi.cpp | 1226 +++++++++-------- .../layers/validation/ur_leak_check.hpp | 44 +- .../loader/layers/validation/ur_valddi.cpp | 484 +++---- .../layers/validation/ur_validation_layer.cpp | 3 +- .../source/loader/ur_adapter_registry.hpp | 70 +- unified-runtime/source/loader/ur_lib.cpp | 86 +- .../test/loader/platforms/platforms.cpp | 20 +- unified-runtime/test/unit/logger/env_var.cpp | 8 +- unified-runtime/tools/urtrace/collector.cpp | 77 +- 85 files changed, 2057 insertions(+), 2022 deletions(-) diff --git a/unified-runtime/scripts/templates/valddi.cpp.mako b/unified-runtime/scripts/templates/valddi.cpp.mako index 6ea8510c8c56..69b07c307a0e 100644 --- a/unified-runtime/scripts/templates/valddi.cpp.mako +++ b/unified-runtime/scripts/templates/valddi.cpp.mako @@ -93,7 +93,7 @@ namespace ur_validation_layer %> %if tp_input_handle_funcs and not is_related_create_get_retain_release_func: if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(${tp['name']})) { - getContext()->refCountContext->logInvalidReference(${tp['name']}); + URLOG_CTX_INVALID_REFERENCES(${tp['name']}); } %endif %endfor diff --git a/unified-runtime/source/CMakeLists.txt b/unified-runtime/source/CMakeLists.txt index f0dd315313e7..4a444dbc7c65 100644 --- a/unified-runtime/source/CMakeLists.txt +++ b/unified-runtime/source/CMakeLists.txt @@ -6,6 +6,9 @@ add_definitions(-DUR_VERSION="${PROJECT_VERSION_MAJOR}") add_definitions(-DUR_VALIDATION_LAYER_SUPPORTED_VERSION="${PROJECT_VERSION_MAJOR}") +string(LENGTH "${CMAKE_SOURCE_DIR}/" SRC_PATH_SIZE) +add_definitions("-DSRC_PATH_SIZE=${SRC_PATH_SIZE}") # for nicer log messages + add_subdirectory(common) add_subdirectory(loader) add_subdirectory(mock) diff --git a/unified-runtime/source/adapters/cuda/command_buffer.hpp b/unified-runtime/source/adapters/cuda/command_buffer.hpp index 97d809e5a341..6ce85f9aa978 100644 --- a/unified-runtime/source/adapters/cuda/command_buffer.hpp +++ b/unified-runtime/source/adapters/cuda/command_buffer.hpp @@ -29,10 +29,10 @@ #define UR_CALL(Call, Result) \ { \ if (PrintTrace) \ - logger::always("UR ---> {}", #Call); \ + URLOG_ALWAYS("UR ---> {}", #Call); \ Result = (Call); \ if (PrintTrace) \ - logger::always("UR <--- {}({})", #Call, Result); \ + URLOG_ALWAYS("UR <--- {}({})", #Call, Result); \ } enum class CommandType { diff --git a/unified-runtime/source/adapters/cuda/common.cpp b/unified-runtime/source/adapters/cuda/common.cpp index 89500d1a1c9a..9d5ded1a633c 100644 --- a/unified-runtime/source/adapters/cuda/common.cpp +++ b/unified-runtime/source/adapters/cuda/common.cpp @@ -53,7 +53,7 @@ void checkErrorUR(CUresult Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - logger::error("{}", SS.str()); + URLOG(ERR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr || std::getenv("UR_CUDA_ABORT") != nullptr) { @@ -73,7 +73,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - logger::error("{}", SS.str()); + URLOG(ERR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr) { std::abort(); @@ -93,7 +93,7 @@ std::string getCudaVersionString() { } void detail::ur::die(const char *Message) { - logger::always("ur_die:{}", Message); + URLOG_ALWAYS("ur_die:{}", Message); std::terminate(); } diff --git a/unified-runtime/source/adapters/cuda/device.cpp b/unified-runtime/source/adapters/cuda/device.cpp index f3b6aa7c593a..64704638b8ba 100644 --- a/unified-runtime/source/adapters/cuda/device.cpp +++ b/unified-runtime/source/adapters/cuda/device.cpp @@ -284,7 +284,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, } else if (std::getenv("SYCL_UR_CUDA_ENABLE_IMAGE_SUPPORT") != nullptr) { Enabled = true; } else { - logger::always( + URLOG_ALWAYS( "Images are not fully supported by the CUDA BE, their support is " "disabled by default. Their partial support can be activated by " "setting SYCL_UR_CUDA_ENABLE_IMAGE_SUPPORT environment variable at " diff --git a/unified-runtime/source/adapters/cuda/image.cpp b/unified-runtime/source/adapters/cuda/image.cpp index e21d726d4fd9..925a8ff752aa 100644 --- a/unified-runtime/source/adapters/cuda/image.cpp +++ b/unified-runtime/source/adapters/cuda/image.cpp @@ -806,8 +806,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - logger::error( - "Unsupported copy operation between different type of images"); + URLOG(ERR, + "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/hip/common.cpp b/unified-runtime/source/adapters/hip/common.cpp index bfe158fced0b..a2a03cb7251d 100644 --- a/unified-runtime/source/adapters/hip/common.cpp +++ b/unified-runtime/source/adapters/hip/common.cpp @@ -86,7 +86,7 @@ void checkErrorUR(amd_comgr_status_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - logger::error("{}", SS.str()); + URLOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -113,7 +113,7 @@ void checkErrorUR(hipError_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - logger::error("{}", SS.str()); + URLOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -133,7 +133,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR HIP ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - logger::error("{}", SS.str()); + URLOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -157,7 +157,7 @@ hipError_t getHipVersionString(std::string &Version) { } void detail::ur::die(const char *pMessage) { - logger::always("ur_die: {}", pMessage); + URLOG_ALWAYS("ur_die: {}", pMessage); std::terminate(); } diff --git a/unified-runtime/source/adapters/hip/image.cpp b/unified-runtime/source/adapters/hip/image.cpp index 0fa0c128e95b..9cac458e09b4 100644 --- a/unified-runtime/source/adapters/hip/image.cpp +++ b/unified-runtime/source/adapters/hip/image.cpp @@ -825,8 +825,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - logger::error( - "Unsupported copy operation between different type of images"); + URLOG(ERR, + "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/adapter.cpp b/unified-runtime/source/adapters/level_zero/adapter.cpp index 4339aed2a229..87e7b81ccba4 100644 --- a/unified-runtime/source/adapters/level_zero/adapter.cpp +++ b/unified-runtime/source/adapters/level_zero/adapter.cpp @@ -163,7 +163,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, ZE2UR_CALL(zeDriverGet, (&ZeDriverGetCount, ZeDriverGetHandles.data())); } if (ZeDriverGetCount == 0 && GlobalAdapter->ZeInitDriversCount == 0) { - logger::error("\nNo Valid L0 Drivers found.\n"); + URLOG(ERR, "\nNo Valid L0 Drivers found.\n"); return UR_RESULT_SUCCESS; } @@ -188,9 +188,10 @@ ur_result_t initPlatforms(PlatformVec &platforms, // newer drivers. if (ZeDriverGetProperties.driverVersion != ZeInitDriverProperties.driverVersion) { - logger::debug("\nzeDriverHandle {} added to the zeInitDrivers list " - "of possible handles.\n", - ZeDriverGetHandles[Y]); + URLOG(DEBUG, + "\nzeDriverHandle {} added to the zeInitDrivers list " + "of possible handles.\n", + ZeDriverGetHandles[Y]); ZeDrivers.push_back(ZeDriverGetHandles[Y]); } } @@ -201,7 +202,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, ZeDrivers.assign(ZeDriverGetHandles.begin(), ZeDriverGetHandles.end()); } ZeDriverCount = ZeDrivers.size(); - logger::debug("\n{} L0 Drivers found.\n", ZeDriverCount); + URLOG(DEBUG, "\n{} L0 Drivers found.\n", ZeDriverCount); for (uint32_t I = 0; I < ZeDriverCount; ++I) { // Keep track of the first platform init for this Driver bool DriverPlatformInit = false; @@ -359,8 +360,8 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() } if (getenv("SYCL_ENABLE_PCI") != nullptr) { - logger::warning( - "WARNING: SYCL_ENABLE_PCI is deprecated and no longer needed.\n"); + URLOG(WARN, + "WARNING: SYCL_ENABLE_PCI is deprecated and no longer needed.\n"); } // TODO: We can still safely recover if something goes wrong during the @@ -381,13 +382,13 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (UrL0InitAllDrivers) { L0InitFlags |= ZE_INIT_FLAG_VPU_ONLY; } - logger::debug("\nzeInit with flags value of {}\n", - static_cast(L0InitFlags)); + URLOG(DEBUG, "\nzeInit with flags value of {}\n", + static_cast(L0InitFlags)); GlobalAdapter->ZeInitResult = ZE_CALL_NOCHECK(zeInit, (L0InitFlags)); if (GlobalAdapter->ZeInitResult != ZE_RESULT_SUCCESS) { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitResult, ErrorString); - logger::error("\nzeInit failed with {}\n", ErrorString); + URLOG(ERR, "\nzeInit failed with {}\n", ErrorString); } bool useInitDrivers = false; @@ -403,9 +404,9 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (strncmp(versions[i].component_name, "loader", strlen("loader")) == 0) { loader_version = versions[i].component_lib_version; - logger::debug("\nLevel Zero Loader Version: {}.{}.{}\n", - loader_version.major, loader_version.minor, - loader_version.patch); + URLOG(DEBUG, "\nLevel Zero Loader Version: {}.{}.{}\n", + loader_version.major, loader_version.minor, + loader_version.patch); break; } } @@ -428,8 +429,8 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() GlobalAdapter->processHandle, "zeInitDrivers"); #endif if (GlobalAdapter->initDriversFunctionPtr) { - logger::debug("\nzeInitDrivers with flags value of {}\n", - static_cast(GlobalAdapter->InitDriversDesc.flags)); + URLOG(DEBUG, "\nzeInitDrivers with flags value of {}\n", + static_cast(GlobalAdapter->InitDriversDesc.flags)); GlobalAdapter->ZeInitDriversResult = ZE_CALL_NOCHECK(GlobalAdapter->initDriversFunctionPtr, (&GlobalAdapter->ZeInitDriversCount, nullptr, @@ -439,7 +440,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() } else { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitDriversResult, ErrorString); - logger::error("\nzeInitDrivers failed with {}\n", ErrorString); + URLOG(ERR, "\nzeInitDrivers failed with {}\n", ErrorString); } } } @@ -457,12 +458,12 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() // Absorb the ZE_RESULT_ERROR_UNINITIALIZED and just return 0 Platforms. if (*GlobalAdapter->ZeResult == ZE_RESULT_ERROR_UNINITIALIZED) { - logger::error("Level Zero Uninitialized\n"); + URLOG(ERR, "Level Zero Uninitialized\n"); result = std::move(platforms); return; } if (*GlobalAdapter->ZeResult != ZE_RESULT_SUCCESS) { - logger::error("Level Zero initialization failure\n"); + URLOG(ERR, "Level Zero initialization failure\n"); result = ze2urResult(*GlobalAdapter->ZeResult); return; @@ -509,8 +510,8 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() GlobalAdapter->getSysManDriversFunctionPtr && GlobalAdapter->sysManInitFunctionPtr) { ze_init_flags_t L0ZesInitFlags = 0; - logger::debug("\nzesInit with flags value of {}\n", - static_cast(L0ZesInitFlags)); + URLOG(DEBUG, "\nzesInit with flags value of {}\n", + static_cast(L0ZesInitFlags)); GlobalAdapter->ZesResult = ZE_CALL_NOCHECK( GlobalAdapter->sysManInitFunctionPtr, (L0ZesInitFlags)); } else { diff --git a/unified-runtime/source/adapters/level_zero/async_alloc.cpp b/unified-runtime/source/adapters/level_zero/async_alloc.cpp index b9d71ef4ca36..178680bcd5e8 100644 --- a/unified-runtime/source/adapters/level_zero/async_alloc.cpp +++ b/unified-runtime/source/adapters/level_zero/async_alloc.cpp @@ -92,7 +92,7 @@ static ur_result_t enqueueUSMAllocHelper( CommandType = UR_COMMAND_ENQUEUE_USM_SHARED_ALLOC_EXP; break; default: - logger::error("enqueueUSMAllocHelper: unsupported USM type"); + URLOG(ERR, "enqueueUSMAllocHelper: unsupported USM type"); throw UR_RESULT_ERROR_UNKNOWN; } UR_CALL(createEventAndAssociateQueue(Queue, Event, CommandType, CommandList, diff --git a/unified-runtime/source/adapters/level_zero/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/command_buffer.cpp index 45ab74c52a96..aa855cc35bf7 100644 --- a/unified-runtime/source/adapters/level_zero/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/command_buffer.cpp @@ -19,7 +19,7 @@ */ // Print the name of a variable and its value in the L0 debug log -#define DEBUG_LOG(VAR) logger::debug(#VAR " {}", VAR); +#define DEBUG_LOG(VAR) URLOG(DEBUG, #VAR " {}", VAR); namespace { @@ -44,17 +44,18 @@ bool checkImmediateAppendSupport(ur_context_handle_t Context, const bool EnableAppendPath = std::atoi(UrRet) == 1; if (EnableAppendPath && !Device->ImmCommandListUsed) { - logger::error("{} is set but immediate command-lists are currently " - "disabled. Immediate command-lists are " - "required to use the immediate append path.", - AppendEnvVarName); + URLOG(ERR, + "{} is set but immediate command-lists are currently " + "disabled. Immediate command-lists are " + "required to use the immediate append path.", + AppendEnvVarName); std::abort(); } if (EnableAppendPath && !DriverSupportsImmediateAppend) { - logger::error("{} is set but " - "the current driver does not support the " - "zeCommandListImmediateAppendCommandListsExp entrypoint.", - AppendEnvVarName); + URLOG(ERR, + "{} is set but the current driver does not support the " + "zeCommandListImmediateAppendCommandListsExp entrypoint.", + AppendEnvVarName); std::abort(); } @@ -1840,7 +1841,7 @@ ur_result_t validateCommandDesc( auto SupportedFeatures = CommandBuffer->Device->ZeDeviceMutableCmdListsProperties ->mutableCommandFlags; - logger::debug("Mutable features supported by device {}", SupportedFeatures); + URLOG(DEBUG, "Mutable features supported by device {}", SupportedFeatures); auto Command = static_cast(CommandDesc.hCommand); UR_ASSERT(CommandBuffer == Command->CommandBuffer, @@ -1869,7 +1870,7 @@ ur_result_t validateCommandDesc( if (NewGlobalWorkOffset) { if (!CommandBuffer->Context->getPlatform() ->ZeDriverGlobalOffsetExtensionFound) { - logger::error("No global offset extension found on this driver"); + URLOG(ERR, "No global offset extension found on this driver"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/common.cpp b/unified-runtime/source/adapters/level_zero/common.cpp index 94d864108e68..4de8c4087460 100644 --- a/unified-runtime/source/adapters/level_zero/common.cpp +++ b/unified-runtime/source/adapters/level_zero/common.cpp @@ -76,8 +76,8 @@ bool setEnvVar(const char *name, const char *value) { int Res = setenv(name, value, 1); #endif if (Res != 0) { - logger::debug( - "UR L0 Adapter was unable to set the environment variable: {}", name); + URLOG(DEBUG, "UR L0 Adapter was unable to set the environment variable: {}", + name); return false; } return true; @@ -138,7 +138,7 @@ void zeParseError(ze_result_t ZeError, const char *&ErrorString) { ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *ZeName, const char *ZeArgs, bool TraceError) { - logger::debug("ZE ---> {}{}", ZeName, ZeArgs); + URLOG(DEBUG, "ZE ---> {}{}", ZeName, ZeArgs); if (ZeResult == ZE_RESULT_SUCCESS) { if (UrL0LeaksDebug) { @@ -150,7 +150,7 @@ ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *ZeName, if (TraceError) { const char *ErrorString = "Unknown"; zeParseError(ZeResult, ErrorString); - logger::error("Error ({}) in {}", ErrorString, ZeName); + URLOG(ERR, "Error ({}) in {}", ErrorString, ZeName); } return ZeResult; } diff --git a/unified-runtime/source/adapters/level_zero/common.hpp b/unified-runtime/source/adapters/level_zero/common.hpp index 4ddd1c49a493..f6217fc60f88 100644 --- a/unified-runtime/source/adapters/level_zero/common.hpp +++ b/unified-runtime/source/adapters/level_zero/common.hpp @@ -48,21 +48,20 @@ struct _ur_platform_handle_t; (zeDriverGet_t)GetProcAddress(zeLoader, "zeDriverGet"); if (zeDriverGetLoader) { ze_result_t result = zeDriverGetLoader(&ZeDriverCount, nullptr); - logger::debug( - "ZE ---> checkL0LoaderTeardown result = {} driver count = {}", result, - ZeDriverCount); + URLOG(DEBUG, + "ZE ---> checkL0LoaderTeardown result = {} driver count = {}", + result, ZeDriverCount); if (result != ZE_RESULT_SUCCESS || ZeDriverCount == 0) { loaderStable = false; } } else { - logger::debug("ZE ---> checkL0LoaderTeardown: Failed to get address of " - "zeDriverGet"); + URLOG(DEBUG, "ZE ---> checkL0LoaderTeardown: Failed to get address of " + "zeDriverGet"); loaderStable = false; } FreeLibrary(zeLoader); } else { - logger::debug( - "ZE ---> checkL0LoaderTeardown: Failed to load ze_loader.dll"); + URLOG(DEBUG, "ZE ---> checkL0LoaderTeardown: Failed to load ze_loader.dll"); loaderStable = false; } #else @@ -74,26 +73,27 @@ struct _ur_platform_handle_t; (zeDriverGet_t)dlsym(zeLoader, "zeDriverGet"); if (zeDriverGetLoader) { ze_result_t result = zeDriverGetLoader(&ZeDriverCount, nullptr); - logger::debug( - "ZE ---> checkL0LoaderTeardown result = {} driver count = {}", result, - ZeDriverCount); + URLOG(DEBUG, + "ZE ---> checkL0LoaderTeardown result = {} driver count = {}", + result, ZeDriverCount); if (result != ZE_RESULT_SUCCESS || ZeDriverCount == 0) { loaderStable = false; } } else { - logger::debug("ZE ---> checkL0LoaderTeardown: Failed to get address of " - "zeDriverGet"); + URLOG(DEBUG, "ZE ---> checkL0LoaderTeardown: Failed to get address of " + "zeDriverGet"); loaderStable = false; } dlclose(zeLoader); } else { - logger::debug( - "ZE ---> checkL0LoaderTeardown: Failed to load libze_loader.so.1"); + URLOG(DEBUG, + "ZE ---> checkL0LoaderTeardown: Failed to load libze_loader.so.1"); loaderStable = false; } #endif if (!loaderStable) { - logger::debug( + URLOG( + DEBUG, "ZE ---> checkL0LoaderTeardown: Loader is not stable, returning false"); } return loaderStable; @@ -244,10 +244,10 @@ static auto getUrResultString = [](ur_result_t Result) { #define UR_CALL(Call) \ { \ if (PrintTrace) \ - logger::always("UR ---> {}", #Call); \ + URLOG_ALWAYS("UR ---> {}", #Call); \ ur_result_t Result = (Call); \ if (PrintTrace) \ - logger::always("UR <--- {}({})", #Call, getUrResultString(Result)); \ + URLOG_ALWAYS("UR <--- {}({})", #Call, getUrResultString(Result)); \ if (Result != UR_RESULT_SUCCESS) \ return Result; \ } @@ -256,10 +256,10 @@ static auto getUrResultString = [](ur_result_t Result) { #define UR_CALL_THROWS(Call) \ { \ if (PrintTrace) \ - logger::always("UR ---> {}", #Call); \ + URLOG_ALWAYS("UR ---> {}", #Call); \ ur_result_t Result = (Call); \ if (PrintTrace) \ - logger::always("UR <--- {}({})", #Call, getUrResultString(Result)); \ + URLOG_ALWAYS("UR <--- {}({})", #Call, getUrResultString(Result)); \ if (Result != UR_RESULT_SUCCESS) \ throw Result; \ } diff --git a/unified-runtime/source/adapters/level_zero/context.cpp b/unified-runtime/source/adapters/level_zero/context.cpp index de1ca00f9f8f..464eab20d597 100644 --- a/unified-runtime/source/adapters/level_zero/context.cpp +++ b/unified-runtime/source/adapters/level_zero/context.cpp @@ -172,8 +172,8 @@ ur_result_t urContextSetExtendedDeleter( std::ignore = Context; std::ignore = Deleter; std::ignore = UserData; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!", __FUNCTION__); + URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } } // namespace ur::level_zero @@ -209,7 +209,8 @@ ur_result_t ur_context_handle_t_::initialize() { ZeCommandQueueDesc.mode = ZE_COMMAND_QUEUE_MODE_SYNCHRONOUS; if (Device->useDriverInOrderLists() && Device->useDriverCounterBasedEvents()) { - logger::debug( + URLOG( + DEBUG, "L0 Synchronous Immediate Command List needed with In Order property."); ZeCommandQueueDesc.flags |= ZE_COMMAND_QUEUE_FLAG_IN_ORDER; } @@ -437,8 +438,8 @@ ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool( ZeEventPoolDesc.flags |= ZE_EVENT_POOL_FLAG_HOST_VISIBLE; if (ProfilingEnabled) ZeEventPoolDesc.flags |= ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP; - logger::debug("ze_event_pool_desc_t flags set to: {}", - ZeEventPoolDesc.flags); + URLOG(DEBUG, "ze_event_pool_desc_t flags set to: {}", + ZeEventPoolDesc.flags); if (CounterBasedEventEnabled) { if (UsingImmCmdList) { counterBasedExt.flags = ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_IMMEDIATE; @@ -446,8 +447,8 @@ ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool( counterBasedExt.flags = ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_NON_IMMEDIATE; } - logger::debug("ze_event_pool_desc_t counter based flags set to: {}", - counterBasedExt.flags); + URLOG(DEBUG, "ze_event_pool_desc_t counter based flags set to: {}", + counterBasedExt.flags); if (InterruptBasedEventEnabled) { counterBasedExt.pNext = &eventSyncMode; } @@ -487,10 +488,11 @@ ur_event_handle_t ur_context_handle_t_::getEventFromContextCache( getEventCache(HostVisible, WithProfiling, Device, CounterBasedEventEnabled, InterruptBasedEventEnabled); if (Cache->empty()) { - logger::info("Cache empty (Host Visible: {}, Profiling: {}, Counter: {}, " - "Interrupt: {}, Device: {})", - HostVisible, WithProfiling, CounterBasedEventEnabled, - InterruptBasedEventEnabled, Device); + URLOG(INFO, + "Cache empty (Host Visible: {}, Profiling: {}, Counter: {}, " + "Interrupt: {}, Device: {})", + HostVisible, WithProfiling, CounterBasedEventEnabled, + InterruptBasedEventEnabled, Device); return nullptr; } @@ -501,11 +503,12 @@ ur_event_handle_t ur_context_handle_t_::getEventFromContextCache( // We have to reset event before using it. Event->reset(); - logger::info("Using {} event (Host Visible: {}, Profiling: {}, Counter: {}, " - "Interrupt: {}, Device: {}) from cache {}", - Event, Event->HostVisibleEvent, Event->isProfilingEnabled(), - Event->CounterBasedEventsEnabled, - Event->InterruptBasedEventsEnabled, Device, Cache); + URLOG(INFO, + "Using {} event (Host Visible: {}, Profiling: {}, Counter: {}, " + "Interrupt: {}, Device: {}) from cache {}", + Event, Event->HostVisibleEvent, Event->isProfilingEnabled(), + Event->CounterBasedEventsEnabled, Event->InterruptBasedEventsEnabled, + Device, Cache); return Event; } @@ -521,10 +524,11 @@ void ur_context_handle_t_::addEventToContextCache(ur_event_handle_t Event) { auto Cache = getEventCache( Event->isHostVisible(), Event->isProfilingEnabled(), Device, Event->CounterBasedEventsEnabled, Event->InterruptBasedEventsEnabled); - logger::info("Inserting {} event (Host Visible: {}, Profiling: {}, Counter: " - "{}, Device: {}) into cache {}", - Event, Event->HostVisibleEvent, Event->isProfilingEnabled(), - Event->CounterBasedEventsEnabled, Device, Cache); + URLOG(INFO, + "Inserting {} event (Host Visible: {}, Profiling: {}, Counter: {}, " + "Device: {}) into cache {}", + Event, Event->HostVisibleEvent, Event->isProfilingEnabled(), + Event->CounterBasedEventsEnabled, Device, Cache); Cache->emplace_back(Event); } diff --git a/unified-runtime/source/adapters/level_zero/device.cpp b/unified-runtime/source/adapters/level_zero/device.cpp index 429a04178763..4d8e205b6765 100644 --- a/unified-runtime/source/adapters/level_zero/device.cpp +++ b/unified-runtime/source/adapters/level_zero/device.cpp @@ -52,8 +52,8 @@ getRangeOfAllowedCopyEngines(const ur_device_handle_t &Device) { int UpperCopyEngineIndex = std::stoi(CopyEngineRange.substr(pos + 1)); if ((LowerCopyEngineIndex > UpperCopyEngineIndex) || (LowerCopyEngineIndex < -1) || (UpperCopyEngineIndex < -1)) { - logger::error("UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " - "default set."); + URLOG(ERR, "UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " + "default set."); LowerCopyEngineIndex = 0; UpperCopyEngineIndex = INT_MAX; } @@ -141,7 +141,7 @@ ur_result_t urDeviceGet( break; default: Matched = false; - logger::warning("Unknown device type"); + URLOG(WARN, "Unknown device type"); break; } @@ -194,8 +194,8 @@ static std::tuple getZesDeviceData(ur_device_handle_t Device) { bool SysManEnv = getenv_tobool("ZES_ENABLE_SYSMAN", false); if ((Device->Platform->ZedeviceToZesDeviceMap.size() == 0) && !SysManEnv) { - logger::error("SysMan support is unavailable on this system. Please " - "check your level zero driver installation."); + URLOG(ERR, "SysMan support is unavailable on this system. Please " + "check your level zero driver installation."); return {nullptr, {}, UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION}; } @@ -250,7 +250,7 @@ ur_result_t urDeviceGetInfo( case ZE_DEVICE_TYPE_FPGA: return ReturnValue(UR_DEVICE_TYPE_FPGA); default: - logger::error("This device type is not supported"); + URLOG(ERR, "This device type is not supported"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1099,8 +1099,8 @@ ur_result_t urDeviceGetInfo( case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP: - logger::error("Unsupported ParamName in urGetDeviceInfo"); - logger::error("ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + URLOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + URLOG(ERR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP: { // L0 does not support mipmaps. @@ -1111,8 +1111,8 @@ ur_result_t urDeviceGetInfo( return ReturnValue(false); } case UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP: - logger::error("Unsupported ParamName in urGetDeviceInfo"); - logger::error("ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + URLOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + URLOG(ERR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP: { // L0 does not support creation of images from individual mipmap levels. @@ -1328,9 +1328,9 @@ ur_result_t urDeviceGetInfo( } } default: - logger::error("Unsupported ParamName in urGetDeviceInfo"); - logger::error("ParamNameParamName={}(0x{})", ParamName, - logger::toHex(ParamName)); + URLOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + URLOG(ERR, "ParamNameParamName={}(0x{})", ParamName, + logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; } @@ -1643,8 +1643,8 @@ ur_device_handle_t_::useImmediateCommandLists() { } } - logger::info("NOTE: L0 Immediate CommandList Setting: {}", - ImmediateCommandlistsSetting); + URLOG(INFO, "NOTE: L0 Immediate CommandList Setting: {}", + ImmediateCommandlistsSetting); switch (ImmediateCommandlistsSetting) { case 0: @@ -1801,8 +1801,9 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal, if (numQueueGroups == 0) { return UR_RESULT_ERROR_UNKNOWN; } - logger::info(logger::LegacyMessage("NOTE: Number of queue groups = {}"), - "Number of queue groups = {}", numQueueGroups); + URLOG_L(ERR, logger::LegacyMessage("NOTE: Number of queue groups = {}"), + "Number of queue groups = {}", numQueueGroups); + std::vector> QueueGroupProperties(numQueueGroups); ZE2UR_CALL(zeDeviceGetCommandQueueGroupProperties, @@ -1855,22 +1856,26 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal, } } if (QueueGroup[queue_group_info_t::MainCopy].ZeOrdinal < 0) - logger::info(logger::LegacyMessage( - "NOTE: main blitter/copy engine is not available"), - "main blitter/copy engine is not available"); + URLOG_L(INFO, + logger::LegacyMessage( + "NOTE: main blitter/copy engine is not available"), + "main blitter/copy engine is not available") else - logger::info(logger::LegacyMessage( - "NOTE: main blitter/copy engine is available"), - "main blitter/copy engine is available"); + URLOG_L(INFO, + logger::LegacyMessage( + "NOTE: main blitter/copy engine is available"), + "main blitter/copy engine is available") if (QueueGroup[queue_group_info_t::LinkCopy].ZeOrdinal < 0) - logger::info(logger::LegacyMessage( - "NOTE: link blitter/copy engines are not available"), - "link blitter/copy engines are not available"); + URLOG_L(INFO, + logger::LegacyMessage( + "NOTE: link blitter/copy engines are not available"), + "link blitter/copy engines are not available") else - logger::info(logger::LegacyMessage( - "NOTE: link blitter/copy engines are available"), - "link blitter/copy engines are available"); + URLOG_L(INFO, + logger::LegacyMessage( + "NOTE: link blitter/copy engines are available"), + "link blitter/copy engines are available") } } diff --git a/unified-runtime/source/adapters/level_zero/event.cpp b/unified-runtime/source/adapters/level_zero/event.cpp index 11c0502a5593..e783ae158153 100644 --- a/unified-runtime/source/adapters/level_zero/event.cpp +++ b/unified-runtime/source/adapters/level_zero/event.cpp @@ -29,7 +29,7 @@ void printZeEventList(const _ur_ze_event_list_t &UrZeEventList) { for (uint32_t I = 0; I < UrZeEventList.Length; I++) { ss << " " << ur_cast(UrZeEventList.ZeEventList[I]); } - logger::debug(ss.str().c_str()); + URLOG(DEBUG, ss.str().c_str()); } } @@ -523,9 +523,8 @@ ur_result_t urEventGetInfo( return ReturnValue(Event->RefCount.load()); } default: - logger::error( - "Unsupported ParamName in urEventGetInfo: ParamName=ParamName={}(0x{})", - PropName, logger::toHex(PropName)); + URLOG(ERR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + PropName, logger::toHex(PropName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -610,11 +609,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - logger::error("urEventGetProfilingInfo: " - "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); + URLOG(ERR, "urEventGetProfilingInfo: " + "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - logger::error("urEventGetProfilingInfo: not supported ParamName"); + URLOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -677,11 +676,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - logger::error("urEventGetProfilingInfo: " - "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); + URLOG(ERR, "urEventGetProfilingInfo: " + "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - logger::error("urEventGetProfilingInfo: not supported ParamName"); + URLOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } else { @@ -724,11 +723,11 @@ ur_result_t urEventGetProfilingInfo( // return ReturnValue(uint64_t{0}); case UR_PROFILING_INFO_COMMAND_COMPLETE: - logger::error("urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " - "not supported"); + URLOG(ERR, "urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " + "not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - logger::error("urEventGetProfilingInfo: not supported ParamName"); + URLOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -843,7 +842,7 @@ urEventWait(uint32_t NumEvents, die("The host-visible proxy event missing"); ze_event_handle_t ZeEvent = HostVisibleEvent->ZeEvent; - logger::debug("ZeEvent = {}", ur_cast(ZeEvent)); + URLOG(DEBUG, "ZeEvent = {}", ur_cast(ZeEvent)); // If this event was an inner batched event, then sync with // the Queue instead of waiting on the event. if (HostVisibleEvent->IsInnerBatchedEvent && Event->ZeBatchedQueue) { @@ -1019,8 +1018,10 @@ ur_result_t urEventSetCallback( std::ignore = ExecStatus; std::ignore = Notify; std::ignore = UserData; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!", __FUNCTION__); + logger::get_logger().log( + logger::LegacyMessage("[UR][L0] {} function not implemented!"), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp index 9da1750e8c1f..9c7ae0fd3434 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp @@ -35,9 +35,8 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormatTypeSize = 32; break; default: - logger::error( - "ze2urImageFormat: unsupported image format layout: layout = {}", - ZeImageFormat.layout); + URLOG(ERR, "ze2urImageFormat: unsupported image format layout: layout = {}", + ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -54,9 +53,8 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_A; break; default: - logger::error( - "ze2urImageFormat: unexpected image format channel x: x = {}", - ZeImageFormat.x); + URLOG(ERR, "ze2urImageFormat: unexpected image format channel x: x = {}", + ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -64,9 +62,8 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, case ZE_IMAGE_FORMAT_LAYOUT_16_16: case ZE_IMAGE_FORMAT_LAYOUT_32_32: if (ZeImageFormat.x != ZE_IMAGE_FORMAT_SWIZZLE_R) { - logger::error( - "ze2urImageFormat: unexpected image format channel x: x = {}", - ZeImageFormat.x); + URLOG(ERR, "ze2urImageFormat: unexpected image format channel x: x = {}", + ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; } switch (ZeImageFormat.y) { @@ -80,9 +77,9 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RX; break; default: - logger::error( - "ze2urImageFormat: unexpected image format channel y: y = {}\n", - ZeImageFormat.y); + URLOG(ERR, + "ze2urImageFormat: unexpected image format channel y: y = {}\n", + ZeImageFormat.y); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -99,13 +96,13 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGX; break; default: - logger::error( - "ze2urImageFormat: unexpected image format channel z: z = {}\n", - ZeImageFormat.z); + URLOG(ERR, + "ze2urImageFormat: unexpected image format channel z: z = {}\n", + ZeImageFormat.z); return UR_RESULT_ERROR_INVALID_VALUE; } } else { - logger::error("ze2urImageFormat: unexpected image format channel"); + URLOG(ERR, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -123,9 +120,9 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGBA; break; default: - logger::error("ze2urImageFormat: unexpected image format channel w: w " - "= {}", - ZeImageFormat.x); + URLOG(ERR, + "ze2urImageFormat: unexpected image format channel w: w = {}", + ZeImageFormat.w); return UR_RESULT_ERROR_INVALID_VALUE; } } else if (ZeImageFormat.x == ZE_IMAGE_FORMAT_SWIZZLE_A && @@ -139,14 +136,13 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormat.w == ZE_IMAGE_FORMAT_SWIZZLE_A) { ChannelOrder = UR_IMAGE_CHANNEL_ORDER_BGRA; } else { - logger::error("ze2urImageFormat: unexpected image format channel"); + URLOG(ERR, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - logger::error( - "ze2urImageFormat: unsupported image format layout: layout = {}", - ZeImageFormat.layout); + URLOG(ERR, "ze2urImageFormat: unsupported image format layout: layout = {}", + ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -164,9 +160,9 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32; break; default: - logger::error("ze2urImageFormat: unexpected image format type size: size " - "= {}", - ZeImageFormatTypeSize); + URLOG(ERR, + "ze2urImageFormat: unexpected image format type size: size = {}", + ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -182,9 +178,9 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SIGNED_INT32; break; default: - logger::error("ze2urImageFormat: unexpected image format type size: size " - "= {}", - ZeImageFormatTypeSize); + URLOG(ERR, + "ze2urImageFormat: unexpected image format type size: size = {}", + ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -197,9 +193,9 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNORM_INT16; break; default: - logger::error("ze2urImageFormat: unexpected image format type size: size " - "= {}", - ZeImageFormatTypeSize); + URLOG(ERR, + "ze2urImageFormat: unexpected image format type size: size = {}", + ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -212,9 +208,9 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SNORM_INT16; break; default: - logger::error("ze2urImageFormat: unexpected image format type size: size " - "= {}", - ZeImageFormatTypeSize); + URLOG(ERR, + "ze2urImageFormat: unexpected image format type size: size = {}", + ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -227,15 +223,15 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_FLOAT; break; default: - logger::error("ze2urImageFormat: unexpected image format type size: size " - "= {}", - ZeImageFormatTypeSize); + URLOG(ERR, + "ze2urImageFormat: unexpected image format type size: size = {}", + ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - logger::error("ze2urImageFormat: unsupported image format type: type = {}", - ZeImageFormat.type); + URLOG(ERR, "ze2urImageFormat: unsupported image format type: type = {}", + ZeImageFormat.type); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -281,13 +277,13 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - logger::error("ur2zeImageDesc: unexpected data type Size\n"); + URLOG(ERR, "ur2zeImageDesc: unexpected data type Size\n"); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; } break; } default: - logger::error("format layout = {}", ImageFormat->channelOrder); + URLOG(ERR, "format layout = {}", ImageFormat->channelOrder); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; break; } @@ -316,7 +312,7 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - logger::error("ur2zeImageDesc: unsupported image type"); + URLOG(ERR, "ur2zeImageDesc: unsupported image type"); return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR; } @@ -513,8 +509,8 @@ getImageFormatTypeAndSize(const ur_image_format_t *ImageFormat) { break; } default: - logger::error("ur2zeImageDesc: unsupported image data type: data type = {}", - ImageFormat->channelType); + URLOG(ERR, "ur2zeImageDesc: unsupported image data type: data type = {}", + ImageFormat->channelType); ZeImageFormatType = ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32; ZeImageFormatTypeSize = 0; } diff --git a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp index 895dbbe7d9ce..af04d492149e 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp @@ -52,15 +52,15 @@ ur_result_t getSuggestedLocalWorkSize(ur_device_handle_t hDevice, --GroupSize[I]; } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - logger::error("getSuggestedLocalWorkSize: can't find a WG size " - "suitable for global work size > UINT32_MAX"); + URLOG(ERR, "getSuggestedLocalWorkSize: can't find a WG size " + "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } WG[I] = GroupSize[I]; } - logger::debug( - "getSuggestedLocalWorkSize: using computed WG size = {{{}, {}, {}}}", - WG[0], WG[1], WG[2]); + URLOG(DEBUG, + "getSuggestedLocalWorkSize: using computed WG size = {{{}, {}, {}}}", + WG[0], WG[1], WG[2]); } return UR_RESULT_SUCCESS; @@ -70,7 +70,7 @@ ur_result_t setKernelGlobalOffset(ur_context_handle_t Context, ze_kernel_handle_t Kernel, uint32_t WorkDim, const size_t *GlobalWorkOffset) { if (!Context->getPlatform()->ZeDriverGlobalOffsetExtensionFound) { - logger::debug("No global offset extension found on this driver"); + URLOG(DEBUG, "No global offset extension found on this driver"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -130,27 +130,27 @@ ur_result_t calculateKernelWorkDimensions( break; default: - logger::error("calculateKernelWorkDimensions: unsupported work_dim"); + URLOG(ERR, "calculateKernelWorkDimensions: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - logger::error("calculateKernelWorkDimensions: invalid work_dim. The range " - "is not a multiple of the group size in the 1st dimension"); + URLOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + "is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - logger::error("calculateKernelWorkDimensions: invalid work_dim. The range " - "is not a multiple of the group size in the 2nd dimension"); + URLOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + "is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[2] != size_t(ZeThreadGroupDimensions.groupCountZ) * WG[2]) { - logger::error("calculateKernelWorkDimensions: invalid work_dim. The range " - "is not a multiple of the group size in the 3rd dimension"); + URLOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + "is not a multiple of the group size in the 3rd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } diff --git a/unified-runtime/source/adapters/level_zero/image.cpp b/unified-runtime/source/adapters/level_zero/image.cpp index 0dffcdcbf60f..6b54ab9af2fe 100644 --- a/unified-runtime/source/adapters/level_zero/image.cpp +++ b/unified-runtime/source/adapters/level_zero/image.cpp @@ -56,7 +56,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32; break; default: - logger::error("ur2zeImageDescBindless: unexpected data type size"); + URLOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -75,7 +75,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32; break; default: - logger::error("ur2zeImageDescBindless: unexpected data type size"); + URLOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -95,7 +95,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - logger::error("ur2zeImageDescBindless: unexpected data type size"); + URLOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -113,13 +113,13 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32; break; default: - logger::error("ur2zeImageDescBindless: unexpected data type size"); + URLOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; } default: - logger::error("format channel order = {}", ImageFormat->channelOrder); + URLOG(ERR, "format channel order = {}", ImageFormat->channelOrder); die("ur2zeImageDescBindless: unsupported image channel order\n"); break; } @@ -148,7 +148,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - logger::error("ur2zeImageDescBindless: unsupported image type"); + URLOG(ERR, "ur2zeImageDescBindless: unsupported image type"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -237,9 +237,10 @@ ur_result_t bindlessImagesCreateImpl(ur_context_handle_t hContext, DriverHandle, "zeImageGetDeviceOffsetExp", (void **)&zeImageGetDeviceOffsetExpFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - logger::error("zeDriverGetExtensionFunctionAddress " - "zeImageGetDeviceOffsetExpv failed, err = {}", - Result); + URLOG(ERR, + "zeDriverGetExtensionFunctionAddress zeImageGetDeviceOffsetExpv " + "failed, err = {}", + Result); }); if (!zeImageGetDeviceOffsetExpFunctionPtr) return UR_RESULT_ERROR_INVALID_OPERATION; @@ -280,10 +281,10 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, DriverHandle, "zeMemGetPitchFor2dImage", (void **)&zeMemGetPitchFor2dImageFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - logger::error( - "zeDriverGetExtensionFunctionAddress zeMemGetPitchFor2dImage " - "failed, err = {}", - Result); + URLOG(ERR, + "zeDriverGetExtensionFunctionAddress zeMemGetPitchFor2dImage " + "failed, err = {}", + Result); }); if (!zeMemGetPitchFor2dImageFunctionPtr) return UR_RESULT_ERROR_INVALID_OPERATION; @@ -551,7 +552,7 @@ ur_result_t urBindlessImagesImageCopyExp( &DstRegion, &SrcRegion, ZeEvent, WaitList.Length, WaitList.ZeEventList)); } else { - logger::error("urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); + URLOG(ERR, "urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -619,8 +620,10 @@ ur_result_t urBindlessImagesMipmapGetLevelExp( std::ignore = hImageMem; std::ignore = mipmapLevel; std::ignore = phImageMem; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!", __FUNCTION__); + logger::get_logger().log( + logger::LegacyMessage("[UR][L0] {} function not implemented!"), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -735,8 +738,8 @@ ur_result_t urBindlessImagesMapExternalLinearMemoryExp( std::ignore = offset; std::ignore = hExternalMem; std::ignore = phRetMem; - logger::error("[UR][L0] {} function not implemented!", - "{} function not implemented!", __FUNCTION__); + URLOG(ERR, "[UR][L0] {} function not implemented!", + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -778,8 +781,9 @@ ur_result_t urBindlessImagesImportExternalSemaphoreExp( auto UrPlatform = hContext->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - logger::error(logger::LegacyMessage("[UR][L0] "), - " {} function not supported!", __FUNCTION__); + logger::get_logger().log(logger::LegacyMessage("[UR][L0] "), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ze_intel_external_semaphore_exp_desc_t SemDesc = { @@ -845,8 +849,9 @@ ur_result_t urBindlessImagesReleaseExternalSemaphoreExp( std::ignore = hDevice; auto UrPlatform = hContext->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - logger::error(logger::LegacyMessage("[UR][L0] "), - " {} function not supported!", __FUNCTION__); + logger::get_logger().log(logger::LegacyMessage("[UR][L0] "), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ZE2UR_CALL( @@ -862,8 +867,9 @@ ur_result_t urBindlessImagesWaitExternalSemaphoreExp( const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { auto UrPlatform = hQueue->Context->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - logger::error(logger::LegacyMessage("[UR][L0] "), - " {} function not supported!", __FUNCTION__); + logger::get_logger().log(logger::LegacyMessage("[UR][L0] "), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -924,8 +930,9 @@ ur_result_t urBindlessImagesSignalExternalSemaphoreExp( std::ignore = phEvent; auto UrPlatform = hQueue->Context->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - logger::error(logger::LegacyMessage("[UR][L0] "), - " {} function not supported!", __FUNCTION__); + logger::get_logger().log(logger::LegacyMessage("[UR][L0] "), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/kernel.cpp b/unified-runtime/source/adapters/level_zero/kernel.cpp index d9dd4cc38ad0..4ec49469520c 100644 --- a/unified-runtime/source/adapters/level_zero/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/kernel.cpp @@ -189,9 +189,8 @@ ur_result_t urEnqueueKernelLaunch( (*Event)->WaitList.Length, (*Event)->WaitList.ZeEventList)); } - logger::debug("calling zeCommandListAppendLaunchKernel() with" - " ZeEvent {}", - ur_cast(ZeEvent)); + URLOG(DEBUG, "calling zeCommandListAppendLaunchKernel() with ZeEvent {}", + ur_cast(ZeEvent)); printZeEventList((*Event)->WaitList); // Execute command list asynchronously, as the event will be used @@ -317,16 +316,17 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - logger::error( - "urEnqueueCooperativeKernelLaunchExp: can't find a WG size " - "suitable for global work size > UINT32_MAX"); + URLOG(ERR, + "urEnqueueCooperativeKernelLaunchExp: can't find a WG size " + "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } WG[I] = GroupSize[I]; } - logger::debug("urEnqueueCooperativeKernelLaunchExp: using computed WG " - "size = {{{}, {}, {}}}", - WG[0], WG[1], WG[2]); + URLOG(DEBUG, + "urEnqueueCooperativeKernelLaunchExp: using computed WG " + "size = {{{}, {}, {}}}", + WG[0], WG[1], WG[2]); } } @@ -355,30 +355,30 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( break; default: - logger::error("urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); + URLOG(ERR, "urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - logger::error("urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " - "range is not a " - "multiple of the group size in the 1st dimension"); + URLOG(ERR, + "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " + "range is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - logger::error("urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " - "range is not a " - "multiple of the group size in the 2nd dimension"); + URLOG(ERR, + "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " + "range is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[2] != size_t(ZeThreadGroupDimensions.groupCountZ) * WG[2]) { - logger::debug("urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " - "range is not a " - "multiple of the group size in the 3rd dimension"); + URLOG(DEBUG, + "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " + "range is not a multiple of the group size in the 3rd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } @@ -449,9 +449,9 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( (*Event)->WaitList.Length, (*Event)->WaitList.ZeEventList)); } - logger::debug("calling zeCommandListAppendLaunchCooperativeKernel() with" - " ZeEvent {}", - ur_cast(ZeEvent)); + URLOG(DEBUG, + "calling zeCommandListAppendLaunchCooperativeKernel() with ZeEvent {}", + ur_cast(ZeEvent)); printZeEventList((*Event)->WaitList); // Execute command list asynchronously, as the event will be used @@ -790,9 +790,8 @@ ur_result_t urKernelGetInfo( return UR_RESULT_ERROR_UNKNOWN; } default: - logger::error( - "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", - ParamName, logger::toHex(ParamName)); + URLOG(ERR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", + ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -879,9 +878,8 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - logger::error( - "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", - ParamName, logger::toHex(ParamName)); + URLOG(ERR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", + ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1022,7 +1020,7 @@ ur_result_t urKernelSetExecInfo( return UR_RESULT_ERROR_INVALID_VALUE; ZE2UR_CALL(zeKernelSetCacheConfig, (ZeKernel, ZeCacheConfig);); } else { - logger::error("urKernelSetExecInfo: unsupported ParamName"); + URLOG(ERR, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1175,8 +1173,10 @@ ur_result_t urKernelSetSpecializationConstants( std::ignore = Kernel; std::ignore = Count; std::ignore = SpecConstants; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!", __FUNCTION__); + logger::get_logger().log( + logger::LegacyMessage("[UR][L0] {} function not implemented!"), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/memory.cpp b/unified-runtime/source/adapters/level_zero/memory.cpp index eab949cdf988..293511840496 100644 --- a/unified-runtime/source/adapters/level_zero/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/memory.cpp @@ -117,9 +117,8 @@ ur_result_t enqueueMemCopyHelper(ur_command_t CommandType, const auto &ZeCommandList = CommandList->first; const auto &WaitList = (*Event)->WaitList; - logger::debug("calling zeCommandListAppendMemoryCopy() with" - " ZeEvent {}", - ur_cast(ZeEvent)); + URLOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + ur_cast(ZeEvent)); printZeEventList(WaitList); ZE2UR_CALL(zeCommandListAppendMemoryCopy, @@ -170,9 +169,8 @@ ur_result_t enqueueMemCopyRectHelper( const auto &ZeCommandList = CommandList->first; const auto &WaitList = (*Event)->WaitList; - logger::debug("calling zeCommandListAppendMemoryCopy() with" - " ZeEvent {}", - ur_cast(ZeEvent)); + URLOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + ur_cast(ZeEvent)); printZeEventList(WaitList); auto ZeParams = ur2zeRegionParams(SrcOrigin, DstOrigin, Region, SrcRowPitch, @@ -184,7 +182,7 @@ ur_result_t enqueueMemCopyRectHelper( ZeParams.srcPitch, ZeParams.srcSlicePitch, ZeEvent, WaitList.Length, WaitList.ZeEventList)); - logger::debug("calling zeCommandListAppendMemoryCopyRegion()"); + URLOG(DEBUG, "calling zeCommandListAppendMemoryCopyRegion()"); UR_CALL(Queue->executeCommandList(CommandList, Blocking, OkToBatch)); @@ -259,9 +257,8 @@ static ur_result_t enqueueMemFillHelper(ur_command_t CommandType, (ZeCommandList, Ptr, Pattern, PatternSize, Size, ZeEvent, WaitList.Length, WaitList.ZeEventList)); - logger::debug("calling zeCommandListAppendMemoryFill() with" - " ZeEvent {}", - ur_cast(ZeEvent)); + URLOG(DEBUG, "calling zeCommandListAppendMemoryFill() with ZeEvent {}", + ur_cast(ZeEvent)); printZeEventList(WaitList); // Execute command list asynchronously, as the event will be used @@ -281,9 +278,8 @@ static ur_result_t enqueueMemFillHelper(ur_command_t CommandType, WaitList.Length, WaitList.ZeEventList)); } - logger::debug("calling zeCommandListAppendMemoryCopy() with" - " ZeEvent {}", - ur_cast(ZeEvent)); + URLOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + ur_cast(ZeEvent)); printZeEventList(WaitList); // Execute command list synchronously. @@ -466,7 +462,7 @@ static ur_result_t enqueueMemImageCommandHelper( ur_cast(ZeHandleSrc), &ZeDstRegion, &ZeSrcRegion, ZeEvent, 0, nullptr)); } else { - logger::error("enqueueMemImageUpdate: unsupported image command type"); + URLOG(ERR, "enqueueMemImageUpdate: unsupported image command type"); return UR_RESULT_ERROR_INVALID_OPERATION; } @@ -1043,7 +1039,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - logger::error("urEnqueueMemBufferMap: duplicate mapping detected"); + URLOG(ERR, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -1104,7 +1100,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - logger::error("urEnqueueMemBufferMap: duplicate mapping detected"); + URLOG(ERR, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -1158,7 +1154,7 @@ ur_result_t urEnqueueMemUnmap( std::scoped_lock Guard(Buffer->Mutex); auto It = Buffer->Mappings.find(MappedPtr); if (It == Buffer->Mappings.end()) { - logger::error("urEnqueueMemUnmap: unknown memory mapping"); + URLOG(ERR, "urEnqueueMemUnmap: unknown memory mapping"); return UR_RESULT_ERROR_INVALID_VALUE; } MapInfo = It->second; @@ -1441,8 +1437,10 @@ ur_result_t urEnqueueUSMFill2D( std::ignore = NumEventsInWaitList; std::ignore = EventWaitList; std::ignore = OutEvent; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!", __FUNCTION__); + logger::get_logger().log( + logger::LegacyMessage("[UR][L0] {} function not implemented!"), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1889,8 +1887,10 @@ ur_result_t urMemImageGetInfo( std::ignore = PropSize; std::ignore = ImgInfo; std::ignore = PropSizeRet; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!", __FUNCTION__); + logger::get_logger().log( + logger::LegacyMessage("[UR][L0] {} function not implemented!"), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1943,8 +1943,10 @@ ur_result_t urEnqueueReadHostPipe(ur_queue_handle_t hQueue, std::ignore = numEventsInWaitList; std::ignore = phEventWaitList; std::ignore = phEvent; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!", __FUNCTION__); + logger::get_logger().log( + logger::LegacyMessage("[UR][L0] {} function not implemented!"), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1964,8 +1966,10 @@ ur_result_t urEnqueueWriteHostPipe(ur_queue_handle_t hQueue, std::ignore = numEventsInWaitList; std::ignore = phEventWaitList; std::ignore = phEvent; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!", __FUNCTION__); + logger::get_logger().log( + logger::LegacyMessage("[UR][L0] {} function not implemented!"), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -2229,8 +2233,8 @@ ur_result_t _ur_buffer::getBufferZeHandle(char *&ZeHandle, } } - logger::debug("getZeHandle(pi_device{{{}}}) = {}", (void *)Device, - (void *)Allocation.ZeHandle); + URLOG(DEBUG, "getZeHandle(pi_device{{{}}}) = {}", (void *)Device, + (void *)Allocation.ZeHandle); return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/adapters/level_zero/platform.cpp b/unified-runtime/source/adapters/level_zero/platform.cpp index 7694044de51d..8c0147e863a4 100644 --- a/unified-runtime/source/adapters/level_zero/platform.cpp +++ b/unified-runtime/source/adapters/level_zero/platform.cpp @@ -102,7 +102,7 @@ ur_result_t urPlatformGetInfo( case UR_PLATFORM_INFO_ADAPTER: return ReturnValue(GlobalAdapter); default: - logger::debug("urPlatformGetInfo: unrecognized ParamName"); + URLOG(DEBUG, "urPlatformGetInfo: unrecognized ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/program.cpp b/unified-runtime/source/adapters/level_zero/program.cpp index af5c7fb00545..73b15c1ebb16 100644 --- a/unified-runtime/source/adapters/level_zero/program.cpp +++ b/unified-runtime/source/adapters/level_zero/program.cpp @@ -440,9 +440,9 @@ ur_result_t urProgramLinkExp( ZeModuleDesc.pInputModule = ZeExtModuleDesc.pInputModules[0]; ZeModuleDesc.pConstants = ZeExtModuleDesc.pConstants[0]; } else { - logger::error( - "urProgramLink: level_zero driver does not have static linking " - "support."); + URLOG(ERR, + "urProgramLink: level_zero driver does not have static linking " + "support."); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -894,7 +894,7 @@ ur_result_t urProgramGetBuildInfo( // program. return ReturnValue(""); } else { - logger::error("urProgramGetBuildInfo: unsupported ParamName"); + URLOG(ERR, "urProgramGetBuildInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -913,8 +913,10 @@ ur_result_t urProgramSetSpecializationConstant( std::ignore = SpecId; std::ignore = SpecSize; std::ignore = SpecValue; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!"); + logger::get_logger().log( + logger::LegacyMessage("[UR][L0] {} function not implemented!"), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + "{} function not implemented!"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/queue.cpp b/unified-runtime/source/adapters/level_zero/queue.cpp index d4cea7faa9d6..795b80da02bb 100644 --- a/unified-runtime/source/adapters/level_zero/queue.cpp +++ b/unified-runtime/source/adapters/level_zero/queue.cpp @@ -455,7 +455,8 @@ ur_result_t urQueueGetInfo( return ReturnValue(true); } default: - logger::error( + URLOG( + ERR, "Unsupported ParamName in urQueueGetInfo: ParamName=ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_ENUMERATION; @@ -930,8 +931,8 @@ ur_result_t urEnqueueKernelLaunchCustomExp( std::ignore = phEventWaitList; std::ignore = phEvent; - logger::error("[UR][L0] {} function not implemented!", - "{} function not implemented!", __FUNCTION__); + URLOG(ERR, "[UR][L0] {} function not implemented!", + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1011,9 +1012,9 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { Val = std::stoi(BatchConfig.substr(Pos)); } catch (...) { if (IsCopy) - logger::error("UR_L0_COPY_BATCH_SIZE: failed to parse value"); + URLOG(ERR, "UR_L0_COPY_BATCH_SIZE: failed to parse value") else - logger::error("UR_L0_BATCH_SIZE: failed to parse value"); + URLOG(ERR, "UR_L0_BATCH_SIZE: failed to parse value") break; } switch (Ord) { @@ -1036,20 +1037,19 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { die("Unexpected batch config"); } if (IsCopy) - logger::error("UR_L0_COPY_BATCH_SIZE: dynamic batch param " - "#{}: {}", - (int)Ord, (int)Val); + URLOG(ERR, "UR_L0_COPY_BATCH_SIZE: dynamic batch param #{}: {}", + (int)Ord, (int)Val) else - logger::error("UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", - (int)Ord, (int)Val); + URLOG(ERR, "UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, + (int)Val) }; } else { // Negative batch sizes are silently ignored. if (IsCopy) - logger::warning("UR_L0_COPY_BATCH_SIZE: ignored negative value"); + URLOG(WARN, "UR_L0_COPY_BATCH_SIZE: ignored negative value") else - logger::warning("UR_L0_BATCH_SIZE: ignored negative value"); + URLOG(WARN, "UR_L0_BATCH_SIZE: ignored negative value") } } return Config; @@ -1225,7 +1225,7 @@ void ur_queue_handle_t_::adjustBatchSizeForFullBatch(bool IsCopy) { ZeCommandListBatchConfig.NumTimesClosedFullThreshold) { if (QueueBatchSize < ZeCommandListBatchConfig.DynamicSizeMax) { QueueBatchSize += ZeCommandListBatchConfig.DynamicSizeStep; - logger::debug("Raising QueueBatchSize to {}", QueueBatchSize); + URLOG(DEBUG, "Raising QueueBatchSize to {}", QueueBatchSize); } CommandBatch.NumTimesClosedEarly = 0; CommandBatch.NumTimesClosedFull = 0; @@ -1252,7 +1252,7 @@ void ur_queue_handle_t_::adjustBatchSizeForPartialBatch(bool IsCopy) { QueueBatchSize = CommandBatch.OpenCommandList->second.size() - 1; if (QueueBatchSize < 1) QueueBatchSize = 1; - logger::debug("Lowering QueueBatchSize to {}", QueueBatchSize); + URLOG(DEBUG, "Lowering QueueBatchSize to {}", QueueBatchSize); CommandBatch.NumTimesClosedEarly = 0; CommandBatch.NumTimesClosedFull = 0; } @@ -1617,14 +1617,15 @@ ur_result_t urQueueReleaseInternal(ur_queue_handle_t Queue) { Queue->clearEndTimeRecordings(); - logger::debug("urQueueRelease(compute) NumTimesClosedFull {}, " - "NumTimesClosedEarly {}", - Queue->ComputeCommandBatch.NumTimesClosedFull, - Queue->ComputeCommandBatch.NumTimesClosedEarly); - logger::debug( - "urQueueRelease(copy) NumTimesClosedFull {}, NumTimesClosedEarly {}", - Queue->CopyCommandBatch.NumTimesClosedFull, - Queue->CopyCommandBatch.NumTimesClosedEarly); + URLOG(DEBUG, + "urQueueRelease(compute) NumTimesClosedFull {}, " + "NumTimesClosedEarly {}", + Queue->ComputeCommandBatch.NumTimesClosedFull, + Queue->ComputeCommandBatch.NumTimesClosedEarly); + URLOG(DEBUG, + "urQueueRelease(copy) NumTimesClosedFull {}, NumTimesClosedEarly {}", + Queue->CopyCommandBatch.NumTimesClosedFull, + Queue->CopyCommandBatch.NumTimesClosedEarly); delete Queue; @@ -2241,10 +2242,11 @@ ur_queue_handle_t_::ur_queue_group_t::getZeQueue(uint32_t *QueueGroupOrdinal) { ZeCommandQueueDesc.flags = ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY; } - logger::debug("[getZeQueue]: create queue ordinal = {}, index = {} " - "(round robin in [{}, {}]) priority = {}", - ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, - LowerIndex, UpperIndex, Priority); + URLOG(DEBUG, + "[getZeQueue]: create queue ordinal = {}, index = {} " + "(round robin in [{}, {}]) priority = {}", + ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, LowerIndex, + UpperIndex, Priority); auto ZeResult = ZE_CALL_NOCHECK( zeCommandQueueCreate, (Queue->Context->ZeContext, Queue->Device->ZeDevice, @@ -2302,7 +2304,8 @@ ur_result_t ur_queue_handle_t_::createCommandList( IsInOrderList = true; } - logger::debug( + URLOG( + DEBUG, "create command list ordinal: {}, type: regular, device: {}, inOrder: {}", QueueGroupOrdinal, Device->ZeDevice, IsInOrderList); @@ -2468,14 +2471,15 @@ ur_command_list_ptr_t &ur_queue_handle_t_::ur_queue_group_t::getImmCmdList() { // If cache didn't contain a command list, create one. if (!ZeCommandList) { - logger::debug("[getZeQueue]: create queue ordinal = {}, index = {} " - "(round robin in [{}, {}]) priority = {}", - ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, - LowerIndex, UpperIndex, Priority); - logger::debug("create command list ordinal: {}, type: immediate, device: " - "{}, inOrder: {}", - ZeCommandQueueDesc.ordinal, Queue->Device->ZeDevice, - isInOrderList); + URLOG(DEBUG, + "[getZeQueue]: create queue ordinal = {}, index = {} " + "(round robin in [{}, {}]) priority = {}", + ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, LowerIndex, + UpperIndex, Priority); + URLOG(DEBUG, + "create command list ordinal: {}, type: immediate, device: " + "{}, inOrder: {}", + ZeCommandQueueDesc.ordinal, Queue->Device->ZeDevice, isInOrderList); ZE_CALL_NOCHECK(zeCommandListCreateImmediate, (Queue->Context->ZeContext, Queue->Device->ZeDevice, diff --git a/unified-runtime/source/adapters/level_zero/sampler.cpp b/unified-runtime/source/adapters/level_zero/sampler.cpp index f239dfed5ce4..2c2e72179b41 100644 --- a/unified-runtime/source/adapters/level_zero/sampler.cpp +++ b/unified-runtime/source/adapters/level_zero/sampler.cpp @@ -83,9 +83,8 @@ ur_result_t urSamplerCreate( ZeSamplerDesc.addressMode = ZE_SAMPLER_ADDRESS_MODE_MIRROR; break; default: - logger::error("urSamplerCreate: unsupported " - "UR_SAMPLER_PROPERTIES_ADDRESSING_MODEE " - "value"); + URLOG(ERR, "urSamplerCreate: unsupported " + "UR_SAMPLER_PROPERTIES_ADDRESSING_MODEE value"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -94,8 +93,7 @@ ur_result_t urSamplerCreate( else if (Props->filterMode == UR_SAMPLER_FILTER_MODE_LINEAR) ZeSamplerDesc.filterMode = ZE_SAMPLER_FILTER_MODE_LINEAR; else { - logger::error( - "urSamplerCreate: unsupported UR_SAMPLER_FILTER_MODE value"); + URLOG(ERR, "urSamplerCreate: unsupported UR_SAMPLER_FILTER_MODE value"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -154,8 +152,10 @@ ur_result_t urSamplerGetInfo( std::ignore = PropValueSize; std::ignore = PropValue; std::ignore = PropSizeRet; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!", __FUNCTION__); + logger::get_logger().log( + logger::LegacyMessage("[UR][L0] {} function not implemented!"), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -166,8 +166,10 @@ ur_result_t urSamplerGetNativeHandle( ur_native_handle_t *NativeSampler) { std::ignore = Sampler; std::ignore = NativeSampler; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!", __FUNCTION__); + logger::get_logger().log( + logger::LegacyMessage("[UR][L0] {} function not implemented!"), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -184,8 +186,10 @@ ur_result_t urSamplerCreateWithNativeHandle( std::ignore = Context; std::ignore = Properties; std::ignore = Sampler; - logger::error(logger::LegacyMessage("[UR][L0] {} function not implemented!"), - "{} function not implemented!", __FUNCTION__); + logger::get_logger().log( + logger::LegacyMessage("[UR][L0] {} function not implemented!"), + logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), + "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } } // namespace ur::level_zero diff --git a/unified-runtime/source/adapters/level_zero/usm.cpp b/unified-runtime/source/adapters/level_zero/usm.cpp index 64130939d6c9..66c70c0da428 100644 --- a/unified-runtime/source/adapters/level_zero/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/usm.cpp @@ -450,7 +450,7 @@ ur_result_t urUSMGetMemAllocInfo( MemAllocaType = UR_USM_TYPE_SHARED; break; default: - logger::error("urUSMGetMemAllocInfo: unexpected usm memory type"); + URLOG(ERR, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(MemAllocaType); @@ -490,7 +490,7 @@ ur_result_t urUSMGetMemAllocInfo( return UR_RESULT_ERROR_INVALID_VALUE; } default: - logger::error("urUSMGetMemAllocInfo: unsupported ParamName"); + URLOG(ERR, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -857,7 +857,7 @@ umf_result_t L0MemoryProvider::open_ipc_handle(void *IpcData, void **Ptr) { memcpy(&fdRemote, &zeIpcData->zeHandle, sizeof(fdRemote)); fdLocal = ur_duplicate_fd(zeIpcData->pid, fdRemote); if (fdLocal == -1) { - logger::error("duplicating file descriptor from IPC handle failed"); + URLOG(ERR, "duplicating file descriptor from IPC handle failed"); return UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC; } @@ -965,12 +965,12 @@ MakeProvider(ProviderParams *Params = nullptr) { } break; default: - logger::error("urUSMPoolCreate: invalid USM type found"); + URLOG(ERR, "urUSMPoolCreate: invalid USM type found"); Ret = UMF_RESULT_ERROR_INVALID_ARGUMENT; } if (Ret != UMF_RESULT_SUCCESS) { - logger::error("urUSMPoolCreate: failed to create UMF provider"); + URLOG(ERR, "urUSMPoolCreate: failed to create UMF provider"); throw UsmAllocationException(umf::umf2urResult(Ret)); } @@ -1011,13 +1011,13 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - logger::error("urUSMPoolCreate: failed to store USM pool tag"); + URLOG(ERR, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - logger::error("urUSMPoolCreate: failed to store UMF pool"); + URLOG(ERR, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1071,12 +1071,12 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - logger::error("urUSMPoolCreate: failed to store USM pool tag"); + URLOG(ERR, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - logger::error("urUSMPoolCreate: failed to store UMF pool"); + URLOG(ERR, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1193,9 +1193,9 @@ ur_result_t ur_usm_pool_handle_t_::allocate(ur_context_handle_t Context, } if (*RetMem == nullptr) { auto umfRet = umfPoolGetLastAllocationError(umfPool); - logger::error( - "enqueueUSMAllocHelper: allocation from the UMF pool {} failed", - umfPool); + URLOG(ERR, + "enqueueUSMAllocHelper: allocation from the UMF pool {} failed", + umfPool); return umf::umf2urResult(umfRet); } } diff --git a/unified-runtime/source/adapters/level_zero/v2/api.cpp b/unified-runtime/source/adapters/level_zero/v2/api.cpp index 8fe4e245d0b7..b77865c19f87 100644 --- a/unified-runtime/source/adapters/level_zero/v2/api.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/api.cpp @@ -23,21 +23,21 @@ ur_result_t urContextSetExtendedDeleter(ur_context_handle_t hContext, ur_context_extended_deleter_t pfnDeleter, void *pUserData) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urKernelSetSpecializationConstants( ur_kernel_handle_t hKernel, uint32_t count, const ur_specialization_constant_info_t *pSpecConstants) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urEventSetCallback(ur_event_handle_t hEvent, ur_execution_info_t execStatus, ur_event_callback_t pfnNotify, void *pUserData) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -47,21 +47,21 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, ur_usm_pool_handle_t pool, size_t widthInBytes, size_t height, size_t elementSizeBytes, void **ppMem, size_t *pResultPitch) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -69,7 +69,7 @@ ur_result_t urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_mem_native_handle_t *phImageMem) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -77,7 +77,7 @@ ur_result_t urBindlessImagesImageFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -86,7 +86,7 @@ ur_result_t urBindlessImagesUnsampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_native_handle_t *phImage) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -95,14 +95,14 @@ ur_result_t urBindlessImagesSampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_sampler_handle_t hSampler, ur_exp_image_native_handle_t *phImage) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesImageGetInfoExp( ur_context_handle_t hContext, ur_exp_image_mem_native_handle_t hImageMem, ur_image_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -110,7 +110,7 @@ ur_result_t urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem, uint32_t mipmapLevel, ur_exp_image_mem_native_handle_t *phImageMem) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -118,7 +118,7 @@ ur_result_t urBindlessImagesMipmapFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hMem) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -127,7 +127,7 @@ ur_result_t urBindlessImagesImportExternalMemoryExp( ur_exp_external_mem_type_t memHandleType, ur_exp_external_mem_desc_t *pExternalMemDesc, ur_exp_external_mem_handle_t *phExternalMem) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -136,21 +136,21 @@ ur_result_t urBindlessImagesMapExternalArrayExp( const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_external_mem_handle_t hExternalMem, ur_exp_image_mem_native_handle_t *phImageMem) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesMapExternalLinearMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, uint64_t offset, uint64_t size, ur_exp_external_mem_handle_t hExternalMem, void **ppRetMem) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_mem_handle_t hExternalMem) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -159,14 +159,14 @@ ur_result_t urBindlessImagesImportExternalSemaphoreExp( ur_exp_external_semaphore_type_t semHandleType, ur_exp_external_semaphore_desc_t *pExternalSemaphoreDesc, ur_exp_external_semaphore_handle_t *phExternalSemaphore) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalSemaphoreExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_semaphore_handle_t hExternalSemaphore) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -174,21 +174,21 @@ ur_result_t urCommandBufferUpdateKernelLaunchExp( ur_exp_command_buffer_handle_t hCommandBuffer, uint32_t numKernelUpdates, const ur_exp_command_buffer_update_kernel_launch_desc_t *pUpdateKernelLaunch) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateSignalEventExp( ur_exp_command_buffer_command_handle_t hCommand, ur_event_handle_t *phEvent) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateWaitEventsExp( ur_exp_command_buffer_command_handle_t hCommand, uint32_t NumEventsInWaitList, const ur_event_handle_t *phEventWaitList) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -196,14 +196,14 @@ ur_result_t UR_APICALL urUSMPoolCreateExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_desc_t *PoolDesc, ur_usm_pool_handle_t *pPool) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -211,14 +211,14 @@ ur_result_t UR_APICALL urUSMPoolSetThresholdExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool, size_t newThreshold) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -226,21 +226,21 @@ ur_result_t UR_APICALL urUSMPoolGetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -248,7 +248,7 @@ ur_result_t UR_APICALL urUSMPoolTrimToExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool, size_t minBytesToKeep) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp index bd1831340c05..a8673537f854 100644 --- a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp @@ -20,9 +20,8 @@ namespace { // given context. void checkImmediateAppendSupport(ur_context_handle_t context) { if (!context->getPlatform()->ZeCommandListImmediateAppendExt.Supported) { - logger::error("Adapter v2 is used but " - "the current driver does not support the " - "zeCommandListImmediateAppendCommandListsExp entrypoint."); + URLOG(ERR, "Adapter v2 is used but the current driver does not support " + "the zeCommandListImmediateAppendCommandListsExp entrypoint."); throw UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } } diff --git a/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp b/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp index 9fddf6c00bd3..c86dccee2576 100644 --- a/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp @@ -58,8 +58,8 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { std::visit([](auto &&arg) { return arg.CopyOffloadEnabled; }, desc); if (!ZeCopyOffloadExtensionSupported && requestedCopyOffload) { - logger::info( - "Copy offload is requested but is not supported by the driver."); + URLOG(INFO, + "Copy offload is requested but is not supported by the driver."); offloadDesc.copyOffloadEnabled = false; } else { offloadDesc.copyOffloadEnabled = requestedCopyOffload; @@ -80,10 +80,10 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { } QueueDesc.pNext = &offloadDesc; - logger::debug("create command list ordinal: {}, type: immediate, device: " - "{}, inOrder: {}", - ImmCmdDesc->Ordinal, ImmCmdDesc->ZeDevice, - ImmCmdDesc->IsInOrder); + URLOG(DEBUG, + "create command list ordinal: {}, type: immediate, " + "device: {}, inOrder: {}", + ImmCmdDesc->Ordinal, ImmCmdDesc->ZeDevice, ImmCmdDesc->IsInOrder); ZE2UR_CALL_THROWS( zeCommandListCreateImmediate, @@ -97,10 +97,10 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { CmdListDesc.commandQueueGroupOrdinal = RegCmdDesc.Ordinal; CmdListDesc.pNext = &offloadDesc; - logger::debug("create command list ordinal: {}, type: immediate, device: " - "{}, inOrder: {}", - RegCmdDesc.Ordinal, RegCmdDesc.ZeDevice, - RegCmdDesc.IsInOrder); + URLOG(DEBUG, + "create command list ordinal: {}, type: immediate, " + "device: {}, inOrder: {}", + RegCmdDesc.Ordinal, RegCmdDesc.ZeDevice, RegCmdDesc.IsInOrder); ze_command_list_handle_t ZeCommandList; ZE2UR_CALL_THROWS(zeCommandListCreate, (ZeContext, RegCmdDesc.ZeDevice, diff --git a/unified-runtime/source/adapters/level_zero/v2/event.cpp b/unified-runtime/source/adapters/level_zero/v2/event.cpp index 68c0d439dce7..dc72edc013e2 100644 --- a/unified-runtime/source/adapters/level_zero/v2/event.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/event.cpp @@ -271,9 +271,8 @@ ur_result_t urEventGetInfo(ur_event_handle_t hEvent, ur_event_info_t propName, return returnValue(hEvent->getCommandType()); } default: - logger::error( - "Unsupported ParamName in urEventGetInfo: ParamName=ParamName={}(0x{})", - propName, logger::toHex(propName)); + URLOG(ERR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + propName, logger::toHex(propName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -318,7 +317,7 @@ ur_result_t urEventGetProfilingInfo( return returnValue(hEvent->getEventEndTimestamp()); } default: - logger::error("urEventGetProfilingInfo: not supported ParamName"); + URLOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -368,7 +367,7 @@ ur_result_t urEventGetProfilingInfo( // return returnValue(uint64_t{0}); default: - logger::error("urEventGetProfilingInfo: not supported ParamName"); + URLOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp b/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp index 3f7116adf334..842584b1c5c4 100644 --- a/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp @@ -50,7 +50,7 @@ provider_pool::provider_pool(ur_context_handle_t context, queue_type queue, devices.push_back(d->ZeDevice); } - logger::debug("ze_event_pool_desc_t flags set to: {}", desc.flags); + URLOG(DEBUG, "ze_event_pool_desc_t flags set to: {}", desc.flags); ZE2UR_CALL_THROWS(zeEventPoolCreate, (context->getZeHandle(), &desc, devices.size(), diff --git a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp index 5f8bad0acdbc..9f8001c7f59b 100644 --- a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp @@ -264,7 +264,7 @@ ur_result_t ur_kernel_handle_t_::setExecInfo(ur_kernel_exec_info_t propName, ZE2UR_CALL(zeKernelSetCacheConfig, (kernel->hKernel.get(), zeCacheConfig);); } else { - logger::error("urKernelSetExecInfo: unsupported ParamName"); + URLOG(ERR, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -561,9 +561,8 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - logger::error( - "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", - paramName, logger::toHex(paramName)); + URLOG(ERR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", + paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -646,9 +645,8 @@ ur_result_t urKernelGetInfo(ur_kernel_handle_t hKernel, return ReturnValue(static_cast(attributes.data())); } default: - logger::error( - "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", - paramName, logger::toHex(paramName)); + URLOG(ERR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", + paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/memory.cpp b/unified-runtime/source/adapters/level_zero/v2/memory.cpp index 2844cc3ec07c..172d2f3191f1 100644 --- a/unified-runtime/source/adapters/level_zero/v2/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/memory.cpp @@ -95,7 +95,7 @@ ur_integrated_buffer_handle_t::ur_integrated_buffer_handle_t( this->ptr = usm_unique_ptr_t(rawPtr, [hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - logger::error("Failed to free host memory: {}", ret); + URLOG(ERR, "Failed to free host memory: {}", ret); } }); @@ -185,7 +185,7 @@ void *ur_discrete_buffer_handle_t::allocateOnDevice(ur_device_handle_t hDevice, usm_unique_ptr_t(ptr, [hContext = this->hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - logger::error("Failed to free device memory: {}", ret); + URLOG(ERR, "Failed to free device memory: {}", ret); } }); @@ -315,7 +315,7 @@ void *ur_discrete_buffer_handle_t::mapHostPtr( if (ownsAlloc) { auto ret = hContext->getDefaultUSMPool()->free(p); if (ret != UR_RESULT_SUCCESS) { - logger::error("Failed to mapped memory: {}", ret); + URLOG(ERR, "Failed to mapped memory: {}", ret); } } }); @@ -717,7 +717,7 @@ ur_result_t urMemImageCreateWithNativeHandle( ur_result_t urMemImageGetInfo(ur_mem_handle_t hMemory, ur_image_info_t propName, size_t propSize, void *pPropValue, size_t *pPropSizeRet) { - logger::error("{} function not implemented!", __FUNCTION__); + URLOG(ERR, "{} function not implemented!", __FUNCTION__); std::ignore = hMemory; std::ignore = propName; diff --git a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp index 3209ec9b7d12..1a6a060fe414 100644 --- a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp @@ -129,9 +129,10 @@ ur_queue_immediate_in_order_t::queueGetInfo(ur_queue_info_t propName, } } default: - logger::error("Unsupported ParamName in urQueueGetInfo: " - "ParamName=ParamName={}(0x{})", - propName, logger::toHex(propName)); + URLOG(ERR, + "Unsupported ParamName in urQueueGetInfo: " + "ParamName=ParamName={}(0x{})", + propName, logger::toHex(propName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -190,7 +191,7 @@ ur_queue_immediate_in_order_t::~ur_queue_immediate_in_order_t() { try { UR_CALL_THROWS(queueFinish()); } catch (...) { - logger::error("Failed to finish queue on destruction"); + URLOG(ERR, "Failed to finish queue on destruction"); } } diff --git a/unified-runtime/source/adapters/level_zero/v2/usm.cpp b/unified-runtime/source/adapters/level_zero/v2/usm.cpp index d7fce748e4c9..4a7ddc7aa7af 100644 --- a/unified-runtime/source/adapters/level_zero/v2/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/usm.cpp @@ -163,7 +163,7 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t hContext, } } else { // If pooling is disabled, do nothing. - logger::info("USM pooling is disabled. Skiping pool limits adjustment."); + URLOG(INFO, "USM pooling is disabled. Skiping pool limits adjustment."); } auto devicesAndSubDevices = @@ -236,7 +236,7 @@ ur_result_t ur_usm_pool_handle_t_::free(void *ptr) { if (umfPool) { return umf::umf2urResult(umfPoolFree(umfPool, ptr)); } else { - logger::error("Failed to find pool for pointer: {}", ptr); + URLOG(ERR, "Failed to find pool for pointer: {}", ptr); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -440,7 +440,7 @@ ur_result_t urUSMGetMemAllocInfo( memAllocType = UR_USM_TYPE_SHARED; break; default: - logger::error("urUSMGetMemAllocInfo: unexpected usm memory type"); + URLOG(ERR, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(memAllocType); @@ -469,7 +469,7 @@ ur_result_t urUSMGetMemAllocInfo( // TODO return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; default: - logger::error("urUSMGetMemAllocInfo: unsupported ParamName"); + URLOG(ERR, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp index 092edc8ed1f9..e04b09d580b0 100644 --- a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp +++ b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp @@ -38,8 +38,8 @@ ur_result_t urVirtualMemGranularityGetInfo( return ReturnValue(PageSize); } default: - logger::error("Unsupported propName in urQueueGetInfo: propName={}({})", - propName, propName); + URLOG(ERR, "Unsupported propName in urQueueGetInfo: propName={}({})", + propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -120,8 +120,8 @@ ur_result_t urVirtualMemGetInfo(ur_context_handle_t hContext, return ReturnValue(RetFlags); } default: - logger::error("Unsupported propName in urQueueGetInfo: propName={}({})", - propName, propName); + URLOG(ERR, "Unsupported propName in urQueueGetInfo: propName={}({})", + propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/native_cpu/common.cpp b/unified-runtime/source/adapters/native_cpu/common.cpp index ab7c7a07ea42..fb67851a22c9 100644 --- a/unified-runtime/source/adapters/native_cpu/common.cpp +++ b/unified-runtime/source/adapters/native_cpu/common.cpp @@ -31,6 +31,6 @@ ur_result_t urGetLastResult(ur_platform_handle_t, const char **ppMessage) { } void detail::ur::die(const char *pMessage) { - logger::always("ur_die: {}", pMessage); + URLOG_ALWAYS("ur_die: {}", pMessage); std::terminate(); } diff --git a/unified-runtime/source/adapters/native_cpu/common.hpp b/unified-runtime/source/adapters/native_cpu/common.hpp index 14273b7dce6c..36c5e67694cb 100644 --- a/unified-runtime/source/adapters/native_cpu/common.hpp +++ b/unified-runtime/source/adapters/native_cpu/common.hpp @@ -21,23 +21,23 @@ extern thread_local char ErrorMessage[MaxMessageSize]; #define DIE_NO_IMPLEMENTATION \ do { \ - logger::error("Not Implemented : {} - File : {} / Line : {}", \ - __FUNCTION__, __FILE__, __LINE__); \ + URLOG(ERR, "Not Implemented : {} - File : {} / Line : {}", __FUNCTION__, \ + __FILE__, __LINE__); \ \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; \ } while (false) #define CONTINUE_NO_IMPLEMENTATION \ do { \ - logger::warning("Not Implemented : {} - File : {} / Line : {}", \ - __FUNCTION__, __FILE__, __LINE__); \ + URLOG(WARN, "Not Implemented : {} - File : {} / Line : {}", __FUNCTION__, \ + __FILE__, __LINE__); \ return UR_RESULT_SUCCESS; \ } while (false) #define CASE_UR_UNSUPPORTED(not_supported) \ case not_supported: \ - logger::error("Unsupported UR case : {} in {}:{}({})", #not_supported, \ - __FUNCTION__, __LINE__, __FILE__); \ + URLOG(ERR, "Unsupported UR case : {} in {}:{}({})", #not_supported, \ + __FUNCTION__, __LINE__, __FILE__); \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; /// ------ Error handling, matching OpenCL plugin semantics. diff --git a/unified-runtime/source/adapters/native_cpu/device.cpp b/unified-runtime/source/adapters/native_cpu/device.cpp index 21bab5982441..223e91e353cd 100644 --- a/unified-runtime/source/adapters/native_cpu/device.cpp +++ b/unified-runtime/source/adapters/native_cpu/device.cpp @@ -99,7 +99,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGet(ur_platform_handle_t hPlatform, if (NumEntries == 0) { /// Runtime queries number of devices if (phDevices != nullptr) { - logger::error("Invalid Arguments for urDevicesGet"); + URLOG(ERR, "Invalid Arguments for urDevicesGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/adapters/native_cpu/platform.cpp b/unified-runtime/source/adapters/native_cpu/platform.cpp index 8e550370792c..53fd793b477a 100644 --- a/unified-runtime/source/adapters/native_cpu/platform.cpp +++ b/unified-runtime/source/adapters/native_cpu/platform.cpp @@ -29,7 +29,7 @@ urPlatformGet(ur_adapter_handle_t *, uint32_t, uint32_t NumEntries, if (NumEntries == 0) { if (phPlatforms != nullptr) { - logger::error("Invalid argument combination for urPlatformsGet"); + URLOG(ERR, "Invalid argument combination for urPlatformsGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/adapters/opencl/common.cpp b/unified-runtime/source/adapters/opencl/common.cpp index a2bd9ed54924..c8b151e7ab96 100644 --- a/unified-runtime/source/adapters/opencl/common.cpp +++ b/unified-runtime/source/adapters/opencl/common.cpp @@ -107,7 +107,7 @@ ur_result_t mapCLErrorToUR(cl_int Result) { } void cl_adapter::die(const char *Message) { - logger::always("ur_die: {}", Message); + URLOG_ALWAYS("ur_die: {}", Message); std::terminate(); } diff --git a/unified-runtime/source/adapters/opencl/context.cpp b/unified-runtime/source/adapters/opencl/context.cpp index 4363c4dbb2ea..19719e44d4ea 100644 --- a/unified-runtime/source/adapters/opencl/context.cpp +++ b/unified-runtime/source/adapters/opencl/context.cpp @@ -163,9 +163,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextSetExtendedDeleter( ur_context_handle_t hContext, ur_context_extended_deleter_t pfnDeleter, void *pUserData) { if (!ur::cl::getAdapter()->clSetContextDestructorCallback) { - ur::cl::getAdapter()->log.warning( - "clSetContextDestructorCallback not found, consider upgrading the " - "OpenCL-ICD-Loader to the latest version."); + URLOG_(ur::cl::getAdapter()->log, WARN, + "clSetContextDestructorCallback not found, consider upgrading the " + "OpenCL-ICD-Loader to the latest version."); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/common/latency_tracker.hpp b/unified-runtime/source/common/latency_tracker.hpp index b8af6c6de527..fd36a553d35b 100644 --- a/unified-runtime/source/common/latency_tracker.hpp +++ b/unified-runtime/source/common/latency_tracker.hpp @@ -64,7 +64,7 @@ static inline latencyValues getValues(const struct hdr_histogram *histogram) { auto ret = hdr_value_at_percentiles(histogram, percentiles, values.percentileValues, numPercentiles); if (ret != 0) { - logger::error("Failed to get percentiles from latency histogram"); + URLOG(ERR, "Failed to get percentiles from latency histogram"); } return values; @@ -137,7 +137,7 @@ class latency_histogram { auto ret = hdr_init(lowestDiscernibleValue, highestTrackableValue, significantFigures, &cHistogram); if (ret != 0) { - logger::error("Failed to initialize latency histogram"); + URLOG(ERR, "Failed to initialize latency histogram"); } histogram = std::unique_ptr( cHistogram, &hdr_close); @@ -153,7 +153,7 @@ class latency_histogram { } if (hdr_min(histogram.get()) == std::numeric_limits::max()) { - logger::info("[{}] latency: no data", name); + URLOG(INFO, "[{}] latency: no data", name); return; } diff --git a/unified-runtime/source/common/linux/ur_lib_loader.cpp b/unified-runtime/source/common/linux/ur_lib_loader.cpp index 65e67bba048e..1a1ac071f352 100644 --- a/unified-runtime/source/common/linux/ur_lib_loader.cpp +++ b/unified-runtime/source/common/linux/ur_lib_loader.cpp @@ -25,10 +25,10 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { int res = dlclose(handle); if (res) { - logger::error( - "Failed to unload the library with the handle at address {}", handle); + URLOG(ERR, "Failed to unload the library with the handle at address {}", + handle); } else { - logger::info("unloaded adapter 0x{}", handle); + URLOG(INFO, "unloaded adapter 0x{}", handle); } } } @@ -40,10 +40,10 @@ LibLoader::loadAdapterLibrary(const char *name) { bool deepbind = getenv_tobool(DEEP_BIND_ENV); if (deepbind) { #if defined(SANITIZER_ANY) - logger::warning( - "Enabling RTLD_DEEPBIND while running under a sanitizer is likely " - "to cause issues. Consider disabling {} environment variable.", - DEEP_BIND_ENV); + URLOG(WARN + "Enabling RTLD_DEEPBIND while running under a sanitizer is likely " + "to cause issues. Consider disabling {} environment variable.", + DEEP_BIND_ENV); #endif mode |= RTLD_DEEPBIND; } @@ -58,21 +58,21 @@ LibLoader::loadAdapterLibrary(const char *name) { (strstr(err, name) == NULL || strstr(err, "required by") != NULL)) { // If the adapter cannot be loaded due to missing dependencies or any // other related error, it is considered as an error. - logger::error("failed to load adapter '{}' with error: {}", name, err); + URLOG(ERR, "failed to load adapter '{}' with error: {}", name, err); } else { // Simply having the adapter library missing isn't an error. - logger::info("failed to load adapter '{}' with error: {}", name, - err ? err : "unknown error"); + URLOG(INFO, "failed to load adapter '{}' with error: {}", name, + err ? err : "unknown error"); } } else { #if defined(ADD_FULL_PATH_LOG) struct link_map *dlinfo_map; if (dlinfo(handle, RTLD_DI_LINKMAP, &dlinfo_map) == 0) { - logger::info("loaded adapter 0x{} ({}) from {}", handle, name, - dlinfo_map->l_name); + URLOG(INFO, "loaded adapter 0x{} ({}) from {}", handle, name, + dlinfo_map->l_name); } else #endif - logger::info("loaded adapter 0x{} ({})", handle, name); + URLOG(INFO, "loaded adapter 0x{} ({})", handle, name); } return std::unique_ptr(handle); } diff --git a/unified-runtime/source/common/logger/ur_logger.hpp b/unified-runtime/source/common/logger/ur_logger.hpp index 9d640be0e280..e26ce57cad43 100644 --- a/unified-runtime/source/common/logger/ur_logger.hpp +++ b/unified-runtime/source/common/logger/ur_logger.hpp @@ -16,11 +16,10 @@ namespace logger { Logger create_logger(std::string logger_name, bool skip_prefix = false, bool skip_linebreak = false, - logger::Level default_log_level = logger::Level::QUIET); + Level default_log_level = Level::QUIET); -inline Logger & -get_logger(std::string name = "common", - logger::Level default_log_level = logger::Level::QUIET) { +inline Logger &get_logger(std::string name = "common", + Level default_log_level = Level::QUIET) { static Logger logger = create_logger(std::move(name), /*skip_prefix*/ false, /*slip_linebreak*/ false, default_log_level); @@ -29,59 +28,15 @@ get_logger(std::string name = "common", inline void init(const std::string &name) { get_logger(name.c_str()); } -template -inline void debug(const char *format, Args &&...args) { - get_logger().log(logger::Level::DEBUG, format, std::forward(args)...); -} - -template -inline void info(const char *format, Args &&...args) { - get_logger().log(logger::Level::INFO, format, std::forward(args)...); -} +#define URLOG(...) URLOG_(logger::get_logger(), __VA_ARGS__) +#define URLOG_ALWAYS(...) URLOG_ALWAYS_(logger::get_logger(), __VA_ARGS__) +#define URLOG_CTX(...) URLOG_(getContext()->logger, __VA_ARGS__) +#define URLOG_CTX_ALWAYS(...) URLOG_(getContext()->logger, QUIET, __VA_ARGS__) +#define URLOG_L(...) URLOG_LEGACY_(logger::get_logger(), __VA_ARGS__) -template -inline void warning(const char *format, Args &&...args) { - get_logger().log(logger::Level::WARN, format, std::forward(args)...); -} +inline void setLevel(Level level) { get_logger().setLevel(level); } -template -inline void error(const char *format, Args &&...args) { - get_logger().log(logger::Level::ERR, format, std::forward(args)...); -} - -template -inline void always(const char *format, Args &&...args) { - get_logger().always(format, std::forward(args)...); -} - -template -inline void debug(const logger::LegacyMessage &p, const char *format, - Args &&...args) { - get_logger().log(p, logger::Level::DEBUG, format, - std::forward(args)...); -} - -template -inline void info(logger::LegacyMessage p, const char *format, Args &&...args) { - get_logger().log(p, logger::Level::INFO, format, std::forward(args)...); -} - -template -inline void warning(logger::LegacyMessage p, const char *format, - Args &&...args) { - get_logger().log(p, logger::Level::WARN, format, std::forward(args)...); -} - -template -inline void error(logger::LegacyMessage p, const char *format, Args &&...args) { - get_logger().log(p, logger::Level::ERR, format, std::forward(args)...); -} - -inline void setLevel(logger::Level level) { get_logger().setLevel(level); } - -inline void setFlushLevel(logger::Level level) { - get_logger().setFlushLevel(level); -} +inline void setFlushLevel(Level level) { get_logger().setFlushLevel(level); } template inline std::string toHex(T t) { std::stringstream s; @@ -89,6 +44,11 @@ template inline std::string toHex(T t) { return s.str(); } +inline bool str_to_bool(const std::string str) { + return str == "true" || str == "TRUE" || str == "yes" || str == "YES" || + str == "y" || str == "Y" || str == "on" || str == "ON" || str == "1"; +} + /// @brief Create an instance of the logger with parameters obtained from the /// respective /// environment variable or with default configuration if the env var is @@ -115,23 +75,24 @@ template inline std::string toHex(T t) { /// to be printed immediately as they occur /// - output: stderr inline Logger create_logger(std::string logger_name, bool skip_prefix, - bool skip_linebreak, - logger::Level default_log_level) { + bool skip_linebreak, Level default_log_level) { std::transform(logger_name.begin(), logger_name.end(), logger_name.begin(), ::toupper); - const auto default_flush_level = logger::Level::ERR; + const auto default_flush_level = Level::ERR; const std::string default_output = "stderr"; + const bool default_fileline = false; auto level = default_log_level; auto flush_level = default_flush_level; - std::unique_ptr sink; + bool fileline = default_fileline; + std::unique_ptr sink; auto env_var_name = "UR_LOG_" + logger_name; try { auto map = getenv_to_map(env_var_name.c_str()); if (!map.has_value()) { return Logger(default_log_level, - std::make_unique( - std::move(logger_name), skip_prefix, skip_linebreak)); + std::make_unique(std::move(logger_name), + skip_prefix, skip_linebreak)); } auto kv = map->find("level"); @@ -148,6 +109,13 @@ inline Logger create_logger(std::string logger_name, bool skip_prefix, map->erase(kv); } + kv = map->find("fileline"); + if (kv != map->end()) { + auto value = kv->second.front(); + fileline = str_to_bool(std::move(value)); + map->erase(kv); + } + std::vector values = {std::move(default_output)}; kv = map->find("output"); if (kv != map->end()) { @@ -159,8 +127,8 @@ inline Logger create_logger(std::string logger_name, bool skip_prefix, std::cerr << "Wrong logger environment variable parameter: '" << map->begin()->first << "'. Default logger options are set."; return Logger(default_log_level, - std::make_unique( - std::move(logger_name), skip_prefix, skip_linebreak)); + std::make_unique(std::move(logger_name), + skip_prefix, skip_linebreak)); } sink = values.size() == 2 ? sink_from_str(logger_name, values[0], values[1], @@ -172,10 +140,11 @@ inline Logger create_logger(std::string logger_name, bool skip_prefix, << env_var_name << "' environment variable:\n" << e.what() << std::endl; return Logger(default_log_level, - std::make_unique( - std::move(logger_name), skip_prefix, skip_linebreak)); + std::make_unique(std::move(logger_name), + skip_prefix, skip_linebreak)); } sink->setFlushLevel(flush_level); + sink->setFileLine(fileline); return Logger(level, std::move(sink)); } diff --git a/unified-runtime/source/common/logger/ur_logger_details.hpp b/unified-runtime/source/common/logger/ur_logger_details.hpp index 1247ba2cbea4..e9ae7f53312c 100644 --- a/unified-runtime/source/common/logger/ur_logger_details.hpp +++ b/unified-runtime/source/common/logger/ur_logger_details.hpp @@ -19,111 +19,84 @@ struct LegacyMessage { class Logger { public: - Logger(std::unique_ptr sink) : sink(std::move(sink)) { - this->level = logger::Level::QUIET; - } + Logger(std::unique_ptr sink) + : level(Level::QUIET), sink(std::move(sink)) {} - Logger(logger::Level level, std::unique_ptr sink) + Logger(Level level, std::unique_ptr sink) : level(level), sink(std::move(sink)) {} - Logger &operator=(Logger &&) = default; - ~Logger() = default; - - void setLevel(logger::Level level) { this->level = level; } + void setLevel(Level level) { this->level = level; } - logger::Level getLevel() { return this->level; } + Level getLevel() { return this->level; } - void setFlushLevel(logger::Level level) { + void setFlushLevel(Level level) { if (sink) { this->sink->setFlushLevel(level); } } - template void debug(const char *format, Args &&...args) { - log(logger::Level::DEBUG, format, std::forward(args)...); - } - - template void info(const char *format, Args &&...args) { - log(logger::Level::INFO, format, std::forward(args)...); - } - - template void warning(const char *format, Args &&...args) { - log(logger::Level::WARN, format, std::forward(args)...); - } - - template void warn(const char *format, Args &&...args) { - warning(format, std::forward(args)...); - } - - template void error(const char *format, Args &&...args) { - log(logger::Level::ERR, format, std::forward(args)...); - } - - template void always(const char *format, Args &&...args) { - if (sink) { - sink->log(logger::Level::QUIET, format, std::forward(args)...); - } - } - - template - void debug(const logger::LegacyMessage &p, const char *format, - Args &&...args) { - log(p, logger::Level::DEBUG, format, std::forward(args)...); - } - template - void info(const logger::LegacyMessage &p, const char *format, - Args &&...args) { - log(p, logger::Level::INFO, format, std::forward(args)...); - } - - template - void warning(const logger::LegacyMessage &p, const char *format, - Args &&...args) { - log(p, logger::Level::WARN, format, std::forward(args)...); - } - - template - void error(const logger::LegacyMessage &p, const char *format, - Args &&...args) { - log(p, logger::Level::ERR, format, std::forward(args)...); - } - - template - void log(logger::Level level, const char *format, Args &&...args) { - log(logger::LegacyMessage(format), level, format, + void log(Level level, const char *filename, const char *lineno, + const char *format, Args &&...args) { + log(LegacyMessage(format), level, filename, lineno, format, std::forward(args)...); } template - void log(const logger::LegacyMessage &p, logger::Level level, - const char *format, Args &&...args) { + void log(const LegacyMessage &p, Level level, const char *filename, + const char *lineno, const char *format, Args &&...args) { if (!sink) { return; } if (isLegacySink) { - sink->log(level, p.message, std::forward(args)...); + sink->log(level, filename, lineno, p.message, + std::forward(args)...); return; } if (level < this->level) { return; } - sink->log(level, format, std::forward(args)...); + sink->log(level, filename, lineno, format, std::forward(args)...); } - void setLegacySink(std::unique_ptr legacySink) { + void setLegacySink(std::unique_ptr legacySink) { this->isLegacySink = true; this->sink = std::move(legacySink); } private: - logger::Level level; - std::unique_ptr sink; + Level level; + std::unique_ptr sink; bool isLegacySink = false; }; } // namespace logger +#ifdef SRC_PATH_SIZE +#define SHORT_FILE ((__FILE__) + (SRC_PATH_SIZE)) +#else +#define SHORT_FILE __FILE__ +#endif + +#define UR_STRIMPL(x) #x +#define UR_STR(x) UR_STRIMPL(x) + +#define URLOG_(logger_instance, level, ...) \ + { \ + (logger_instance) \ + .log(logger::Level::level, SHORT_FILE, UR_STR(__LINE__), __VA_ARGS__); \ + } + +#define URLOG_ALWAYS_(logger_instance, ...) \ + URLOG_(logger_instance, QUIET, __VA_ARGS__) + +#define URLOG_LEGACY_(logger_instance, level, legacy_message, ...) \ + { \ + (logger_instance) \ + .log(legacy_message, logger::Level::level, SHORT_FILE, \ + UR_STR(__LINE__), __VA_ARGS__); \ + } + #endif /* UR_LOGGER_DETAILS_HPP */ diff --git a/unified-runtime/source/common/logger/ur_sinks.hpp b/unified-runtime/source/common/logger/ur_sinks.hpp index 8f580bc04d6c..75dbab23a33e 100644 --- a/unified-runtime/source/common/logger/ur_sinks.hpp +++ b/unified-runtime/source/common/logger/ur_sinks.hpp @@ -25,14 +25,21 @@ inline bool isTearDowned = false; class Sink { public: template - void log(logger::Level level, const char *fmt, Args &&...args) { + void log(Level level, const char *filename, const char *lineno, + const char *fmt, Args &&...args) { std::ostringstream buffer; - if (!skip_prefix && level != logger::Level::QUIET) { + if (!skip_prefix && level != Level::QUIET) { buffer << "<" << logger_name << ">" << "[" << level_to_str(level) << "]: "; } format(buffer, fmt, std::forward(args)...); + if (add_fileline) { + buffer << " <" << filename << ":" << lineno << ">"; + } + if (!skip_linebreak) { + buffer << "\n"; + } // This is a temporary workaround on windows, where UR adapter is teardowned // before the UR loader, which will result in access violation when we use print // function as the overrided print function was already released with the UR @@ -50,23 +57,24 @@ class Sink { #endif } - void setFlushLevel(logger::Level level) { this->flush_level = level; } + void setFlushLevel(Level level) { this->flush_level = level; } + void setFileLine(bool fileline) { add_fileline = fileline; } virtual ~Sink() = default; protected: std::ostream *ostream; - logger::Level flush_level; + Level flush_level; Sink(std::string logger_name, bool skip_prefix = false, bool skip_linebreak = false) : logger_name(std::move(logger_name)), skip_prefix(skip_prefix), - skip_linebreak(skip_linebreak) { + skip_linebreak(skip_linebreak), add_fileline(false) { ostream = nullptr; - flush_level = logger::Level::ERR; + flush_level = Level::ERR; } - virtual void print(logger::Level level, const std::string &msg) { + virtual void print(Level level, const std::string &msg) { std::scoped_lock lock(output_mutex); *ostream << msg; if (level >= flush_level) { @@ -76,8 +84,9 @@ class Sink { private: std::string logger_name; - bool skip_prefix; - bool skip_linebreak; + const bool skip_prefix; + const bool skip_linebreak; + bool add_fileline; std::mutex output_mutex; const char *error_prefix = "Log message syntax error: "; @@ -104,9 +113,6 @@ class Sink { } } } - if (!skip_linebreak) { - buffer << "\n"; - } } template @@ -138,7 +144,8 @@ class Sink { } if (*fmt == '\0') { - std::cerr << error_prefix << "Too many arguments!" << std::endl; + std::cerr << error_prefix + << "Too many arguments! first excessive:" << arg << std::endl; // ignore all left arguments and finalize message format(buffer, fmt); return; @@ -217,14 +224,14 @@ inline std::unique_ptr sink_from_str(std::string logger_name, bool skip_prefix = false, bool skip_linebreak = false) { if (name == "stdout" && file_path.empty()) { - return std::make_unique(logger_name, skip_prefix, - skip_linebreak); + return std::make_unique(logger_name, skip_prefix, + skip_linebreak); } else if (name == "stderr" && file_path.empty()) { - return std::make_unique(logger_name, skip_prefix, - skip_linebreak); + return std::make_unique(logger_name, skip_prefix, + skip_linebreak); } else if (name == "file" && !file_path.empty()) { - return std::make_unique(logger_name, file_path, - skip_prefix, skip_linebreak); + return std::make_unique(logger_name, file_path, skip_prefix, + skip_linebreak); } throw std::invalid_argument( diff --git a/unified-runtime/source/common/umf_helpers.hpp b/unified-runtime/source/common/umf_helpers.hpp index 12432bd933bc..1c9436b6992f 100644 --- a/unified-runtime/source/common/umf_helpers.hpp +++ b/unified-runtime/source/common/umf_helpers.hpp @@ -296,7 +296,7 @@ inline ur_result_t umf2urResult(umf_result_t umfResult) { umfMemoryProviderGetLastNativeError(hProvider, &Msg, &Err); if (Msg) { - logger::error("UMF failed with: {}", Msg); + URLOG(ERR, "UMF failed with: {}", Msg); } return getProviderNativeError(umfMemoryProviderGetName(hProvider), Err); diff --git a/unified-runtime/source/common/ur_pool_manager.hpp b/unified-runtime/source/common/ur_pool_manager.hpp index 67bf0a9b3a3e..cf18c5caae69 100644 --- a/unified-runtime/source/common/ur_pool_manager.hpp +++ b/unified-runtime/source/common/ur_pool_manager.hpp @@ -176,7 +176,7 @@ template struct pool_manager { ur_result_t addPool(const D &desc, unique_pool_handle_t &&hPool) noexcept { if (!descToPoolMap.try_emplace(desc, std::move(hPool)).second) { - logger::error("Pool for pool descriptor: {}, already exists", desc); + URLOG(ERR, "Pool for pool descriptor: {}, already exists", desc); return UR_RESULT_ERROR_INVALID_ARGUMENT; } @@ -186,8 +186,7 @@ template struct pool_manager { std::optional getPool(const D &desc) noexcept { auto it = descToPoolMap.find(desc); if (it == descToPoolMap.end()) { - logger::error("Pool descriptor doesn't match any existing pool: {}", - desc); + URLOG(ERR, "Pool descriptor doesn't match any existing pool: {}", desc); return std::nullopt; } diff --git a/unified-runtime/source/common/ur_util.cpp b/unified-runtime/source/common/ur_util.cpp index 268a8dc0a223..d44df684e0e4 100644 --- a/unified-runtime/source/common/ur_util.cpp +++ b/unified-runtime/source/common/ur_util.cpp @@ -45,14 +45,14 @@ int ur_duplicate_fd(int pid, int fd_in) { errno = 0; int pid_fd = syscall(__NR_pidfd_open, pid, 0); if (pid_fd == -1) { - logger::error("__NR_pidfd_open"); + URLOG(ERR, "__NR_pidfd_open"); return -1; } int fd_dup = syscall(__NR_pidfd_getfd, pid_fd, fd_in, 0); close(pid_fd); if (fd_dup == -1) { - logger::error("__NR_pidfd_getfd"); + URLOG(ERR, "__NR_pidfd_getfd"); return -1; } @@ -63,7 +63,7 @@ int ur_duplicate_fd(int pid, int fd_in) { (void)pid; // unused (void)fd_in; // unused errno = ENOTSUP; // unsupported - logger::error("__NR_pidfd_open or __NR_pidfd_getfd not available"); + URLOG(ERR, "__NR_pidfd_open or __NR_pidfd_getfd not available"); return -1; #endif /* defined(__NR_pidfd_open) && defined(__NR_pidfd_getfd) */ } diff --git a/unified-runtime/source/common/windows/ur_lib_loader.cpp b/unified-runtime/source/common/windows/ur_lib_loader.cpp index a3a86c2e7c6e..f6906b39a496 100644 --- a/unified-runtime/source/common/windows/ur_lib_loader.cpp +++ b/unified-runtime/source/common/windows/ur_lib_loader.cpp @@ -17,11 +17,10 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { BOOL res = FreeLibrary(handle); if (!res) { - logger::error( - "Failed to unload the library with the handle at address 0x{}", - handle); + URLOG(ERR, "Failed to unload the library with the handle at address 0x{}", + handle); } else { - logger::info("unloaded adapter 0x{}", handle); + URLOG(INFO, "unloaded adapter 0x{}", handle); } } } @@ -29,11 +28,11 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { std::unique_ptr LibLoader::loadAdapterLibrary(const char *name) { if (HMODULE handle = LoadLibraryExA(name, nullptr, 0)) { - logger::info("loaded adapter 0x{}: {}", handle, name); + URLOG(INFO, "loaded adapter 0x{}: {}", handle, name); return std::unique_ptr{handle}; } else { - logger::debug("loading adapter failed with error {}: {}", GetLastError(), - name); + URLOG(DEBUG, "loading adapter failed with error {}: {}", GetLastError(), + name); } return nullptr; } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp index 248af595e33b..25e66a191db8 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp @@ -18,10 +18,10 @@ namespace ur_sanitizer_layer { namespace asan { void AllocInfo::print() { - getContext()->logger.info( - "AllocInfo(Alloc=[{}-{}), User=[{}-{}), AllocSize={}, Type={})", - (void *)AllocBegin, (void *)(AllocBegin + AllocSize), (void *)UserBegin, - (void *)(UserEnd), AllocSize, ToString(Type)); + URLOG_CTX(INFO, + "AllocInfo(Alloc=[{}-{}), User=[{}-{}), AllocSize={}, Type={})", + (void *)AllocBegin, (void *)(AllocBegin + AllocSize), + (void *)UserBegin, (void *)(UserEnd), AllocSize, ToString(Type)); } } // namespace asan diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp index 2bc055caa0ff..9a42886f7507 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp @@ -97,8 +97,8 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::MEM_BUFFER, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error( - "Failed to allocate {} bytes memory for buffer {}", Size, this); + URLOG_CTX(ERR, "Failed to allocate {} bytes memory for buffer {}", Size, + this); return URes; } @@ -107,9 +107,10 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to copy {} bytes data from host " - "pointer {} to buffer {}", - Size, HostPtr, this); + URLOG_CTX( + ERR, + "Failed to copy {} bytes data from host pointer {} to buffer {}", + Size, HostPtr, this); return URes; } } @@ -134,9 +135,9 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Context, nullptr, &USMDesc, Pool, Size, AllocType::HOST_USM, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to allocate {} bytes host " - "USM for buffer {} migration", - Size, this); + URLOG_CTX( + ERR, "Failed to allocate {} bytes host USM for buffer {} migration", + Size, this); return URes; } } @@ -148,7 +149,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to migrate memory buffer data"); + URLOG_CTX(ERR, "Failed to migrate memory buffer data"); return URes; } } @@ -159,7 +160,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to migrate memory buffer data"); + URLOG_CTX(ERR, "Failed to migrate memory buffer data"); return URes; } } @@ -174,7 +175,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getAsanInterceptor()->releaseMemory(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to free buffer handle {}", Ptr); + URLOG_CTX(ERR, "Failed to free buffer handle {}", Ptr); return URes; } } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp index f5862efe58f1..d887a27e41d3 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp @@ -40,18 +40,18 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getAsanInterceptor()->insertDevice(hDevice, DI)); DI->Type = GetDeviceType(Context, hDevice); if (DI->Type == DeviceType::UNKNOWN) { - getContext()->logger.error("Unsupport device"); + URLOG_CTX(ERR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } if (DI->Type != DeviceType) { - getContext()->logger.error("Different device type in the same context"); + URLOG_CTX(ERR, "Different device type in the same context"); return UR_RESULT_ERROR_INVALID_DEVICE; } - getContext()->logger.info( - "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", - (void *)DI->Handle, ToString(DI->Type), DI->IsSupportSharedSystemUSM); - getContext()->logger.info("Add {} into context {}", (void *)DI->Handle, - (void *)Context); + URLOG_CTX(INFO, "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", + (void *)DI->Handle, ToString(DI->Type), + DI->IsSupportSharedSystemUSM); + URLOG_CTX(INFO, "Add {} into context {}", (void *)DI->Handle, + (void *)Context); DI->Shadow = ShadowMemory; CI->DeviceList.emplace_back(hDevice); CI->AllocInfosMap[hDevice]; @@ -111,7 +111,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urUSMHostAlloc"); + URLOG_CTX(DEBUG, "==== urUSMHostAlloc"); return getAsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -138,7 +138,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urUSMDeviceAlloc"); + URLOG_CTX(DEBUG, "==== urUSMDeviceAlloc"); return getAsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -165,7 +165,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urUSMSharedAlloc"); + URLOG_CTX(DEBUG, "==== urUSMSharedAlloc"); return getAsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -184,7 +184,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urUSMFree"); + URLOG_CTX(DEBUG, "==== urUSMFree"); return getAsanInterceptor()->releaseMemory(hContext, pMem); } @@ -209,7 +209,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urProgramCreateWithIL"); + URLOG_CTX(DEBUG, "==== urProgramCreateWithIL"); UR_CALL( pfnProgramCreateWithIL(hContext, pIL, length, pProperties, phProgram)); @@ -245,7 +245,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urProgramCreateWithBinary"); + URLOG_CTX(DEBUG, "==== urProgramCreateWithBinary"); UR_CALL(pfnProgramCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, pProperties, phProgram)); @@ -272,7 +272,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urProgramCreateWithNativeHandle"); + URLOG_CTX(DEBUG, "==== urProgramCreateWithNativeHandle"); UR_CALL(pfnProgramCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram)); @@ -293,7 +293,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urProgramRetain"); + URLOG_CTX(DEBUG, "==== urProgramRetain"); UR_CALL(pfnRetain(hProgram)); @@ -320,7 +320,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urProgramBuild"); + URLOG_CTX(DEBUG, "==== urProgramBuild"); UR_CALL(pfnProgramBuild(hContext, hProgram, pOptions)); @@ -346,7 +346,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urProgramBuildExp"); + URLOG_CTX(DEBUG, "==== urProgramBuildExp"); UR_CALL(pfnBuildExp(hProgram, numDevices, phDevices, pOptions)); UR_CALL(getAsanInterceptor()->registerProgram(hProgram)); @@ -373,7 +373,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urProgramLink"); + URLOG_CTX(DEBUG, "==== urProgramLink"); UR_CALL(pfnProgramLink(hContext, count, phPrograms, pOptions, phProgram)); @@ -406,7 +406,7 @@ ur_result_t UR_APICALL urProgramLinkExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urProgramLinkExp"); + URLOG_CTX(DEBUG, "==== urProgramLinkExp"); UR_CALL(pfnProgramLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram)); @@ -428,7 +428,7 @@ ur_result_t UR_APICALL urProgramRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urProgramRelease"); + URLOG_CTX(DEBUG, "==== urProgramRelease"); UR_CALL(pfnProgramRelease(hProgram)); @@ -486,7 +486,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urEnqueueKernelLaunch"); + URLOG_CTX(DEBUG, "==== urEnqueueKernelLaunch"); LaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue), pGlobalWorkSize, pLocalWorkSize, pGlobalWorkOffset, workDim); @@ -529,7 +529,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urContextCreate"); + URLOG_CTX(DEBUG, "==== urContextCreate"); ur_result_t result = pfnCreate(numDevices, phDevices, pProperties, phContext); @@ -561,7 +561,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urContextCreateWithNativeHandle"); + URLOG_CTX(DEBUG, "==== urContextCreateWithNativeHandle"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -584,7 +584,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urContextRetain"); + URLOG_CTX(DEBUG, "==== urContextRetain"); UR_CALL(pfnRetain(hContext)); @@ -606,7 +606,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urContextRelease"); + URLOG_CTX(DEBUG, "==== urContextRelease"); UR_CALL(pfnRelease(hContext)); @@ -642,7 +642,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - getContext()->logger.debug("==== urMemBufferCreate"); + URLOG_CTX(DEBUG, "==== urMemBufferCreate"); void *Host = nullptr; if (pProperties) { @@ -696,7 +696,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urMemGetInfo"); + URLOG_CTX(DEBUG, "==== urMemGetInfo"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMemory)) { UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); @@ -729,7 +729,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urMemRetain"); + URLOG_CTX(DEBUG, "==== urMemRetain"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { MemBuffer->RefCount++; @@ -751,7 +751,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urMemRelease"); + URLOG_CTX(DEBUG, "==== urMemRelease"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { if (--MemBuffer->RefCount != 0) { @@ -786,7 +786,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urMemBufferPartition"); + URLOG_CTX(DEBUG, "==== urMemBufferPartition"); if (auto ParentBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { @@ -817,7 +817,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urMemGetNativeHandle"); + URLOG_CTX(DEBUG, "==== urMemGetNativeHandle"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { char *Handle = nullptr; @@ -861,7 +861,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urEnqueueMemBufferRead"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferRead"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -909,7 +909,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urEnqueueMemBufferWrite"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWrite"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -971,7 +971,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urEnqueueMemBufferReadRect"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferReadRect"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *SrcHandle = nullptr; @@ -1036,7 +1036,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urEnqueueMemBufferWriteRect"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWriteRect"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *DstHandle = nullptr; @@ -1088,7 +1088,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urEnqueueMemBufferCopy"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopy"); auto SrcBuffer = getAsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getAsanInterceptor()->getMemBuffer(hBufferDst); @@ -1156,7 +1156,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urEnqueueMemBufferCopyRect"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopyRect"); auto SrcBuffer = getAsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getAsanInterceptor()->getMemBuffer(hBufferDst); @@ -1218,7 +1218,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urEnqueueMemBufferFill"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferFill"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *Handle = nullptr; @@ -1270,7 +1270,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urEnqueueMemBufferMap"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferMap"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { @@ -1357,7 +1357,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urEnqueueMemUnmap"); + URLOG_CTX(DEBUG, "==== urEnqueueMemUnmap"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { MemBuffer::Mapping Mapping{}; @@ -1402,7 +1402,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urKernelRetain"); + URLOG_CTX(DEBUG, "==== urKernelRetain"); UR_CALL(pfnRetain(hKernel)); @@ -1423,7 +1423,7 @@ __urdlllocal ur_result_t urKernelRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urKernelRelease"); + URLOG_CTX(DEBUG, "==== urKernelRelease"); auto &KernelInfo = getAsanInterceptor()->getOrCreateKernelInfo(hKernel); if (--KernelInfo.RefCount == 0) { @@ -1453,7 +1453,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urKernelSetArgValue"); + URLOG_CTX(DEBUG, "==== urKernelSetArgValue"); std::shared_ptr MemBuffer; if (argSize == sizeof(ur_mem_handle_t) && @@ -1486,7 +1486,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug("==== urKernelSetArgMemObj"); + URLOG_CTX(DEBUG, "==== urKernelSetArgMemObj"); std::shared_ptr MemBuffer; if ((MemBuffer = getAsanInterceptor()->getMemBuffer(hArgValue))) { @@ -1517,8 +1517,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug( - "==== urKernelSetArgLocal (argIndex={}, argSize={})", argIndex, argSize); + URLOG_CTX(DEBUG, "==== urKernelSetArgLocal (argIndex={}, argSize={})", + argIndex, argSize); { auto &KI = getAsanInterceptor()->getOrCreateKernelInfo(hKernel); @@ -1553,9 +1553,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - getContext()->logger.debug( - "==== urKernelSetArgPointer (argIndex={}, pArgValue={})", argIndex, - pArgValue); + URLOG_CTX(DEBUG, "==== urKernelSetArgPointer (argIndex={}, pArgValue={})", + argIndex, pArgValue); std::shared_ptr KI; if (getContext()->Options.DetectKernelArguments) { @@ -1938,7 +1937,7 @@ template struct NotSupportedApi; template struct NotSupportedApi { R static ReportError(A...) { - getContext()->logger.error(MsgType::value); + URLOG_CTX(ERR, MsgType::value); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } }; @@ -2066,7 +2065,7 @@ __urdlllocal ur_result_t UR_APICALL urGetVirtualMemProcAddrTable( ur_result_t initAsanDDITable(ur_dditable_t *dditable) { ur_result_t result = UR_RESULT_SUCCESS; - getContext()->logger.always("==== DeviceSanitizer: ASAN"); + URLOG_CTX_ALWAYS("==== DeviceSanitizer: ASAN"); if (UR_RESULT_SUCCESS == result) { result = ur_sanitizer_layer::asan::urGetGlobalProcAddrTable( @@ -2129,7 +2128,7 @@ ur_result_t initAsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Initialize ASAN DDI table failed: {}", result); + URLOG_CTX(ERR, "Initialize ASAN DDI table failed: {}", result); } return result; diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp index 7447887e9574..3d9954261c37 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp @@ -117,7 +117,7 @@ ur_result_t AsanInterceptor::allocateMemory(ur_context_handle_t Context, UR_CALL(getContext()->urDdiTable.USM.pfnDeviceAlloc( Context, Device, Properties, Pool, NeededSize, &Allocated)); } else { - getContext()->logger.error("Unsupport memory type"); + URLOG_CTX(ERR, "Unsupport memory type"); return UR_RESULT_ERROR_INVALID_ARGUMENT; } @@ -225,7 +225,7 @@ ur_result_t AsanInterceptor::releaseMemory(ur_context_handle_t Context, // If quarantine is disabled, USM is freed immediately if (!m_Quarantine) { - getContext()->logger.debug("Free: {}", (void *)AllocInfo->AllocBegin); + URLOG_CTX(DEBUG, "Free: {}", (void *)AllocInfo->AllocBegin); ContextInfo->Stats.UpdateUSMRealFreed(AllocInfo->AllocSize, AllocInfo->getRedzoneSize()); @@ -243,8 +243,8 @@ ur_result_t AsanInterceptor::releaseMemory(ur_context_handle_t Context, std::scoped_lock Guard(m_AllocationMapMutex); for (auto &It : ReleaseList) { auto ToFreeAllocInfo = It->second; - getContext()->logger.info("Quarantine Free: {}", - (void *)ToFreeAllocInfo->AllocBegin); + URLOG_CTX(INFO, "Quarantine Free: {}", + (void *)ToFreeAllocInfo->AllocBegin); ContextInfo->Stats.UpdateUSMRealFreed(ToFreeAllocInfo->AllocSize, ToFreeAllocInfo->getRedzoneSize()); @@ -271,7 +271,7 @@ ur_result_t AsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(Context, Device); if (!InternalQueue) { - getContext()->logger.error("Failed to create internal queue"); + URLOG_CTX(ERR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -327,7 +327,7 @@ AsanInterceptor::getOrCreateShadowMemory(ur_device_handle_t Device, auto Res = getContext()->urDdiTable.Context.pfnCreate(1, &Device, nullptr, &InternalContext); if (Res != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to create shadow context"); + URLOG_CTX(ERR, "Failed to create shadow context"); return nullptr; } std::shared_ptr CI; @@ -440,13 +440,13 @@ AsanInterceptor::updateShadowMemory(std::shared_ptr &ContextInfo, ur_result_t AsanInterceptor::registerProgram(ur_program_handle_t Program) { ur_result_t Result = UR_RESULT_SUCCESS; - getContext()->logger.info("registerSpirKernels"); + URLOG_CTX(INFO, "registerSpirKernels"); Result = registerSpirKernels(Program); if (Result != UR_RESULT_SUCCESS) { return Result; } - getContext()->logger.info("registerDeviceGlobals"); + URLOG_CTX(INFO, "registerDeviceGlobals"); Result = registerDeviceGlobals(Program); if (Result != UR_RESULT_SUCCESS) { return Result; @@ -496,8 +496,8 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, &SKInfo[0], MetadataPtr, sizeof(SpirKernelInfo) * NumOfSpirKernel, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Can't read the value of <{}>: {}", - kSPIR_AsanSpirKernelMetadata, Result); + URLOG_CTX(ERR, "Can't read the value of <{}>: {}", + kSPIR_AsanSpirKernelMetadata, Result); return Result; } @@ -512,20 +512,20 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, KernelNameV.data(), (void *)SKI.KernelName, sizeof(char) * SKI.Size, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Can't read kernel name: {}", Result); + URLOG_CTX(ERR, "Can't read kernel name: {}", Result); return Result; } std::string KernelName = std::string(KernelNameV.begin(), KernelNameV.end()); - getContext()->logger.info("SpirKernel(name='{}', isInstrumented={})", - KernelName, true); + URLOG_CTX(INFO, "SpirKernel(name='{}', isInstrumented={})", KernelName, + true); PI->InstrumentedKernels.insert(std::move(KernelName)); } - getContext()->logger.info("Number of sanitized kernel: {}", - PI->InstrumentedKernels.size()); + URLOG_CTX(INFO, "Number of sanitized kernel: {}", + PI->InstrumentedKernels.size()); } return UR_RESULT_SUCCESS; @@ -549,7 +549,7 @@ AsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Device, Program, kSPIR_AsanDeviceGlobalMetadata, &MetadataSize, &MetadataPtr); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.info("No device globals"); + URLOG_CTX(INFO, "No device globals"); continue; } @@ -561,8 +561,8 @@ AsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Device Global[{}] Read Failed: {}", - kSPIR_AsanDeviceGlobalMetadata, Result); + URLOG_CTX(ERR, "Device Global[{}] Read Failed: {}", + kSPIR_AsanDeviceGlobalMetadata, Result); return Result; } @@ -728,11 +728,11 @@ ur_result_t AsanInterceptor::prepareLaunch( auto PrivateMemoryUsage = GetKernelPrivateMemorySize(Kernel, DeviceInfo->Handle); - getContext()->logger.info( - "KernelInfo {} (Name={}, ArgNums={}, IsInstrumented={}, " - "LocalMemory={}, PrivateMemory={})", - (void *)Kernel, GetKernelName(Kernel), ArgNums, KernelInfo.IsInstrumented, - LocalMemoryUsage, PrivateMemoryUsage); + URLOG_CTX(INFO, + "KernelInfo {} (Name={}, ArgNums={}, IsInstrumented={}, " + "LocalMemory={}, PrivateMemory={})", + (void *)Kernel, GetKernelName(Kernel), ArgNums, + KernelInfo.IsInstrumented, LocalMemoryUsage, PrivateMemoryUsage); // Validate pointer arguments if (getContext()->Options.DetectKernelArguments) { @@ -759,9 +759,9 @@ ur_result_t AsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error( - "Failed to set buffer {} as the {} arg to kernel {}: {}", - ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); + URLOG_CTX(ERR, "Failed to set buffer {} as the {} arg to kernel {}: {}", + ur_cast(MemBuffer.get()), ArgIndex, Kernel, + URes); } } @@ -779,7 +779,7 @@ ur_result_t AsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgNums - 1, nullptr, LaunchInfo.Data.getDevicePtr()); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to set launch info: {}", URes); + URLOG_CTX(ERR, "Failed to set launch info: {}", URes); return URes; } } @@ -819,18 +819,16 @@ ur_result_t AsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocLocalShadow( Queue, NumWG, LaunchInfo.Data.Host.LocalShadowOffset, LaunchInfo.Data.Host.LocalShadowOffsetEnd) != UR_RESULT_SUCCESS) { - getContext()->logger.warning( - "Failed to allocate shadow memory for local " - "memory, maybe the number of workgroup ({}) is too " - "large", - NumWG); - getContext()->logger.warning("Skip checking local memory of kernel <{}>", - GetKernelName(Kernel)); + URLOG_CTX(WARN, + "Failed to allocate shadow memory for local memory, " + "maybe the number of workgroup ({}) is too large", + NumWG); + URLOG_CTX(WARN, "Skip checking local memory of kernel <{}>", + GetKernelName(Kernel)); } else { - getContext()->logger.info( - "ShadowMemory(Local, WorkGroup{}, {} - {})", NumWG, - (void *)LaunchInfo.Data.Host.LocalShadowOffset, - (void *)LaunchInfo.Data.Host.LocalShadowOffsetEnd); + URLOG_CTX(INFO, "ShadowMemory(Local, WorkGroup{}, {} - {})", NumWG, + (void *)LaunchInfo.Data.Host.LocalShadowOffset, + (void *)LaunchInfo.Data.Host.LocalShadowOffsetEnd); } } @@ -839,18 +837,16 @@ ur_result_t AsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocPrivateShadow( Queue, NumWG, LaunchInfo.Data.Host.PrivateShadowOffset, LaunchInfo.Data.Host.PrivateShadowOffsetEnd) != UR_RESULT_SUCCESS) { - getContext()->logger.warning( - "Failed to allocate shadow memory for private " - "memory, maybe the number of workgroup ({}) is too " - "large", - NumWG); - getContext()->logger.warning( - "Skip checking private memory of kernel <{}>", GetKernelName(Kernel)); + URLOG_CTX(WARN, + "Failed to allocate shadow memory for private memory, " + "maybe the number of workgroup ({}) is too large", + NumWG); + URLOG_CTX(WARN, "Skip checking private memory of kernel <{}>", + GetKernelName(Kernel)); } else { - getContext()->logger.info( - "ShadowMemory(Private, WorkGroup{}, {} - {})", NumWG, - (void *)LaunchInfo.Data.Host.PrivateShadowOffset, - (void *)LaunchInfo.Data.Host.PrivateShadowOffsetEnd); + URLOG_CTX(INFO, "ShadowMemory(Private, WorkGroup{}, {} - {})", NumWG, + (void *)LaunchInfo.Data.Host.PrivateShadowOffset, + (void *)LaunchInfo.Data.Host.PrivateShadowOffsetEnd); } } @@ -859,9 +855,8 @@ ur_result_t AsanInterceptor::prepareLaunch( std::vector LocalArgsInfo; for (auto [ArgIndex, ArgInfo] : KernelInfo.LocalArgs) { LocalArgsInfo.push_back(ArgInfo); - getContext()->logger.debug( - "local_args (argIndex={}, size={}, sizeWithRZ={})", ArgIndex, - ArgInfo.Size, ArgInfo.SizeWithRedZone); + URLOG_CTX(DEBUG, "local_args (argIndex={}, size={}, sizeWithRZ={})", + ArgIndex, ArgInfo.Size, ArgInfo.SizeWithRedZone); } UR_CALL(LaunchInfo.Data.importLocalArgsInfo(Queue, LocalArgsInfo)); } @@ -869,7 +864,8 @@ ur_result_t AsanInterceptor::prepareLaunch( // sync asan runtime data to device side UR_CALL(LaunchInfo.Data.syncToDevice(Queue)); - getContext()->logger.info( + URLOG_CTX( + INFO, "LaunchInfo {} (device={}, debug={}, numLocalArgs={}, localArgs={})", (void *)LaunchInfo.Data.getDevicePtr(), ToString(LaunchInfo.Data.Host.DeviceTy), LaunchInfo.Data.Host.Debug, @@ -947,10 +943,10 @@ ur_usm_pool_handle_t ContextInfo::getUSMPool() { getContext()->urDdiTable.USM.pfnPoolCreate(Handle, &Desc, &USMPool); if (URes != UR_RESULT_SUCCESS && URes != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) { - getContext()->logger.warning( - "Failed to create USM pool, the memory overhead " - "may increase: {}", - URes); + URLOG_CTX(WARN, + "Failed to create USM pool, the memory overhead " + "may increase: {}", + URes); } }); return USMPool; diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp index 53aac416f256..a09a9ad03a2f 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp @@ -185,8 +185,8 @@ struct AsanRuntimeDataWrapper { Context, Device, nullptr, nullptr, sizeof(AsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error( - "Failed to alloc device usm for asan runtime data: {}", Result); + URLOG_CTX(ERR, "Failed to alloc device usm for asan runtime data: {}", + Result); } } return DevicePtr; diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_report.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_report.cpp index 2f294f77faf2..54de7ac53c62 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_report.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_report.cpp @@ -26,13 +26,13 @@ namespace asan { namespace { void PrintAllocateInfo(uptr Addr, const AllocInfo *AI) { - getContext()->logger.always("{} is located inside of {} region [{}, {})", - (void *)Addr, ToString(AI->Type), - (void *)AI->UserBegin, (void *)AI->UserEnd); - getContext()->logger.always("allocated here:"); + URLOG_CTX_ALWAYS("{} is located inside of {} region [{}, {})", (void *)Addr, + ToString(AI->Type), (void *)AI->UserBegin, + (void *)AI->UserEnd); + URLOG_CTX_ALWAYS("allocated here:"); AI->AllocStack.print(); if (AI->IsReleased) { - getContext()->logger.always("freed here:"); + URLOG_CTX_ALWAYS("freed here:"); AI->ReleaseStack.print(); } } @@ -41,13 +41,12 @@ void PrintAllocateInfo(uptr Addr, const AllocInfo *AI) { void ReportBadFree(uptr Addr, const StackTrace &stack, const std::shared_ptr &AI) { - getContext()->logger.always( - "\n====ERROR: DeviceSanitizer: bad-free on address {}", (void *)Addr); + URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: bad-free on address {}", + (void *)Addr); stack.print(); if (!AI) { - getContext()->logger.always("{} may be allocated on Host Memory", - (void *)Addr); + URLOG_CTX_ALWAYS("{} may be allocated on Host Memory", (void *)Addr); } else { assert(!AI->IsReleased && "Chunk must be not released"); PrintAllocateInfo(Addr, AI.get()); @@ -56,8 +55,8 @@ void ReportBadFree(uptr Addr, const StackTrace &stack, void ReportBadContext(uptr Addr, const StackTrace &stack, const std::shared_ptr &AI) { - getContext()->logger.always( - "\n====ERROR: DeviceSanitizer: bad-context on address {}", (void *)Addr); + URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: bad-context on address {}", + (void *)Addr); stack.print(); PrintAllocateInfo(Addr, AI.get()); @@ -65,32 +64,30 @@ void ReportBadContext(uptr Addr, const StackTrace &stack, void ReportDoubleFree(uptr Addr, const StackTrace &Stack, const std::shared_ptr &AI) { - getContext()->logger.always( - "\n====ERROR: DeviceSanitizer: double-free on address {}", (void *)Addr); + URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: double-free on address {}", + (void *)Addr); Stack.print(); - getContext()->logger.always("{} is located inside of {} region [{}, {})", - (void *)Addr, ToString(AI->Type), - (void *)AI->UserBegin, (void *)AI->UserEnd); - getContext()->logger.always("freed here:"); + URLOG_CTX_ALWAYS("{} is located inside of {} region [{}, {})", (void *)Addr, + ToString(AI->Type), (void *)AI->UserBegin, + (void *)AI->UserEnd); + URLOG_CTX_ALWAYS("freed here:"); AI->ReleaseStack.print(); - getContext()->logger.always("previously allocated here:"); + URLOG_CTX_ALWAYS("previously allocated here:"); AI->AllocStack.print(); } void ReportMemoryLeak(const std::shared_ptr &AI) { - getContext()->logger.always( - "\n====ERROR: DeviceSanitizer: detected memory leaks of {}", - ToString(AI->Type)); - getContext()->logger.always("Direct leak of {} byte(s) at {} allocated from:", - AI->UserEnd - AI->UserBegin, - (void *)AI->UserBegin); + URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: detected memory leaks of {}", + ToString(AI->Type)); + URLOG_CTX_ALWAYS("Direct leak of {} byte(s) at {} allocated from:", + AI->UserEnd - AI->UserBegin, (void *)AI->UserBegin); AI->AllocStack.print(); } void ReportFatalError(const AsanErrorReport &Report) { - getContext()->logger.always("\n====ERROR: DeviceSanitizer: {}", - ToString(Report.ErrorTy)); + URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: {}", + ToString(Report.ErrorTy)); } void ReportGenericError(const AsanErrorReport &Report, @@ -102,16 +99,15 @@ void ReportGenericError(const AsanErrorReport &Report, // Try to demangle the kernel name KernelName = DemangleName(KernelName); - getContext()->logger.always( - "\n====ERROR: DeviceSanitizer: {} on {} ({})", ToString(Report.ErrorTy), - ToString(Report.MemoryTy), (void *)Report.Address); - getContext()->logger.always( - "{} of size {} at kernel <{}> LID({}, {}, {}) GID({}, " - "{}, {})", + URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: {} on {} ({})", + ToString(Report.ErrorTy), ToString(Report.MemoryTy), + (void *)Report.Address); + URLOG_CTX_ALWAYS( + "{} of size {} at kernel <{}> LID({}, {}, {}) GID({}, {}, {})", Report.IsWrite ? "WRITE" : "READ", Report.AccessSize, KernelName.c_str(), Report.LID0, Report.LID1, Report.LID2, Report.GID0, Report.GID1, Report.GID2); - getContext()->logger.always(" #0 {} {}:{}", Func, File, Report.Line); + URLOG_CTX_ALWAYS(" #0 {} {}:{}", Func, File, Report.Line); } void ReportUseAfterFree(const AsanErrorReport &Report, @@ -124,30 +120,28 @@ void ReportUseAfterFree(const AsanErrorReport &Report, // Try to demangle the kernel name KernelName = DemangleName(KernelName); - getContext()->logger.always("\n====ERROR: DeviceSanitizer: {} on address {}", - ToString(Report.ErrorTy), (void *)Report.Address); - getContext()->logger.always( - "{} of size {} at kernel <{}> LID({}, {}, {}) GID({}, " - "{}, {})", + URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: {} on address {}", + ToString(Report.ErrorTy), (void *)Report.Address); + URLOG_CTX_ALWAYS( + "{} of size {} at kernel <{}> LID({}, {}, {}) GID({}, {}, {})", Report.IsWrite ? "WRITE" : "READ", Report.AccessSize, KernelName.c_str(), Report.LID0, Report.LID1, Report.LID2, Report.GID0, Report.GID1, Report.GID2); - getContext()->logger.always(" #0 {} {}:{}", Func, File, Report.Line); - getContext()->logger.always(""); + URLOG_CTX_ALWAYS(" #0 {} {}:{}", Func, File, Report.Line); + URLOG_CTX_ALWAYS(""); if (getContext()->Options.MaxQuarantineSizeMB > 0) { auto AllocInfoItOp = getAsanInterceptor()->findAllocInfoByAddress(Report.Address); if (!AllocInfoItOp) { - getContext()->logger.always("Failed to find which chunck {} is allocated", - (void *)Report.Address); + URLOG_CTX_ALWAYS("Failed to find which chunck {} is allocated", + (void *)Report.Address); } else { auto &AllocInfo = (*AllocInfoItOp)->second; if (AllocInfo->Context != Context) { - getContext()->logger.always( - "Failed to find which chunck {} is allocated", - (void *)Report.Address); + URLOG_CTX_ALWAYS("Failed to find which chunck {} is allocated", + (void *)Report.Address); } assert(AllocInfo->IsReleased && "It must be released since it's use-after-free"); @@ -155,7 +149,7 @@ void ReportUseAfterFree(const AsanErrorReport &Report, PrintAllocateInfo(Report.Address, AllocInfo.get()); } } else { - getContext()->logger.always( + URLOG_CTX_ALWAYS( "Please enable quarantine to get more information like memory " "chunck's kind and where the chunck was allocated and released."); } @@ -164,40 +158,37 @@ void ReportUseAfterFree(const AsanErrorReport &Report, void ReportInvalidKernelArgument(ur_kernel_handle_t Kernel, uint32_t ArgIndex, uptr Addr, const ValidateUSMResult &VR, StackTrace Stack) { - getContext()->logger.always("\n====ERROR: DeviceSanitizer: " - "invalid-argument on kernel <{}>", - DemangleName(GetKernelName(Kernel))); + URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: " + "invalid-argument on kernel <{}>", + DemangleName(GetKernelName(Kernel))); Stack.print(); auto &AI = VR.AI; ArgIndex = ArgIndex + 1; switch (VR.Type) { case ValidateUSMResult::MAYBE_HOST_POINTER: - getContext()->logger.always("The {}th argument {} is not a USM pointer", - ArgIndex, (void *)Addr); + URLOG_CTX_ALWAYS("The {}th argument {} is not a USM pointer", ArgIndex, + (void *)Addr); break; case ValidateUSMResult::RELEASED_POINTER: - getContext()->logger.always( - "The {}th argument {} is a released USM pointer", ArgIndex + 1, - (void *)Addr); + URLOG_CTX_ALWAYS("The {}th argument {} is a released USM pointer", + ArgIndex + 1, (void *)Addr); PrintAllocateInfo(Addr, AI.get()); break; case ValidateUSMResult::BAD_CONTEXT: - getContext()->logger.always( - "The {}th argument {} is allocated in other context", ArgIndex + 1, - (void *)Addr); + URLOG_CTX_ALWAYS("The {}th argument {} is allocated in other context", + ArgIndex + 1, (void *)Addr); PrintAllocateInfo(Addr, AI.get()); break; case ValidateUSMResult::BAD_DEVICE: - getContext()->logger.always( - "The {}th argument {} is allocated in other device", ArgIndex + 1, - (void *)Addr); + URLOG_CTX_ALWAYS("The {}th argument {} is allocated in other device", + ArgIndex + 1, (void *)Addr); PrintAllocateInfo(Addr, AI.get()); break; case ValidateUSMResult::OUT_OF_BOUNDS: - getContext()->logger.always( + URLOG_CTX_ALWAYS( "The {}th argument {} is located outside of its region [{}, {})", ArgIndex + 1, (void *)Addr, (void *)AI->UserBegin, (void *)AI->UserEnd); - getContext()->logger.always("allocated here:"); + URLOG_CTX_ALWAYS("allocated here:"); AI->AllocStack.print(); break; default: diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp index e3c77989a189..79b68a93564a 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp @@ -36,7 +36,7 @@ std::shared_ptr GetShadowMemory(ur_context_handle_t Context, std::make_shared(Context, Device); return ShadowDG2; } else { - getContext()->logger.error("Unsupport device type"); + URLOG_CTX(ERR, "Unsupport device type"); return nullptr; } } @@ -57,8 +57,7 @@ ur_result_t ShadowMemoryCPU::Setup() { auto URes = EnqueuePoisonShadow({}, 0, NullptrRedzoneSize, kNullPointerRedzoneMagic); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("EnqueuePoisonShadow(NullPointerRZ): {}", - URes); + URLOG_CTX(ERR, "EnqueuePoisonShadow(NullPointerRZ): {}", URes); return URes; } return URes; @@ -92,9 +91,9 @@ ur_result_t ShadowMemoryCPU::EnqueuePoisonShadow(ur_queue_handle_t, uptr Ptr, uptr ShadowBegin = MemToShadow(Ptr); uptr ShadowEnd = MemToShadow(Ptr + Size - 1); assert(ShadowBegin <= ShadowEnd); - getContext()->logger.debug("EnqueuePoisonShadow(addr={}, count={}, value={})", - (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, - (void *)(size_t)Value); + URLOG_CTX(DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={})", + (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, + (void *)(size_t)Value); memset((void *)ShadowBegin, Value, ShadowEnd - ShadowBegin + 1); return UR_RESULT_SUCCESS; @@ -115,9 +114,8 @@ ur_result_t ShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error( - "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, - Result); + URLOG_CTX(ERR, "Shadow memory reserved failed with size {}: {}", + (void *)ShadowSize, Result); return Result; } ShadowEnd = ShadowBegin + ShadowSize; @@ -132,8 +130,7 @@ ur_result_t ShadowMemoryGPU::Setup() { Result = EnqueuePoisonShadow(Queue, 0, NullptrRedzoneSize, kNullPointerRedzoneMagic); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error("EnqueuePoisonShadow(NullPointerRZ): {}", - Result); + URLOG_CTX(ERR, "EnqueuePoisonShadow(NullPointerRZ): {}", Result); return Result; } return Result; @@ -203,7 +200,7 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, &Desc, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("urPhysicalMemCreate(): {}", URes); + URLOG_CTX(ERR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -211,19 +208,18 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("urVirtualMemMap({}, {}): {}", - (void *)MappedPtr, PageSize, URes); + URLOG_CTX(ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, + PageSize, URes); return URes; } - getContext()->logger.debug("urVirtualMemMap: {} ~ {}", - (void *)MappedPtr, - (void *)(MappedPtr + PageSize - 1)); + URLOG_CTX(DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, + (void *)(MappedPtr + PageSize - 1)); // Initialize to zero URes = EnqueueUSMBlockingSet(Queue, (void *)MappedPtr, 0, PageSize); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("EnqueueUSMBlockingSet(): {}", URes); + URLOG_CTX(ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } @@ -234,12 +230,11 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, auto URes = EnqueueUSMBlockingSet(Queue, (void *)ShadowBegin, Value, ShadowEnd - ShadowBegin + 1); - getContext()->logger.debug( - "EnqueuePoisonShadow (addr={}, count={}, value={}): {}", - (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value, - URes); + URLOG_CTX(DEBUG, "EnqueuePoisonShadow (addr={}, count={}, value={}): {}", + (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, + (void *)(size_t)Value, URes); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("EnqueueUSMBlockingSet(): {}", URes); + URLOG_CTX(ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp index a149245f345f..29b81e90894b 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp @@ -46,23 +46,22 @@ struct AsanStats { }; void AsanStats::Print(ur_context_handle_t Context) { - getContext()->logger.always("Stats: Context {}", (void *)Context); - getContext()->logger.always("Stats: peak memory overhead: {}%", - Overhead * 100); + URLOG_CTX_ALWAYS("Stats: Context {}", (void *)Context); + URLOG_CTX_ALWAYS("Stats: peak memory overhead: {}%", Overhead * 100); } void AsanStats::UpdateUSMMalloced(uptr MallocedSize, uptr RedzoneSize) { UsmMalloced += MallocedSize; UsmMallocedRedzones += RedzoneSize; - getContext()->logger.debug( - "Stats: UpdateUSMMalloced(UsmMalloced={}, UsmMallocedRedzones={})", - UsmMalloced, UsmMallocedRedzones); + URLOG_CTX(DEBUG, + "Stats: UpdateUSMMalloced(UsmMalloced={}, UsmMallocedRedzones={})", + UsmMalloced, UsmMallocedRedzones); UpdateOverhead(); } void AsanStats::UpdateUSMFreed(uptr FreedSize) { UsmFreed += FreedSize; - getContext()->logger.debug("Stats: UpdateUSMFreed(UsmFreed={})", UsmFreed); + URLOG_CTX(DEBUG, "Stats: UpdateUSMFreed(UsmFreed={})", UsmFreed); } void AsanStats::UpdateUSMRealFreed(uptr FreedSize, uptr RedzoneSize) { @@ -71,23 +70,23 @@ void AsanStats::UpdateUSMRealFreed(uptr FreedSize, uptr RedzoneSize) { if (getContext()->Options.MaxQuarantineSizeMB) { UsmFreed -= FreedSize; } - getContext()->logger.debug( - "Stats: UpdateUSMRealFreed(UsmMalloced={}, UsmMallocedRedzones={})", - UsmMalloced, UsmMallocedRedzones); + URLOG_CTX(DEBUG, + "Stats: UpdateUSMRealFreed(UsmMalloced={}, UsmMallocedRedzones={})", + UsmMalloced, UsmMallocedRedzones); UpdateOverhead(); } void AsanStats::UpdateShadowMalloced(uptr ShadowSize) { ShadowMalloced += ShadowSize; - getContext()->logger.debug("Stats: UpdateShadowMalloced(ShadowMalloced={})", - ShadowMalloced); + URLOG_CTX(DEBUG, "Stats: UpdateShadowMalloced(ShadowMalloced={})", + ShadowMalloced); UpdateOverhead(); } void AsanStats::UpdateShadowFreed(uptr ShadowSize) { ShadowMalloced -= ShadowSize; - getContext()->logger.debug("Stats: UpdateShadowFreed(ShadowMalloced={})", - ShadowMalloced); + URLOG_CTX(DEBUG, "Stats: UpdateShadowFreed(ShadowMalloced={})", + ShadowMalloced); UpdateOverhead(); } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp index 56f81fdb967a..1976eac9ef0e 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp @@ -18,9 +18,8 @@ namespace ur_sanitizer_layer { namespace msan { void MsanAllocInfo::print() { - getContext()->logger.info("AllocInfo(Alloc=[{}-{}), AllocSize={})", - (void *)AllocBegin, - (void *)(AllocBegin + AllocSize), AllocSize); + URLOG_CTX(INFO, "AllocInfo(Alloc=[{}-{}), AllocSize={})", (void *)AllocBegin, + (void *)(AllocBegin + AllocSize), AllocSize); } } // namespace msan diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp index 8cd7b7308bab..6cdf5349edd0 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp @@ -137,8 +137,8 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::DEVICE_USM, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error( - "Failed to allocate {} bytes memory for buffer {}", Size, this); + URLOG_CTX(ERR, "Failed to allocate {} bytes memory for buffer {}", Size, + this); return URes; } @@ -147,9 +147,10 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to copy {} bytes data from host " - "pointer {} to buffer {}", - Size, HostPtr, this); + URLOG_CTX( + ERR, + "Failed to copy {} bytes data from host pointer {} to buffer {}", + Size, HostPtr, this); return URes; } @@ -179,9 +180,10 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.USM.pfnHostAlloc( Context, &USMDesc, Pool, Size, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to allocate {} bytes host " - "USM for buffer {} migration", - Size, this); + URLOG_CTX(ERR, + "Failed to allocate {} bytes host " + "USM for buffer {} migration", + Size, this); return URes; } } @@ -193,7 +195,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to migrate memory buffer data"); + URLOG_CTX(ERR, "Failed to migrate memory buffer data"); return URes; } } @@ -204,7 +206,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to migrate memory buffer data"); + URLOG_CTX(ERR, "Failed to migrate memory buffer data"); return URes; } } @@ -219,7 +221,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getContext()->urDdiTable.USM.pfnFree(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to free buffer handle {}", Ptr); + URLOG_CTX(ERR, "Failed to free buffer handle {}", Ptr); return URes; } } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp index 45f5586c7644..36179f6647c4 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp @@ -33,14 +33,14 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getMsanInterceptor()->insertDevice(hDevice, DI)); DI->Type = GetDeviceType(Context, hDevice); if (DI->Type == DeviceType::UNKNOWN) { - getContext()->logger.error("Unsupport device"); + URLOG_CTX(ERR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } - getContext()->logger.info( - "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", - (void *)DI->Handle, ToString(DI->Type), DI->IsSupportSharedSystemUSM); - getContext()->logger.info("Add {} into context {}", (void *)DI->Handle, - (void *)Context); + URLOG_CTX(INFO, "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", + (void *)DI->Handle, ToString(DI->Type), + DI->IsSupportSharedSystemUSM); + URLOG_CTX(INFO, "Add {} into context {}", (void *)DI->Handle, + (void *)Context); if (!DI->Shadow) { UR_CALL(DI->allocShadowMemory(Context)); } @@ -98,7 +98,7 @@ ur_result_t urUSMDeviceAlloc( size_t size, /// [out] pointer to USM device memory object void **ppMem) { - getContext()->logger.debug("==== urUSMDeviceAlloc"); + URLOG_CTX(DEBUG, "==== urUSMDeviceAlloc"); return getMsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -116,7 +116,7 @@ ur_result_t UR_APICALL urUSMHostAlloc( size, ///< [in] size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM host memory object ) { - getContext()->logger.debug("==== urUSMHostAlloc"); + URLOG_CTX(DEBUG, "==== urUSMHostAlloc"); return getMsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -135,7 +135,7 @@ ur_result_t UR_APICALL urUSMSharedAlloc( size, ///< [in] size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM shared memory object ) { - getContext()->logger.debug("==== urUSMSharedAlloc"); + URLOG_CTX(DEBUG, "==== urUSMSharedAlloc"); return getMsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -148,7 +148,7 @@ ur_result_t UR_APICALL urUSMFree( ur_context_handle_t hContext, /// [in] pointer to USM memory object void *pMem) { - getContext()->logger.debug("==== urUSMFree"); + URLOG_CTX(DEBUG, "==== urUSMFree"); return getMsanInterceptor()->releaseMemory(hContext, pMem); } @@ -169,7 +169,7 @@ ur_result_t urProgramCreateWithIL( auto pfnProgramCreateWithIL = getContext()->urDdiTable.Program.pfnCreateWithIL; - getContext()->logger.debug("==== urProgramCreateWithIL"); + URLOG_CTX(DEBUG, "==== urProgramCreateWithIL"); UR_CALL( pfnProgramCreateWithIL(hContext, pIL, length, pProperties, phProgram)); @@ -201,7 +201,7 @@ ur_result_t urProgramCreateWithBinary( auto pfnProgramCreateWithBinary = getContext()->urDdiTable.Program.pfnCreateWithBinary; - getContext()->logger.debug("==== urProgramCreateWithBinary"); + URLOG_CTX(DEBUG, "==== urProgramCreateWithBinary"); UR_CALL(pfnProgramCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, pProperties, phProgram)); @@ -224,7 +224,7 @@ ur_result_t urProgramCreateWithNativeHandle( auto pfnProgramCreateWithNativeHandle = getContext()->urDdiTable.Program.pfnCreateWithNativeHandle; - getContext()->logger.debug("==== urProgramCreateWithNativeHandle"); + URLOG_CTX(DEBUG, "==== urProgramCreateWithNativeHandle"); UR_CALL(pfnProgramCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram)); @@ -241,7 +241,7 @@ urProgramRetain(ur_program_handle_t hProgram) { auto pfnRetain = getContext()->urDdiTable.Program.pfnRetain; - getContext()->logger.debug("==== urProgramRetain"); + URLOG_CTX(DEBUG, "==== urProgramRetain"); UR_CALL(pfnRetain(hProgram)); @@ -263,7 +263,7 @@ ur_result_t urProgramBuild( const char *pOptions) { auto pfnProgramBuild = getContext()->urDdiTable.Program.pfnBuild; - getContext()->logger.debug("==== urProgramBuild"); + URLOG_CTX(DEBUG, "==== urProgramBuild"); UR_CALL(pfnProgramBuild(hContext, hProgram, pOptions)); @@ -285,7 +285,7 @@ ur_result_t urProgramBuildExp( const char *pOptions) { auto pfnBuildExp = getContext()->urDdiTable.ProgramExp.pfnBuildExp; - getContext()->logger.debug("==== urProgramBuildExp"); + URLOG_CTX(DEBUG, "==== urProgramBuildExp"); UR_CALL(pfnBuildExp(hProgram, numDevices, phDevices, pOptions)); UR_CALL(getMsanInterceptor()->registerProgram(hProgram)); @@ -308,7 +308,7 @@ ur_result_t urProgramLink( ur_program_handle_t *phProgram) { auto pfnProgramLink = getContext()->urDdiTable.Program.pfnLink; - getContext()->logger.debug("==== urProgramLink"); + URLOG_CTX(DEBUG, "==== urProgramLink"); UR_CALL(pfnProgramLink(hContext, count, phPrograms, pOptions, phProgram)); @@ -337,7 +337,7 @@ ur_result_t urProgramLinkExp( ur_program_handle_t *phProgram) { auto pfnProgramLinkExp = getContext()->urDdiTable.ProgramExp.pfnLinkExp; - getContext()->logger.debug("==== urProgramLinkExp"); + URLOG_CTX(DEBUG, "==== urProgramLinkExp"); UR_CALL(pfnProgramLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram)); @@ -355,7 +355,7 @@ ur_result_t urProgramRelease( ur_program_handle_t hProgram) { auto pfnProgramRelease = getContext()->urDdiTable.Program.pfnRelease; - getContext()->logger.debug("==== urProgramRelease"); + URLOG_CTX(DEBUG, "==== urProgramRelease"); UR_CALL(pfnProgramRelease(hProgram)); @@ -403,7 +403,7 @@ ur_result_t urEnqueueKernelLaunch( ur_event_handle_t *phEvent) { auto pfnKernelLaunch = getContext()->urDdiTable.Enqueue.pfnKernelLaunch; - getContext()->logger.debug("==== urEnqueueKernelLaunch"); + URLOG_CTX(DEBUG, "==== urEnqueueKernelLaunch"); USMLaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue), pGlobalWorkSize, pLocalWorkSize, pGlobalWorkOffset, @@ -443,7 +443,7 @@ ur_result_t urContextCreate( ur_context_handle_t *phContext) { auto pfnCreate = getContext()->urDdiTable.Context.pfnCreate; - getContext()->logger.debug("==== urContextCreate"); + URLOG_CTX(DEBUG, "==== urContextCreate"); ur_result_t result = pfnCreate(numDevices, phDevices, pProperties, phContext); @@ -471,7 +471,7 @@ ur_result_t urContextCreateWithNativeHandle( auto pfnCreateWithNativeHandle = getContext()->urDdiTable.Context.pfnCreateWithNativeHandle; - getContext()->logger.debug("==== urContextCreateWithNativeHandle"); + URLOG_CTX(DEBUG, "==== urContextCreateWithNativeHandle"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -491,7 +491,7 @@ ur_result_t urContextRetain( ur_context_handle_t hContext) { auto pfnRetain = getContext()->urDdiTable.Context.pfnRetain; - getContext()->logger.debug("==== urContextRetain"); + URLOG_CTX(DEBUG, "==== urContextRetain"); UR_CALL(pfnRetain(hContext)); @@ -509,7 +509,7 @@ ur_result_t urContextRelease( ur_context_handle_t hContext) { auto pfnRelease = getContext()->urDdiTable.Context.pfnRelease; - getContext()->logger.debug("==== urContextRelease"); + URLOG_CTX(DEBUG, "==== urContextRelease"); UR_CALL(pfnRelease(hContext)); @@ -539,7 +539,7 @@ ur_result_t urMemBufferCreate( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - getContext()->logger.debug("==== urMemBufferCreate"); + URLOG_CTX(DEBUG, "==== urMemBufferCreate"); void *Host = nullptr; if (pProperties) { @@ -595,7 +595,7 @@ ur_result_t urMemGetInfo( size_t *pPropSizeRet) { auto pfnGetInfo = getContext()->urDdiTable.Mem.pfnGetInfo; - getContext()->logger.debug("==== urMemGetInfo"); + URLOG_CTX(DEBUG, "==== urMemGetInfo"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMemory)) { UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); @@ -624,7 +624,7 @@ ur_result_t urMemRetain( ur_mem_handle_t hMem) { auto pfnRetain = getContext()->urDdiTable.Mem.pfnRetain; - getContext()->logger.debug("==== urMemRetain"); + URLOG_CTX(DEBUG, "==== urMemRetain"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { MemBuffer->RefCount++; @@ -642,7 +642,7 @@ ur_result_t urMemRelease( ur_mem_handle_t hMem) { auto pfnRelease = getContext()->urDdiTable.Mem.pfnRelease; - getContext()->logger.debug("==== urMemRelease"); + URLOG_CTX(DEBUG, "==== urMemRelease"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { if (--MemBuffer->RefCount != 0) { @@ -673,7 +673,7 @@ ur_result_t urMemBufferPartition( ur_mem_handle_t *phMem) { auto pfnBufferPartition = getContext()->urDdiTable.Mem.pfnBufferPartition; - getContext()->logger.debug("==== urMemBufferPartition"); + URLOG_CTX(DEBUG, "==== urMemBufferPartition"); if (auto ParentBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { @@ -700,7 +700,7 @@ ur_result_t urMemGetNativeHandle( ur_native_handle_t *phNativeMem) { auto pfnGetNativeHandle = getContext()->urDdiTable.Mem.pfnGetNativeHandle; - getContext()->logger.debug("==== urMemGetNativeHandle"); + URLOG_CTX(DEBUG, "==== urMemGetNativeHandle"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { char *Handle = nullptr; @@ -740,7 +740,7 @@ ur_result_t urEnqueueMemBufferRead( ur_event_handle_t *phEvent) { auto pfnMemBufferRead = getContext()->urDdiTable.Enqueue.pfnMemBufferRead; - getContext()->logger.debug("==== urEnqueueMemBufferRead"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferRead"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -784,7 +784,7 @@ ur_result_t urEnqueueMemBufferWrite( ur_event_handle_t *phEvent) { auto pfnMemBufferWrite = getContext()->urDdiTable.Enqueue.pfnMemBufferWrite; - getContext()->logger.debug("==== urEnqueueMemBufferWrite"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWrite"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -861,7 +861,7 @@ ur_result_t urEnqueueMemBufferReadRect( auto pfnMemBufferReadRect = getContext()->urDdiTable.Enqueue.pfnMemBufferReadRect; - getContext()->logger.debug("==== urEnqueueMemBufferReadRect"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferReadRect"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *SrcHandle = nullptr; @@ -922,7 +922,7 @@ ur_result_t urEnqueueMemBufferWriteRect( auto pfnMemBufferWriteRect = getContext()->urDdiTable.Enqueue.pfnMemBufferWriteRect; - getContext()->logger.debug("==== urEnqueueMemBufferWriteRect"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWriteRect"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *DstHandle = nullptr; @@ -970,7 +970,7 @@ ur_result_t urEnqueueMemBufferCopy( ur_event_handle_t *phEvent) { auto pfnMemBufferCopy = getContext()->urDdiTable.Enqueue.pfnMemBufferCopy; - getContext()->logger.debug("==== urEnqueueMemBufferCopy"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopy"); auto SrcBuffer = getMsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getMsanInterceptor()->getMemBuffer(hBufferDst); @@ -1055,7 +1055,7 @@ ur_result_t urEnqueueMemBufferCopyRect( auto pfnMemBufferCopyRect = getContext()->urDdiTable.Enqueue.pfnMemBufferCopyRect; - getContext()->logger.debug("==== urEnqueueMemBufferCopyRect"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopyRect"); auto SrcBuffer = getMsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getMsanInterceptor()->getMemBuffer(hBufferDst); @@ -1112,7 +1112,7 @@ ur_result_t urEnqueueMemBufferFill( ur_event_handle_t *phEvent) { auto pfnMemBufferFill = getContext()->urDdiTable.Enqueue.pfnMemBufferFill; - getContext()->logger.debug("==== urEnqueueMemBufferFill"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferFill"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *Handle = nullptr; @@ -1179,7 +1179,7 @@ ur_result_t urEnqueueMemBufferMap( void **ppRetMap) { auto pfnMemBufferMap = getContext()->urDdiTable.Enqueue.pfnMemBufferMap; - getContext()->logger.debug("==== urEnqueueMemBufferMap"); + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferMap"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { @@ -1261,7 +1261,7 @@ ur_result_t urEnqueueMemUnmap( ur_event_handle_t *phEvent) { auto pfnMemUnmap = getContext()->urDdiTable.Enqueue.pfnMemUnmap; - getContext()->logger.debug("==== urEnqueueMemUnmap"); + URLOG_CTX(DEBUG, "==== urEnqueueMemUnmap"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { MemBuffer::Mapping Mapping{}; @@ -1302,7 +1302,7 @@ ur_result_t urKernelRetain( ur_kernel_handle_t hKernel) { auto pfnRetain = getContext()->urDdiTable.Kernel.pfnRetain; - getContext()->logger.debug("==== urKernelRetain"); + URLOG_CTX(DEBUG, "==== urKernelRetain"); UR_CALL(pfnRetain(hKernel)); @@ -1319,7 +1319,7 @@ ur_result_t urKernelRelease( ur_kernel_handle_t hKernel) { auto pfnRelease = getContext()->urDdiTable.Kernel.pfnRelease; - getContext()->logger.debug("==== urKernelRelease"); + URLOG_CTX(DEBUG, "==== urKernelRelease"); auto &KernelInfo = getMsanInterceptor()->getOrCreateKernelInfo(hKernel); if (--KernelInfo.RefCount == 0) { @@ -1345,7 +1345,7 @@ ur_result_t urKernelSetArgValue( const void *pArgValue) { auto pfnSetArgValue = getContext()->urDdiTable.Kernel.pfnSetArgValue; - getContext()->logger.debug("==== urKernelSetArgValue"); + URLOG_CTX(DEBUG, "==== urKernelSetArgValue"); std::shared_ptr MemBuffer; if (argSize == sizeof(ur_mem_handle_t) && @@ -1374,7 +1374,7 @@ ur_result_t urKernelSetArgMemObj( ur_mem_handle_t hArgValue) { auto pfnSetArgMemObj = getContext()->urDdiTable.Kernel.pfnSetArgMemObj; - getContext()->logger.debug("==== urKernelSetArgMemObj"); + URLOG_CTX(DEBUG, "==== urKernelSetArgMemObj"); std::shared_ptr MemBuffer; std::shared_ptr KernelInfo; @@ -1402,8 +1402,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( const ur_kernel_arg_local_properties_t *pProperties) { auto pfnSetArgLocal = getContext()->urDdiTable.Kernel.pfnSetArgLocal; - getContext()->logger.debug( - "==== urKernelSetArgLocal (argIndex={}, argSize={})", argIndex, argSize); + URLOG_CTX(DEBUG, "==== urKernelSetArgLocal (argIndex={}, argSize={})", + argIndex, argSize); { auto &KI = getMsanInterceptor()->getOrCreateKernelInfo(hKernel); @@ -1440,7 +1440,7 @@ ur_result_t UR_APICALL urEnqueueUSMFill( /// must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMFill = getContext()->urDdiTable.Enqueue.pfnUSMFill; - getContext()->logger.debug("==== urEnqueueUSMFill"); + URLOG_CTX(DEBUG, "==== urEnqueueUSMFill"); std::vector Events; ur_event_handle_t Event{}; @@ -1496,7 +1496,7 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy( /// must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMMemcpy = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy; - getContext()->logger.debug("==== pfnUSMMemcpy"); + URLOG_CTX(DEBUG, "==== pfnUSMMemcpy"); std::vector Events; ur_event_handle_t Event{}; @@ -1573,7 +1573,7 @@ ur_result_t UR_APICALL urEnqueueUSMFill2D( /// phEvent must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMFill2D = getContext()->urDdiTable.Enqueue.pfnUSMFill2D; - getContext()->logger.debug("==== urEnqueueUSMFill2D"); + URLOG_CTX(DEBUG, "==== urEnqueueUSMFill2D"); std::vector Events; ur_event_handle_t Event{}; @@ -1637,7 +1637,7 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( /// phEvent must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMMemcpy2D = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy2D; - getContext()->logger.debug("==== pfnUSMMemcpy2D"); + URLOG_CTX(DEBUG, "==== pfnUSMMemcpy2D"); std::vector Events; ur_event_handle_t Event{}; @@ -1877,7 +1877,7 @@ ur_result_t urCheckVersion(ur_api_version_t version) { ur_result_t initMsanDDITable(ur_dditable_t *dditable) { ur_result_t result = UR_RESULT_SUCCESS; - getContext()->logger.always("==== DeviceSanitizer: MSAN"); + URLOG_CTX_ALWAYS("==== DeviceSanitizer: MSAN"); if (UR_RESULT_SUCCESS == result) { result = ur_sanitizer_layer::msan::urCheckVersion(UR_API_VERSION_CURRENT); @@ -1927,7 +1927,7 @@ ur_result_t initMsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Initialize MSAN DDI table failed: {}", result); + URLOG_CTX(ERR, "Initialize MSAN DDI table failed: {}", result); } return result; diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp index a83ec5aea6ce..9da7a0394ede 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp @@ -123,7 +123,7 @@ ur_result_t MsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(Context, Device); if (!InternalQueue) { - getContext()->logger.error("Failed to create internal queue"); + URLOG_CTX(ERR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -157,13 +157,13 @@ ur_result_t MsanInterceptor::postLaunchKernel(ur_kernel_handle_t Kernel, ur_result_t MsanInterceptor::registerProgram(ur_program_handle_t Program) { ur_result_t Result = UR_RESULT_SUCCESS; - getContext()->logger.info("registerSpirKernels"); + URLOG_CTX(INFO, "registerSpirKernels"); Result = registerSpirKernels(Program); if (Result != UR_RESULT_SUCCESS) { return Result; } - getContext()->logger.info("registerDeviceGlobals"); + URLOG_CTX(INFO, "registerDeviceGlobals"); Result = registerDeviceGlobals(Program); if (Result != UR_RESULT_SUCCESS) { return Result; @@ -202,8 +202,8 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, &SKInfo[0], MetadataPtr, sizeof(SpirKernelInfo) * NumOfSpirKernel, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Can't read the value of <{}>: {}", - kSPIR_MsanSpirKernelMetadata, Result); + URLOG_CTX(ERR, "Can't read the value of <{}>: {}", + kSPIR_MsanSpirKernelMetadata, Result); return Result; } @@ -217,23 +217,24 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, KernelNameV.data(), (void *)SKI.KernelName, sizeof(char) * SKI.Size, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Can't read kernel name: {}", Result); + URLOG_CTX(ERR, "Can't read kernel name: {}", Result); return Result; } std::string KernelName = std::string(KernelNameV.begin(), KernelNameV.end()); - getContext()->logger.info("SpirKernel(name='{}', isInstrumented={}, " - "checkLocals={}, checkPrivates={})", - KernelName, true, (bool)SKI.CheckLocals, - (bool)SKI.CheckPrivates); + URLOG_CTX(INFO, + "SpirKernel(name='{}', isInstrumented={}, " + "checkLocals={}, checkPrivates={})", + KernelName, true, (bool)SKI.CheckLocals, + (bool)SKI.CheckPrivates); PI->KernelMetadataMap[KernelName] = ProgramInfo::KernelMetada{ (bool)SKI.CheckLocals, (bool)SKI.CheckPrivates}; } - getContext()->logger.info("Number of sanitized kernel: {}", - PI->KernelMetadataMap.size()); + URLOG_CTX(INFO, "Number of sanitized kernel: {}", + PI->KernelMetadataMap.size()); } return UR_RESULT_SUCCESS; @@ -257,7 +258,7 @@ MsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Device, Program, kSPIR_MsanDeviceGlobalMetadata, &MetadataSize, &MetadataPtr); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.info("No device globals"); + URLOG_CTX(INFO, "No device globals"); continue; } @@ -269,8 +270,8 @@ MsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Device Global[{}] Read Failed: {}", - kSPIR_MsanDeviceGlobalMetadata, Result); + URLOG_CTX(ERR, "Device Global[{}] Read Failed: {}", + kSPIR_MsanDeviceGlobalMetadata, Result); return Result; } @@ -436,8 +437,7 @@ ur_result_t MsanInterceptor::prepareLaunch( auto Result = getContext()->urDdiTable.Enqueue.pfnDeviceGlobalVariableWrite( Queue, Program, Name, false, Size, 0, Value, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to write device global \"{}\": {}", - Name, Result); + URLOG_CTX(ERR, "Failed to write device global \"{}\": {}", Name, Result); return Result; } return UR_RESULT_SUCCESS; @@ -445,11 +445,11 @@ ur_result_t MsanInterceptor::prepareLaunch( // Set membuffer arguments auto &KernelInfo = getOrCreateKernelInfo(Kernel); - getContext()->logger.info("KernelInfo {} (Name=<{}>, IsInstrumented={}, " - "IsCheckLocals={}, IsCheckPrivates={})", - (void *)Kernel, GetKernelName(Kernel), - KernelInfo.IsInstrumented, KernelInfo.IsCheckLocals, - KernelInfo.IsCheckPrivates); + URLOG_CTX(INFO, + "KernelInfo {} (Name=<{}>, IsInstrumented={}, " + "IsCheckLocals={}, IsCheckPrivates={})", + (void *)Kernel, GetKernelName(Kernel), KernelInfo.IsInstrumented, + KernelInfo.IsCheckLocals, KernelInfo.IsCheckPrivates); std::shared_lock Guard(KernelInfo.Mutex); @@ -459,9 +459,9 @@ ur_result_t MsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error( - "Failed to set buffer {} as the {} arg to kernel {}: {}", - ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); + URLOG_CTX(ERR, "Failed to set buffer {} as the {} arg to kernel {}: {}", + ur_cast(MemBuffer.get()), ArgIndex, Kernel, + URes); } } @@ -509,18 +509,16 @@ ur_result_t MsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocLocalShadow( Queue, NumWG, LaunchInfo.Data->LocalShadowOffset, LaunchInfo.Data->LocalShadowOffsetEnd) != UR_RESULT_SUCCESS) { - getContext()->logger.warning( - "Failed to allocate shadow memory for local " - "memory, maybe the number of workgroup ({}) is too " - "large", - NumWG); - getContext()->logger.warning("Skip checking local memory of kernel <{}> ", - GetKernelName(Kernel)); + URLOG_CTX(WARN, + "Failed to allocate shadow memory for local memory, " + "maybe the number of workgroup ({}) is too large", + NumWG); + URLOG_CTX(WARN, "Skip checking local memory of kernel <{}> ", + GetKernelName(Kernel)); } else { - getContext()->logger.debug("ShadowMemory(Local, WorkGroup={}, {} - {})", - NumWG, - (void *)LaunchInfo.Data->LocalShadowOffset, - (void *)LaunchInfo.Data->LocalShadowOffsetEnd); + URLOG_CTX(DEBUG, "ShadowMemory(Local, WorkGroup={}, {} - {})", NumWG, + (void *)LaunchInfo.Data->LocalShadowOffset, + (void *)LaunchInfo.Data->LocalShadowOffsetEnd); } } @@ -529,32 +527,31 @@ ur_result_t MsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocPrivateShadow( Queue, NumWG, LaunchInfo.Data->PrivateShadowOffset, LaunchInfo.Data->PrivateShadowOffsetEnd) != UR_RESULT_SUCCESS) { - getContext()->logger.warning( - "Failed to allocate shadow memory for private " - "memory, maybe the number of workgroup ({}) is too " - "large", - NumWG); - getContext()->logger.warning( - "Skip checking private memory of kernel <{}>", GetKernelName(Kernel)); + URLOG_CTX(WARN, + "Failed to allocate shadow memory for private memory, " + "maybe the number of workgroup ({}) is too large", + NumWG); + URLOG_CTX(WARN, "Skip checking private memory of kernel <{}>", + GetKernelName(Kernel)); } else { - getContext()->logger.debug( - "ShadowMemory(Private, WorkGroup={}, {} - {})", NumWG, - (void *)LaunchInfo.Data->PrivateShadowOffset, - (void *)LaunchInfo.Data->PrivateShadowOffsetEnd); + URLOG_CTX(DEBUG, "ShadowMemory(Private, WorkGroup={}, {} - {})", NumWG, + (void *)LaunchInfo.Data->PrivateShadowOffset, + (void *)LaunchInfo.Data->PrivateShadowOffsetEnd); } // Write local arguments info if (!KernelInfo.LocalArgs.empty()) { std::vector LocalArgsInfo; for (auto [ArgIndex, ArgInfo] : KernelInfo.LocalArgs) { LocalArgsInfo.push_back(ArgInfo); - getContext()->logger.debug("LocalArgs (argIndex={}, size={})", ArgIndex, - ArgInfo.Size); + URLOG_CTX(DEBUG, "LocalArgs (argIndex={}, size={})", ArgIndex, + ArgInfo.Size); } UR_CALL(LaunchInfo.importLocalArgsInfo(Queue, LocalArgsInfo)); } } - getContext()->logger.info( + URLOG_CTX( + INFO, "LaunchInfo {} (GlobalShadow={}, LocalShadow={}, PrivateShadow={}, " "CleanShadow={}, LocalArgs={}, NumLocalArgs={}, Device={}, Debug={})", (void *)LaunchInfo.Data, (void *)LaunchInfo.Data->GlobalShadowOffset, @@ -567,9 +564,10 @@ ur_result_t MsanInterceptor::prepareLaunch( ur_result_t URes = EnqueueWriteGlobal("__MsanLaunchInfo", &LaunchInfo.Data, sizeof(uptr)); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.info("EnqueueWriteGlobal(__MsanLaunchInfo) " - "failed, maybe empty kernel: {}", - URes); + URLOG_CTX(INFO, + "EnqueueWriteGlobal(__MsanLaunchInfo) " + "failed, maybe empty kernel: {}", + URes); } return UR_RESULT_SUCCESS; @@ -611,9 +609,8 @@ ur_result_t DeviceInfo::allocShadowMemory(ur_context_handle_t Context) { Shadow = GetMsanShadowMemory(Context, Handle, Type); assert(Shadow && "Failed to get shadow memory"); UR_CALL(Shadow->Setup()); - getContext()->logger.info("ShadowMemory(Global): {} - {}", - (void *)Shadow->ShadowBegin, - (void *)Shadow->ShadowEnd); + URLOG_CTX(INFO, "ShadowMemory(Global): {} - {}", (void *)Shadow->ShadowBegin, + (void *)Shadow->ShadowEnd); return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_report.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_report.cpp index c9c984fbc605..9500ed6a2338 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_report.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_report.cpp @@ -31,20 +31,20 @@ void ReportUsesUninitializedValue(const MsanErrorReport &Report, KernelName = DemangleName(KernelName); if (Report.Origin) { - getContext()->logger.always( + URLOG_CTX_ALWAYS( "====WARNING: DeviceSanitizer: use-of-uninitialized-value (shadow: {})", (void *)Report.Origin); } else { - getContext()->logger.always( + URLOG_CTX_ALWAYS( "====WARNING: DeviceSanitizer: use-of-uninitialized-value)"); } - getContext()->logger.always( - "use of size {} at kernel <{}> LID({}, {}, {}) GID({}, " - "{}, {})", - Report.AccessSize, KernelName.c_str(), Report.LID0, Report.LID1, - Report.LID2, Report.GID0, Report.GID1, Report.GID2); - getContext()->logger.always(" #0 {} {}:{}", Func, File, Report.Line); + URLOG_CTX_ALWAYS("use of size {} at kernel <{}> LID({}, {}, {}) GID({}, " + "{}, {})", + Report.AccessSize, KernelName.c_str(), Report.LID0, + Report.LID1, Report.LID2, Report.GID0, Report.GID1, + Report.GID2); + URLOG_CTX_ALWAYS(" #0 {} {}:{}", Func, File, Report.Line); } } // namespace msan diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp index ef54faeba18d..1beda4ecf489 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp @@ -45,7 +45,7 @@ GetMsanShadowMemory(ur_context_handle_t Context, ur_device_handle_t Device, std::make_shared(Context, Device); return ShadowDG2; } else { - getContext()->logger.error("Unsupport device type"); + URLOG_CTX(ERR, "Unsupport device type"); return nullptr; } } @@ -118,9 +118,9 @@ ur_result_t MsanShadowMemoryCPU::EnqueuePoisonShadow( const uptr ShadowBegin = MemToShadow(Ptr); const uptr ShadowEnd = MemToShadow(Ptr + Size - 1); assert(ShadowBegin <= ShadowEnd); - getContext()->logger.debug( - "EnqueuePoisonShadow(addr={}, count={}, value={})", (void *)ShadowBegin, - ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value); + URLOG_CTX(DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={})", + (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, + (void *)(size_t)Value); memset((void *)ShadowBegin, Value, ShadowEnd - ShadowBegin + 1); } @@ -146,9 +146,8 @@ ur_result_t MsanShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error( - "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, - Result); + URLOG_CTX(ERR, "Shadow memory reserved failed with size {}: {}", + (void *)ShadowSize, Result); return Result; } ShadowEnd = ShadowBegin + ShadowSize; @@ -192,7 +191,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, nullptr, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("urPhysicalMemCreate(): {}", URes); + URLOG_CTX(ERR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -200,20 +199,20 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("urVirtualMemMap({}, {}): {}", - (void *)MappedPtr, PageSize, URes); + URLOG_CTX(ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, + PageSize, URes); return URes; } - getContext()->logger.debug("urVirtualMemMap: {} ~ {}", (void *)MappedPtr, - (void *)(MappedPtr + PageSize - 1)); + URLOG_CTX(DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, + (void *)(MappedPtr + PageSize - 1)); // Initialize to zero URes = EnqueueUSMBlockingSet(Queue, (void *)MappedPtr, 0, PageSize, EventWaitList.size(), EventWaitList.data(), OutEvent); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("EnqueueUSMSet(): {}", URes); + URLOG_CTX(ERR, "EnqueueUSMSet(): {}", URes); return URes; } @@ -257,10 +256,9 @@ ur_result_t MsanShadowMemoryGPU::EnqueuePoisonShadow( ShadowEnd - ShadowBegin + 1, Events.size(), Events.data(), OutEvent); - getContext()->logger.debug( - "EnqueuePoisonShadow(addr={}, count={}, value={}): {}", - (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value, - Result); + URLOG_CTX(DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={}): {}", + (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, + (void *)(size_t)Value, Result); return Result; } @@ -285,9 +283,8 @@ MsanShadowMemoryGPU::ReleaseShadow(std::shared_ptr AI) { Context, (void *)MappedPtr, PageSize)); UR_CALL(getContext()->urDdiTable.PhysicalMem.pfnRelease( VirtualMemMaps[MappedPtr].first)); - getContext()->logger.debug("urVirtualMemUnmap: {} ~ {}", - (void *)MappedPtr, - (void *)(MappedPtr + PageSize - 1)); + URLOG_CTX(DEBUG, "urVirtualMemUnmap: {} ~ {}", (void *)MappedPtr, + (void *)(MappedPtr + PageSize - 1)); } } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp index e7e1b77da010..6013b7ae4f70 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp @@ -67,12 +67,12 @@ bool DontCoredumpRange(uptr Addr, uptr Size) { void *GetMemFunctionPointer(const char *FuncName) { void *handle = dlopen(LIBC_SO, RTLD_LAZY | RTLD_NOLOAD); if (!handle) { - getContext()->logger.error("Failed to dlopen {}", LIBC_SO); + URLOG_CTX(ERR, "Failed to dlopen {}", LIBC_SO); return nullptr; } auto ptr = dlsym(handle, FuncName); if (!ptr) { - getContext()->logger.error("Failed to get '{}' from {}", FuncName, LIBC_SO); + URLOG_CTX(ERR, "Failed to get '{}' from {}", FuncName, LIBC_SO); } return ptr; } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_common.hpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_common.hpp index 2501f769d2ef..54c524926615 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_common.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_common.hpp @@ -118,10 +118,10 @@ inline uint64_t GetSizeAndRedzoneSizeForLocal(uint64_t Size, #define UR_CALL(Call) \ { \ if (PrintTrace) \ - getContext()->logger.debug("UR ---> {}", #Call); \ + URLOG_CTX(DEBUG, "UR ---> {}", #Call); \ ur_result_t Result = (Call); \ if (PrintTrace) \ - getContext()->logger.debug("UR <--- {}({})", #Call, Result); \ + URLOG_CTX(DEBUG, "UR <--- {}({})", #Call, Result); \ if (Result != UR_RESULT_SUCCESS) \ return Result; \ } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp index 54f1ad5bcd2f..f09320dc6f59 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp @@ -28,7 +28,7 @@ void SanitizerOptions::Init(const std::string &EnvName, std::stringstream SS; SS << "[ERROR]: "; SS << e.what(); - Logger.always(SS.str().c_str()); + URLOG_ALWAYS_(Logger, SS.str().c_str()); die("Sanitizer failed to parse options.\n"); } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp index 6087c540be83..74b219ee31b4 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp @@ -72,7 +72,7 @@ struct OptionParser { SS << " \"" << S << "\""; } SS << "."; - Logger.error(SS.str().c_str()); + URLOG_(Logger, ERR, SS.str().c_str()); die("Sanitizer failed to parse options.\n"); } } @@ -93,22 +93,25 @@ struct OptionParser { uint64_t Value = std::stoul(ValueStr.c_str()); if (Value < Min) { - Logger.warning("The valid range of \"{}\" is [{}, {}]. " - "Setting to the minimum value {}.", - Name, Min, Max, Min); + URLOG_(Logger, WARN, + "The valid range of \"{}\" is [{}, {}]. " + "Setting to the minimum value {}.", + Name, Min, Max, Min); Result = Min; } else if (Value > Max) { - Logger.warning("The valid range of \"{}\" is [{}, {}]. " - "Setting to the maximum value {}.", - Name, Min, Max, Max); + URLOG_(Logger, WARN, + "The valid range of \"{}\" is [{}, {}]. " + "Setting to the maximum value {}.", + Name, Min, Max, Max); Result = Max; } else { Result = Value; } } catch (...) { - Logger.error("The valid range of \"{}\" is [{}, {}]. Failed " - "to parse the value \"{}\".", - Name, Min, Max, ValueStr); + URLOG_(Logger, ERR, + "The valid range of \"{}\" is [{}, {}]. Failed " + "to parse the value \"{}\".", + Name, Min, Max, ValueStr); die("Sanitizer failed to parse options.\n"); } } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_stacktrace.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_stacktrace.cpp index ab4e5e5a3233..cd2bf0b7b626 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_stacktrace.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_stacktrace.cpp @@ -82,7 +82,7 @@ SourceInfo ParseSymbolizerOutput(const std::string &Output) { void StackTrace::print() const { if (!stack.size()) { - getContext()->logger.always(" failed to acquire backtrace"); + URLOG_CTX_ALWAYS(" failed to acquire backtrace"); } unsigned index = 0; @@ -113,21 +113,19 @@ void StackTrace::print() const { std::string Result((char *)ResultVector.data()); SourceInfo SrcInfo = ParseSymbolizerOutput(Result); if (SrcInfo.file != "??") { - getContext()->logger.always(" #{} in {} {}:{}:{}", index, - SrcInfo.function, SrcInfo.file, - SrcInfo.line, SrcInfo.column); + URLOG_CTX_ALWAYS(" #{} in {} {}:{}:{}", index, SrcInfo.function, + SrcInfo.file, SrcInfo.line, SrcInfo.column); } else { - getContext()->logger.always(" #{} in {} ({}+{})", index, - SrcInfo.function, ModuleName, - (void *)Offset); + URLOG_CTX_ALWAYS(" #{} in {} ({}+{})", index, SrcInfo.function, + ModuleName, (void *)Offset); } } } else { - getContext()->logger.always(" #{} {}", index, BI); + URLOG_CTX_ALWAYS(" #{} {}", index, BI); } ++index; } - getContext()->logger.always(""); + URLOG_CTX_ALWAYS(""); free(BacktraceSymbols); } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp index c135be0bf724..1f8b40f27dec 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp @@ -22,16 +22,16 @@ ManagedQueue::ManagedQueue(ur_context_handle_t Context, [[maybe_unused]] auto Result = getContext()->urDdiTable.Queue.pfnCreate( Context, Device, nullptr, &Handle); assert(Result == UR_RESULT_SUCCESS && "Failed to create ManagedQueue"); - getContext()->logger.debug(">>> ManagedQueue {}", (void *)Handle); + URLOG_CTX(DEBUG, ">>> ManagedQueue {}", (void *)Handle); } ManagedQueue::~ManagedQueue() { - getContext()->logger.debug("<<< ~ManagedQueue {}", (void *)Handle); + URLOG_CTX(DEBUG, "<<< ~ManagedQueue {}", (void *)Handle); [[maybe_unused]] ur_result_t Result; Result = getContext()->urDdiTable.Queue.pfnFinish(Handle); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Failed to finish ManagedQueue: {}", Result); + URLOG_CTX(ERR, "Failed to finish ManagedQueue: {}", Result); } assert(Result == UR_RESULT_SUCCESS && "Failed to finish ManagedQueue"); Result = getContext()->urDdiTable.Queue.pfnRelease(Handle); @@ -149,7 +149,7 @@ DeviceType GetDeviceType(ur_context_handle_t Context, [[maybe_unused]] ur_result_t Result = getContext()->urDdiTable.USM.pfnDeviceAlloc(Context, Device, nullptr, nullptr, 4, (void **)&Ptr); - getContext()->logger.debug("GetDeviceType: {}", (void *)Ptr); + URLOG_CTX(DEBUG, "GetDeviceType: {}", (void *)Ptr); assert(Result == UR_RESULT_SUCCESS && "getDeviceType() failed at allocating device USM"); // FIXME: There's no API querying the address bits of device, so we guess it diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp index b71b750acc29..5123410aa6cb 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp @@ -31,7 +31,7 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getTsanInterceptor()->insertDevice(phDevices[i], DI)); DI->Type = GetDeviceType(Context, DI->Handle); if (DI->Type == DeviceType::UNKNOWN) { - getContext()->logger.error("Unsupport device"); + URLOG_CTX(ERR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } if (!DI->Shadow) @@ -54,7 +54,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( const ur_context_properties_t *pProperties, /// [out] pointer to handle of context object created ur_context_handle_t *phContext) { - getContext()->logger.debug("==== urContextCreate"); + URLOG_CTX(DEBUG, "==== urContextCreate"); UR_CALL(getContext()->urDdiTable.Context.pfnCreate(numDevices, phDevices, pProperties, phContext)); @@ -78,7 +78,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( const ur_context_native_properties_t *pProperties, /// [out] pointer to the handle of the context object created. ur_context_handle_t *phContext) { - getContext()->logger.debug("==== urContextCreateWithNativeHandle"); + URLOG_CTX(DEBUG, "==== urContextCreateWithNativeHandle"); UR_CALL(getContext()->urDdiTable.Context.pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext)); @@ -94,13 +94,13 @@ ur_result_t urContextRetain( /// [in] handle of the context to get a reference of. ur_context_handle_t hContext) { - getContext()->logger.debug("==== urContextRetain"); + URLOG_CTX(DEBUG, "==== urContextRetain"); UR_CALL(getContext()->urDdiTable.Context.pfnRetain(hContext)); auto ContextInfo = getTsanInterceptor()->getContextInfo(hContext); if (!ContextInfo) { - getContext()->logger.error("Invalid context"); + URLOG_CTX(ERR, "Invalid context"); return UR_RESULT_ERROR_INVALID_CONTEXT; } ContextInfo->RefCount++; @@ -113,13 +113,13 @@ ur_result_t urContextRetain( ur_result_t urContextRelease( /// [in] handle of the context to release. ur_context_handle_t hContext) { - getContext()->logger.debug("==== urContextRelease"); + URLOG_CTX(DEBUG, "==== urContextRelease"); UR_CALL(getContext()->urDdiTable.Context.pfnRelease(hContext)); auto ContextInfo = getTsanInterceptor()->getContextInfo(hContext); if (!ContextInfo) { - getContext()->logger.error("Invalid context"); + URLOG_CTX(ERR, "Invalid context"); return UR_RESULT_ERROR_INVALID_CONTEXT; } @@ -145,7 +145,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( size_t size, /// [out] pointer to USM device memory object void **ppMem) { - getContext()->logger.debug("==== urUSMDeviceAlloc"); + URLOG_CTX(DEBUG, "==== urUSMDeviceAlloc"); return getTsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -164,7 +164,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( size_t size, /// [out] pointer to USM host memory object void **ppMem) { - getContext()->logger.debug("==== urUSMHostAlloc"); + URLOG_CTX(DEBUG, "==== urUSMHostAlloc"); return getTsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -185,7 +185,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( size_t size, /// [out] pointer to USM shared memory object void **ppMem) { - getContext()->logger.debug("==== urUSMSharedAlloc"); + URLOG_CTX(DEBUG, "==== urUSMSharedAlloc"); return getTsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -223,7 +223,7 @@ ur_result_t urEnqueueKernelLaunch( /// [out][optional] return an event object that identifies this /// particular kernel execution instance. ur_event_handle_t *phEvent) { - getContext()->logger.debug("==== urEnqueueKernelLaunch"); + URLOG_CTX(DEBUG, "==== urEnqueueKernelLaunch"); LaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue)); @@ -352,7 +352,7 @@ __urdlllocal ur_result_t UR_APICALL urGetEnqueueProcAddrTable( ur_result_t initTsanDDITable(ur_dditable_t *dditable) { ur_result_t result = UR_RESULT_SUCCESS; - getContext()->logger.always("==== DeviceSanitizer: TSAN"); + URLOG_CTX_ALWAYS("==== DeviceSanitizer: TSAN"); if (UR_RESULT_SUCCESS == result) { result = ur_sanitizer_layer::tsan::urCheckVersion(UR_API_VERSION_CURRENT); @@ -374,7 +374,7 @@ ur_result_t initTsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Initialize TSAN DDI table failed: {}", result); + URLOG_CTX(ERR, "Initialize TSAN DDI table failed: {}", result); } return result; diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp index a37ebecb85fc..c9aa5aa5484e 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp @@ -33,8 +33,8 @@ TsanRuntimeData *TsanRuntimeDataWrapper::getDevicePtr() { Context, Device, nullptr, nullptr, sizeof(TsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error( - "Failed to alloc device usm for asan runtime data: {}", Result); + URLOG(ERR, "Failed to alloc device usm for asan runtime data: {}", + Result); } } return DevicePtr; @@ -63,9 +63,8 @@ ur_result_t DeviceInfo::allocShadowMemory() { Shadow = GetShadowMemory(ShadowContext, Handle, Type); assert(Shadow && "Failed to get shadow memory"); UR_CALL(Shadow->Setup()); - getContext()->logger.info("ShadowMemory(Global): {} - {}", - (void *)Shadow->ShadowBegin, - (void *)Shadow->ShadowEnd); + URLOG_CTX(INFO, "ShadowMemory(Global): {} - {}", (void *)Shadow->ShadowBegin, + (void *)Shadow->ShadowEnd); return UR_RESULT_SUCCESS; } @@ -163,7 +162,7 @@ ur_result_t TsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(CI->Handle, DI->Handle); if (!InternalQueue) { - getContext()->logger.error("Failed to create internal queue"); + URLOG_CTX(ERR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -211,9 +210,10 @@ ur_result_t TsanInterceptor::prepareLaunch(std::shared_ptr &, Queue, GetProgram(Kernel), "__TsanLaunchInfo", true, sizeof(LaunchInfoPtr), 0, &LaunchInfoPtr, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.info("EnqueueWriteGlobal(__TsanLaunchInfo) " - "failed, maybe empty kernel: {}", - URes); + URLOG_CTX(INFO, + "EnqueueWriteGlobal(__TsanLaunchInfo) " + "failed, maybe empty kernel: {}", + URes); } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_report.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_report.cpp index 759ae5451b27..cd7f76fd2c3c 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_report.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_report.cpp @@ -26,14 +26,14 @@ void ReportDataRace(const TsanErrorReport &Report, ur_kernel_handle_t Kernel) { // Try to demangle the kernel name KernelName = DemangleName(KernelName); - getContext()->logger.always("====WARNING: DeviceSanitizer: data race"); - getContext()->logger.always( + URLOG_CTX_ALWAYS("====WARNING: DeviceSanitizer: data race"); + URLOG_CTX_ALWAYS( "When {} of size {} at {} in kernel <{}> LID({}, {}, {}) GID({}, " "{}, {})", Report.Type & kAccessRead ? "read" : "write", Report.AccessSize, (void *)Report.Address, KernelName.c_str(), Report.LID0, Report.LID1, Report.LID2, Report.GID0, Report.GID1, Report.GID2); - getContext()->logger.always(" #0 {} {}:{}", Func, File, Report.Line); + URLOG_CTX_ALWAYS(" #0 {} {}:{}", Func, File, Report.Line); } } // namespace tsan diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp index fde2aa711dce..fed6903924c4 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp @@ -29,7 +29,7 @@ std::shared_ptr GetShadowMemory(ur_context_handle_t Context, } else if (Type == DeviceType::GPU_PVC) { return std::make_shared(Context, Device); } else { - getContext()->logger.error("Unsupport device type"); + URLOG_CTX(ERR, "Unsupport device type"); return nullptr; } } @@ -71,8 +71,8 @@ ur_result_t ShadowMemoryCPU::CleanShadow(ur_queue_handle_t, uptr Ptr, Size = RoundUpTo(Size, kShadowCell); RawShadow *Begin = MemToShadow(Ptr); - getContext()->logger.debug("CleanShadow(addr={}, count={})", (void *)Begin, - Size / kShadowCell); + URLOG_CTX(DEBUG, "CleanShadow(addr={}, count={})", (void *)Begin, + Size / kShadowCell); memset((void *)Begin, 0, Size / kShadowCell * kShadowCnt * kShadowSize); } return UR_RESULT_SUCCESS; @@ -91,8 +91,8 @@ ur_result_t ShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - getContext()->logger.error("Shadow memory reserved failed with size {}: {}", - (void *)ShadowSize, Result); + URLOG_CTX(ERR, "Shadow memory reserved failed with size {}: {}", + (void *)ShadowSize, Result); return Result; } ShadowEnd = ShadowBegin + ShadowSize; @@ -146,7 +146,7 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, &Desc, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("urPhysicalMemCreate(): {}", URes); + URLOG_CTX(ERR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -154,19 +154,18 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("urVirtualMemMap({}, {}): {}", - (void *)MappedPtr, PageSize, URes); + URLOG_CTX(ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, + PageSize, URes); return URes; } - getContext()->logger.debug("urVirtualMemMap: {} ~ {}", - (void *)MappedPtr, - (void *)(MappedPtr + PageSize - 1)); + URLOG_CTX(DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, + (void *)(MappedPtr + PageSize - 1)); // Initialize to zero URes = EnqueueUSMBlockingSet(Queue, (void *)MappedPtr, 0, PageSize); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("EnqueueUSMBlockingSet(): {}", URes); + URLOG_CTX(ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } @@ -178,12 +177,12 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, auto URes = EnqueueUSMBlockingSet( Queue, (void *)Begin, 0, Size / kShadowCell * kShadowCnt * kShadowSize); if (URes != UR_RESULT_SUCCESS) { - getContext()->logger.error("EnqueueUSMBlockingSet(): {}", URes); + URLOG_CTX(ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } - getContext()->logger.debug("CleanShadow(addr={}, count={})", (void *)Begin, - Size / kShadowCell); + URLOG_CTX(DEBUG, "CleanShadow(addr={}, count={})", (void *)Begin, + Size / kShadowCell); return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp b/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp index 2a92d367e145..a31b5cf249f4 100644 --- a/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp @@ -26,9 +26,8 @@ ur_result_t context_t::init(ur_dditable_t *dditable, bool tsanEnabled = enabledLayerNames.count("UR_LAYER_TSAN"); if ((asanEnabled + msanEnabled + tsanEnabled) >= 2) { - getContext()->logger.warning( - "Enabling ASAN or MSAN or TSAN at the same time is not " - "supported."); + URLOG(WARN, + "Enabling ASAN or MSAN or TSAN at the same time is not supported."); return UR_RESULT_SUCCESS; } else if (asanEnabled) { enabledType = SanitizerType::AddressSanitizer; diff --git a/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp b/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp index 0557496f9aa5..ac941397353a 100644 --- a/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp +++ b/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp @@ -42,7 +42,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGet( "urAdapterGet", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urAdapterGet\n"); + URLOG_(logger, INFO, " ---> urAdapterGet\n"); ur_result_t result = pfnAdapterGet(NumEntries, phAdapters, pNumAdapters); @@ -52,7 +52,8 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGet( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_GET, ¶ms); - logger.info(" <--- urAdapterGet({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urAdapterGet({}) -> {};\n", args_str.str(), + result); } return result; @@ -73,7 +74,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRelease( "urAdapterRelease", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urAdapterRelease\n"); + URLOG_(logger, INFO, " ---> urAdapterRelease\n"); ur_result_t result = pfnAdapterRelease(hAdapter); @@ -84,8 +85,8 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_RELEASE, ¶ms); - logger.info(" <--- urAdapterRelease({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urAdapterRelease({}) -> {};\n", + args_str.str(), result); } return result; @@ -106,7 +107,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain( "urAdapterRetain", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urAdapterRetain\n"); + URLOG_(logger, INFO, " ---> urAdapterRetain\n"); ur_result_t result = pfnAdapterRetain(hAdapter); @@ -117,7 +118,8 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_RETAIN, ¶ms); - logger.info(" <--- urAdapterRetain({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urAdapterRetain({}) -> {};\n", args_str.str(), + result); } return result; @@ -145,7 +147,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetLastError( UR_FUNCTION_ADAPTER_GET_LAST_ERROR, "urAdapterGetLastError", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urAdapterGetLastError\n"); + URLOG_(logger, INFO, " ---> urAdapterGetLastError\n"); ur_result_t result = pfnAdapterGetLastError(hAdapter, ppMessage, pError); @@ -156,8 +158,8 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetLastError( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ADAPTER_GET_LAST_ERROR, ¶ms); - logger.info(" <--- urAdapterGetLastError({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urAdapterGetLastError({}) -> {};\n", + args_str.str(), result); } return result; @@ -192,7 +194,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetInfo( "urAdapterGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urAdapterGetInfo\n"); + URLOG_(logger, INFO, " ---> urAdapterGetInfo\n"); ur_result_t result = pfnAdapterGetInfo(hAdapter, propName, propSize, pPropValue, pPropSizeRet); @@ -204,8 +206,8 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_GET_INFO, ¶ms); - logger.info(" <--- urAdapterGetInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urAdapterGetInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -240,7 +242,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGet( "urPlatformGet", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urPlatformGet\n"); + URLOG_(logger, INFO, " ---> urPlatformGet\n"); ur_result_t result = pfnGet(phAdapters, NumAdapters, NumEntries, phPlatforms, pNumPlatforms); @@ -252,7 +254,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGet( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PLATFORM_GET, ¶ms); - logger.info(" <--- urPlatformGet({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urPlatformGet({}) -> {};\n", args_str.str(), + result); } return result; @@ -287,7 +290,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetInfo( "urPlatformGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urPlatformGetInfo\n"); + URLOG_(logger, INFO, " ---> urPlatformGetInfo\n"); ur_result_t result = pfnGetInfo(hPlatform, propName, propSize, pPropValue, pPropSizeRet); @@ -299,8 +302,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PLATFORM_GET_INFO, ¶ms); - logger.info(" <--- urPlatformGetInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urPlatformGetInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -323,7 +326,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetApiVersion( UR_FUNCTION_PLATFORM_GET_API_VERSION, "urPlatformGetApiVersion", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urPlatformGetApiVersion\n"); + URLOG_(logger, INFO, " ---> urPlatformGetApiVersion\n"); ur_result_t result = pfnGetApiVersion(hPlatform, pVersion); @@ -335,8 +338,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetApiVersion( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_API_VERSION, ¶ms); - logger.info(" <--- urPlatformGetApiVersion({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urPlatformGetApiVersion({}) -> {};\n", + args_str.str(), result); } return result; @@ -362,7 +365,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle( "urPlatformGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urPlatformGetNativeHandle\n"); + URLOG_(logger, INFO, " ---> urPlatformGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hPlatform, phNativePlatform); @@ -374,8 +377,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urPlatformGetNativeHandle({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urPlatformGetNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -405,7 +408,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( "urPlatformCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urPlatformCreateWithNativeHandle\n"); + URLOG_(logger, INFO, " ---> urPlatformCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativePlatform, hAdapter, pProperties, phPlatform); @@ -418,8 +421,9 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_CREATE_WITH_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urPlatformCreateWithNativeHandle({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urPlatformCreateWithNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -448,7 +452,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption( "urPlatformGetBackendOption", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urPlatformGetBackendOption\n"); + URLOG_(logger, INFO, " ---> urPlatformGetBackendOption\n"); ur_result_t result = pfnGetBackendOption(hPlatform, pFrontendOption, ppPlatformOption); @@ -461,8 +465,8 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_BACKEND_OPTION, ¶ms); - logger.info(" <--- urPlatformGetBackendOption({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urPlatformGetBackendOption({}) -> {};\n", + args_str.str(), result); } return result; @@ -498,7 +502,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGet( "urDeviceGet", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urDeviceGet\n"); + URLOG_(logger, INFO, " ---> urDeviceGet\n"); ur_result_t result = pfnGet(hPlatform, DeviceType, NumEntries, phDevices, pNumDevices); @@ -509,7 +513,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGet( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_GET, ¶ms); - logger.info(" <--- urDeviceGet({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urDeviceGet({}) -> {};\n", args_str.str(), + result); } return result; @@ -545,7 +550,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( "urDeviceGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urDeviceGetInfo\n"); + URLOG_(logger, INFO, " ---> urDeviceGetInfo\n"); ur_result_t result = pfnGetInfo(hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -557,7 +562,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_GET_INFO, ¶ms); - logger.info(" <--- urDeviceGetInfo({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urDeviceGetInfo({}) -> {};\n", args_str.str(), + result); } return result; @@ -578,7 +584,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain( "urDeviceRetain", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urDeviceRetain\n"); + URLOG_(logger, INFO, " ---> urDeviceRetain\n"); ur_result_t result = pfnRetain(hDevice); @@ -589,7 +595,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_RETAIN, ¶ms); - logger.info(" <--- urDeviceRetain({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urDeviceRetain({}) -> {};\n", args_str.str(), + result); } return result; @@ -610,7 +617,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRelease( "urDeviceRelease", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urDeviceRelease\n"); + URLOG_(logger, INFO, " ---> urDeviceRelease\n"); ur_result_t result = pfnRelease(hDevice); @@ -621,7 +628,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_RELEASE, ¶ms); - logger.info(" <--- urDeviceRelease({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urDeviceRelease({}) -> {};\n", args_str.str(), + result); } return result; @@ -654,7 +662,7 @@ __urdlllocal ur_result_t UR_APICALL urDevicePartition( "urDevicePartition", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urDevicePartition\n"); + URLOG_(logger, INFO, " ---> urDevicePartition\n"); ur_result_t result = pfnPartition(hDevice, pProperties, NumDevices, phSubDevices, pNumDevicesRet); @@ -666,8 +674,8 @@ __urdlllocal ur_result_t UR_APICALL urDevicePartition( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_PARTITION, ¶ms); - logger.info(" <--- urDevicePartition({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urDevicePartition({}) -> {};\n", + args_str.str(), result); } return result; @@ -699,7 +707,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceSelectBinary( UR_FUNCTION_DEVICE_SELECT_BINARY, "urDeviceSelectBinary", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urDeviceSelectBinary\n"); + URLOG_(logger, INFO, " ---> urDeviceSelectBinary\n"); ur_result_t result = pfnSelectBinary(hDevice, pBinaries, NumBinaries, pSelectedBinary); @@ -711,8 +719,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceSelectBinary( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_SELECT_BINARY, ¶ms); - logger.info(" <--- urDeviceSelectBinary({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urDeviceSelectBinary({}) -> {};\n", + args_str.str(), result); } return result; @@ -735,7 +743,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( UR_FUNCTION_DEVICE_GET_NATIVE_HANDLE, "urDeviceGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urDeviceGetNativeHandle\n"); + URLOG_(logger, INFO, " ---> urDeviceGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hDevice, phNativeDevice); @@ -747,8 +755,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_GET_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urDeviceGetNativeHandle({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urDeviceGetNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -778,7 +786,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( "urDeviceCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urDeviceCreateWithNativeHandle\n"); + URLOG_(logger, INFO, " ---> urDeviceCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeDevice, hAdapter, pProperties, phDevice); @@ -791,8 +799,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urDeviceCreateWithNativeHandle({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urDeviceCreateWithNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -822,7 +830,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( "urDeviceGetGlobalTimestamps", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urDeviceGetGlobalTimestamps\n"); + URLOG_(logger, INFO, " ---> urDeviceGetGlobalTimestamps\n"); ur_result_t result = pfnGetGlobalTimestamps(hDevice, pDeviceTimestamp, pHostTimestamp); @@ -835,8 +843,8 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_GET_GLOBAL_TIMESTAMPS, ¶ms); - logger.info(" <--- urDeviceGetGlobalTimestamps({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urDeviceGetGlobalTimestamps({}) -> {};\n", + args_str.str(), result); } return result; @@ -864,7 +872,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( "urContextCreate", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urContextCreate\n"); + URLOG_(logger, INFO, " ---> urContextCreate\n"); ur_result_t result = pfnCreate(DeviceCount, phDevices, pProperties, phContext); @@ -876,7 +884,8 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_CREATE, ¶ms); - logger.info(" <--- urContextCreate({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urContextCreate({}) -> {};\n", args_str.str(), + result); } return result; @@ -897,7 +906,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( "urContextRetain", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urContextRetain\n"); + URLOG_(logger, INFO, " ---> urContextRetain\n"); ur_result_t result = pfnRetain(hContext); @@ -908,7 +917,8 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_RETAIN, ¶ms); - logger.info(" <--- urContextRetain({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urContextRetain({}) -> {};\n", args_str.str(), + result); } return result; @@ -929,7 +939,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( "urContextRelease", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urContextRelease\n"); + URLOG_(logger, INFO, " ---> urContextRelease\n"); ur_result_t result = pfnRelease(hContext); @@ -940,8 +950,8 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_RELEASE, ¶ms); - logger.info(" <--- urContextRelease({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urContextRelease({}) -> {};\n", + args_str.str(), result); } return result; @@ -977,7 +987,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo( "urContextGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urContextGetInfo\n"); + URLOG_(logger, INFO, " ---> urContextGetInfo\n"); ur_result_t result = pfnGetInfo(hContext, propName, propSize, pPropValue, pPropSizeRet); @@ -989,8 +999,8 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_GET_INFO, ¶ms); - logger.info(" <--- urContextGetInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urContextGetInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -1014,7 +1024,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetNativeHandle( "urContextGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urContextGetNativeHandle\n"); + URLOG_(logger, INFO, " ---> urContextGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hContext, phNativeContext); @@ -1026,8 +1036,8 @@ __urdlllocal ur_result_t UR_APICALL urContextGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_GET_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urContextGetNativeHandle({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urContextGetNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -1063,7 +1073,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( "urContextCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urContextCreateWithNativeHandle\n"); + URLOG_(logger, INFO, " ---> urContextCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -1076,8 +1086,8 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_CREATE_WITH_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urContextCreateWithNativeHandle({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urContextCreateWithNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -1105,7 +1115,7 @@ __urdlllocal ur_result_t UR_APICALL urContextSetExtendedDeleter( "urContextSetExtendedDeleter", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urContextSetExtendedDeleter\n"); + URLOG_(logger, INFO, " ---> urContextSetExtendedDeleter\n"); ur_result_t result = pfnSetExtendedDeleter(hContext, pfnDeleter, pUserData); @@ -1117,8 +1127,8 @@ __urdlllocal ur_result_t UR_APICALL urContextSetExtendedDeleter( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_SET_EXTENDED_DELETER, ¶ms); - logger.info(" <--- urContextSetExtendedDeleter({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urContextSetExtendedDeleter({}) -> {};\n", + args_str.str(), result); } return result; @@ -1150,7 +1160,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreate( "urMemImageCreate", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urMemImageCreate\n"); + URLOG_(logger, INFO, " ---> urMemImageCreate\n"); ur_result_t result = pfnImageCreate(hContext, flags, pImageFormat, pImageDesc, pHost, phMem); @@ -1162,8 +1172,8 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_IMAGE_CREATE, ¶ms); - logger.info(" <--- urMemImageCreate({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urMemImageCreate({}) -> {};\n", + args_str.str(), result); } return result; @@ -1193,7 +1203,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( "urMemBufferCreate", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urMemBufferCreate\n"); + URLOG_(logger, INFO, " ---> urMemBufferCreate\n"); ur_result_t result = pfnBufferCreate(hContext, flags, size, pProperties, phBuffer); @@ -1205,8 +1215,8 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_BUFFER_CREATE, ¶ms); - logger.info(" <--- urMemBufferCreate({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urMemBufferCreate({}) -> {};\n", + args_str.str(), result); } return result; @@ -1227,7 +1237,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( "urMemRetain", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urMemRetain\n"); + URLOG_(logger, INFO, " ---> urMemRetain\n"); ur_result_t result = pfnRetain(hMem); @@ -1237,7 +1247,8 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_RETAIN, ¶ms); - logger.info(" <--- urMemRetain({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urMemRetain({}) -> {};\n", args_str.str(), + result); } return result; @@ -1258,7 +1269,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( "urMemRelease", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urMemRelease\n"); + URLOG_(logger, INFO, " ---> urMemRelease\n"); ur_result_t result = pfnRelease(hMem); @@ -1268,7 +1279,8 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_RELEASE, ¶ms); - logger.info(" <--- urMemRelease({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urMemRelease({}) -> {};\n", args_str.str(), + result); } return result; @@ -1298,7 +1310,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( UR_FUNCTION_MEM_BUFFER_PARTITION, "urMemBufferPartition", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urMemBufferPartition\n"); + URLOG_(logger, INFO, " ---> urMemBufferPartition\n"); ur_result_t result = pfnBufferPartition(hBuffer, flags, bufferCreateType, pRegion, phMem); @@ -1310,8 +1322,8 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_BUFFER_PARTITION, ¶ms); - logger.info(" <--- urMemBufferPartition({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urMemBufferPartition({}) -> {};\n", + args_str.str(), result); } return result; @@ -1337,7 +1349,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( UR_FUNCTION_MEM_GET_NATIVE_HANDLE, "urMemGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urMemGetNativeHandle\n"); + URLOG_(logger, INFO, " ---> urMemGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hMem, hDevice, phNativeMem); @@ -1348,8 +1360,8 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_GET_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urMemGetNativeHandle({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urMemGetNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -1379,7 +1391,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( "urMemBufferCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urMemBufferCreateWithNativeHandle\n"); + URLOG_(logger, INFO, " ---> urMemBufferCreateWithNativeHandle\n"); ur_result_t result = pfnBufferCreateWithNativeHandle(hNativeMem, hContext, pProperties, phMem); @@ -1392,8 +1404,9 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_MEM_BUFFER_CREATE_WITH_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urMemBufferCreateWithNativeHandle({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urMemBufferCreateWithNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -1427,7 +1440,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( "urMemImageCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urMemImageCreateWithNativeHandle\n"); + URLOG_(logger, INFO, " ---> urMemImageCreateWithNativeHandle\n"); ur_result_t result = pfnImageCreateWithNativeHandle( hNativeMem, hContext, pImageFormat, pImageDesc, pProperties, phMem); @@ -1440,8 +1453,9 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_MEM_IMAGE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urMemImageCreateWithNativeHandle({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urMemImageCreateWithNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -1476,7 +1490,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( "urMemGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urMemGetInfo\n"); + URLOG_(logger, INFO, " ---> urMemGetInfo\n"); ur_result_t result = pfnGetInfo(hMemory, propName, propSize, pPropValue, pPropSizeRet); @@ -1488,7 +1502,8 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_GET_INFO, ¶ms); - logger.info(" <--- urMemGetInfo({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urMemGetInfo({}) -> {};\n", args_str.str(), + result); } return result; @@ -1523,7 +1538,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageGetInfo( "urMemImageGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urMemImageGetInfo\n"); + URLOG_(logger, INFO, " ---> urMemImageGetInfo\n"); ur_result_t result = pfnImageGetInfo(hMemory, propName, propSize, pPropValue, pPropSizeRet); @@ -1535,8 +1550,8 @@ __urdlllocal ur_result_t UR_APICALL urMemImageGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_IMAGE_GET_INFO, ¶ms); - logger.info(" <--- urMemImageGetInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urMemImageGetInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -1561,7 +1576,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreate( "urSamplerCreate", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urSamplerCreate\n"); + URLOG_(logger, INFO, " ---> urSamplerCreate\n"); ur_result_t result = pfnCreate(hContext, pDesc, phSampler); @@ -1572,7 +1587,8 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_CREATE, ¶ms); - logger.info(" <--- urSamplerCreate({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urSamplerCreate({}) -> {};\n", args_str.str(), + result); } return result; @@ -1593,7 +1609,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain( "urSamplerRetain", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urSamplerRetain\n"); + URLOG_(logger, INFO, " ---> urSamplerRetain\n"); ur_result_t result = pfnRetain(hSampler); @@ -1604,7 +1620,8 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_RETAIN, ¶ms); - logger.info(" <--- urSamplerRetain({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urSamplerRetain({}) -> {};\n", args_str.str(), + result); } return result; @@ -1625,7 +1642,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRelease( "urSamplerRelease", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urSamplerRelease\n"); + URLOG_(logger, INFO, " ---> urSamplerRelease\n"); ur_result_t result = pfnRelease(hSampler); @@ -1636,8 +1653,8 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_RELEASE, ¶ms); - logger.info(" <--- urSamplerRelease({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urSamplerRelease({}) -> {};\n", + args_str.str(), result); } return result; @@ -1668,7 +1685,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo( "urSamplerGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urSamplerGetInfo\n"); + URLOG_(logger, INFO, " ---> urSamplerGetInfo\n"); ur_result_t result = pfnGetInfo(hSampler, propName, propSize, pPropValue, pPropSizeRet); @@ -1680,8 +1697,8 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_GET_INFO, ¶ms); - logger.info(" <--- urSamplerGetInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urSamplerGetInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -1705,7 +1722,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetNativeHandle( "urSamplerGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urSamplerGetNativeHandle\n"); + URLOG_(logger, INFO, " ---> urSamplerGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hSampler, phNativeSampler); @@ -1717,8 +1734,8 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_SAMPLER_GET_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urSamplerGetNativeHandle({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urSamplerGetNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -1748,7 +1765,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( "urSamplerCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urSamplerCreateWithNativeHandle\n"); + URLOG_(logger, INFO, " ---> urSamplerCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeSampler, hContext, pProperties, phSampler); @@ -1761,8 +1778,8 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_SAMPLER_CREATE_WITH_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urSamplerCreateWithNativeHandle({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urSamplerCreateWithNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -1792,7 +1809,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( "urUSMHostAlloc", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMHostAlloc\n"); + URLOG_(logger, INFO, " ---> urUSMHostAlloc\n"); ur_result_t result = pfnHostAlloc(hContext, pUSMDesc, pool, size, ppMem); @@ -1803,7 +1820,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_HOST_ALLOC, ¶ms); - logger.info(" <--- urUSMHostAlloc({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urUSMHostAlloc({}) -> {};\n", args_str.str(), + result); } return result; @@ -1835,7 +1853,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( "urUSMDeviceAlloc", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMDeviceAlloc\n"); + URLOG_(logger, INFO, " ---> urUSMDeviceAlloc\n"); ur_result_t result = pfnDeviceAlloc(hContext, hDevice, pUSMDesc, pool, size, ppMem); @@ -1847,8 +1865,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_DEVICE_ALLOC, ¶ms); - logger.info(" <--- urUSMDeviceAlloc({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urUSMDeviceAlloc({}) -> {};\n", + args_str.str(), result); } return result; @@ -1880,7 +1898,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( "urUSMSharedAlloc", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMSharedAlloc\n"); + URLOG_(logger, INFO, " ---> urUSMSharedAlloc\n"); ur_result_t result = pfnSharedAlloc(hContext, hDevice, pUSMDesc, pool, size, ppMem); @@ -1892,8 +1910,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_SHARED_ALLOC, ¶ms); - logger.info(" <--- urUSMSharedAlloc({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urUSMSharedAlloc({}) -> {};\n", + args_str.str(), result); } return result; @@ -1916,7 +1934,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( getContext()->notify_begin(UR_FUNCTION_USM_FREE, "urUSMFree", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMFree\n"); + URLOG_(logger, INFO, " ---> urUSMFree\n"); ur_result_t result = pfnFree(hContext, pMem); @@ -1926,7 +1944,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_FREE, ¶ms); - logger.info(" <--- urUSMFree({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urUSMFree({}) -> {};\n", args_str.str(), + result); } return result; @@ -1959,7 +1978,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMGetMemAllocInfo( UR_FUNCTION_USM_GET_MEM_ALLOC_INFO, "urUSMGetMemAllocInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMGetMemAllocInfo\n"); + URLOG_(logger, INFO, " ---> urUSMGetMemAllocInfo\n"); ur_result_t result = pfnGetMemAllocInfo(hContext, pMem, propName, propSize, pPropValue, pPropSizeRet); @@ -1971,8 +1990,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMGetMemAllocInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_GET_MEM_ALLOC_INFO, ¶ms); - logger.info(" <--- urUSMGetMemAllocInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urUSMGetMemAllocInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -1998,7 +2017,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreate( "urUSMPoolCreate", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolCreate\n"); + URLOG_(logger, INFO, " ---> urUSMPoolCreate\n"); ur_result_t result = pfnPoolCreate(hContext, pPoolDesc, ppPool); @@ -2009,7 +2028,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_CREATE, ¶ms); - logger.info(" <--- urUSMPoolCreate({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urUSMPoolCreate({}) -> {};\n", args_str.str(), + result); } return result; @@ -2030,7 +2050,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain( "urUSMPoolRetain", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolRetain\n"); + URLOG_(logger, INFO, " ---> urUSMPoolRetain\n"); ur_result_t result = pfnPoolRetain(pPool); @@ -2041,7 +2061,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_RETAIN, ¶ms); - logger.info(" <--- urUSMPoolRetain({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urUSMPoolRetain({}) -> {};\n", args_str.str(), + result); } return result; @@ -2062,7 +2083,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRelease( "urUSMPoolRelease", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolRelease\n"); + URLOG_(logger, INFO, " ---> urUSMPoolRelease\n"); ur_result_t result = pfnPoolRelease(pPool); @@ -2073,8 +2094,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_RELEASE, ¶ms); - logger.info(" <--- urUSMPoolRelease({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urUSMPoolRelease({}) -> {};\n", + args_str.str(), result); } return result; @@ -2105,7 +2126,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfo( "urUSMPoolGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolGetInfo\n"); + URLOG_(logger, INFO, " ---> urUSMPoolGetInfo\n"); ur_result_t result = pfnPoolGetInfo(hPool, propName, propSize, pPropValue, pPropSizeRet); @@ -2117,8 +2138,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_GET_INFO, ¶ms); - logger.info(" <--- urUSMPoolGetInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urUSMPoolGetInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -2158,7 +2179,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGranularityGetInfo( "urVirtualMemGranularityGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urVirtualMemGranularityGetInfo\n"); + URLOG_(logger, INFO, " ---> urVirtualMemGranularityGetInfo\n"); ur_result_t result = pfnGranularityGetInfo( hContext, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -2171,8 +2192,8 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGranularityGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_VIRTUAL_MEM_GRANULARITY_GET_INFO, ¶ms); - logger.info(" <--- urVirtualMemGranularityGetInfo({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urVirtualMemGranularityGetInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -2203,7 +2224,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemReserve( UR_FUNCTION_VIRTUAL_MEM_RESERVE, "urVirtualMemReserve", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urVirtualMemReserve\n"); + URLOG_(logger, INFO, " ---> urVirtualMemReserve\n"); ur_result_t result = pfnReserve(hContext, pStart, size, ppStart); @@ -2214,8 +2235,8 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemReserve( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_RESERVE, ¶ms); - logger.info(" <--- urVirtualMemReserve({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urVirtualMemReserve({}) -> {};\n", + args_str.str(), result); } return result; @@ -2240,7 +2261,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemFree( "urVirtualMemFree", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urVirtualMemFree\n"); + URLOG_(logger, INFO, " ---> urVirtualMemFree\n"); ur_result_t result = pfnFree(hContext, pStart, size); @@ -2251,8 +2272,8 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemFree( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_FREE, ¶ms); - logger.info(" <--- urVirtualMemFree({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urVirtualMemFree({}) -> {};\n", + args_str.str(), result); } return result; @@ -2284,7 +2305,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemMap( "urVirtualMemMap", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urVirtualMemMap\n"); + URLOG_(logger, INFO, " ---> urVirtualMemMap\n"); ur_result_t result = pfnMap(hContext, pStart, size, hPhysicalMem, offset, flags); @@ -2296,7 +2317,8 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemMap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_MAP, ¶ms); - logger.info(" <--- urVirtualMemMap({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urVirtualMemMap({}) -> {};\n", args_str.str(), + result); } return result; @@ -2321,7 +2343,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemUnmap( "urVirtualMemUnmap", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urVirtualMemUnmap\n"); + URLOG_(logger, INFO, " ---> urVirtualMemUnmap\n"); ur_result_t result = pfnUnmap(hContext, pStart, size); @@ -2332,8 +2354,8 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemUnmap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_UNMAP, ¶ms); - logger.info(" <--- urVirtualMemUnmap({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urVirtualMemUnmap({}) -> {};\n", + args_str.str(), result); } return result; @@ -2361,7 +2383,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemSetAccess( UR_FUNCTION_VIRTUAL_MEM_SET_ACCESS, "urVirtualMemSetAccess", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urVirtualMemSetAccess\n"); + URLOG_(logger, INFO, " ---> urVirtualMemSetAccess\n"); ur_result_t result = pfnSetAccess(hContext, pStart, size, flags); @@ -2372,8 +2394,8 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemSetAccess( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_VIRTUAL_MEM_SET_ACCESS, ¶ms); - logger.info(" <--- urVirtualMemSetAccess({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urVirtualMemSetAccess({}) -> {};\n", + args_str.str(), result); } return result; @@ -2412,7 +2434,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGetInfo( UR_FUNCTION_VIRTUAL_MEM_GET_INFO, "urVirtualMemGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urVirtualMemGetInfo\n"); + URLOG_(logger, INFO, " ---> urVirtualMemGetInfo\n"); ur_result_t result = pfnGetInfo(hContext, pStart, size, propName, propSize, pPropValue, pPropSizeRet); @@ -2424,8 +2446,8 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_GET_INFO, ¶ms); - logger.info(" <--- urVirtualMemGetInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urVirtualMemGetInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -2456,7 +2478,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemCreate( UR_FUNCTION_PHYSICAL_MEM_CREATE, "urPhysicalMemCreate", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urPhysicalMemCreate\n"); + URLOG_(logger, INFO, " ---> urPhysicalMemCreate\n"); ur_result_t result = pfnCreate(hContext, hDevice, size, pProperties, phPhysicalMem); @@ -2468,8 +2490,8 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_CREATE, ¶ms); - logger.info(" <--- urPhysicalMemCreate({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urPhysicalMemCreate({}) -> {};\n", + args_str.str(), result); } return result; @@ -2490,7 +2512,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain( UR_FUNCTION_PHYSICAL_MEM_RETAIN, "urPhysicalMemRetain", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urPhysicalMemRetain\n"); + URLOG_(logger, INFO, " ---> urPhysicalMemRetain\n"); ur_result_t result = pfnRetain(hPhysicalMem); @@ -2501,8 +2523,8 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_RETAIN, ¶ms); - logger.info(" <--- urPhysicalMemRetain({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urPhysicalMemRetain({}) -> {};\n", + args_str.str(), result); } return result; @@ -2523,7 +2545,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( UR_FUNCTION_PHYSICAL_MEM_RELEASE, "urPhysicalMemRelease", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urPhysicalMemRelease\n"); + URLOG_(logger, INFO, " ---> urPhysicalMemRelease\n"); ur_result_t result = pfnRelease(hPhysicalMem); @@ -2534,8 +2556,8 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_RELEASE, ¶ms); - logger.info(" <--- urPhysicalMemRelease({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urPhysicalMemRelease({}) -> {};\n", + args_str.str(), result); } return result; @@ -2569,7 +2591,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( UR_FUNCTION_PHYSICAL_MEM_GET_INFO, "urPhysicalMemGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urPhysicalMemGetInfo\n"); + URLOG_(logger, INFO, " ---> urPhysicalMemGetInfo\n"); ur_result_t result = pfnGetInfo(hPhysicalMem, propName, propSize, pPropValue, pPropSizeRet); @@ -2581,8 +2603,8 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_GET_INFO, ¶ms); - logger.info(" <--- urPhysicalMemGetInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urPhysicalMemGetInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -2612,7 +2634,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( UR_FUNCTION_PROGRAM_CREATE_WITH_IL, "urProgramCreateWithIL", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramCreateWithIL\n"); + URLOG_(logger, INFO, " ---> urProgramCreateWithIL\n"); ur_result_t result = pfnCreateWithIL(hContext, pIL, length, pProperties, phProgram); @@ -2624,8 +2646,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_IL, ¶ms); - logger.info(" <--- urProgramCreateWithIL({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urProgramCreateWithIL({}) -> {};\n", + args_str.str(), result); } return result; @@ -2665,7 +2687,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( "urProgramCreateWithBinary", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramCreateWithBinary\n"); + URLOG_(logger, INFO, " ---> urProgramCreateWithBinary\n"); ur_result_t result = pfnCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, @@ -2679,8 +2701,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_BINARY, ¶ms); - logger.info(" <--- urProgramCreateWithBinary({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urProgramCreateWithBinary({}) -> {};\n", + args_str.str(), result); } return result; @@ -2705,7 +2727,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( "urProgramBuild", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramBuild\n"); + URLOG_(logger, INFO, " ---> urProgramBuild\n"); ur_result_t result = pfnBuild(hContext, hProgram, pOptions); @@ -2716,7 +2738,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_BUILD, ¶ms); - logger.info(" <--- urProgramBuild({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urProgramBuild({}) -> {};\n", args_str.str(), + result); } return result; @@ -2741,7 +2764,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompile( "urProgramCompile", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramCompile\n"); + URLOG_(logger, INFO, " ---> urProgramCompile\n"); ur_result_t result = pfnCompile(hContext, hProgram, pOptions); @@ -2752,8 +2775,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompile( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_COMPILE, ¶ms); - logger.info(" <--- urProgramCompile({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urProgramCompile({}) -> {};\n", + args_str.str(), result); } return result; @@ -2786,7 +2809,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( "urProgramLink", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramLink\n"); + URLOG_(logger, INFO, " ---> urProgramLink\n"); ur_result_t result = pfnLink(hContext, count, phPrograms, pOptions, phProgram); @@ -2798,7 +2821,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_LINK, ¶ms); - logger.info(" <--- urProgramLink({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urProgramLink({}) -> {};\n", args_str.str(), + result); } return result; @@ -2819,7 +2843,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( "urProgramRetain", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramRetain\n"); + URLOG_(logger, INFO, " ---> urProgramRetain\n"); ur_result_t result = pfnRetain(hProgram); @@ -2830,7 +2854,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_RETAIN, ¶ms); - logger.info(" <--- urProgramRetain({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urProgramRetain({}) -> {};\n", args_str.str(), + result); } return result; @@ -2851,7 +2876,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRelease( "urProgramRelease", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramRelease\n"); + URLOG_(logger, INFO, " ---> urProgramRelease\n"); ur_result_t result = pfnRelease(hProgram); @@ -2862,8 +2887,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_RELEASE, ¶ms); - logger.info(" <--- urProgramRelease({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urProgramRelease({}) -> {};\n", + args_str.str(), result); } return result; @@ -2895,7 +2920,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetFunctionPointer( "urProgramGetFunctionPointer", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramGetFunctionPointer\n"); + URLOG_(logger, INFO, " ---> urProgramGetFunctionPointer\n"); ur_result_t result = pfnGetFunctionPointer(hDevice, hProgram, pFunctionName, ppFunctionPointer); @@ -2908,8 +2933,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetFunctionPointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_FUNCTION_POINTER, ¶ms); - logger.info(" <--- urProgramGetFunctionPointer({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urProgramGetFunctionPointer({}) -> {};\n", + args_str.str(), result); } return result; @@ -2944,7 +2969,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetGlobalVariablePointer( "urProgramGetGlobalVariablePointer", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramGetGlobalVariablePointer\n"); + URLOG_(logger, INFO, " ---> urProgramGetGlobalVariablePointer\n"); ur_result_t result = pfnGetGlobalVariablePointer( hDevice, hProgram, pGlobalVariableName, pGlobalVariableSizeRet, @@ -2958,8 +2983,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetGlobalVariablePointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_GLOBAL_VARIABLE_POINTER, ¶ms); - logger.info(" <--- urProgramGetGlobalVariablePointer({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urProgramGetGlobalVariablePointer({}) -> {};\n", + args_str.str(), result); } return result; @@ -2995,7 +3021,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetInfo( "urProgramGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramGetInfo\n"); + URLOG_(logger, INFO, " ---> urProgramGetInfo\n"); ur_result_t result = pfnGetInfo(hProgram, propName, propSize, pPropValue, pPropSizeRet); @@ -3007,8 +3033,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_GET_INFO, ¶ms); - logger.info(" <--- urProgramGetInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urProgramGetInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -3045,7 +3071,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetBuildInfo( UR_FUNCTION_PROGRAM_GET_BUILD_INFO, "urProgramGetBuildInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramGetBuildInfo\n"); + URLOG_(logger, INFO, " ---> urProgramGetBuildInfo\n"); ur_result_t result = pfnGetBuildInfo(hProgram, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3057,8 +3083,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetBuildInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_BUILD_INFO, ¶ms); - logger.info(" <--- urProgramGetBuildInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urProgramGetBuildInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -3087,7 +3113,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramSetSpecializationConstants( "urProgramSetSpecializationConstants", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramSetSpecializationConstants\n"); + URLOG_(logger, INFO, " ---> urProgramSetSpecializationConstants\n"); ur_result_t result = pfnSetSpecializationConstants(hProgram, count, pSpecConstants); @@ -3100,8 +3126,9 @@ __urdlllocal ur_result_t UR_APICALL urProgramSetSpecializationConstants( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_SET_SPECIALIZATION_CONSTANTS, ¶ms); - logger.info(" <--- urProgramSetSpecializationConstants({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urProgramSetSpecializationConstants({}) -> {};\n", + args_str.str(), result); } return result; @@ -3125,7 +3152,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetNativeHandle( "urProgramGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramGetNativeHandle\n"); + URLOG_(logger, INFO, " ---> urProgramGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hProgram, phNativeProgram); @@ -3137,8 +3164,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urProgramGetNativeHandle({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urProgramGetNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -3168,7 +3195,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( "urProgramCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramCreateWithNativeHandle\n"); + URLOG_(logger, INFO, " ---> urProgramCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram); @@ -3181,8 +3208,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urProgramCreateWithNativeHandle({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urProgramCreateWithNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -3207,7 +3234,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreate( "urKernelCreate", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelCreate\n"); + URLOG_(logger, INFO, " ---> urKernelCreate\n"); ur_result_t result = pfnCreate(hProgram, pKernelName, phKernel); @@ -3218,7 +3245,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_CREATE, ¶ms); - logger.info(" <--- urKernelCreate({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urKernelCreate({}) -> {};\n", args_str.str(), + result); } return result; @@ -3250,7 +3278,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( UR_FUNCTION_KERNEL_SET_ARG_VALUE, "urKernelSetArgValue", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelSetArgValue\n"); + URLOG_(logger, INFO, " ---> urKernelSetArgValue\n"); ur_result_t result = pfnSetArgValue(hKernel, argIndex, argSize, pProperties, pArgValue); @@ -3262,8 +3290,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_ARG_VALUE, ¶ms); - logger.info(" <--- urKernelSetArgValue({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urKernelSetArgValue({}) -> {};\n", + args_str.str(), result); } return result; @@ -3291,7 +3319,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( UR_FUNCTION_KERNEL_SET_ARG_LOCAL, "urKernelSetArgLocal", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelSetArgLocal\n"); + URLOG_(logger, INFO, " ---> urKernelSetArgLocal\n"); ur_result_t result = pfnSetArgLocal(hKernel, argIndex, argSize, pProperties); @@ -3302,8 +3330,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_ARG_LOCAL, ¶ms); - logger.info(" <--- urKernelSetArgLocal({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urKernelSetArgLocal({}) -> {};\n", + args_str.str(), result); } return result; @@ -3339,7 +3367,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetInfo( "urKernelGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelGetInfo\n"); + URLOG_(logger, INFO, " ---> urKernelGetInfo\n"); ur_result_t result = pfnGetInfo(hKernel, propName, propSize, pPropValue, pPropSizeRet); @@ -3351,7 +3379,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_GET_INFO, ¶ms); - logger.info(" <--- urKernelGetInfo({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urKernelGetInfo({}) -> {};\n", args_str.str(), + result); } return result; @@ -3385,7 +3414,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetGroupInfo( UR_FUNCTION_KERNEL_GET_GROUP_INFO, "urKernelGetGroupInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelGetGroupInfo\n"); + URLOG_(logger, INFO, " ---> urKernelGetGroupInfo\n"); ur_result_t result = pfnGetGroupInfo(hKernel, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3397,8 +3426,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetGroupInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_GET_GROUP_INFO, ¶ms); - logger.info(" <--- urKernelGetGroupInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urKernelGetGroupInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -3433,7 +3462,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSubGroupInfo( "urKernelGetSubGroupInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelGetSubGroupInfo\n"); + URLOG_(logger, INFO, " ---> urKernelGetSubGroupInfo\n"); ur_result_t result = pfnGetSubGroupInfo(hKernel, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3446,8 +3475,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSubGroupInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_SUB_GROUP_INFO, ¶ms); - logger.info(" <--- urKernelGetSubGroupInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urKernelGetSubGroupInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -3468,7 +3497,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( "urKernelRetain", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelRetain\n"); + URLOG_(logger, INFO, " ---> urKernelRetain\n"); ur_result_t result = pfnRetain(hKernel); @@ -3479,7 +3508,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_RETAIN, ¶ms); - logger.info(" <--- urKernelRetain({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urKernelRetain({}) -> {};\n", args_str.str(), + result); } return result; @@ -3500,7 +3530,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRelease( "urKernelRelease", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelRelease\n"); + URLOG_(logger, INFO, " ---> urKernelRelease\n"); ur_result_t result = pfnRelease(hKernel); @@ -3511,7 +3541,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_RELEASE, ¶ms); - logger.info(" <--- urKernelRelease({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urKernelRelease({}) -> {};\n", args_str.str(), + result); } return result; @@ -3540,7 +3571,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( UR_FUNCTION_KERNEL_SET_ARG_POINTER, "urKernelSetArgPointer", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelSetArgPointer\n"); + URLOG_(logger, INFO, " ---> urKernelSetArgPointer\n"); ur_result_t result = pfnSetArgPointer(hKernel, argIndex, pProperties, pArgValue); @@ -3552,8 +3583,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_POINTER, ¶ms); - logger.info(" <--- urKernelSetArgPointer({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urKernelSetArgPointer({}) -> {};\n", + args_str.str(), result); } return result; @@ -3584,7 +3615,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetExecInfo( UR_FUNCTION_KERNEL_SET_EXEC_INFO, "urKernelSetExecInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelSetExecInfo\n"); + URLOG_(logger, INFO, " ---> urKernelSetExecInfo\n"); ur_result_t result = pfnSetExecInfo(hKernel, propName, propSize, pProperties, pPropValue); @@ -3596,8 +3627,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetExecInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_EXEC_INFO, ¶ms); - logger.info(" <--- urKernelSetExecInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urKernelSetExecInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -3625,7 +3656,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( UR_FUNCTION_KERNEL_SET_ARG_SAMPLER, "urKernelSetArgSampler", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelSetArgSampler\n"); + URLOG_(logger, INFO, " ---> urKernelSetArgSampler\n"); ur_result_t result = pfnSetArgSampler(hKernel, argIndex, pProperties, hArgValue); @@ -3637,8 +3668,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_SAMPLER, ¶ms); - logger.info(" <--- urKernelSetArgSampler({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urKernelSetArgSampler({}) -> {};\n", + args_str.str(), result); } return result; @@ -3666,7 +3697,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, "urKernelSetArgMemObj", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelSetArgMemObj\n"); + URLOG_(logger, INFO, " ---> urKernelSetArgMemObj\n"); ur_result_t result = pfnSetArgMemObj(hKernel, argIndex, pProperties, hArgValue); @@ -3678,8 +3709,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, ¶ms); - logger.info(" <--- urKernelSetArgMemObj({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urKernelSetArgMemObj({}) -> {};\n", + args_str.str(), result); } return result; @@ -3707,7 +3738,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetSpecializationConstants( "urKernelSetSpecializationConstants", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelSetSpecializationConstants\n"); + URLOG_(logger, INFO, " ---> urKernelSetSpecializationConstants\n"); ur_result_t result = pfnSetSpecializationConstants(hKernel, count, pSpecConstants); @@ -3720,8 +3751,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetSpecializationConstants( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_SPECIALIZATION_CONSTANTS, ¶ms); - logger.info(" <--- urKernelSetSpecializationConstants({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urKernelSetSpecializationConstants({}) -> {};\n", + args_str.str(), result); } return result; @@ -3744,7 +3776,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetNativeHandle( UR_FUNCTION_KERNEL_GET_NATIVE_HANDLE, "urKernelGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelGetNativeHandle\n"); + URLOG_(logger, INFO, " ---> urKernelGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hKernel, phNativeKernel); @@ -3756,8 +3788,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urKernelGetNativeHandle({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urKernelGetNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -3789,7 +3821,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreateWithNativeHandle( "urKernelCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelCreateWithNativeHandle\n"); + URLOG_(logger, INFO, " ---> urKernelCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle( hNativeKernel, hContext, hProgram, pProperties, phKernel); @@ -3802,8 +3834,8 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_CREATE_WITH_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urKernelCreateWithNativeHandle({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urKernelCreateWithNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -3843,7 +3875,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize( "urKernelGetSuggestedLocalWorkSize", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelGetSuggestedLocalWorkSize\n"); + URLOG_(logger, INFO, " ---> urKernelGetSuggestedLocalWorkSize\n"); ur_result_t result = pfnGetSuggestedLocalWorkSize( hKernel, hQueue, numWorkDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -3857,8 +3889,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_SUGGESTED_LOCAL_WORK_SIZE, ¶ms); - logger.info(" <--- urKernelGetSuggestedLocalWorkSize({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urKernelGetSuggestedLocalWorkSize({}) -> {};\n", + args_str.str(), result); } return result; @@ -3889,7 +3922,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetInfo( "urQueueGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urQueueGetInfo\n"); + URLOG_(logger, INFO, " ---> urQueueGetInfo\n"); ur_result_t result = pfnGetInfo(hQueue, propName, propSize, pPropValue, pPropSizeRet); @@ -3901,7 +3934,8 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_GET_INFO, ¶ms); - logger.info(" <--- urQueueGetInfo({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urQueueGetInfo({}) -> {};\n", args_str.str(), + result); } return result; @@ -3929,7 +3963,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreate( "urQueueCreate", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urQueueCreate\n"); + URLOG_(logger, INFO, " ---> urQueueCreate\n"); ur_result_t result = pfnCreate(hContext, hDevice, pProperties, phQueue); @@ -3940,7 +3974,8 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_CREATE, ¶ms); - logger.info(" <--- urQueueCreate({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urQueueCreate({}) -> {};\n", args_str.str(), + result); } return result; @@ -3961,7 +3996,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain( "urQueueRetain", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urQueueRetain\n"); + URLOG_(logger, INFO, " ---> urQueueRetain\n"); ur_result_t result = pfnRetain(hQueue); @@ -3972,7 +4007,8 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_RETAIN, ¶ms); - logger.info(" <--- urQueueRetain({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urQueueRetain({}) -> {};\n", args_str.str(), + result); } return result; @@ -3993,7 +4029,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRelease( "urQueueRelease", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urQueueRelease\n"); + URLOG_(logger, INFO, " ---> urQueueRelease\n"); ur_result_t result = pfnRelease(hQueue); @@ -4004,7 +4040,8 @@ __urdlllocal ur_result_t UR_APICALL urQueueRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_RELEASE, ¶ms); - logger.info(" <--- urQueueRelease({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urQueueRelease({}) -> {};\n", args_str.str(), + result); } return result; @@ -4030,7 +4067,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetNativeHandle( UR_FUNCTION_QUEUE_GET_NATIVE_HANDLE, "urQueueGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urQueueGetNativeHandle\n"); + URLOG_(logger, INFO, " ---> urQueueGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hQueue, pDesc, phNativeQueue); @@ -4042,8 +4079,8 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_QUEUE_GET_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urQueueGetNativeHandle({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urQueueGetNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -4075,7 +4112,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreateWithNativeHandle( "urQueueCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urQueueCreateWithNativeHandle\n"); + URLOG_(logger, INFO, " ---> urQueueCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeQueue, hContext, hDevice, pProperties, phQueue); @@ -4088,8 +4125,8 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_QUEUE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urQueueCreateWithNativeHandle({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urQueueCreateWithNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -4110,7 +4147,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFinish( "urQueueFinish", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urQueueFinish\n"); + URLOG_(logger, INFO, " ---> urQueueFinish\n"); ur_result_t result = pfnFinish(hQueue); @@ -4121,7 +4158,8 @@ __urdlllocal ur_result_t UR_APICALL urQueueFinish( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_FINISH, ¶ms); - logger.info(" <--- urQueueFinish({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urQueueFinish({}) -> {};\n", args_str.str(), + result); } return result; @@ -4142,7 +4180,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFlush( "urQueueFlush", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urQueueFlush\n"); + URLOG_(logger, INFO, " ---> urQueueFlush\n"); ur_result_t result = pfnFlush(hQueue); @@ -4152,7 +4190,8 @@ __urdlllocal ur_result_t UR_APICALL urQueueFlush( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_FLUSH, ¶ms); - logger.info(" <--- urQueueFlush({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urQueueFlush({}) -> {};\n", args_str.str(), + result); } return result; @@ -4183,7 +4222,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetInfo( "urEventGetInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEventGetInfo\n"); + URLOG_(logger, INFO, " ---> urEventGetInfo\n"); ur_result_t result = pfnGetInfo(hEvent, propName, propSize, pPropValue, pPropSizeRet); @@ -4195,7 +4234,8 @@ __urdlllocal ur_result_t UR_APICALL urEventGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_GET_INFO, ¶ms); - logger.info(" <--- urEventGetInfo({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urEventGetInfo({}) -> {};\n", args_str.str(), + result); } return result; @@ -4227,7 +4267,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetProfilingInfo( UR_FUNCTION_EVENT_GET_PROFILING_INFO, "urEventGetProfilingInfo", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEventGetProfilingInfo\n"); + URLOG_(logger, INFO, " ---> urEventGetProfilingInfo\n"); ur_result_t result = pfnGetProfilingInfo(hEvent, propName, propSize, pPropValue, pPropSizeRet); @@ -4240,8 +4280,8 @@ __urdlllocal ur_result_t UR_APICALL urEventGetProfilingInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_GET_PROFILING_INFO, ¶ms); - logger.info(" <--- urEventGetProfilingInfo({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEventGetProfilingInfo({}) -> {};\n", + args_str.str(), result); } return result; @@ -4265,7 +4305,7 @@ __urdlllocal ur_result_t UR_APICALL urEventWait( "urEventWait", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEventWait\n"); + URLOG_(logger, INFO, " ---> urEventWait\n"); ur_result_t result = pfnWait(numEvents, phEventWaitList); @@ -4275,7 +4315,8 @@ __urdlllocal ur_result_t UR_APICALL urEventWait( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_WAIT, ¶ms); - logger.info(" <--- urEventWait({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urEventWait({}) -> {};\n", args_str.str(), + result); } return result; @@ -4296,7 +4337,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain( "urEventRetain", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEventRetain\n"); + URLOG_(logger, INFO, " ---> urEventRetain\n"); ur_result_t result = pfnRetain(hEvent); @@ -4307,7 +4348,8 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_RETAIN, ¶ms); - logger.info(" <--- urEventRetain({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urEventRetain({}) -> {};\n", args_str.str(), + result); } return result; @@ -4328,7 +4370,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRelease( "urEventRelease", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEventRelease\n"); + URLOG_(logger, INFO, " ---> urEventRelease\n"); ur_result_t result = pfnRelease(hEvent); @@ -4339,7 +4381,8 @@ __urdlllocal ur_result_t UR_APICALL urEventRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_RELEASE, ¶ms); - logger.info(" <--- urEventRelease({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urEventRelease({}) -> {};\n", args_str.str(), + result); } return result; @@ -4362,7 +4405,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetNativeHandle( UR_FUNCTION_EVENT_GET_NATIVE_HANDLE, "urEventGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEventGetNativeHandle\n"); + URLOG_(logger, INFO, " ---> urEventGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hEvent, phNativeEvent); @@ -4374,8 +4417,8 @@ __urdlllocal ur_result_t UR_APICALL urEventGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_GET_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urEventGetNativeHandle({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEventGetNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -4405,7 +4448,7 @@ __urdlllocal ur_result_t UR_APICALL urEventCreateWithNativeHandle( "urEventCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEventCreateWithNativeHandle\n"); + URLOG_(logger, INFO, " ---> urEventCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeEvent, hContext, pProperties, phEvent); @@ -4418,8 +4461,8 @@ __urdlllocal ur_result_t UR_APICALL urEventCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_CREATE_WITH_NATIVE_HANDLE, ¶ms); - logger.info(" <--- urEventCreateWithNativeHandle({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urEventCreateWithNativeHandle({}) -> {};\n", + args_str.str(), result); } return result; @@ -4447,7 +4490,7 @@ __urdlllocal ur_result_t UR_APICALL urEventSetCallback( "urEventSetCallback", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEventSetCallback\n"); + URLOG_(logger, INFO, " ---> urEventSetCallback\n"); ur_result_t result = pfnSetCallback(hEvent, execStatus, pfnNotify, pUserData); @@ -4458,8 +4501,8 @@ __urdlllocal ur_result_t UR_APICALL urEventSetCallback( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_SET_CALLBACK, ¶ms); - logger.info(" <--- urEventSetCallback({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEventSetCallback({}) -> {};\n", + args_str.str(), result); } return result; @@ -4517,7 +4560,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH, "urEnqueueKernelLaunch", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueKernelLaunch\n"); + URLOG_(logger, INFO, " ---> urEnqueueKernelLaunch\n"); ur_result_t result = pfnKernelLaunch( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -4530,8 +4573,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH, ¶ms); - logger.info(" <--- urEnqueueKernelLaunch({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueKernelLaunch({}) -> {};\n", + args_str.str(), result); } return result; @@ -4565,7 +4608,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWait( UR_FUNCTION_ENQUEUE_EVENTS_WAIT, "urEnqueueEventsWait", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueEventsWait\n"); + URLOG_(logger, INFO, " ---> urEnqueueEventsWait\n"); ur_result_t result = pfnEventsWait(hQueue, numEventsInWaitList, phEventWaitList, phEvent); @@ -4577,8 +4620,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWait( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT, ¶ms); - logger.info(" <--- urEnqueueEventsWait({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueEventsWait({}) -> {};\n", + args_str.str(), result); } return result; @@ -4614,7 +4657,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( "urEnqueueEventsWaitWithBarrier", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueEventsWaitWithBarrier\n"); + URLOG_(logger, INFO, " ---> urEnqueueEventsWaitWithBarrier\n"); ur_result_t result = pfnEventsWaitWithBarrier(hQueue, numEventsInWaitList, phEventWaitList, phEvent); @@ -4627,8 +4670,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER, ¶ms); - logger.info(" <--- urEnqueueEventsWaitWithBarrier({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urEnqueueEventsWaitWithBarrier({}) -> {};\n", + args_str.str(), result); } return result; @@ -4673,7 +4716,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ, "urEnqueueMemBufferRead", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemBufferRead\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemBufferRead\n"); ur_result_t result = pfnMemBufferRead(hQueue, hBuffer, blockingRead, offset, size, pDst, @@ -4687,8 +4730,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ, ¶ms); - logger.info(" <--- urEnqueueMemBufferRead({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueMemBufferRead({}) -> {};\n", + args_str.str(), result); } return result; @@ -4733,7 +4776,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE, "urEnqueueMemBufferWrite", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemBufferWrite\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemBufferWrite\n"); ur_result_t result = pfnMemBufferWrite(hQueue, hBuffer, blockingWrite, offset, size, pSrc, @@ -4747,8 +4790,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE, ¶ms); - logger.info(" <--- urEnqueueMemBufferWrite({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueMemBufferWrite({}) -> {};\n", + args_str.str(), result); } return result; @@ -4808,7 +4851,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( "urEnqueueMemBufferReadRect", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemBufferReadRect\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemBufferReadRect\n"); ur_result_t result = pfnMemBufferReadRect( hQueue, hBuffer, blockingRead, bufferOrigin, hostOrigin, region, @@ -4823,8 +4866,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ_RECT, ¶ms); - logger.info(" <--- urEnqueueMemBufferReadRect({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urEnqueueMemBufferReadRect({}) -> {};\n", + args_str.str(), result); } return result; @@ -4885,7 +4928,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( "urEnqueueMemBufferWriteRect", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemBufferWriteRect\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemBufferWriteRect\n"); ur_result_t result = pfnMemBufferWriteRect( hQueue, hBuffer, blockingWrite, bufferOrigin, hostOrigin, region, @@ -4900,8 +4943,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE_RECT, ¶ms); - logger.info(" <--- urEnqueueMemBufferWriteRect({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urEnqueueMemBufferWriteRect({}) -> {};\n", + args_str.str(), result); } return result; @@ -4945,7 +4988,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY, "urEnqueueMemBufferCopy", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemBufferCopy\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemBufferCopy\n"); ur_result_t result = pfnMemBufferCopy(hQueue, hBufferSrc, hBufferDst, srcOffset, dstOffset, @@ -4959,8 +5002,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY, ¶ms); - logger.info(" <--- urEnqueueMemBufferCopy({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueMemBufferCopy({}) -> {};\n", + args_str.str(), result); } return result; @@ -5016,7 +5059,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( "urEnqueueMemBufferCopyRect", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemBufferCopyRect\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemBufferCopyRect\n"); ur_result_t result = pfnMemBufferCopyRect( hQueue, hBufferSrc, hBufferDst, srcOrigin, dstOrigin, region, srcRowPitch, @@ -5031,8 +5074,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY_RECT, ¶ms); - logger.info(" <--- urEnqueueMemBufferCopyRect({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urEnqueueMemBufferCopyRect({}) -> {};\n", + args_str.str(), result); } return result; @@ -5082,7 +5125,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( UR_FUNCTION_ENQUEUE_MEM_BUFFER_FILL, "urEnqueueMemBufferFill", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemBufferFill\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemBufferFill\n"); ur_result_t result = pfnMemBufferFill(hQueue, hBuffer, pPattern, patternSize, offset, size, @@ -5096,8 +5139,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_FILL, ¶ms); - logger.info(" <--- urEnqueueMemBufferFill({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueMemBufferFill({}) -> {};\n", + args_str.str(), result); } return result; @@ -5148,7 +5191,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageRead( UR_FUNCTION_ENQUEUE_MEM_IMAGE_READ, "urEnqueueMemImageRead", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemImageRead\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemImageRead\n"); ur_result_t result = pfnMemImageRead( hQueue, hImage, blockingRead, origin, region, rowPitch, slicePitch, pDst, @@ -5161,8 +5204,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_READ, ¶ms); - logger.info(" <--- urEnqueueMemImageRead({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueMemImageRead({}) -> {};\n", + args_str.str(), result); } return result; @@ -5213,7 +5256,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageWrite( UR_FUNCTION_ENQUEUE_MEM_IMAGE_WRITE, "urEnqueueMemImageWrite", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemImageWrite\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemImageWrite\n"); ur_result_t result = pfnMemImageWrite( hQueue, hImage, blockingWrite, origin, region, rowPitch, slicePitch, pSrc, @@ -5227,8 +5270,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_WRITE, ¶ms); - logger.info(" <--- urEnqueueMemImageWrite({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueMemImageWrite({}) -> {};\n", + args_str.str(), result); } return result; @@ -5275,7 +5318,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageCopy( UR_FUNCTION_ENQUEUE_MEM_IMAGE_COPY, "urEnqueueMemImageCopy", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemImageCopy\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemImageCopy\n"); ur_result_t result = pfnMemImageCopy(hQueue, hImageSrc, hImageDst, srcOrigin, dstOrigin, @@ -5288,8 +5331,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageCopy( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_COPY, ¶ms); - logger.info(" <--- urEnqueueMemImageCopy({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueMemImageCopy({}) -> {};\n", + args_str.str(), result); } return result; @@ -5337,7 +5380,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( UR_FUNCTION_ENQUEUE_MEM_BUFFER_MAP, "urEnqueueMemBufferMap", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemBufferMap\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemBufferMap\n"); ur_result_t result = pfnMemBufferMap(hQueue, hBuffer, blockingMap, mapFlags, offset, size, @@ -5350,8 +5393,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_MAP, ¶ms); - logger.info(" <--- urEnqueueMemBufferMap({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueMemBufferMap({}) -> {};\n", + args_str.str(), result); } return result; @@ -5389,7 +5432,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( "urEnqueueMemUnmap", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueMemUnmap\n"); + URLOG_(logger, INFO, " ---> urEnqueueMemUnmap\n"); ur_result_t result = pfnMemUnmap( hQueue, hMem, pMappedPtr, numEventsInWaitList, phEventWaitList, phEvent); @@ -5401,8 +5444,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_MEM_UNMAP, ¶ms); - logger.info(" <--- urEnqueueMemUnmap({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueMemUnmap({}) -> {};\n", + args_str.str(), result); } return result; @@ -5446,7 +5489,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill( "urEnqueueUSMFill", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueUSMFill\n"); + URLOG_(logger, INFO, " ---> urEnqueueUSMFill\n"); ur_result_t result = pfnUSMFill(hQueue, pMem, patternSize, pPattern, size, numEventsInWaitList, @@ -5459,8 +5502,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FILL, ¶ms); - logger.info(" <--- urEnqueueUSMFill({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueUSMFill({}) -> {};\n", + args_str.str(), result); } return result; @@ -5502,7 +5545,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy( "urEnqueueUSMMemcpy", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueUSMMemcpy\n"); + URLOG_(logger, INFO, " ---> urEnqueueUSMMemcpy\n"); ur_result_t result = pfnUSMMemcpy(hQueue, blocking, pDst, pSrc, size, numEventsInWaitList, @@ -5515,8 +5558,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_MEMCPY, ¶ms); - logger.info(" <--- urEnqueueUSMMemcpy({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueUSMMemcpy({}) -> {};\n", + args_str.str(), result); } return result; @@ -5556,7 +5599,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMPrefetch( UR_FUNCTION_ENQUEUE_USM_PREFETCH, "urEnqueueUSMPrefetch", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueUSMPrefetch\n"); + URLOG_(logger, INFO, " ---> urEnqueueUSMPrefetch\n"); ur_result_t result = pfnUSMPrefetch( hQueue, pMem, size, flags, numEventsInWaitList, phEventWaitList, phEvent); @@ -5568,8 +5611,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMPrefetch( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_PREFETCH, ¶ms); - logger.info(" <--- urEnqueueUSMPrefetch({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueUSMPrefetch({}) -> {};\n", + args_str.str(), result); } return result; @@ -5600,7 +5643,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMAdvise( "urEnqueueUSMAdvise", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueUSMAdvise\n"); + URLOG_(logger, INFO, " ---> urEnqueueUSMAdvise\n"); ur_result_t result = pfnUSMAdvise(hQueue, pMem, size, advice, phEvent); @@ -5611,8 +5654,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMAdvise( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_ADVISE, ¶ms); - logger.info(" <--- urEnqueueUSMAdvise({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueUSMAdvise({}) -> {};\n", + args_str.str(), result); } return result; @@ -5662,7 +5705,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill2D( UR_FUNCTION_ENQUEUE_USM_FILL_2D, "urEnqueueUSMFill2D", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueUSMFill2D\n"); + URLOG_(logger, INFO, " ---> urEnqueueUSMFill2D\n"); ur_result_t result = pfnUSMFill2D(hQueue, pMem, pitch, patternSize, pPattern, width, height, @@ -5675,8 +5718,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill2D( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FILL_2D, ¶ms); - logger.info(" <--- urEnqueueUSMFill2D({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueUSMFill2D({}) -> {};\n", + args_str.str(), result); } return result; @@ -5728,7 +5771,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( UR_FUNCTION_ENQUEUE_USM_MEMCPY_2D, "urEnqueueUSMMemcpy2D", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueUSMMemcpy2D\n"); + URLOG_(logger, INFO, " ---> urEnqueueUSMMemcpy2D\n"); ur_result_t result = pfnUSMMemcpy2D(hQueue, blocking, pDst, dstPitch, pSrc, srcPitch, width, @@ -5741,8 +5784,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_MEMCPY_2D, ¶ms); - logger.info(" <--- urEnqueueUSMMemcpy2D({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueUSMMemcpy2D({}) -> {};\n", + args_str.str(), result); } return result; @@ -5792,7 +5835,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( "urEnqueueDeviceGlobalVariableWrite", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueDeviceGlobalVariableWrite\n"); + URLOG_(logger, INFO, " ---> urEnqueueDeviceGlobalVariableWrite\n"); ur_result_t result = pfnDeviceGlobalVariableWrite( hQueue, hProgram, name, blockingWrite, count, offset, pSrc, @@ -5806,8 +5849,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_DEVICE_GLOBAL_VARIABLE_WRITE, ¶ms); - logger.info(" <--- urEnqueueDeviceGlobalVariableWrite({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urEnqueueDeviceGlobalVariableWrite({}) -> {};\n", + args_str.str(), result); } return result; @@ -5857,7 +5901,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( "urEnqueueDeviceGlobalVariableRead", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueDeviceGlobalVariableRead\n"); + URLOG_(logger, INFO, " ---> urEnqueueDeviceGlobalVariableRead\n"); ur_result_t result = pfnDeviceGlobalVariableRead( hQueue, hProgram, name, blockingRead, count, offset, pDst, @@ -5871,8 +5915,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_DEVICE_GLOBAL_VARIABLE_READ, ¶ms); - logger.info(" <--- urEnqueueDeviceGlobalVariableRead({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urEnqueueDeviceGlobalVariableRead({}) -> {};\n", + args_str.str(), result); } return result; @@ -5922,7 +5967,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueReadHostPipe( UR_FUNCTION_ENQUEUE_READ_HOST_PIPE, "urEnqueueReadHostPipe", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueReadHostPipe\n"); + URLOG_(logger, INFO, " ---> urEnqueueReadHostPipe\n"); ur_result_t result = pfnReadHostPipe(hQueue, hProgram, pipe_symbol, blocking, pDst, size, @@ -5935,8 +5980,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueReadHostPipe( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_READ_HOST_PIPE, ¶ms); - logger.info(" <--- urEnqueueReadHostPipe({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueReadHostPipe({}) -> {};\n", + args_str.str(), result); } return result; @@ -5987,7 +6032,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueWriteHostPipe( UR_FUNCTION_ENQUEUE_WRITE_HOST_PIPE, "urEnqueueWriteHostPipe", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueWriteHostPipe\n"); + URLOG_(logger, INFO, " ---> urEnqueueWriteHostPipe\n"); ur_result_t result = pfnWriteHostPipe(hQueue, hProgram, pipe_symbol, blocking, pSrc, size, @@ -6001,8 +6046,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueWriteHostPipe( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_WRITE_HOST_PIPE, ¶ms); - logger.info(" <--- urEnqueueWriteHostPipe({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueWriteHostPipe({}) -> {};\n", + args_str.str(), result); } return result; @@ -6044,7 +6089,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMDeviceAllocExp( "urEnqueueUSMDeviceAllocExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueUSMDeviceAllocExp\n"); + URLOG_(logger, INFO, " ---> urEnqueueUSMDeviceAllocExp\n"); ur_result_t result = pfnUSMDeviceAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6058,8 +6103,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMDeviceAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_DEVICE_ALLOC_EXP, ¶ms); - logger.info(" <--- urEnqueueUSMDeviceAllocExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urEnqueueUSMDeviceAllocExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6101,7 +6146,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMSharedAllocExp( "urEnqueueUSMSharedAllocExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueUSMSharedAllocExp\n"); + URLOG_(logger, INFO, " ---> urEnqueueUSMSharedAllocExp\n"); ur_result_t result = pfnUSMSharedAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6115,8 +6160,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMSharedAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_SHARED_ALLOC_EXP, ¶ms); - logger.info(" <--- urEnqueueUSMSharedAllocExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urEnqueueUSMSharedAllocExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6158,7 +6203,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMHostAllocExp( "urEnqueueUSMHostAllocExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueUSMHostAllocExp\n"); + URLOG_(logger, INFO, " ---> urEnqueueUSMHostAllocExp\n"); ur_result_t result = pfnUSMHostAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6172,8 +6217,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMHostAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_HOST_ALLOC_EXP, ¶ms); - logger.info(" <--- urEnqueueUSMHostAllocExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueUSMHostAllocExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6208,7 +6253,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFreeExp( UR_FUNCTION_ENQUEUE_USM_FREE_EXP, "urEnqueueUSMFreeExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueUSMFreeExp\n"); + URLOG_(logger, INFO, " ---> urEnqueueUSMFreeExp\n"); ur_result_t result = pfnUSMFreeExp(hQueue, pPool, pMem, numEventsInWaitList, phEventWaitList, phEvent); @@ -6220,8 +6265,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FREE_EXP, ¶ms); - logger.info(" <--- urEnqueueUSMFreeExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urEnqueueUSMFreeExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6250,7 +6295,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreateExp( UR_FUNCTION_USM_POOL_CREATE_EXP, "urUSMPoolCreateExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolCreateExp\n"); + URLOG_(logger, INFO, " ---> urUSMPoolCreateExp\n"); ur_result_t result = pfnPoolCreateExp(hContext, hDevice, pPoolDesc, pPool); @@ -6261,8 +6306,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreateExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_CREATE_EXP, ¶ms); - logger.info(" <--- urUSMPoolCreateExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urUSMPoolCreateExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6287,7 +6332,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( UR_FUNCTION_USM_POOL_DESTROY_EXP, "urUSMPoolDestroyExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolDestroyExp\n"); + URLOG_(logger, INFO, " ---> urUSMPoolDestroyExp\n"); ur_result_t result = pfnPoolDestroyExp(hContext, hDevice, hPool); @@ -6298,8 +6343,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_DESTROY_EXP, ¶ms); - logger.info(" <--- urUSMPoolDestroyExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urUSMPoolDestroyExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6329,7 +6374,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetThresholdExp( "urUSMPoolSetThresholdExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolSetThresholdExp\n"); + URLOG_(logger, INFO, " ---> urUSMPoolSetThresholdExp\n"); ur_result_t result = pfnPoolSetThresholdExp(hContext, hDevice, hPool, newThreshold); @@ -6342,8 +6387,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetThresholdExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_SET_THRESHOLD_EXP, ¶ms); - logger.info(" <--- urUSMPoolSetThresholdExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urUSMPoolSetThresholdExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6371,7 +6416,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( "urUSMPoolGetDefaultDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolGetDefaultDevicePoolExp\n"); + URLOG_(logger, INFO, " ---> urUSMPoolGetDefaultDevicePoolExp\n"); ur_result_t result = pfnPoolGetDefaultDevicePoolExp(hContext, hDevice, pPool); @@ -6383,8 +6428,9 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_GET_DEFAULT_DEVICE_POOL_EXP, ¶ms); - logger.info(" <--- urUSMPoolGetDefaultDevicePoolExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urUSMPoolGetDefaultDevicePoolExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6412,7 +6458,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( UR_FUNCTION_USM_POOL_GET_INFO_EXP, "urUSMPoolGetInfoExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolGetInfoExp\n"); + URLOG_(logger, INFO, " ---> urUSMPoolGetInfoExp\n"); ur_result_t result = pfnPoolGetInfoExp(hPool, propName, pPropValue, pPropSizeRet); @@ -6424,8 +6470,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_GET_INFO_EXP, ¶ms); - logger.info(" <--- urUSMPoolGetInfoExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urUSMPoolGetInfoExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6453,7 +6499,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( "urUSMPoolSetDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolSetDevicePoolExp\n"); + URLOG_(logger, INFO, " ---> urUSMPoolSetDevicePoolExp\n"); ur_result_t result = pfnPoolSetDevicePoolExp(hContext, hDevice, hPool); @@ -6465,8 +6511,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_SET_DEVICE_POOL_EXP, ¶ms); - logger.info(" <--- urUSMPoolSetDevicePoolExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urUSMPoolSetDevicePoolExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6494,7 +6540,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp( "urUSMPoolGetDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolGetDevicePoolExp\n"); + URLOG_(logger, INFO, " ---> urUSMPoolGetDevicePoolExp\n"); ur_result_t result = pfnPoolGetDevicePoolExp(hContext, hDevice, pPool); @@ -6506,8 +6552,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_GET_DEVICE_POOL_EXP, ¶ms); - logger.info(" <--- urUSMPoolGetDevicePoolExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urUSMPoolGetDevicePoolExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6535,7 +6581,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolTrimToExp( UR_FUNCTION_USM_POOL_TRIM_TO_EXP, "urUSMPoolTrimToExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPoolTrimToExp\n"); + URLOG_(logger, INFO, " ---> urUSMPoolTrimToExp\n"); ur_result_t result = pfnPoolTrimToExp(hContext, hDevice, hPool, minBytesToKeep); @@ -6547,8 +6593,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolTrimToExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_TRIM_TO_EXP, ¶ms); - logger.info(" <--- urUSMPoolTrimToExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urUSMPoolTrimToExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6587,7 +6633,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( UR_FUNCTION_USM_PITCHED_ALLOC_EXP, "urUSMPitchedAllocExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMPitchedAllocExp\n"); + URLOG_(logger, INFO, " ---> urUSMPitchedAllocExp\n"); ur_result_t result = pfnPitchedAllocExp(hContext, hDevice, pUSMDesc, pool, widthInBytes, @@ -6600,8 +6646,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_PITCHED_ALLOC_EXP, ¶ms); - logger.info(" <--- urUSMPitchedAllocExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urUSMPitchedAllocExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6631,7 +6677,8 @@ urBindlessImagesUnsampledImageHandleDestroyExp( "urBindlessImagesUnsampledImageHandleDestroyExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesUnsampledImageHandleDestroyExp\n"); + URLOG_(logger, INFO, + " ---> urBindlessImagesUnsampledImageHandleDestroyExp\n"); ur_result_t result = pfnUnsampledImageHandleDestroyExp(hContext, hDevice, hImage); @@ -6647,7 +6694,8 @@ urBindlessImagesUnsampledImageHandleDestroyExp( args_str, UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_HANDLE_DESTROY_EXP, ¶ms); - logger.info( + URLOG_( + logger, INFO, " <--- urBindlessImagesUnsampledImageHandleDestroyExp({}) -> {};\n", args_str.str(), result); } @@ -6679,7 +6727,8 @@ urBindlessImagesSampledImageHandleDestroyExp( "urBindlessImagesSampledImageHandleDestroyExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesSampledImageHandleDestroyExp\n"); + URLOG_(logger, INFO, + " ---> urBindlessImagesSampledImageHandleDestroyExp\n"); ur_result_t result = pfnSampledImageHandleDestroyExp(hContext, hDevice, hImage); @@ -6694,9 +6743,9 @@ urBindlessImagesSampledImageHandleDestroyExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_HANDLE_DESTROY_EXP, ¶ms); - logger.info( - " <--- urBindlessImagesSampledImageHandleDestroyExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesSampledImageHandleDestroyExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6728,7 +6777,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( "urBindlessImagesImageAllocateExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesImageAllocateExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesImageAllocateExp\n"); ur_result_t result = pfnImageAllocateExp(hContext, hDevice, pImageFormat, pImageDesc, phImageMem); @@ -6741,8 +6790,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_ALLOCATE_EXP, ¶ms); - logger.info(" <--- urBindlessImagesImageAllocateExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesImageAllocateExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6770,7 +6820,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( "urBindlessImagesImageFreeExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesImageFreeExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesImageFreeExp\n"); ur_result_t result = pfnImageFreeExp(hContext, hDevice, hImageMem); @@ -6782,8 +6832,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_FREE_EXP, ¶ms); - logger.info(" <--- urBindlessImagesImageFreeExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urBindlessImagesImageFreeExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6817,7 +6867,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( "urBindlessImagesUnsampledImageCreateExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesUnsampledImageCreateExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesUnsampledImageCreateExp\n"); ur_result_t result = pfnUnsampledImageCreateExp( hContext, hDevice, hImageMem, pImageFormat, pImageDesc, phImage); @@ -6831,8 +6881,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_CREATE_EXP, ¶ms); - logger.info(" <--- urBindlessImagesUnsampledImageCreateExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesUnsampledImageCreateExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6869,7 +6920,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( "urBindlessImagesSampledImageCreateExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesSampledImageCreateExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesSampledImageCreateExp\n"); ur_result_t result = pfnSampledImageCreateExp(hContext, hDevice, hImageMem, pImageFormat, @@ -6884,8 +6935,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_CREATE_EXP, ¶ms); - logger.info(" <--- urBindlessImagesSampledImageCreateExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesSampledImageCreateExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6948,7 +7000,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( "urBindlessImagesImageCopyExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesImageCopyExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesImageCopyExp\n"); ur_result_t result = pfnImageCopyExp( hQueue, pSrc, pDst, pSrcImageDesc, pDstImageDesc, pSrcImageFormat, @@ -6963,8 +7015,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_COPY_EXP, ¶ms); - logger.info(" <--- urBindlessImagesImageCopyExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urBindlessImagesImageCopyExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -6996,7 +7048,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( "urBindlessImagesImageGetInfoExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesImageGetInfoExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesImageGetInfoExp\n"); ur_result_t result = pfnImageGetInfoExp(hContext, hImageMem, propName, pPropValue, pPropSizeRet); @@ -7009,8 +7061,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_GET_INFO_EXP, ¶ms); - logger.info(" <--- urBindlessImagesImageGetInfoExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urBindlessImagesImageGetInfoExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7042,7 +7094,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( "urBindlessImagesMipmapGetLevelExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesMipmapGetLevelExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesMipmapGetLevelExp\n"); ur_result_t result = pfnMipmapGetLevelExp(hContext, hDevice, hImageMem, mipmapLevel, phImageMem); @@ -7055,8 +7107,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_GET_LEVEL_EXP, ¶ms); - logger.info(" <--- urBindlessImagesMipmapGetLevelExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesMipmapGetLevelExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7084,7 +7137,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( "urBindlessImagesMipmapFreeExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesMipmapFreeExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesMipmapFreeExp\n"); ur_result_t result = pfnMipmapFreeExp(hContext, hDevice, hMem); @@ -7096,8 +7149,8 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_FREE_EXP, ¶ms); - logger.info(" <--- urBindlessImagesMipmapFreeExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urBindlessImagesMipmapFreeExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7132,7 +7185,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalMemoryExp( "urBindlessImagesImportExternalMemoryExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesImportExternalMemoryExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesImportExternalMemoryExp\n"); ur_result_t result = pfnImportExternalMemoryExp( hContext, hDevice, size, memHandleType, pExternalMemDesc, phExternalMem); @@ -7146,8 +7199,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_MEMORY_EXP, ¶ms); - logger.info(" <--- urBindlessImagesImportExternalMemoryExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesImportExternalMemoryExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7182,7 +7236,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( "urBindlessImagesMapExternalArrayExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesMapExternalArrayExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesMapExternalArrayExp\n"); ur_result_t result = pfnMapExternalArrayExp( hContext, hDevice, pImageFormat, pImageDesc, hExternalMem, phImageMem); @@ -7195,8 +7249,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_ARRAY_EXP, ¶ms); - logger.info(" <--- urBindlessImagesMapExternalArrayExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesMapExternalArrayExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7230,7 +7285,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalLinearMemoryExp( "urBindlessImagesMapExternalLinearMemoryExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesMapExternalLinearMemoryExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesMapExternalLinearMemoryExp\n"); ur_result_t result = pfnMapExternalLinearMemoryExp( hContext, hDevice, offset, size, hExternalMem, ppRetMem); @@ -7244,9 +7299,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalLinearMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP, ¶ms); - logger.info( - " <--- urBindlessImagesMapExternalLinearMemoryExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesMapExternalLinearMemoryExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7274,7 +7329,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalMemoryExp( "urBindlessImagesReleaseExternalMemoryExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesReleaseExternalMemoryExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesReleaseExternalMemoryExp\n"); ur_result_t result = pfnReleaseExternalMemoryExp(hContext, hDevice, hExternalMem); @@ -7288,8 +7343,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_RELEASE_EXTERNAL_MEMORY_EXP, ¶ms); - logger.info(" <--- urBindlessImagesReleaseExternalMemoryExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesReleaseExternalMemoryExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7322,7 +7378,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreExp( "urBindlessImagesImportExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesImportExternalSemaphoreExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesImportExternalSemaphoreExp\n"); ur_result_t result = pfnImportExternalSemaphoreExp( hContext, hDevice, semHandleType, pExternalSemaphoreDesc, @@ -7337,9 +7393,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_SEMAPHORE_EXP, ¶ms); - logger.info( - " <--- urBindlessImagesImportExternalSemaphoreExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesImportExternalSemaphoreExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7367,7 +7423,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalSemaphoreExp( "urBindlessImagesReleaseExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesReleaseExternalSemaphoreExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesReleaseExternalSemaphoreExp\n"); ur_result_t result = pfnReleaseExternalSemaphoreExp(hContext, hDevice, hExternalSemaphore); @@ -7382,9 +7438,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_RELEASE_EXTERNAL_SEMAPHORE_EXP, ¶ms); - logger.info( - " <--- urBindlessImagesReleaseExternalSemaphoreExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesReleaseExternalSemaphoreExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7431,7 +7487,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesWaitExternalSemaphoreExp( "urBindlessImagesWaitExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesWaitExternalSemaphoreExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesWaitExternalSemaphoreExp\n"); ur_result_t result = pfnWaitExternalSemaphoreExp( hQueue, hSemaphore, hasWaitValue, waitValue, numEventsInWaitList, @@ -7446,8 +7502,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesWaitExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_WAIT_EXTERNAL_SEMAPHORE_EXP, ¶ms); - logger.info(" <--- urBindlessImagesWaitExternalSemaphoreExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesWaitExternalSemaphoreExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7494,7 +7551,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSignalExternalSemaphoreExp( "urBindlessImagesSignalExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urBindlessImagesSignalExternalSemaphoreExp\n"); + URLOG_(logger, INFO, " ---> urBindlessImagesSignalExternalSemaphoreExp\n"); ur_result_t result = pfnSignalExternalSemaphoreExp( hQueue, hSemaphore, hasSignalValue, signalValue, numEventsInWaitList, @@ -7509,9 +7566,9 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSignalExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_SIGNAL_EXTERNAL_SEMAPHORE_EXP, ¶ms); - logger.info( - " <--- urBindlessImagesSignalExternalSemaphoreExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urBindlessImagesSignalExternalSemaphoreExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7540,7 +7597,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferCreateExp( "urCommandBufferCreateExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferCreateExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferCreateExp\n"); ur_result_t result = pfnCreateExp(hContext, hDevice, pCommandBufferDesc, phCommandBuffer); @@ -7553,8 +7610,8 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferCreateExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_CREATE_EXP, ¶ms); - logger.info(" <--- urCommandBufferCreateExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urCommandBufferCreateExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7576,7 +7633,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainExp( "urCommandBufferRetainExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferRetainExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferRetainExp\n"); ur_result_t result = pfnRetainExp(hCommandBuffer); @@ -7588,8 +7645,8 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_RETAIN_EXP, ¶ms); - logger.info(" <--- urCommandBufferRetainExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urCommandBufferRetainExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7611,7 +7668,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferReleaseExp( "urCommandBufferReleaseExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferReleaseExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferReleaseExp\n"); ur_result_t result = pfnReleaseExp(hCommandBuffer); @@ -7623,8 +7680,8 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferReleaseExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_RELEASE_EXP, ¶ms); - logger.info(" <--- urCommandBufferReleaseExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urCommandBufferReleaseExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7647,7 +7704,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferFinalizeExp( "urCommandBufferFinalizeExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferFinalizeExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferFinalizeExp\n"); ur_result_t result = pfnFinalizeExp(hCommandBuffer); @@ -7659,8 +7716,8 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferFinalizeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_FINALIZE_EXP, ¶ms); - logger.info(" <--- urCommandBufferFinalizeExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urCommandBufferFinalizeExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7739,7 +7796,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( "urCommandBufferAppendKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendKernelLaunchExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendKernelLaunchExp\n"); ur_result_t result = pfnAppendKernelLaunchExp( hCommandBuffer, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -7755,8 +7812,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_KERNEL_LAUNCH_EXP, ¶ms); - logger.info(" <--- urCommandBufferAppendKernelLaunchExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendKernelLaunchExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7815,7 +7873,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp( "urCommandBufferAppendUSMMemcpyExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendUSMMemcpyExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendUSMMemcpyExp\n"); ur_result_t result = pfnAppendUSMMemcpyExp( hCommandBuffer, pDst, pSrc, size, numSyncPointsInWaitList, @@ -7830,8 +7888,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_MEMCPY_EXP, ¶ms); - logger.info(" <--- urCommandBufferAppendUSMMemcpyExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendUSMMemcpyExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7893,7 +7952,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMFillExp( "urCommandBufferAppendUSMFillExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendUSMFillExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendUSMFillExp\n"); ur_result_t result = pfnAppendUSMFillExp( hCommandBuffer, pMemory, pPattern, patternSize, size, @@ -7908,8 +7967,8 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMFillExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_FILL_EXP, ¶ms); - logger.info(" <--- urCommandBufferAppendUSMFillExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urCommandBufferAppendUSMFillExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -7974,7 +8033,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp( "urCommandBufferAppendMemBufferCopyExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendMemBufferCopyExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferCopyExp\n"); ur_result_t result = pfnAppendMemBufferCopyExp( hCommandBuffer, hSrcMem, hDstMem, srcOffset, dstOffset, size, @@ -7990,8 +8049,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_COPY_EXP, ¶ms); - logger.info(" <--- urCommandBufferAppendMemBufferCopyExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendMemBufferCopyExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8053,7 +8113,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp( "urCommandBufferAppendMemBufferWriteExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendMemBufferWriteExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferWriteExp\n"); ur_result_t result = pfnAppendMemBufferWriteExp( hCommandBuffer, hBuffer, offset, size, pSrc, numSyncPointsInWaitList, @@ -8069,8 +8129,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_WRITE_EXP, ¶ms); - logger.info(" <--- urCommandBufferAppendMemBufferWriteExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendMemBufferWriteExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8132,7 +8193,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp( "urCommandBufferAppendMemBufferReadExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendMemBufferReadExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferReadExp\n"); ur_result_t result = pfnAppendMemBufferReadExp( hCommandBuffer, hBuffer, offset, size, pDst, numSyncPointsInWaitList, @@ -8148,8 +8209,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_READ_EXP, ¶ms); - logger.info(" <--- urCommandBufferAppendMemBufferReadExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendMemBufferReadExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8226,7 +8288,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp( "urCommandBufferAppendMemBufferCopyRectExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendMemBufferCopyRectExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferCopyRectExp\n"); ur_result_t result = pfnAppendMemBufferCopyRectExp( hCommandBuffer, hSrcMem, hDstMem, srcOrigin, dstOrigin, region, @@ -8243,9 +8305,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_COPY_RECT_EXP, ¶ms); - logger.info( - " <--- urCommandBufferAppendMemBufferCopyRectExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendMemBufferCopyRectExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8325,7 +8387,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp( "urCommandBufferAppendMemBufferWriteRectExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendMemBufferWriteRectExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferWriteRectExp\n"); ur_result_t result = pfnAppendMemBufferWriteRectExp( hCommandBuffer, hBuffer, bufferOffset, hostOffset, region, bufferRowPitch, @@ -8342,9 +8404,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_WRITE_RECT_EXP, ¶ms); - logger.info( - " <--- urCommandBufferAppendMemBufferWriteRectExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendMemBufferWriteRectExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8423,7 +8485,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp( "urCommandBufferAppendMemBufferReadRectExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendMemBufferReadRectExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferReadRectExp\n"); ur_result_t result = pfnAppendMemBufferReadRectExp( hCommandBuffer, hBuffer, bufferOffset, hostOffset, region, bufferRowPitch, @@ -8440,9 +8502,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_READ_RECT_EXP, ¶ms); - logger.info( - " <--- urCommandBufferAppendMemBufferReadRectExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendMemBufferReadRectExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8507,7 +8569,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp( "urCommandBufferAppendMemBufferFillExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendMemBufferFillExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferFillExp\n"); ur_result_t result = pfnAppendMemBufferFillExp( hCommandBuffer, hBuffer, pPattern, patternSize, offset, size, @@ -8523,8 +8585,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_FILL_EXP, ¶ms); - logger.info(" <--- urCommandBufferAppendMemBufferFillExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendMemBufferFillExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8583,7 +8646,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMPrefetchExp( "urCommandBufferAppendUSMPrefetchExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendUSMPrefetchExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendUSMPrefetchExp\n"); ur_result_t result = pfnAppendUSMPrefetchExp( hCommandBuffer, pMemory, size, flags, numSyncPointsInWaitList, @@ -8598,8 +8661,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMPrefetchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_PREFETCH_EXP, ¶ms); - logger.info(" <--- urCommandBufferAppendUSMPrefetchExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendUSMPrefetchExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8658,7 +8722,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp( "urCommandBufferAppendUSMAdviseExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendUSMAdviseExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendUSMAdviseExp\n"); ur_result_t result = pfnAppendUSMAdviseExp( hCommandBuffer, pMemory, size, advice, numSyncPointsInWaitList, @@ -8673,8 +8737,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_ADVISE_EXP, ¶ms); - logger.info(" <--- urCommandBufferAppendUSMAdviseExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendUSMAdviseExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8718,7 +8783,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendNativeCommandExp( "urCommandBufferAppendNativeCommandExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferAppendNativeCommandExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferAppendNativeCommandExp\n"); ur_result_t result = pfnAppendNativeCommandExp( hCommandBuffer, pfnNativeCommand, pData, hChildCommandBuffer, @@ -8733,8 +8798,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendNativeCommandExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_NATIVE_COMMAND_EXP, ¶ms); - logger.info(" <--- urCommandBufferAppendNativeCommandExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferAppendNativeCommandExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8773,7 +8839,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCommandBufferExp( "urEnqueueCommandBufferExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueCommandBufferExp\n"); + URLOG_(logger, INFO, " ---> urEnqueueCommandBufferExp\n"); ur_result_t result = pfnCommandBufferExp( hQueue, hCommandBuffer, numEventsInWaitList, phEventWaitList, phEvent); @@ -8786,8 +8852,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCommandBufferExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP, ¶ms); - logger.info(" <--- urEnqueueCommandBufferExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urEnqueueCommandBufferExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8817,7 +8883,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp( "urCommandBufferUpdateKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferUpdateKernelLaunchExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferUpdateKernelLaunchExp\n"); ur_result_t result = pfnUpdateKernelLaunchExp( hCommandBuffer, numKernelUpdates, pUpdateKernelLaunch); @@ -8830,8 +8896,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_KERNEL_LAUNCH_EXP, ¶ms); - logger.info(" <--- urCommandBufferUpdateKernelLaunchExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferUpdateKernelLaunchExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8857,7 +8924,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateSignalEventExp( "urCommandBufferUpdateSignalEventExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferUpdateSignalEventExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferUpdateSignalEventExp\n"); ur_result_t result = pfnUpdateSignalEventExp(hCommand, phSignalEvent); @@ -8869,8 +8936,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateSignalEventExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP, ¶ms); - logger.info(" <--- urCommandBufferUpdateSignalEventExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferUpdateSignalEventExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8900,7 +8968,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateWaitEventsExp( "urCommandBufferUpdateWaitEventsExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferUpdateWaitEventsExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferUpdateWaitEventsExp\n"); ur_result_t result = pfnUpdateWaitEventsExp(hCommand, numEventsInWaitList, phEventWaitList); @@ -8913,8 +8981,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateWaitEventsExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_WAIT_EVENTS_EXP, ¶ms); - logger.info(" <--- urCommandBufferUpdateWaitEventsExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferUpdateWaitEventsExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8946,7 +9015,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetInfoExp( "urCommandBufferGetInfoExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferGetInfoExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferGetInfoExp\n"); ur_result_t result = pfnGetInfoExp(hCommandBuffer, propName, propSize, pPropValue, pPropSizeRet); @@ -8959,8 +9028,8 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_GET_INFO_EXP, ¶ms); - logger.info(" <--- urCommandBufferGetInfoExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urCommandBufferGetInfoExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -8986,7 +9055,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetNativeHandleExp( "urCommandBufferGetNativeHandleExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urCommandBufferGetNativeHandleExp\n"); + URLOG_(logger, INFO, " ---> urCommandBufferGetNativeHandleExp\n"); ur_result_t result = pfnGetNativeHandleExp(hCommandBuffer, phNativeCommandBuffer); @@ -8999,8 +9068,9 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetNativeHandleExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_GET_NATIVE_HANDLE_EXP, ¶ms); - logger.info(" <--- urCommandBufferGetNativeHandleExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urCommandBufferGetNativeHandleExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -9061,7 +9131,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( "urEnqueueCooperativeKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueCooperativeKernelLaunchExp\n"); + URLOG_(logger, INFO, " ---> urEnqueueCooperativeKernelLaunchExp\n"); ur_result_t result = pfnCooperativeKernelLaunchExp( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -9075,8 +9145,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_COOPERATIVE_KERNEL_LAUNCH_EXP, ¶ms); - logger.info(" <--- urEnqueueCooperativeKernelLaunchExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urEnqueueCooperativeKernelLaunchExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -9119,7 +9190,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp( "urKernelSuggestMaxCooperativeGroupCountExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urKernelSuggestMaxCooperativeGroupCountExp\n"); + URLOG_(logger, INFO, " ---> urKernelSuggestMaxCooperativeGroupCountExp\n"); ur_result_t result = pfnSuggestMaxCooperativeGroupCountExp( hKernel, hDevice, workDim, pLocalWorkSize, dynamicSharedMemorySize, @@ -9134,9 +9205,9 @@ __urdlllocal ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SUGGEST_MAX_COOPERATIVE_GROUP_COUNT_EXP, ¶ms); - logger.info( - " <--- urKernelSuggestMaxCooperativeGroupCountExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urKernelSuggestMaxCooperativeGroupCountExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -9182,7 +9253,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp( "urEnqueueTimestampRecordingExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueTimestampRecordingExp\n"); + URLOG_(logger, INFO, " ---> urEnqueueTimestampRecordingExp\n"); ur_result_t result = pfnTimestampRecordingExp( hQueue, blocking, numEventsInWaitList, phEventWaitList, phEvent); @@ -9195,8 +9266,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_TIMESTAMP_RECORDING_EXP, ¶ms); - logger.info(" <--- urEnqueueTimestampRecordingExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urEnqueueTimestampRecordingExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -9263,7 +9334,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp( "urEnqueueKernelLaunchCustomExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueKernelLaunchCustomExp\n"); + URLOG_(logger, INFO, " ---> urEnqueueKernelLaunchCustomExp\n"); ur_result_t result = pfnKernelLaunchCustomExp( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -9278,8 +9349,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH_CUSTOM_EXP, ¶ms); - logger.info(" <--- urEnqueueKernelLaunchCustomExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urEnqueueKernelLaunchCustomExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -9307,7 +9378,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( "urProgramBuildExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramBuildExp\n"); + URLOG_(logger, INFO, " ---> urProgramBuildExp\n"); ur_result_t result = pfnBuildExp(hProgram, numDevices, phDevices, pOptions); @@ -9318,8 +9389,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_BUILD_EXP, ¶ms); - logger.info(" <--- urProgramBuildExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urProgramBuildExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -9347,7 +9418,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompileExp( UR_FUNCTION_PROGRAM_COMPILE_EXP, "urProgramCompileExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramCompileExp\n"); + URLOG_(logger, INFO, " ---> urProgramCompileExp\n"); ur_result_t result = pfnCompileExp(hProgram, numDevices, phDevices, pOptions); @@ -9358,8 +9429,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompileExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_COMPILE_EXP, ¶ms); - logger.info(" <--- urProgramCompileExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urProgramCompileExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -9397,7 +9468,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLinkExp( "urProgramLinkExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urProgramLinkExp\n"); + URLOG_(logger, INFO, " ---> urProgramLinkExp\n"); ur_result_t result = pfnLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram); @@ -9409,8 +9480,8 @@ __urdlllocal ur_result_t UR_APICALL urProgramLinkExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_LINK_EXP, ¶ms); - logger.info(" <--- urProgramLinkExp({}) -> {};\n", args_str.str(), - result); + URLOG_(logger, INFO, " <--- urProgramLinkExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -9435,7 +9506,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( "urUSMImportExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMImportExp\n"); + URLOG_(logger, INFO, " ---> urUSMImportExp\n"); ur_result_t result = pfnImportExp(hContext, pMem, size); @@ -9446,7 +9517,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_IMPORT_EXP, ¶ms); - logger.info(" <--- urUSMImportExp({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urUSMImportExp({}) -> {};\n", args_str.str(), + result); } return result; @@ -9469,7 +9541,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( "urUSMReleaseExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUSMReleaseExp\n"); + URLOG_(logger, INFO, " ---> urUSMReleaseExp\n"); ur_result_t result = pfnReleaseExp(hContext, pMem); @@ -9480,7 +9552,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_RELEASE_EXP, ¶ms); - logger.info(" <--- urUSMReleaseExp({}) -> {};\n", args_str.str(), result); + URLOG_(logger, INFO, " <--- urUSMReleaseExp({}) -> {};\n", args_str.str(), + result); } return result; @@ -9506,7 +9579,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp( "urUsmP2PEnablePeerAccessExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUsmP2PEnablePeerAccessExp\n"); + URLOG_(logger, INFO, " ---> urUsmP2PEnablePeerAccessExp\n"); ur_result_t result = pfnEnablePeerAccessExp(commandDevice, peerDevice); @@ -9518,8 +9591,8 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_ENABLE_PEER_ACCESS_EXP, ¶ms); - logger.info(" <--- urUsmP2PEnablePeerAccessExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urUsmP2PEnablePeerAccessExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -9545,7 +9618,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( "urUsmP2PDisablePeerAccessExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUsmP2PDisablePeerAccessExp\n"); + URLOG_(logger, INFO, " ---> urUsmP2PDisablePeerAccessExp\n"); ur_result_t result = pfnDisablePeerAccessExp(commandDevice, peerDevice); @@ -9557,8 +9630,8 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_DISABLE_PEER_ACCESS_EXP, ¶ms); - logger.info(" <--- urUsmP2PDisablePeerAccessExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urUsmP2PDisablePeerAccessExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -9599,7 +9672,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( "urUsmP2PPeerAccessGetInfoExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urUsmP2PPeerAccessGetInfoExp\n"); + URLOG_(logger, INFO, " ---> urUsmP2PPeerAccessGetInfoExp\n"); ur_result_t result = pfnPeerAccessGetInfoExp( commandDevice, peerDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -9612,8 +9685,8 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_PEER_ACCESS_GET_INFO_EXP, ¶ms); - logger.info(" <--- urUsmP2PPeerAccessGetInfoExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urUsmP2PPeerAccessGetInfoExp({}) -> {};\n", + args_str.str(), result); } return result; @@ -9651,7 +9724,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrierExt( "urEnqueueEventsWaitWithBarrierExt", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueEventsWaitWithBarrierExt\n"); + URLOG_(logger, INFO, " ---> urEnqueueEventsWaitWithBarrierExt\n"); ur_result_t result = pfnEventsWaitWithBarrierExt( hQueue, pProperties, numEventsInWaitList, phEventWaitList, phEvent); @@ -9664,8 +9737,9 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrierExt( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT, ¶ms); - logger.info(" <--- urEnqueueEventsWaitWithBarrierExt({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, + " <--- urEnqueueEventsWaitWithBarrierExt({}) -> {};\n", + args_str.str(), result); } return result; @@ -9723,7 +9797,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( "urEnqueueNativeCommandExp", ¶ms); auto &logger = getContext()->logger; - logger.info(" ---> urEnqueueNativeCommandExp\n"); + URLOG_(logger, INFO, " ---> urEnqueueNativeCommandExp\n"); ur_result_t result = pfnNativeCommandExp( hQueue, pfnNativeEnqueue, data, numMemsInMemList, phMemList, pProperties, @@ -9737,8 +9811,8 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_NATIVE_COMMAND_EXP, ¶ms); - logger.info(" <--- urEnqueueNativeCommandExp({}) -> {};\n", - args_str.str(), result); + URLOG_(logger, INFO, " <--- urEnqueueNativeCommandExp({}) -> {};\n", + args_str.str(), result); } return result; diff --git a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp index f9a82d258d98..17bbb92d7407 100644 --- a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp +++ b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp @@ -68,14 +68,13 @@ struct RefCountContext { ptr, RefRuntimeInfo{1, std::type_index(typeid(handle)), getCurrentBacktrace()}); } else { - getContext()->logger.error("Handle {} already exists", ptr); + URLOG_CTX(ERR, "Handle {} already exists", ptr); return; } break; case REFCOUNT_INCREASE: if (it == counts.end()) { - getContext()->logger.error("Attempting to retain nonexistent handle {}", - ptr); + URLOG_CTX(ERR, "Attempting to retain nonexistent handle {}", ptr); return; } else { it->second.refCount++; @@ -91,16 +90,15 @@ struct RefCountContext { } if (it->second.refCount < 0) { - getContext()->logger.error( - "Attempting to release nonexistent handle {}", ptr); + URLOG(ERR, "Attempting to release nonexistent handle {}", ptr); } else if (it->second.refCount == 0 && isAdapterHandle) { adapterCount--; } break; } - getContext()->logger.debug("Reference count for handle {} changed to {}", - ptr, it->second.refCount); + URLOG_CTX(DEBUG, "Reference count for handle {} changed to {}", ptr, + it->second.refCount); if (it->second.refCount == 0) { counts.erase(ptr); @@ -108,7 +106,7 @@ struct RefCountContext { // No more active adapters, so any references still held are leaked if (adapterCount == 0) { - logInvalidReferences(); + logInvalidReferences(SHORT_FILE, UR_STR(__LINE__)); counts.clear(); } } @@ -143,25 +141,35 @@ struct RefCountContext { return (it->second.type == std::type_index(typeid(handle))); } - void logInvalidReferences() { + void logInvalidReferences(const char *filename, const char *lineno) { for (auto &[ptr, refRuntimeInfo] : counts) { - getContext()->logger.error("Retained {} reference(s) to handle {}", - refRuntimeInfo.refCount, ptr); - getContext()->logger.error("Handle {} was recorded for first time here:", - ptr); + getContext()->logger.log(logger::Level::ERR, filename, lineno, + "Retained {} reference(s) to handle {}", + refRuntimeInfo.refCount, ptr); + getContext()->logger.log( + logger::Level::ERR, filename, lineno, + "Handle {} was recorded for first time here:", ptr); for (size_t i = 0; i < refRuntimeInfo.backtrace.size(); i++) { - getContext()->logger.error("#{} {}", i, - refRuntimeInfo.backtrace[i].c_str()); + getContext()->logger.log(logger::Level::ERR, filename, lineno, "#{} {}", + i, refRuntimeInfo.backtrace[i].c_str()); } } } - void logInvalidReference(void *ptr) { - getContext()->logger.error("There are no valid references to handle {}", - ptr); + void logInvalidReference(const char *filename, const char *lineno, + void *ptr) { + getContext()->logger.log(logger::Level::ERR, filename, lineno, + "There are no valid references to handle {}", ptr); } }; } // namespace ur_validation_layer +#define URLOG_CTX_INVALID_REFERENCE(ptr) \ + getContext()->refCountContext->logInvalidReference(SHORT_FILE, \ + UR_STR(__LINE__), ptr); +#define URLOG_CTX_INVALID_REFERENCES() \ + getContext()->refCountContext->logInvalidReferences(SHORT_FILE, \ + UR_STR(__LINE__)); + #endif /* UR_LEAK_CHECK_H */ diff --git a/unified-runtime/source/loader/layers/validation/ur_valddi.cpp b/unified-runtime/source/loader/layers/validation/ur_valddi.cpp index 55b5ad3f7b79..5354e36077a9 100644 --- a/unified-runtime/source/loader/layers/validation/ur_valddi.cpp +++ b/unified-runtime/source/loader/layers/validation/ur_valddi.cpp @@ -136,7 +136,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetLastError( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hAdapter)) { - getContext()->refCountContext->logInvalidReference(hAdapter); + URLOG_CTX_INVALID_REFERENCE(hAdapter); } ur_result_t result = pfnAdapterGetLastError(hAdapter, ppMessage, pError); @@ -187,7 +187,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hAdapter)) { - getContext()->refCountContext->logInvalidReference(hAdapter); + URLOG_CTX_INVALID_REFERENCE(hAdapter); } ur_result_t result = @@ -365,7 +365,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hAdapter)) { - getContext()->refCountContext->logInvalidReference(hAdapter); + URLOG_CTX_INVALID_REFERENCE(hAdapter); } ur_result_t result = pfnCreateWithNativeHandle(hNativePlatform, hAdapter, @@ -505,7 +505,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = @@ -599,7 +599,7 @@ __urdlllocal ur_result_t UR_APICALL urDevicePartition( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnPartition(hDevice, pProperties, NumDevices, @@ -645,7 +645,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceSelectBinary( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = @@ -677,7 +677,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnGetNativeHandle(hDevice, phNativeDevice); @@ -713,7 +713,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hAdapter)) { - getContext()->refCountContext->logInvalidReference(hAdapter); + URLOG_CTX_INVALID_REFERENCE(hAdapter); } ur_result_t result = @@ -751,7 +751,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = @@ -892,7 +892,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = @@ -924,7 +924,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnGetNativeHandle(hContext, phNativeContext); @@ -965,7 +965,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hAdapter)) { - getContext()->refCountContext->logInvalidReference(hAdapter); + URLOG_CTX_INVALID_REFERENCE(hAdapter); } ur_result_t result = pfnCreateWithNativeHandle( @@ -1004,7 +1004,7 @@ __urdlllocal ur_result_t UR_APICALL urContextSetExtendedDeleter( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnSetExtendedDeleter(hContext, pfnDeleter, pUserData); @@ -1078,7 +1078,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreate( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = @@ -1141,7 +1141,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = @@ -1245,7 +1245,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = @@ -1280,12 +1280,12 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hMem)) { - getContext()->refCountContext->logInvalidReference(hMem); + URLOG_CTX_INVALID_REFERENCE(hMem); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnGetNativeHandle(hMem, hDevice, phNativeMem); @@ -1321,7 +1321,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = @@ -1372,7 +1372,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnImageCreateWithNativeHandle( @@ -1428,7 +1428,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hMemory)) { - getContext()->refCountContext->logInvalidReference(hMemory); + URLOG_CTX_INVALID_REFERENCE(hMemory); } ur_result_t result = @@ -1480,7 +1480,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hMemory)) { - getContext()->refCountContext->logInvalidReference(hMemory); + URLOG_CTX_INVALID_REFERENCE(hMemory); } ur_result_t result = @@ -1523,7 +1523,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreate( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnCreate(hContext, pDesc, phSampler); @@ -1624,7 +1624,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hSampler)) { - getContext()->refCountContext->logInvalidReference(hSampler); + URLOG_CTX_INVALID_REFERENCE(hSampler); } ur_result_t result = @@ -1656,7 +1656,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hSampler)) { - getContext()->refCountContext->logInvalidReference(hSampler); + URLOG_CTX_INVALID_REFERENCE(hSampler); } ur_result_t result = pfnGetNativeHandle(hSampler, phNativeSampler); @@ -1692,7 +1692,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnCreateWithNativeHandle(hNativeSampler, hContext, @@ -1744,12 +1744,12 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(pool)) { - getContext()->refCountContext->logInvalidReference(pool); + URLOG_CTX_INVALID_REFERENCE(pool); } ur_result_t result = pfnHostAlloc(hContext, pUSMDesc, pool, size, ppMem); @@ -1801,17 +1801,17 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(pool)) { - getContext()->refCountContext->logInvalidReference(pool); + URLOG_CTX_INVALID_REFERENCE(pool); } ur_result_t result = @@ -1864,17 +1864,17 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(pool)) { - getContext()->refCountContext->logInvalidReference(pool); + URLOG_CTX_INVALID_REFERENCE(pool); } ur_result_t result = @@ -1906,7 +1906,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnFree(hContext, pMem); @@ -1949,7 +1949,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMGetMemAllocInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnGetMemAllocInfo(hContext, pMem, propName, propSize, @@ -1990,7 +1990,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreate( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnPoolCreate(hContext, pPoolDesc, ppPool); @@ -2091,7 +2091,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hPool)) { - getContext()->refCountContext->logInvalidReference(hPool); + URLOG_CTX_INVALID_REFERENCE(hPool); } ur_result_t result = @@ -2147,12 +2147,12 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGranularityGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnGranularityGetInfo( @@ -2191,7 +2191,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemReserve( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnReserve(hContext, pStart, size, ppStart); @@ -2224,7 +2224,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemFree( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnFree(hContext, pStart, size); @@ -2269,12 +2269,12 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemMap( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hPhysicalMem)) { - getContext()->refCountContext->logInvalidReference(hPhysicalMem); + URLOG_CTX_INVALID_REFERENCE(hPhysicalMem); } ur_result_t result = @@ -2308,7 +2308,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemUnmap( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnUnmap(hContext, pStart, size); @@ -2346,7 +2346,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemSetAccess( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnSetAccess(hContext, pStart, size, flags); @@ -2394,7 +2394,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnGetInfo(hContext, pStart, size, propName, propSize, @@ -2439,12 +2439,12 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemCreate( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = @@ -2540,7 +2540,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hPhysicalMem)) { - getContext()->refCountContext->logInvalidReference(hPhysicalMem); + URLOG_CTX_INVALID_REFERENCE(hPhysicalMem); } ur_result_t result = @@ -2592,7 +2592,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = @@ -2662,7 +2662,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = @@ -2701,12 +2701,12 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = pfnBuild(hContext, hProgram, pOptions); @@ -2739,12 +2739,12 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompile( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = pfnCompile(hContext, hProgram, pOptions); @@ -2790,7 +2790,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = @@ -2885,12 +2885,12 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetFunctionPointer( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = pfnGetFunctionPointer(hDevice, hProgram, pFunctionName, @@ -2937,12 +2937,12 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetGlobalVariablePointer( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = pfnGetGlobalVariablePointer( @@ -2996,7 +2996,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = @@ -3044,12 +3044,12 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetBuildInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnGetBuildInfo(hProgram, hDevice, propName, propSize, @@ -3088,7 +3088,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramSetSpecializationConstants( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = @@ -3120,7 +3120,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = pfnGetNativeHandle(hProgram, phNativeProgram); @@ -3156,7 +3156,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnCreateWithNativeHandle(hNativeProgram, hContext, @@ -3197,7 +3197,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreate( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = pfnCreate(hProgram, pKernelName, phKernel); @@ -3240,7 +3240,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } ur_result_t result = @@ -3273,7 +3273,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } ur_result_t result = pfnSetArgLocal(hKernel, argIndex, argSize, pProperties); @@ -3325,7 +3325,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } ur_result_t result = @@ -3370,12 +3370,12 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetGroupInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnGetGroupInfo(hKernel, hDevice, propName, propSize, @@ -3420,12 +3420,12 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSubGroupInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnGetSubGroupInfo(hKernel, hDevice, propName, propSize, @@ -3509,7 +3509,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } ur_result_t result = @@ -3551,7 +3551,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetExecInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } ur_result_t result = @@ -3587,12 +3587,12 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hArgValue)) { - getContext()->refCountContext->logInvalidReference(hArgValue); + URLOG_CTX_INVALID_REFERENCE(hArgValue); } ur_result_t result = @@ -3628,12 +3628,12 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hArgValue)) { - getContext()->refCountContext->logInvalidReference(hArgValue); + URLOG_CTX_INVALID_REFERENCE(hArgValue); } ur_result_t result = @@ -3671,7 +3671,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetSpecializationConstants( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } ur_result_t result = @@ -3703,7 +3703,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } ur_result_t result = pfnGetNativeHandle(hKernel, phNativeKernel); @@ -3741,12 +3741,12 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreateWithNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = pfnCreateWithNativeHandle( @@ -3805,12 +3805,12 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnGetSuggestedLocalWorkSize( @@ -3859,7 +3859,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = @@ -3911,12 +3911,12 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreate( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnCreate(hContext, hDevice, pProperties, phQueue); @@ -4003,7 +4003,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnGetNativeHandle(hQueue, pDesc, phNativeQueue); @@ -4041,12 +4041,12 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreateWithNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnCreateWithNativeHandle(hNativeQueue, hContext, @@ -4077,7 +4077,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFinish( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnFinish(hQueue); @@ -4103,7 +4103,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFlush( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnFlush(hQueue); @@ -4150,7 +4150,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hEvent)) { - getContext()->refCountContext->logInvalidReference(hEvent); + URLOG_CTX_INVALID_REFERENCE(hEvent); } ur_result_t result = @@ -4193,7 +4193,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetProfilingInfo( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hEvent)) { - getContext()->refCountContext->logInvalidReference(hEvent); + URLOG_CTX_INVALID_REFERENCE(hEvent); } ur_result_t result = @@ -4302,7 +4302,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hEvent)) { - getContext()->refCountContext->logInvalidReference(hEvent); + URLOG_CTX_INVALID_REFERENCE(hEvent); } ur_result_t result = pfnGetNativeHandle(hEvent, phNativeEvent); @@ -4338,7 +4338,7 @@ __urdlllocal ur_result_t UR_APICALL urEventCreateWithNativeHandle( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = @@ -4384,7 +4384,7 @@ __urdlllocal ur_result_t UR_APICALL urEventSetCallback( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hEvent)) { - getContext()->refCountContext->logInvalidReference(hEvent); + URLOG_CTX_INVALID_REFERENCE(hEvent); } ur_result_t result = pfnSetCallback(hEvent, execStatus, pfnNotify, pUserData); @@ -4462,12 +4462,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } ur_result_t result = pfnKernelLaunch( @@ -4521,7 +4521,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWait( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = @@ -4575,7 +4575,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnEventsWaitWithBarrier(hQueue, numEventsInWaitList, @@ -4650,12 +4650,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = @@ -4731,12 +4731,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = @@ -4854,12 +4854,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = pfnMemBufferReadRect( @@ -4979,12 +4979,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = pfnMemBufferWriteRect( @@ -5068,17 +5068,17 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBufferSrc)) { - getContext()->refCountContext->logInvalidReference(hBufferSrc); + URLOG_CTX_INVALID_REFERENCE(hBufferSrc); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBufferDst)) { - getContext()->refCountContext->logInvalidReference(hBufferDst); + URLOG_CTX_INVALID_REFERENCE(hBufferDst); } ur_result_t result = @@ -5197,17 +5197,17 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBufferSrc)) { - getContext()->refCountContext->logInvalidReference(hBufferSrc); + URLOG_CTX_INVALID_REFERENCE(hBufferSrc); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBufferDst)) { - getContext()->refCountContext->logInvalidReference(hBufferDst); + URLOG_CTX_INVALID_REFERENCE(hBufferDst); } ur_result_t result = pfnMemBufferCopyRect( @@ -5299,12 +5299,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = @@ -5388,12 +5388,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageRead( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hImage)) { - getContext()->refCountContext->logInvalidReference(hImage); + URLOG_CTX_INVALID_REFERENCE(hImage); } ur_result_t result = pfnMemImageRead( @@ -5477,12 +5477,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageWrite( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hImage)) { - getContext()->refCountContext->logInvalidReference(hImage); + URLOG_CTX_INVALID_REFERENCE(hImage); } ur_result_t result = pfnMemImageWrite( @@ -5571,17 +5571,17 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageCopy( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hImageSrc)) { - getContext()->refCountContext->logInvalidReference(hImageSrc); + URLOG_CTX_INVALID_REFERENCE(hImageSrc); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hImageDst)) { - getContext()->refCountContext->logInvalidReference(hImageDst); + URLOG_CTX_INVALID_REFERENCE(hImageDst); } ur_result_t result = @@ -5663,12 +5663,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = @@ -5731,12 +5731,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hMem)) { - getContext()->refCountContext->logInvalidReference(hMem); + URLOG_CTX_INVALID_REFERENCE(hMem); } ur_result_t result = pfnMemUnmap( @@ -5819,7 +5819,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = @@ -5903,7 +5903,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = @@ -5978,7 +5978,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMPrefetch( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnUSMPrefetch( @@ -6030,7 +6030,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMAdvise( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnUSMAdvise(hQueue, pMem, size, advice, phEvent); @@ -6133,7 +6133,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill2D( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = @@ -6237,7 +6237,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = @@ -6313,12 +6313,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = pfnDeviceGlobalVariableWrite( @@ -6394,12 +6394,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = pfnDeviceGlobalVariableRead( @@ -6476,12 +6476,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueReadHostPipe( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = @@ -6559,12 +6559,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueWriteHostPipe( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = @@ -6625,12 +6625,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMDeviceAllocExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(pPool)) { - getContext()->refCountContext->logInvalidReference(pPool); + URLOG_CTX_INVALID_REFERENCE(pPool); } ur_result_t result = pfnUSMDeviceAllocExp(hQueue, pPool, size, pProperties, @@ -6691,12 +6691,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMSharedAllocExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(pPool)) { - getContext()->refCountContext->logInvalidReference(pPool); + URLOG_CTX_INVALID_REFERENCE(pPool); } ur_result_t result = pfnUSMSharedAllocExp(hQueue, pPool, size, pProperties, @@ -6757,12 +6757,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMHostAllocExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(pPool)) { - getContext()->refCountContext->logInvalidReference(pPool); + URLOG_CTX_INVALID_REFERENCE(pPool); } ur_result_t result = @@ -6814,12 +6814,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFreeExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(pPool)) { - getContext()->refCountContext->logInvalidReference(pPool); + URLOG_CTX_INVALID_REFERENCE(pPool); } ur_result_t result = pfnUSMFreeExp(hQueue, pPool, pMem, numEventsInWaitList, @@ -6865,12 +6865,12 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreateExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnPoolCreateExp(hContext, hDevice, pPoolDesc, pPool); @@ -6910,17 +6910,17 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hPool)) { - getContext()->refCountContext->logInvalidReference(hPool); + URLOG_CTX_INVALID_REFERENCE(hPool); } ur_result_t result = pfnPoolDestroyExp(hContext, hDevice, hPool); @@ -6959,17 +6959,17 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetThresholdExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hPool)) { - getContext()->refCountContext->logInvalidReference(hPool); + URLOG_CTX_INVALID_REFERENCE(hPool); } ur_result_t result = @@ -7007,12 +7007,12 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnPoolGetDefaultDevicePoolExp(hContext, hDevice, pPool); @@ -7050,7 +7050,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hPool)) { - getContext()->refCountContext->logInvalidReference(hPool); + URLOG_CTX_INVALID_REFERENCE(hPool); } ur_result_t result = @@ -7088,17 +7088,17 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hPool)) { - getContext()->refCountContext->logInvalidReference(hPool); + URLOG_CTX_INVALID_REFERENCE(hPool); } ur_result_t result = pfnPoolSetDevicePoolExp(hContext, hDevice, hPool); @@ -7135,12 +7135,12 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnPoolGetDevicePoolExp(hContext, hDevice, pPool); @@ -7178,17 +7178,17 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolTrimToExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hPool)) { - getContext()->refCountContext->logInvalidReference(hPool); + URLOG_CTX_INVALID_REFERENCE(hPool); } ur_result_t result = @@ -7250,17 +7250,17 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(pool)) { - getContext()->refCountContext->logInvalidReference(pool); + URLOG_CTX_INVALID_REFERENCE(pool); } ur_result_t result = @@ -7298,12 +7298,12 @@ urBindlessImagesUnsampledImageHandleDestroyExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = @@ -7340,12 +7340,12 @@ urBindlessImagesSampledImageHandleDestroyExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = @@ -7396,12 +7396,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnImageAllocateExp(hContext, hDevice, pImageFormat, @@ -7436,12 +7436,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnImageFreeExp(hContext, hDevice, hImageMem); @@ -7493,12 +7493,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnUnsampledImageCreateExp( @@ -7556,17 +7556,17 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hSampler)) { - getContext()->refCountContext->logInvalidReference(hSampler); + URLOG_CTX_INVALID_REFERENCE(hSampler); } ur_result_t result = @@ -7662,7 +7662,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnImageCopyExp( @@ -7706,7 +7706,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnImageGetInfoExp(hContext, hImageMem, propName, @@ -7748,12 +7748,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnMipmapGetLevelExp(hContext, hDevice, hImageMem, @@ -7788,12 +7788,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnMipmapFreeExp(hContext, hDevice, hMem); @@ -7842,12 +7842,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalMemoryExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnImportExternalMemoryExp( @@ -7903,12 +7903,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnMapExternalArrayExp( @@ -7955,12 +7955,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalLinearMemoryExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnMapExternalLinearMemoryExp( @@ -7998,12 +7998,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalMemoryExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = @@ -8051,12 +8051,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnImportExternalSemaphoreExp( @@ -8095,12 +8095,12 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalSemaphoreExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = @@ -8160,7 +8160,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesWaitExternalSemaphoreExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnWaitExternalSemaphoreExp( @@ -8221,7 +8221,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSignalExternalSemaphoreExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnSignalExternalSemaphoreExp( @@ -8264,12 +8264,12 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferCreateExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = @@ -8437,7 +8437,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } ur_result_t result = pfnAppendKernelLaunchExp( @@ -8689,12 +8689,12 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hSrcMem)) { - getContext()->refCountContext->logInvalidReference(hSrcMem); + URLOG_CTX_INVALID_REFERENCE(hSrcMem); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDstMem)) { - getContext()->refCountContext->logInvalidReference(hDstMem); + URLOG_CTX_INVALID_REFERENCE(hDstMem); } ur_result_t result = pfnAppendMemBufferCopyExp( @@ -8777,7 +8777,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = pfnAppendMemBufferWriteExp( @@ -8860,7 +8860,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = pfnAppendMemBufferReadExp( @@ -8953,12 +8953,12 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hSrcMem)) { - getContext()->refCountContext->logInvalidReference(hSrcMem); + URLOG_CTX_INVALID_REFERENCE(hSrcMem); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDstMem)) { - getContext()->refCountContext->logInvalidReference(hDstMem); + URLOG_CTX_INVALID_REFERENCE(hDstMem); } ur_result_t result = pfnAppendMemBufferCopyRectExp( @@ -9055,7 +9055,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = pfnAppendMemBufferWriteRectExp( @@ -9151,7 +9151,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = pfnAppendMemBufferReadRectExp( @@ -9237,7 +9237,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hBuffer)) { - getContext()->refCountContext->logInvalidReference(hBuffer); + URLOG_CTX_INVALID_REFERENCE(hBuffer); } ur_result_t result = pfnAppendMemBufferFillExp( @@ -9507,7 +9507,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCommandBufferExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnCommandBufferExp( @@ -9766,12 +9766,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } ur_result_t result = pfnCooperativeKernelLaunchExp( @@ -9823,12 +9823,12 @@ __urdlllocal ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hDevice)) { - getContext()->refCountContext->logInvalidReference(hDevice); + URLOG_CTX_INVALID_REFERENCE(hDevice); } ur_result_t result = pfnSuggestMaxCooperativeGroupCountExp( @@ -9896,7 +9896,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnTimestampRecordingExp( @@ -9977,12 +9977,12 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hKernel)) { - getContext()->refCountContext->logInvalidReference(hKernel); + URLOG_CTX_INVALID_REFERENCE(hKernel); } ur_result_t result = pfnKernelLaunchCustomExp( @@ -10020,7 +10020,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = pfnBuildExp(hProgram, numDevices, phDevices, pOptions); @@ -10055,7 +10055,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompileExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hProgram)) { - getContext()->refCountContext->logInvalidReference(hProgram); + URLOG_CTX_INVALID_REFERENCE(hProgram); } ur_result_t result = pfnCompileExp(hProgram, numDevices, phDevices, pOptions); @@ -10108,7 +10108,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLinkExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnLinkExp(hContext, numDevices, phDevices, count, @@ -10142,7 +10142,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnImportExp(hContext, pMem, size); @@ -10173,7 +10173,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hContext)) { - getContext()->refCountContext->logInvalidReference(hContext); + URLOG_CTX_INVALID_REFERENCE(hContext); } ur_result_t result = pfnReleaseExp(hContext, pMem); @@ -10205,12 +10205,12 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(commandDevice)) { - getContext()->refCountContext->logInvalidReference(commandDevice); + URLOG_CTX_INVALID_REFERENCE(commandDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(peerDevice)) { - getContext()->refCountContext->logInvalidReference(peerDevice); + URLOG_CTX_INVALID_REFERENCE(peerDevice); } ur_result_t result = pfnEnablePeerAccessExp(commandDevice, peerDevice); @@ -10242,12 +10242,12 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(commandDevice)) { - getContext()->refCountContext->logInvalidReference(commandDevice); + URLOG_CTX_INVALID_REFERENCE(commandDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(peerDevice)) { - getContext()->refCountContext->logInvalidReference(peerDevice); + URLOG_CTX_INVALID_REFERENCE(peerDevice); } ur_result_t result = pfnDisablePeerAccessExp(commandDevice, peerDevice); @@ -10305,12 +10305,12 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(commandDevice)) { - getContext()->refCountContext->logInvalidReference(commandDevice); + URLOG_CTX_INVALID_REFERENCE(commandDevice); } if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(peerDevice)) { - getContext()->refCountContext->logInvalidReference(peerDevice); + URLOG_CTX_INVALID_REFERENCE(peerDevice); } ur_result_t result = pfnPeerAccessGetInfoExp( @@ -10370,7 +10370,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrierExt( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnEventsWaitWithBarrierExt( @@ -10440,7 +10440,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( if (getContext()->enableLifetimeValidation && !getContext()->refCountContext->isReferenceValid(hQueue)) { - getContext()->refCountContext->logInvalidReference(hQueue); + URLOG_CTX_INVALID_REFERENCE(hQueue); } ur_result_t result = pfnNativeCommandExp( @@ -11906,7 +11906,7 @@ ur_result_t context_t::init(ur_dditable_t *dditable, ur_result_t context_t::tearDown() { if (enableLeakChecking) { - getContext()->refCountContext->logInvalidReferences(); + URLOG_CTX_INVALID_REFERENCES(); } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp b/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp index 4e47e102c73b..c9e99ccb0858 100644 --- a/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp +++ b/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp @@ -33,8 +33,7 @@ context_t::~context_t() {} result == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) \ return UR_RESULT_SUCCESS; \ if (result != UR_RESULT_SUCCESS) { \ - getContext()->logger.error("Unexpected non-success result code from {}", \ - #result); \ + URLOG_CTX(ERR, "Unexpected non-success result code from {}", #result); \ assert(0); \ return result; \ } diff --git a/unified-runtime/source/loader/ur_adapter_registry.hpp b/unified-runtime/source/loader/ur_adapter_registry.hpp index 4ec315fc723b..d29742652ed0 100644 --- a/unified-runtime/source/loader/ur_adapter_registry.hpp +++ b/unified-runtime/source/loader/ur_adapter_registry.hpp @@ -49,9 +49,9 @@ struct FilterTerm { auto backendIter = backendNameMap.find(backend); if (backendIter == backendNameMap.end()) { - logger::debug( - "ONEAPI_DEVICE_SELECTOR Pre-Filter with illegal backend '{}' ", - backend); + URLOG(DEBUG, + "ONEAPI_DEVICE_SELECTOR Pre-Filter with illegal backend '{}' ", + backend); return false; } if (backendIter->second == match_backend) { @@ -74,9 +74,9 @@ struct FilterTerm { } auto deviceIter = deviceTypeMap.find(deviceString); if (deviceIter == deviceTypeMap.end()) { - logger::debug( - "ONEAPI_DEVICE_SELECTOR Pre-Filter with illegal device '{}' ", - deviceString); + URLOG(DEBUG, + "ONEAPI_DEVICE_SELECTOR Pre-Filter with illegal device '{}' ", + deviceString); continue; } if (deviceIter->second == match_device) { @@ -102,16 +102,17 @@ class AdapterRegistry { try { forceLoadedAdaptersOpt = getenv_to_vec("UR_ADAPTERS_FORCE_LOAD"); } catch (const std::invalid_argument &e) { - logger::error(e.what()); + URLOG(ERR, e.what()); } if (forceLoadedAdaptersOpt.has_value()) { for (const auto &s : forceLoadedAdaptersOpt.value()) { auto path = fs::path(s); if (path.filename().extension() == STATIC_LIBRARY_EXTENSION) { - logger::warning("UR_ADAPTERS_FORCE_LOAD contains a path to a static" - "library {}, it will be skipped", - s); + URLOG(WARN, + "UR_ADAPTERS_FORCE_LOAD contains a path to a static" + "library {}, it will be skipped", + s); continue; } @@ -119,16 +120,17 @@ class AdapterRegistry { try { exists = fs::exists(path); } catch (std::exception &e) { - logger::error(e.what()); + URLOG(ERR, e.what()); } if (exists) { forceLoaded = true; adaptersLoadPaths.emplace_back(std::vector{std::move(path)}); } else { - logger::warning("Detected nonexistent path {} in environment " - "variable UR_ADAPTERS_FORCE_LOAD", - s); + URLOG(WARN, + "Detected nonexistent path {} in environment " + "variable UR_ADAPTERS_FORCE_LOAD", + s); } } } else { @@ -203,7 +205,7 @@ class AdapterRegistry { try { pathStringsOpt = getenv_to_vec("UR_ADAPTERS_SEARCH_PATH"); } catch (const std::invalid_argument &e) { - logger::error(e.what()); + URLOG(ERR, e.what()); return std::nullopt; } @@ -214,9 +216,10 @@ class AdapterRegistry { if (fs::exists(path)) { paths.emplace_back(path); } else { - logger::warning("Detected nonexistent path {} in environmental " - "variable UR_ADAPTERS_SEARCH_PATH", - s); + URLOG(WARN, + "Detected nonexistent path {} in environmental " + "variable UR_ADAPTERS_SEARCH_PATH", + s); } } } @@ -232,12 +235,12 @@ class AdapterRegistry { } catch (...) { // If the selector is malformed, then we ignore selector and return // success. - logger::error("ERROR: missing backend, format of filter = " - "'[!]backend:filterStrings'"); + URLOG(ERR, "ERROR: missing backend, format of filter = " + "'[!]backend:filterStrings'"); return UR_RESULT_SUCCESS; } - logger::debug("getenv_to_map parsed env var and {} a map", - (odsEnvMap.has_value() ? "produced" : "failed to produce")); + URLOG(DEBUG, "getenv_to_map parsed env var and {} a map", + (odsEnvMap.has_value() ? "produced" : "failed to produce")); // if the ODS env var is not set at all, then pretend it was set to the // default @@ -255,21 +258,21 @@ class AdapterRegistry { if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case // malformed term: missing backend -- output ERROR, then continue - logger::error("ERROR: missing backend, format of filter = " - "'[!]backend:filterStrings'"); + URLOG(ERR, "ERROR: missing backend, format of filter = " + "'[!]backend:filterStrings'"); continue; } - logger::debug("ONEAPI_DEVICE_SELECTOR Pre-Filter with backend '{}' ", - backend); + URLOG(DEBUG, "ONEAPI_DEVICE_SELECTOR Pre-Filter with backend '{}' ", + backend); bool PositiveFilter = backend.front() != '!'; - logger::debug("term is a {} filter", - (PositiveFilter ? "positive" : "negative")); + URLOG(DEBUG, "term is a {} filter", + (PositiveFilter ? "positive" : "negative")); if (!PositiveFilter) { - logger::debug("DEBUG: backend was '{}'", backend); + URLOG(DEBUG, "DEBUG: backend was '{}'", backend); // Trim off the "!" from the backend backend.erase(backend.cbegin()); - logger::debug("DEBUG: backend now '{}'", backend); + URLOG(DEBUG, "DEBUG: backend now '{}'", backend); } // Make sure the backend is lower case @@ -337,10 +340,9 @@ class AdapterRegistry { std::string(adapterName).find("v2") != std::string::npos; if (v2Requested != v2Adapter) { - logger::info( - "The adapter '{}' is skipped because {} {}.", adapterName, - "UR_LOADER_USE_LEVEL_ZERO_V2 or SYCL_UR_USE_LEVEL_ZERO_V2", - v2Requested ? "is set" : "is not set"); + URLOG(INFO, "The adapter '{}' is skipped because {} {}.", adapterName, + "UR_LOADER_USE_LEVEL_ZERO_V2 or SYCL_UR_USE_LEVEL_ZERO_V2", + v2Requested ? "is set" : "is not set"); continue; } } diff --git a/unified-runtime/source/loader/ur_lib.cpp b/unified-runtime/source/loader/ur_lib.cpp index ef46895861ae..b85dba31ee7c 100644 --- a/unified-runtime/source/loader/ur_lib.cpp +++ b/unified-runtime/source/loader/ur_lib.cpp @@ -76,7 +76,7 @@ __urdlllocal ur_result_t context_t::Init( ur_result_t result; const char *logger_name = "loader"; logger::init(logger_name); - logger::debug("Logger {} initialized successfully!", logger_name); + URLOG(DEBUG, "Logger {} initialized successfully!", logger_name); result = ur_loader::getContext()->init(); @@ -215,7 +215,7 @@ ur_result_t urLoaderTearDown() { ur_result_t result = ret == 0 ? UR_RESULT_SUCCESS : UR_RESULT_ERROR_UNINITIALIZED; - logger::info("---> urLoaderTearDown() -> {}", result); + URLOG(INFO, "---> urLoaderTearDown() -> {}", result); return result; } @@ -324,9 +324,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // `std::map` with `std::queue>` or // something similar.) auto maybeEnvVarMap = getenv_to_map("ONEAPI_DEVICE_SELECTOR", false); - logger::debug( - "getenv_to_map parsed env var and {} a map", - (maybeEnvVarMap.has_value() ? "produced" : "failed to produce")); + URLOG(DEBUG, "getenv_to_map parsed env var and {} a map", + (maybeEnvVarMap.has_value() ? "produced" : "failed to produce")); // if the ODS env var is not set at all, then pretend it was set to the // default @@ -461,23 +460,22 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case // malformed term: missing backend -- output ERROR, then continue - logger::error("ERROR: missing backend, format of filter = " - "'[!]backend:filterStrings'"); + URLOG(ERR, "ERROR: missing backend, format of filter = " + "'[!]backend:filterStrings'"); continue; } enum FilterType { AcceptFilter, DiscardFilter, } termType = (backend.front() != '!') ? AcceptFilter : DiscardFilter; - logger::debug( - "termType is {}", - (termType != AcceptFilter ? "DiscardFilter" : "AcceptFilter")); + URLOG(DEBUG, "termType is {}", + (termType != AcceptFilter ? "DiscardFilter" : "AcceptFilter")); auto &deviceList = (termType != AcceptFilter) ? discardDeviceList : acceptDeviceList; if (termType != AcceptFilter) { - logger::debug("DEBUG: backend was '{}'", backend); + URLOG(DEBUG, "DEBUG: backend was '{}'", backend); backend.erase(backend.cbegin()); - logger::debug("DEBUG: backend now '{}'", backend); + URLOG(DEBUG, "DEBUG: backend now '{}'", backend); } // Note the hPlatform -> platformBackend -> platformBackendName conversion // above guarantees minimal sanity for the comparison with backend from the @@ -492,13 +490,13 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, })) { // irrelevant term for current request: different backend -- silently // ignore - logger::error("unrecognised backend '{}'", backend); + URLOG(ERR, "unrecognised backend '{}'", backend); return UR_RESULT_ERROR_INVALID_VALUE; } if (termPair.second.size() == 0) { // malformed term: missing filterStrings -- output ERROR - logger::error("missing filterStrings, format of filter = " - "'[!]backend:filterStrings'"); + URLOG(ERR, "missing filterStrings, format of filter = " + "'[!]backend:filterStrings'"); return UR_RESULT_ERROR_INVALID_VALUE; } if (std::find_if(termPair.second.cbegin(), termPair.second.cend(), @@ -506,8 +504,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, termPair.second.cend()) { // FIXME: never true because getenv_to_map rejects this case // malformed term: missing filterString -- output warning, then continue - logger::warning("WARNING: empty filterString, format of filterStrings " - "= 'filterString[,filterString[,...]]'"); + URLOG(WARN, "WARNING: empty filterString, format of filterStrings " + "= 'filterString[,filterString[,...]]'"); continue; } if (std::find_if(termPair.second.cbegin(), termPair.second.cend(), @@ -515,8 +513,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return std::count(s.cbegin(), s.cend(), '.') > 2; }) != termPair.second.cend()) { // malformed term: too many dots in filterString - logger::error("too many dots in filterString, format of " - "filterString = 'root[.sub[.subsub]]'"); + URLOG(ERR, "too many dots in filterString, format of " + "filterString = 'root[.sub[.subsub]]'"); return UR_RESULT_ERROR_INVALID_VALUE; } if (std::find_if(termPair.second.cbegin(), termPair.second.cend(), @@ -537,7 +535,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return false; // no BAD things, so must be okay }) != termPair.second.cend()) { // malformed term: star dot no-star in filterString - logger::error("invalid wildcard in filterString, '*.' => '*.*'"); + URLOG(ERR, "invalid wildcard in filterString, '*.' => '*.*'"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -596,10 +594,9 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, 0, 0, nullptr}); } - logger::debug("DEBUG: size of acceptDeviceList = {}", - acceptDeviceList.size()); - logger::debug("DEBUG: size of discardDeviceList = {}", - discardDeviceList.size()); + URLOG(DEBUG, "DEBUG: size of acceptDeviceList = {}", acceptDeviceList.size()); + URLOG(DEBUG, "DEBUG: size of discardDeviceList = {}", + discardDeviceList.size()); std::vector rootDevices; std::vector subDevices; @@ -725,50 +722,50 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // is a subsubdevice filter, then it must be '*.*.*' matches = (filter.hwType == device.hwType) || (filter.hwType == DeviceHardwareType::UR_DEVICE_TYPE_ALL); - logger::debug("DEBUG: In ApplyFilter, if block case 1, matches = {}", - matches); + URLOG(DEBUG, "DEBUG: In ApplyFilter, if block case 1, matches = {}", + matches); } else if (filter.rootId != device.rootId) { // root part in filter is a number but does not match the number in the // root part of device matches = false; - logger::debug("DEBUG: In ApplyFilter, if block case 2, matches = ", - matches); + URLOG(DEBUG, + "DEBUG: In ApplyFilter, if block case 2, matches = ", matches); } else if (filter.level == DevicePartLevel::ROOT) { // this is a root device filter with a number that matches matches = true; - logger::debug("DEBUG: In ApplyFilter, if block case 3, matches = ", - matches); + URLOG(DEBUG, + "DEBUG: In ApplyFilter, if block case 3, matches = ", matches); } else if (filter.subId == DeviceIdTypeALL) { // sub type of star always matches (when root part matches, which we // already know here) if this is a subdevice filter, then it must be // 'matches.*' if this is a subsubdevice filter, then it must be // 'matches.*.*' matches = true; - logger::debug("DEBUG: In ApplyFilter, if block case 4, matches = ", - matches); + URLOG(DEBUG, + "DEBUG: In ApplyFilter, if block case 4, matches = ", matches); } else if (filter.subId != device.subId) { // sub part in filter is a number but does not match the number in the sub // part of device matches = false; - logger::debug("DEBUG: In ApplyFilter, if block case 5, matches = ", - matches); + URLOG(DEBUG, + "DEBUG: In ApplyFilter, if block case 5, matches = ", matches); } else if (filter.level == DevicePartLevel::SUB) { // this is a sub device number filter, numbers match in both parts matches = true; - logger::debug("DEBUG: In ApplyFilter, if block case 6, matches = ", - matches); + URLOG(DEBUG, + "DEBUG: In ApplyFilter, if block case 6, matches = ", matches); } else if (filter.subsubId == DeviceIdTypeALL) { // subsub type of star always matches (when other parts match, which we // already know here) this is a subsub device filter, it must be // 'matches.matches.*' matches = true; - logger::debug("DEBUG: In ApplyFilter, if block case 7, matches = ", - matches); + URLOG(DEBUG, + "DEBUG: In ApplyFilter, if block case 7, matches = ", matches); } else { // this is a subsub device filter, numbers in all three parts match matches = (filter.subsubId == device.subsubId); - logger::debug("DEBUG: In ApplyFilter, if block case 8, matches = ", - matches); + URLOG(DEBUG, + "DEBUG: In ApplyFilter, if block case 8, matches = ", matches); } return matches; }; @@ -832,10 +829,11 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, subSubDevices.end()); } if (numAlreadySelected == selectedDevices.size()) { - logger::warning("WARNING: an accept term was ignored because it " - "does not select any additional devices" - "selectedDevices.size() = {}", - selectedDevices.size()); + URLOG(WARN, + "WARNING: an accept term was ignored because it " + "does not select any additional devices" + "selectedDevices.size() = {}", + selectedDevices.size()); } } diff --git a/unified-runtime/test/loader/platforms/platforms.cpp b/unified-runtime/test/loader/platforms/platforms.cpp index bbadbbcb199c..c315c764bcd1 100644 --- a/unified-runtime/test/loader/platforms/platforms.cpp +++ b/unified-runtime/test/loader/platforms/platforms.cpp @@ -27,23 +27,23 @@ int main(int, char *[]) { // Initialize the platform status = urLoaderInit(0, nullptr); if (status != UR_RESULT_SUCCESS) { - out.error("urLoaderInit failed with return code: {}", status); + URLOG_(out, ERR, "urLoaderInit failed with return code: {}", status); return 1; } - out.info("urLoaderInit succeeded."); + URLOG_(out, INFO, "urLoaderInit succeeded."); uint32_t adapterCount = 0; std::vector adapters; status = urAdapterGet(0, nullptr, &adapterCount); if (status != UR_RESULT_SUCCESS) { - out.error("urAdapterGet failed with return code: {}", status); + URLOG_(out, ERR, "urAdapterGet failed with return code: {}", status); return 1; } adapters.resize(adapterCount); status = urAdapterGet(adapterCount, adapters.data(), nullptr); if (status != UR_RESULT_SUCCESS) { - out.error("urAdapterGet failed with return code: {}", status); + URLOG_(out, ERR, "urAdapterGet failed with return code: {}", status); return 1; } @@ -53,16 +53,16 @@ int main(int, char *[]) { status = urPlatformGet(adapters.data(), adapterCount, 1, nullptr, &platformCount); if (status != UR_RESULT_SUCCESS) { - out.error("urPlatformGet failed with return code: {}", status); + URLOG_(out, ERR, "urPlatformGet failed with return code: {}", status); goto out; } - out.info("urPlatformGet found {} platforms", platformCount); + URLOG_(out, INFO, "urPlatformGet found {} platforms", platformCount); platforms.resize(platformCount); status = urPlatformGet(adapters.data(), adapterCount, platformCount, platforms.data(), nullptr); if (status != UR_RESULT_SUCCESS) { - out.error("urPlatformGet failed with return code: {}", status); + URLOG_(out, ERR, "urPlatformGet failed with return code: {}", status); goto out; } @@ -70,7 +70,7 @@ int main(int, char *[]) { size_t name_len; status = urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, 0, nullptr, &name_len); if (status != UR_RESULT_SUCCESS) { - out.error("urPlatformGetInfo failed with return code: {}", status); + URLOG_(out, ERR, "urPlatformGetInfo failed with return code: {}", status); goto out; } @@ -80,11 +80,11 @@ int main(int, char *[]) { status = urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, name_len, name, nullptr); if (status != UR_RESULT_SUCCESS) { - out.error("urPlatformGetInfo failed with return code: {}", status); + URLOG_(out, ERR, "urPlatformGetInfo failed with return code: {}", status); free(name); goto out; } - out.info("Found {} ", name); + URLOG_(out, INFO, "Found {} ", name); free(name); } diff --git a/unified-runtime/test/unit/logger/env_var.cpp b/unified-runtime/test/unit/logger/env_var.cpp index faf7a15d8889..2171afe70fe4 100644 --- a/unified-runtime/test/unit/logger/env_var.cpp +++ b/unified-runtime/test/unit/logger/env_var.cpp @@ -8,17 +8,17 @@ ////////////////////////////////////////////////////////////////////////////// TEST_F(LoggerFromEnvVar, DebugMessage) { - logger::debug("Test message: {}", "success"); + URLOG(DEBUG, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, InfoMessage) { - logger::info("Test message: {}", "success"); + URLOG(INFO, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, WarningMessage) { - logger::warning("Test message: {}", "success"); + URLOG(WARN, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, ErrorMessage) { - logger::error("Test message: {}", "success"); + URLOG(ERR, "Test message: {}", "success"); } diff --git a/unified-runtime/tools/urtrace/collector.cpp b/unified-runtime/tools/urtrace/collector.cpp index 3d4abb944c59..715ccf970e74 100644 --- a/unified-runtime/tools/urtrace/collector.cpp +++ b/unified-runtime/tools/urtrace/collector.cpp @@ -86,7 +86,7 @@ std::string time_to_str(std::chrono::nanoseconds dur, enum time_unit unit) { ostr << d.count() << "s"; } break; default: { - out.error("invalid time unit {}", unit); + URLOG_(out, ERR, "invalid time unit {}", unit); break; } } @@ -123,7 +123,7 @@ static class cli_args { return std::nullopt; } if (arg_values.size() != 1) { - out.warn("{} requires a single argument, skipping...", name); + URLOG_(out, WARN, "{} requires a single argument, skipping...", name); return std::nullopt; } return arg_values.at(0); @@ -161,18 +161,20 @@ static class cli_args { try { filter = filter_str; } catch (const std::regex_error &err) { - out.warn("invalid filter regex {} {}", *filter_str, err.what()); + URLOG_(out, WARN, "invalid filter regex {} {}", *filter_str, + err.what()); } } else { - out.warn("unknown {} argument {}.", ARGS_ENV, arg_name); + URLOG_(out, WARN, "unknown {} argument {}.", ARGS_ENV, arg_name); } } } - out.debug("collector args (.print_begin = {}, .profiling = {}, " - ".time_unit = {}, .filter = {}, .output_format = {})", - print_begin, profiling, time_unit_str[time_unit], - filter_str.has_value() ? *filter_str : "none", - output_format_str[output_format]); + URLOG_(out, DEBUG, + "collector args (.print_begin = {}, .profiling = {}, " + ".time_unit = {}, .filter = {}, .output_format = {})", + print_begin, profiling, time_unit_str[time_unit], + filter_str.has_value() ? *filter_str : "none", + output_format_str[output_format]); } enum time_unit time_unit; @@ -202,7 +204,7 @@ class TraceWriter { class HumanReadable : public TraceWriter { void begin(uint64_t id, const char *fname, std::string args) override { if (cli_args.print_begin) { - out.info("begin({}) - {}({});", id, fname, args); + URLOG_(out, INFO, "begin({}) - {}({});", id, fname, args); } } void end(uint64_t id, const char *fname, std::string args, Timepoint tp, @@ -218,8 +220,8 @@ class HumanReadable : public TraceWriter { std::chrono::duration_cast(tp - start_tp); profile_str << " (" << time_to_str(dur, cli_args.time_unit) << ")"; } - out.info("{}{}({}) -> {};{}", prefix_str.str(), fname, args, *resultp, - profile_str.str()); + URLOG_(out, INFO, "{}{}({}) -> {};{}", prefix_str.str(), fname, args, + *resultp, profile_str.str()); } }; @@ -234,15 +236,16 @@ class JsonWriter : public TraceWriter { // not much we can do here... } } - void prologue() override { out.info("{{\n \"traceEvents\": ["); } + void prologue() override { URLOG_(out, INFO, "{{\n \"traceEvents\": ["); } void epilogue() override { // Empty trace to avoid ending in a comma // To prevent that last comma from being printed in the first place // we could synchronize the entire 'end' function, while reversing the // logic and printing commas at the front. Not worth it probably. - out.info("{{\"name\": \"\", \"cat\": \"\", \"ph\": \"\", \"pid\": \"\", " - "\"tid\": \"\", \"ts\": \"\"}}"); - out.info("]\n}}"); + URLOG_(out, INFO, + "{{\"name\": \"\", \"cat\": \"\", \"ph\": \"\", \"pid\": \"\", " + "\"tid\": \"\", \"ts\": \"\"}}"); + URLOG_(out, INFO, "]\n}}"); } void begin(uint64_t, const char *, std::string) override {} @@ -254,7 +257,7 @@ class JsonWriter : public TraceWriter { .count(); auto dur_us = std::chrono::duration_cast(dur).count(); - out.info("{{\ + URLOG_(out, INFO, "{{\ \"cat\": \"UR\", \ \"ph\": \"X\",\ \"pid\": {},\ @@ -264,8 +267,7 @@ class JsonWriter : public TraceWriter { \"name\": \"{}\",\ \"args\": \"({})\"\ }},", - ur_getpid(), std::this_thread::get_id(), ts_us, dur_us, fname, - args); + ur_getpid(), std::this_thread::get_id(), ts_us, dur_us, fname, args); } }; @@ -320,8 +322,8 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, if (auto regex = cli_args.filter) { if (!std::regex_match(args->function_name, *regex)) { - out.debug("function {} does not match regex filter, skipping...", - args->function_name); + URLOG_(out, DEBUG, "function {} does not match regex filter, skipping...", + args->function_name); return; } } @@ -342,9 +344,10 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, } else if (trace_type == TRACE_FN_END) { auto ctx = pop_instance_data(instance); if (!ctx) { - out.error("Received TRACE_FN_END without corresponding " - "TRACE_FN_BEGIN, instance {}. Skipping...", - instance); + URLOG_(out, ERR, + "Received TRACE_FN_END without corresponding " + "TRACE_FN_BEGIN, instance {}. Skipping...", + instance); return; } auto resultp = static_cast(args->ret_data); @@ -352,7 +355,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, writer()->end(instance, args->function_name, args_str.str(), time_for_end, *ctx->start, resultp); } else { - out.warn("unsupported trace type"); + URLOG_(out, WARN, "unsupported trace type"); } } @@ -365,27 +368,27 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, unsigned int minor_version, const char *, const char *stream_name) { if (stream_name == nullptr) { - out.debug("Found stream with null name. Skipping..."); + URLOG_(out, DEBUG, "Found stream with null name. Skipping..."); return; } if (std::string_view(stream_name) != UR_STREAM_NAME) { - out.debug("Found stream: {}. Expected: {}. Skipping...", stream_name, - UR_STREAM_NAME); + URLOG_(out, DEBUG, "Found stream: {}. Expected: {}. Skipping...", + stream_name, UR_STREAM_NAME); return; } if (UR_MAKE_VERSION(major_version, minor_version) != UR_API_VERSION_CURRENT) { - out.error("Invalid stream version: {}.{}. Expected: {}.{}. Skipping...", - major_version, minor_version, - UR_MAJOR_VERSION(UR_API_VERSION_CURRENT), - UR_MINOR_VERSION(UR_API_VERSION_CURRENT)); + URLOG_( + out, ERR, "Invalid stream version: {}.{}. Expected: {}.{}. Skipping...", + major_version, minor_version, UR_MAJOR_VERSION(UR_API_VERSION_CURRENT), + UR_MINOR_VERSION(UR_API_VERSION_CURRENT)); return; } uint8_t stream_id = xptiRegisterStream(stream_name); - out.debug("Registered stream {} ({}.{}).", stream_name, major_version, - minor_version); + URLOG_(out, DEBUG, "Registered stream {} ({}.{}).", stream_name, + major_version, minor_version); writer()->prologue(); xptiRegisterCallback(stream_id, TRACE_FN_BEGIN, trace_cb); @@ -397,12 +400,12 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, */ XPTI_CALLBACK_API void xptiTraceFinish(const char *stream_name) { if (stream_name == nullptr) { - out.debug("Found stream with null name. Skipping..."); + URLOG_(out, DEBUG, "Found stream with null name. Skipping..."); return; } if (std::string_view(stream_name) != UR_STREAM_NAME) { - out.debug("Found stream: {}. Expected: {}. Skipping...", stream_name, - UR_STREAM_NAME); + URLOG_(out, DEBUG, "Found stream: {}. Expected: {}. Skipping...", + stream_name, UR_STREAM_NAME); return; } From 146e801d3a802e3c144fb7ff287590827c831086 Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Thu, 27 Mar 2025 17:15:38 +0000 Subject: [PATCH 02/16] Merge remote-tracking branch 'upstream/sycl' into urlog --- .ci/metrics/requirements.lock.txt | 64 +- .github/workflows/sycl-post-commit.yml | 5 - devops/scripts/benchmarks/README.md | 8 +- devops/scripts/benchmarks/benches/base.py | 74 +- devops/scripts/benchmarks/benches/compute.py | 431 +++++-- devops/scripts/benchmarks/benches/llamacpp.py | 38 +- devops/scripts/benchmarks/benches/result.py | 40 - .../scripts/benchmarks/benches/syclbench.py | 82 +- devops/scripts/benchmarks/benches/test.py | 54 +- devops/scripts/benchmarks/benches/umf.py | 11 +- devops/scripts/benchmarks/benches/velocity.py | 131 ++- devops/scripts/benchmarks/history.py | 57 +- devops/scripts/benchmarks/main.py | 160 ++- devops/scripts/benchmarks/options.py | 10 +- devops/scripts/benchmarks/output_html.py | 2 +- devops/scripts/benchmarks/output_markdown.py | 44 +- devops/scripts/benchmarks/presets.py | 38 + .../benchmarks/utils/compute_runtime.py | 15 +- .../benchmarks/{benches => utils}/oneapi.py | 22 +- devops/scripts/benchmarks/utils/result.py | 69 ++ devops/scripts/benchmarks/utils/utils.py | 28 +- llvm/docs/requirements-hashed.txt | 10 +- .../llvm/SYCLLowerIR/DeviceConfigFile.td | 4 +- .../Instrumentation/AddressSanitizer.cpp | 11 +- .../Instrumentation/MemorySanitizer.cpp | 11 +- .../AddressSanitizer/SPIRV/device_global.ll | 4 + .../SPIRV/instrument_device_global.ll | 4 + .../SPIRV/instrument_global_address_space.ll | 147 +-- llvm/utils/git/requirements.txt | 65 +- llvm/utils/git/requirements_formatting.txt | 60 +- sycl-jit/common/include/Kernel.h | 2 +- .../lib/translation/KernelTranslation.cpp | 17 +- sycl-jit/passes/target/TargetFusionInfo.cpp | 1 + sycl/include/sycl/context.hpp | 18 + sycl/include/sycl/detail/cg_types.hpp | 10 +- sycl/include/sycl/detail/property_helper.hpp | 8 +- .../experimental/async_alloc/async_alloc.hpp | 95 ++ .../experimental/async_alloc/memory_pool.hpp | 122 ++ .../async_alloc/memory_pool_properties.hpp | 80 ++ .../sycl/ext/oneapi/experimental/graph.hpp | 5 +- sycl/include/sycl/handler.hpp | 74 +- sycl/include/sycl/info/aspects.def | 1 + sycl/source/CMakeLists.txt | 3 + sycl/source/context.cpp | 37 + sycl/source/detail/async_alloc.cpp | 156 +++ sycl/source/detail/cg.hpp | 44 + sycl/source/detail/config.hpp | 4 +- sycl/source/detail/context_impl.cpp | 41 + sycl/source/detail/context_impl.hpp | 13 + sycl/source/detail/device_impl.cpp | 14 +- sycl/source/detail/graph_impl.hpp | 4 + sycl/source/detail/handler_impl.hpp | 10 + sycl/source/detail/jit_compiler.cpp | 15 +- sycl/source/detail/jit_compiler.hpp | 2 +- sycl/source/detail/memory_pool.cpp | 68 ++ sycl/source/detail/memory_pool_impl.cpp | 223 ++++ sycl/source/detail/memory_pool_impl.hpp | 65 ++ .../program_manager/program_manager.cpp | 11 +- .../program_manager/program_manager.hpp | 2 +- sycl/source/detail/queue_impl.cpp | 4 +- sycl/source/detail/queue_impl.hpp | 9 +- sycl/source/detail/scheduler/commands.cpp | 30 + sycl/source/detail/scheduler/scheduler.cpp | 2 +- sycl/source/detail/scheduler/scheduler.hpp | 2 +- sycl/source/feature_test.hpp.in | 1 + sycl/source/handler.cpp | 18 + .../AsyncAlloc/device/async_alloc.cpp | 144 +++ .../device/async_alloc_from_default_pool.cpp | 123 ++ .../device/async_alloc_from_pool.cpp | 121 ++ .../device/async_alloc_zero_init.cpp | 84 ++ .../AsyncAlloc/device/memory_pool.cpp | 168 +++ .../device/ooo_queue_async_alloc.cpp | 134 +++ .../ooo_queue_async_alloc_from_pool.cpp | 139 +++ sycl/test-e2e/AsyncAlloc/lit.local.cfg | 1 + .../test-e2e/Basic/test_num_kernel_copies.cpp | 43 + .../MemorySanitizer/check_device_global.cpp | 7 - .../is_compatible/is_compatible_amdgcn.cpp | 10 +- .../is_compatible/is_compatible_nvptx64.cpp | 8 +- .../is_compatible_several_targets.cpp | 12 +- .../is_compatible/is_compatible_spir64.cpp | 6 +- .../is_compatible_spir64_gen.cpp | 8 +- .../is_compatible_spir64_x86_64.cpp | 12 +- .../is_compatible_with_aspects.cpp | 11 +- .../test-e2e/ThreadSanitizer/check_buffer.cpp | 33 + .../ThreadSanitizer/check_sub_buffer.cpp | 33 + .../sampled_fetch/fetch_1D_USM_host.cpp | 102 ++ ...tch_1D_USM.cpp => fetch_1D_USM_shared.cpp} | 0 ...tch_2D_USM.cpp => fetch_2D_USM_device.cpp} | 0 .../bindless_images/sampling_1D_USM_host.cpp | 126 ++ sycl/test/abi/sycl_symbols_linux.dump | 36 +- sycl/test/abi/sycl_symbols_windows.dump | 64 +- sycl/test/include_deps/sycl_accessor.hpp.cpp | 1 + .../include_deps/sycl_detail_core.hpp.cpp | 1 + sycl/test/include_deps/update_test.sh | 0 .../test/self-contained-headers/lit.local.cfg | 3 - .../oneapi/experimental/backend/cuda.hpp.cpp | 9 + sycl/tools/sycl-trace/CMakeLists.txt | 3 +- sycl/unittests/Extensions/CMakeLists.txt | 1 + .../Extensions/CommandGraph/Common.hpp | 2 + .../Extensions/CommandGraph/Exceptions.cpp | 140 +++ .../Extensions/KernelQueries/CMakeLists.txt | 3 + .../KernelQueries/SpillMemorySize.cpp | 91 ++ .../Extensions/KernelQueries/test_plan.md | 53 + unified-runtime/include/ur_api.h | 96 +- unified-runtime/include/ur_api_funcs.def | 2 +- unified-runtime/include/ur_ddi.h | 13 +- unified-runtime/include/ur_print.h | 20 +- unified-runtime/include/ur_print.hpp | 63 +- .../scripts/core/EXP-ASYNC-ALLOC.rst | 5 +- unified-runtime/scripts/core/device.yml | 5 +- .../scripts/core/exp-async-alloc.yml | 58 +- unified-runtime/scripts/core/manifests.yml | 2 +- unified-runtime/scripts/core/registry.yml | 6 +- .../source/adapters/cuda/CMakeLists.txt | 3 +- .../source/adapters/cuda/async_alloc.cpp | 83 +- .../source/adapters/cuda/common.cpp | 42 + .../source/adapters/cuda/common.hpp | 4 + .../source/adapters/cuda/device.cpp | 65 +- .../source/adapters/cuda/device.hpp | 20 +- .../adapters/cuda/ur_interface_loader.cpp | 2 +- unified-runtime/source/adapters/cuda/usm.cpp | 228 +++- unified-runtime/source/adapters/cuda/usm.hpp | 18 + .../adapters/hip/ur_interface_loader.cpp | 2 +- unified-runtime/source/adapters/hip/usm.cpp | 5 +- .../level_zero/ur_interface_loader.cpp | 2 +- .../level_zero/ur_interface_loader.hpp | 7 +- .../source/adapters/level_zero/usm.cpp | 5 +- .../source/adapters/level_zero/v2/api.cpp | 7 +- .../source/adapters/mock/ur_mockddi.cpp | 84 +- .../source/adapters/native_cpu/usm.cpp | 5 +- .../source/adapters/opencl/command_buffer.cpp | 3 +- .../source/adapters/opencl/usm.cpp | 5 +- unified-runtime/source/common/ur_util.hpp | 2 +- unified-runtime/source/loader/CMakeLists.txt | 2 + .../loader/layers/sanitizer/msan/msan_ddi.cpp | 4 +- .../layers/sanitizer/tsan/tsan_buffer.cpp | 210 ++++ .../layers/sanitizer/tsan/tsan_buffer.hpp | 84 ++ .../loader/layers/sanitizer/tsan/tsan_ddi.cpp | 1012 +++++++++++++++-- .../sanitizer/tsan/tsan_interceptor.cpp | 64 +- .../sanitizer/tsan/tsan_interceptor.hpp | 51 + .../layers/sanitizer/ur_sanitizer_layer.cpp | 8 +- .../loader/layers/tracing/ur_trcddi.cpp | 91 +- .../loader/layers/validation/ur_valddi.cpp | 98 +- unified-runtime/source/loader/loader.def.in | 4 +- unified-runtime/source/loader/loader.map.in | 4 +- .../source/loader/ur_adapter_registry.hpp | 7 +- unified-runtime/source/loader/ur_ldrddi.cpp | 68 +- unified-runtime/source/loader/ur_libapi.cpp | 84 +- unified-runtime/source/loader/ur_print.cpp | 16 +- unified-runtime/source/ur_api.cpp | 72 +- .../test/adapters/cuda/CMakeLists.txt | 4 +- .../conformance/device/urDeviceGetInfo.cpp | 16 + .../third_party/benchmark_requirements.txt | 44 - unified-runtime/third_party/requirements.txt | 2 +- 154 files changed, 6171 insertions(+), 1278 deletions(-) delete mode 100644 devops/scripts/benchmarks/benches/result.py create mode 100644 devops/scripts/benchmarks/presets.py rename devops/scripts/benchmarks/{benches => utils}/oneapi.py (78%) create mode 100644 devops/scripts/benchmarks/utils/result.py create mode 100644 sycl/include/sycl/ext/oneapi/experimental/async_alloc/async_alloc.hpp create mode 100644 sycl/include/sycl/ext/oneapi/experimental/async_alloc/memory_pool.hpp create mode 100644 sycl/include/sycl/ext/oneapi/experimental/async_alloc/memory_pool_properties.hpp create mode 100644 sycl/source/detail/async_alloc.cpp create mode 100644 sycl/source/detail/memory_pool.cpp create mode 100644 sycl/source/detail/memory_pool_impl.cpp create mode 100644 sycl/source/detail/memory_pool_impl.hpp create mode 100644 sycl/test-e2e/AsyncAlloc/device/async_alloc.cpp create mode 100644 sycl/test-e2e/AsyncAlloc/device/async_alloc_from_default_pool.cpp create mode 100644 sycl/test-e2e/AsyncAlloc/device/async_alloc_from_pool.cpp create mode 100644 sycl/test-e2e/AsyncAlloc/device/async_alloc_zero_init.cpp create mode 100644 sycl/test-e2e/AsyncAlloc/device/memory_pool.cpp create mode 100644 sycl/test-e2e/AsyncAlloc/device/ooo_queue_async_alloc.cpp create mode 100644 sycl/test-e2e/AsyncAlloc/device/ooo_queue_async_alloc_from_pool.cpp create mode 100644 sycl/test-e2e/AsyncAlloc/lit.local.cfg create mode 100644 sycl/test-e2e/Basic/test_num_kernel_copies.cpp create mode 100644 sycl/test-e2e/ThreadSanitizer/check_buffer.cpp create mode 100644 sycl/test-e2e/ThreadSanitizer/check_sub_buffer.cpp create mode 100644 sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM_host.cpp rename sycl/test-e2e/bindless_images/sampled_fetch/{fetch_1D_USM.cpp => fetch_1D_USM_shared.cpp} (100%) rename sycl/test-e2e/bindless_images/sampled_fetch/{fetch_2D_USM.cpp => fetch_2D_USM_device.cpp} (100%) create mode 100644 sycl/test-e2e/bindless_images/sampling_1D_USM_host.cpp mode change 100644 => 100755 sycl/test/include_deps/update_test.sh create mode 100644 sycl/test/self-contained-headers/sycl/ext/oneapi/experimental/backend/cuda.hpp.cpp create mode 100644 sycl/unittests/Extensions/KernelQueries/CMakeLists.txt create mode 100644 sycl/unittests/Extensions/KernelQueries/SpillMemorySize.cpp create mode 100644 sycl/unittests/Extensions/KernelQueries/test_plan.md create mode 100644 unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp create mode 100644 unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.hpp delete mode 100644 unified-runtime/third_party/benchmark_requirements.txt diff --git a/.ci/metrics/requirements.lock.txt b/.ci/metrics/requirements.lock.txt index 74d34f74d33b..cd7f714739e2 100644 --- a/.ci/metrics/requirements.lock.txt +++ b/.ci/metrics/requirements.lock.txt @@ -186,34 +186,38 @@ charset-normalizer==3.4.0 \ --hash=sha256:fe9f97feb71aa9896b81973a7bbada8c49501dc73e58a10fcef6663af95e5079 \ --hash=sha256:ffc519621dce0c767e96b9c53f09c5d215578e10b02c285809f76509a3931482 # via requests -cryptography==43.0.3 \ - --hash=sha256:0c580952eef9bf68c4747774cde7ec1d85a6e61de97281f2dba83c7d2c806362 \ - --hash=sha256:0f996e7268af62598f2fc1204afa98a3b5712313a55c4c9d434aef49cadc91d4 \ - --hash=sha256:1ec0bcf7e17c0c5669d881b1cd38c4972fade441b27bda1051665faaa89bdcaa \ - --hash=sha256:281c945d0e28c92ca5e5930664c1cefd85efe80e5c0d2bc58dd63383fda29f83 \ - --hash=sha256:2ce6fae5bdad59577b44e4dfed356944fbf1d925269114c28be377692643b4ff \ - --hash=sha256:315b9001266a492a6ff443b61238f956b214dbec9910a081ba5b6646a055a805 \ - --hash=sha256:443c4a81bb10daed9a8f334365fe52542771f25aedaf889fd323a853ce7377d6 \ - --hash=sha256:4a02ded6cd4f0a5562a8887df8b3bd14e822a90f97ac5e544c162899bc467664 \ - --hash=sha256:53a583b6637ab4c4e3591a15bc9db855b8d9dee9a669b550f311480acab6eb08 \ - --hash=sha256:63efa177ff54aec6e1c0aefaa1a241232dcd37413835a9b674b6e3f0ae2bfd3e \ - --hash=sha256:74f57f24754fe349223792466a709f8e0c093205ff0dca557af51072ff47ab18 \ - --hash=sha256:7e1ce50266f4f70bf41a2c6dc4358afadae90e2a1e5342d3c08883df1675374f \ - --hash=sha256:81ef806b1fef6b06dcebad789f988d3b37ccaee225695cf3e07648eee0fc6b73 \ - --hash=sha256:846da004a5804145a5f441b8530b4bf35afbf7da70f82409f151695b127213d5 \ - --hash=sha256:8ac43ae87929a5982f5948ceda07001ee5e83227fd69cf55b109144938d96984 \ - --hash=sha256:9762ea51a8fc2a88b70cf2995e5675b38d93bf36bd67d91721c309df184f49bd \ - --hash=sha256:a2a431ee15799d6db9fe80c82b055bae5a752bef645bba795e8e52687c69efe3 \ - --hash=sha256:bf7a1932ac4176486eab36a19ed4c0492da5d97123f1406cf15e41b05e787d2e \ - --hash=sha256:c2e6fc39c4ab499049df3bdf567f768a723a5e8464816e8f009f121a5a9f4405 \ - --hash=sha256:cbeb489927bd7af4aa98d4b261af9a5bc025bd87f0e3547e11584be9e9427be2 \ - --hash=sha256:d03b5621a135bffecad2c73e9f4deb1a0f977b9a8ffe6f8e002bf6c9d07b918c \ - --hash=sha256:d56e96520b1020449bbace2b78b603442e7e378a9b3bd68de65c782db1507995 \ - --hash=sha256:df6b6c6d742395dd77a23ea3728ab62f98379eff8fb61be2744d4679ab678f73 \ - --hash=sha256:e1be4655c7ef6e1bbe6b5d0403526601323420bcf414598955968c9ef3eb7d16 \ - --hash=sha256:f18c716be16bc1fea8e95def49edf46b82fccaa88587a45f8dc0ff6ab5d8e0a7 \ - --hash=sha256:f46304d6f0c6ab8e52770addfa2fc41e6629495548862279641972b6215451cd \ - --hash=sha256:f7b178f11ed3664fd0e995a47ed2b5ff0a12d893e41dd0494f406d1cf555cab7 +cryptography==44.0.1 \ + --hash=sha256:00918d859aa4e57db8299607086f793fa7813ae2ff5a4637e318a25ef82730f7 \ + --hash=sha256:1e8d181e90a777b63f3f0caa836844a1182f1f265687fac2115fcf245f5fbec3 \ + --hash=sha256:1f9a92144fa0c877117e9748c74501bea842f93d21ee00b0cf922846d9d0b183 \ + --hash=sha256:21377472ca4ada2906bc313168c9dc7b1d7ca417b63c1c3011d0c74b7de9ae69 \ + --hash=sha256:24979e9f2040c953a94bf3c6782e67795a4c260734e5264dceea65c8f4bae64a \ + --hash=sha256:2a46a89ad3e6176223b632056f321bc7de36b9f9b93b2cc1cccf935a3849dc62 \ + --hash=sha256:322eb03ecc62784536bc173f1483e76747aafeb69c8728df48537eb431cd1911 \ + --hash=sha256:436df4f203482f41aad60ed1813811ac4ab102765ecae7a2bbb1dbb66dcff5a7 \ + --hash=sha256:4f422e8c6a28cf8b7f883eb790695d6d45b0c385a2583073f3cec434cc705e1a \ + --hash=sha256:53f23339864b617a3dfc2b0ac8d5c432625c80014c25caac9082314e9de56f41 \ + --hash=sha256:5fed5cd6102bb4eb843e3315d2bf25fede494509bddadb81e03a859c1bc17b83 \ + --hash=sha256:610a83540765a8d8ce0f351ce42e26e53e1f774a6efb71eb1b41eb01d01c3d12 \ + --hash=sha256:6c8acf6f3d1f47acb2248ec3ea261171a671f3d9428e34ad0357148d492c7864 \ + --hash=sha256:6f76fdd6fd048576a04c5210d53aa04ca34d2ed63336d4abd306d0cbe298fddf \ + --hash=sha256:72198e2b5925155497a5a3e8c216c7fb3e64c16ccee11f0e7da272fa93b35c4c \ + --hash=sha256:887143b9ff6bad2b7570da75a7fe8bbf5f65276365ac259a5d2d5147a73775f2 \ + --hash=sha256:888fcc3fce0c888785a4876ca55f9f43787f4c5c1cc1e2e0da71ad481ff82c5b \ + --hash=sha256:8e6a85a93d0642bd774460a86513c5d9d80b5c002ca9693e63f6e540f1815ed0 \ + --hash=sha256:94f99f2b943b354a5b6307d7e8d19f5c423a794462bde2bf310c770ba052b1c4 \ + --hash=sha256:9b336599e2cb77b1008cb2ac264b290803ec5e8e89d618a5e978ff5eb6f715d9 \ + --hash=sha256:a2d8a7045e1ab9b9f803f0d9531ead85f90c5f2859e653b61497228b18452008 \ + --hash=sha256:b8272f257cf1cbd3f2e120f14c68bff2b6bdfcc157fafdee84a1b795efd72862 \ + --hash=sha256:bf688f615c29bfe9dfc44312ca470989279f0e94bb9f631f85e3459af8efc009 \ + --hash=sha256:d9c5b9f698a83c8bd71e0f4d3f9f839ef244798e5ffe96febfa9714717db7af7 \ + --hash=sha256:dd7c7e2d71d908dc0f8d2027e1604102140d84b155e658c20e8ad1304317691f \ + --hash=sha256:df978682c1504fc93b3209de21aeabf2375cb1571d4e61907b3e7a2540e83026 \ + --hash=sha256:e403f7f766ded778ecdb790da786b418a9f2394f36e8cc8b796cc056ab05f44f \ + --hash=sha256:eb3889330f2a4a148abead555399ec9a32b13b7c8ba969b72d8e500eb7ef84cd \ + --hash=sha256:f4daefc971c2d1f82f03097dc6f216744a6cd2ac0f04c68fb935ea2ba2a0d420 \ + --hash=sha256:f51f5705ab27898afda1aaa430f34ad90dc117421057782022edf0600bec5f14 \ + --hash=sha256:fd0ee90072861e276b0ff08bd627abec29e32a53b2be44e41dbcdf87cbee2b00 # via pyjwt deprecated==1.2.15 \ --hash=sha256:353bc4a8ac4bfc96800ddab349d89c25dec1079f65fd53acdcc1e0b975b21320 \ @@ -232,8 +236,8 @@ pygithub==2.5.0 \ --hash=sha256:e1613ac508a9be710920d26eb18b1905ebd9926aa49398e88151c1b526aad3cf # via -r ./requirements.txt pyjwt[crypto]==2.10.1 \ - --hash=sha256:543b77207db656de204372350926bed5a86201c4cbff159f623f79c7bb487a15 \ - --hash=sha256:7628a7eb7938959ac1b26e819a1df0fd3259505627b575e4bad6d08f76db695c + --hash=sha256:3cc5772eb20009233caf06e9d8a0577824723b44e6648ee0a2aedb6cf9381953 \ + --hash=sha256:dcdd193e30abefd5debf142f9adfcdd2b58004e644f25406ffaebd50bd98dacb # via pygithub pynacl==1.5.0 \ --hash=sha256:06b8f6fa7f5de8d5d2f7573fe8c863c051225a27b61e6860fd047b1775807858 \ diff --git a/.github/workflows/sycl-post-commit.yml b/.github/workflows/sycl-post-commit.yml index 6c97dedf21fc..a2b388a0ca48 100644 --- a/.github/workflows/sycl-post-commit.yml +++ b/.github/workflows/sycl-post-commit.yml @@ -58,11 +58,6 @@ jobs: runner: '["Linux", "arc"]' extra_lit_opts: --param matrix-xmx8=True reset_intel_gpu: true - - name: AMD/HIP - runner: '["Linux", "amdgpu"]' - image_options: -u 1001 --device=/dev/dri --device=/dev/kfd - target_devices: hip:gpu - reset_intel_gpu: false # Performance tests below. Specifics: # - only run performance tests (use LIT_FILTER env) # - ask llvm-lit to show all the output, even for PASS (-a) diff --git a/devops/scripts/benchmarks/README.md b/devops/scripts/benchmarks/README.md index 004fe14eca35..fcadded3cad5 100644 --- a/devops/scripts/benchmarks/README.md +++ b/devops/scripts/benchmarks/README.md @@ -6,6 +6,8 @@ Scripts for running performance tests on SYCL and Unified Runtime. - [Velocity Bench](https://github.com/oneapi-src/Velocity-Bench) - [Compute Benchmarks](https://github.com/intel/compute-benchmarks/) +- [LlamaCpp Benchmarks](https://github.com/ggerganov/llama.cpp) +- [SYCL-Bench](https://github.com/unisa-hpc/sycl-bench) ## Running @@ -27,8 +29,6 @@ You can also include additional benchmark parameters, such as environment variab Once all the required information is entered, click the "Run workflow" button to initiate a new workflow run. This will execute the benchmarks and then post the results as a comment on the specified Pull Request. -By default, all benchmark runs are compared against `baseline`, which is a well-established set of the latest data. - You must be a member of the `oneapi-src` organization to access these features. ## Comparing results @@ -37,8 +37,8 @@ By default, the benchmark results are not stored. To store them, use the option You can compare benchmark results using `--compare` option. The comparison will be presented in a markdown output file (see below). If you want to calculate the relative performance of the new results against the previously saved data, use `--compare ` (i.e. `--compare baseline`). In case of comparing only stored data without generating new results, use `--dry-run --compare --compare --relative-perf `, where `name1` indicates the baseline for the relative performance calculation and `--dry-run` prevents the script for running benchmarks. Listing more than two `--compare` options results in displaying only execution time, without statistical analysis. -Baseline, as well as baseline-v2 (for the level-zero adapter v2) is updated automatically during a nightly job. The results -are stored [here](https://oneapi-src.github.io/unified-runtime/benchmark_results.html). +Baseline_L0, as well as Baseline_L0v2 (for the level-zero adapter v2) is updated automatically during a nightly job. The results +are stored [here](https://oneapi-src.github.io/unified-runtime/performance/). ## Output formats You can display the results in the form of a HTML file by using `--ouptut-html` and a markdown file by using `--output-markdown`. Due to character limits for posting PR comments, the final content of the markdown file might be reduced. In order to obtain the full markdown output, use `--output-markdown full`. diff --git a/devops/scripts/benchmarks/benches/base.py b/devops/scripts/benchmarks/benches/base.py index d1bb5fb53b83..4c2973d250e3 100644 --- a/devops/scripts/benchmarks/benches/base.py +++ b/devops/scripts/benchmarks/benches/base.py @@ -1,16 +1,37 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +from dataclasses import dataclass import os import shutil from pathlib import Path -from .result import Result +from utils.result import BenchmarkMetadata, BenchmarkTag, Result from options import options from utils.utils import download, run -import urllib.request -import tarfile + +benchmark_tags = [ + BenchmarkTag("SYCL", "Benchmark uses SYCL runtime"), + BenchmarkTag("UR", "Benchmark uses Unified Runtime API"), + BenchmarkTag("L0", "Benchmark uses Level Zero API directly"), + BenchmarkTag("UMF", "Benchmark uses Unified Memory Framework directly"), + BenchmarkTag("micro", "Microbenchmark focusing on a specific functionality"), + BenchmarkTag("application", "Real application-based performance test"), + BenchmarkTag("proxy", "Benchmark that simulates real application use-cases"), + BenchmarkTag("submit", "Tests kernel submission performance"), + BenchmarkTag("math", "Tests math computation performance"), + BenchmarkTag("memory", "Tests memory transfer or bandwidth performance"), + BenchmarkTag("allocation", "Tests memory allocation performance"), + BenchmarkTag("graph", "Tests graph-based execution performance"), + BenchmarkTag("latency", "Measures operation latency"), + BenchmarkTag("throughput", "Measures operation throughput"), + BenchmarkTag("inference", "Tests ML/AI inference performance"), + BenchmarkTag("image", "Image processing benchmark"), + BenchmarkTag("simulation", "Physics or scientific simulation benchmark"), +] + +benchmark_tags_dict = {tag.name: tag for tag in benchmark_tags} class Benchmark: @@ -55,19 +76,25 @@ def create_data_path(self, name, skip_data_dir=False): data_path = os.path.join(self.directory, name) else: data_path = os.path.join(self.directory, "data", name) - if options.rebuild and Path(data_path).exists(): + if options.redownload and Path(data_path).exists(): shutil.rmtree(data_path) Path(data_path).mkdir(parents=True, exist_ok=True) return data_path - def download(self, name, url, file, untar=False, unzip=False, skip_data_dir=False): + def download( + self, + name, + url, + file, + untar=False, + unzip=False, + skip_data_dir=False, + checksum="", + ): self.data_path = self.create_data_path(name, skip_data_dir) - return download(self.data_path, url, file, untar, unzip) - - def name(self): - raise NotImplementedError() + return download(self.data_path, url, file, untar, unzip, checksum) def lower_is_better(self): return True @@ -87,6 +114,30 @@ def stddev_threshold(self): def get_suite_name(self) -> str: return self.suite.name() + def name(self): + raise NotImplementedError() + + def description(self): + return "" + + def notes(self) -> str: + return None + + def unstable(self) -> str: + return None + + def get_tags(self) -> list[str]: + return [] + + def get_metadata(self) -> BenchmarkMetadata: + return BenchmarkMetadata( + type="benchmark", + description=self.description(), + notes=self.notes(), + unstable=self.unstable(), + tags=self.get_tags(), + ) + class Suite: def benchmarks(self) -> list[Benchmark]: @@ -97,3 +148,6 @@ def name(self) -> str: def setup(self): return + + def additionalMetadata(self) -> dict[str, BenchmarkMetadata]: + return {} diff --git a/devops/scripts/benchmarks/benches/compute.py b/devops/scripts/benchmarks/benches/compute.py index 4658a3414e16..b014828b4f6b 100644 --- a/devops/scripts/benchmarks/benches/compute.py +++ b/devops/scripts/benchmarks/benches/compute.py @@ -8,10 +8,33 @@ import io from utils.utils import run, git_clone, create_build_path from .base import Benchmark, Suite -from .result import Result +from utils.result import BenchmarkMetadata, Result from options import options from enum import Enum + +class RUNTIMES(Enum): + SYCL = "sycl" + LEVEL_ZERO = "l0" + UR = "ur" + + +def runtime_to_name(runtime: RUNTIMES) -> str: + return { + RUNTIMES.SYCL: "SYCL", + RUNTIMES.LEVEL_ZERO: "Level Zero", + RUNTIMES.UR: "Unified Runtime", + }[runtime] + + +def runtime_to_tag_name(runtime: RUNTIMES) -> str: + return { + RUNTIMES.SYCL: "SYCL", + RUNTIMES.LEVEL_ZERO: "L0", + RUNTIMES.UR: "UR", + }[runtime] + + class ComputeBench(Suite): def __init__(self, directory): self.directory = directory @@ -19,6 +42,12 @@ def __init__(self, directory): def name(self) -> str: return "Compute Benchmarks" + def git_url(self) -> str: + return "https://github.com/intel/compute-benchmarks.git" + + def git_hash(self) -> str: + return "b5cc46acf61766ab00da04e85bd4da4f7591eb21" + def setup(self): if options.sycl is None: return @@ -26,8 +55,8 @@ def setup(self): repo_path = git_clone( self.directory, "compute-benchmarks-repo", - "https://github.com/intel/compute-benchmarks.git", - "dfdbf2ff9437ee159627cc2cd9159c289da1a7ba", + self.git_url(), + self.git_hash(), ) build_path = create_build_path(self.directory, "compute-benchmarks-build") @@ -47,25 +76,90 @@ def setup(self): f"-Dunified-runtime_DIR={options.ur}/lib/cmake/unified-runtime", ] - print(f"{self.__class__.__name__}: Run {configure_command}") run(configure_command, add_sycl=True) - print(f"{self.__class__.__name__}: Run cmake --build {build_path} -j") - run(f"cmake --build {build_path} -j", add_sycl=True) + + run(f"cmake --build {build_path} -j {options.build_jobs}", add_sycl=True) self.built = True + def additionalMetadata(self) -> dict[str, BenchmarkMetadata]: + return { + "SubmitKernel": BenchmarkMetadata( + type="group", + description="Measures CPU time overhead of submitting kernels through different APIs.", + notes="Each layer builds on top of the previous layer, adding functionality and overhead.\n" + "The first layer is the Level Zero API, the second is the Unified Runtime API, and the third is the SYCL API.\n" + "The UR v2 adapter noticeably reduces UR layer overhead, also improving SYCL performance.\n" + "Work is ongoing to reduce the overhead of the SYCL API\n", + tags=["submit", "micro", "SYCL", "UR", "L0"], + ), + "SinKernelGraph": BenchmarkMetadata( + type="group", + unstable="This benchmark combines both eager and graph execution, and may not be representative of real use cases.", + tags=["submit", "memory", "proxy", "SYCL", "UR", "L0", "graph"], + ), + "SubmitGraph": BenchmarkMetadata( + type="group", tags=["submit", "micro", "SYCL", "UR", "L0", "graph"] + ), + } + + def enabled_runtimes(self, supported_runtimes=None): + # all runtimes in the RUNTIMES enum + runtimes = supported_runtimes or list(RUNTIMES) + + # Filter out UR if not available + if options.ur is None: + runtimes = [r for r in runtimes if r != RUNTIMES.UR] + + return runtimes + def benchmarks(self) -> list[Benchmark]: if options.sycl is None: return [] - if options.ur_adapter == "cuda": + if options.ur_adapter == "cuda" or options.ur_adapter == "hip": return [] - benches = [ - SubmitKernelL0(self, 0), - SubmitKernelL0(self, 1), - SubmitKernelSYCL(self, 0), - SubmitKernelSYCL(self, 1), + benches = [] + + # Add SubmitKernel benchmarks using loops + for runtime in self.enabled_runtimes(): + for in_order_queue in [0, 1]: + for measure_completion in [0, 1]: + benches.append( + SubmitKernel(self, runtime, in_order_queue, measure_completion) + ) + + # Add SinKernelGraph benchmarks + for runtime in self.enabled_runtimes(): + for with_graphs in [0, 1]: + for num_kernels in [5, 100]: + benches.append( + GraphApiSinKernelGraph(self, runtime, with_graphs, num_kernels) + ) + + # Add ULLS benchmarks + for runtime in self.enabled_runtimes([RUNTIMES.SYCL, RUNTIMES.LEVEL_ZERO]): + benches.append(UllsEmptyKernel(self, runtime, 1000, 256)) + benches.append(UllsKernelSwitch(self, runtime, 8, 200, 0, 0, 1, 1)) + + # Add GraphApiSubmitGraph benchmarks + for runtime in self.enabled_runtimes([RUNTIMES.SYCL]): + for in_order_queue in [0, 1]: + for num_kernels in [4, 10, 32]: + for measure_completion_time in [0, 1]: + benches.append( + GraphApiSubmitGraph( + self, + runtime, + in_order_queue, + num_kernels, + measure_completion_time, + ) + ) + + # Add other benchmarks + benches += [ QueueInOrderMemcpy(self, 0, "Device", "Device", 1024), QueueInOrderMemcpy(self, 0, "Host", "Device", 1024), QueueMemcpy(self, "Device", "Device", 1024), @@ -73,29 +167,14 @@ def benchmarks(self) -> list[Benchmark]: ExecImmediateCopyQueue(self, 0, 1, "Device", "Device", 1024), ExecImmediateCopyQueue(self, 1, 1, "Device", "Host", 1024), VectorSum(self), - MemcpyExecute(self, 400, 1, 102400, 10, 1, 1, 1), - MemcpyExecute(self, 400, 8, 1024, 100, 1, 1, 1), - MemcpyExecute(self, 400, 1, 102400, 10, 0, 1, 1), - MemcpyExecute(self, 4096, 4, 1024, 10, 0, 1, 0), - GraphApiSinKernelGraph(self, RUNTIMES.SYCL, 0, 5), - GraphApiSinKernelGraph(self, RUNTIMES.SYCL, 1, 5), - GraphApiSinKernelGraph(self, RUNTIMES.SYCL, 0, 100), - GraphApiSinKernelGraph(self, RUNTIMES.SYCL, 1, 100), - GraphApiSinKernelGraph(self, RUNTIMES.LEVEL_ZERO, 0, 5), - GraphApiSinKernelGraph(self, RUNTIMES.LEVEL_ZERO, 1, 5), - GraphApiSinKernelGraph(self, RUNTIMES.LEVEL_ZERO, 0, 100), - GraphApiSinKernelGraph(self, RUNTIMES.LEVEL_ZERO, 1, 100), ] + # Add UR-specific benchmarks if options.ur is not None: benches += [ - SubmitKernelUR(self, 0, 0), - SubmitKernelUR(self, 1, 0), - SubmitKernelUR(self, 1, 1), - GraphApiSinKernelGraph(self, RUNTIMES.UR, 0, 5), - GraphApiSinKernelGraph(self, RUNTIMES.UR, 1, 5), - GraphApiSinKernelGraph(self, RUNTIMES.UR, 0, 100), - GraphApiSinKernelGraph(self, RUNTIMES.UR, 1, 100), + MemcpyExecute(self, 400, 1, 102400, 10, 1, 1, 1), + MemcpyExecute(self, 400, 1, 102400, 10, 0, 1, 1), + MemcpyExecute(self, 4096, 4, 1024, 10, 0, 1, 0), ] return benches @@ -130,6 +209,9 @@ def setup(self): def explicit_group(self): return "" + def description(self) -> str: + return "" + def run(self, env_vars) -> list[Result]: command = [ f"{self.benchmark_bin}", @@ -161,6 +243,8 @@ def run(self, env_vars) -> list[Result]: env=env_vars, stdout=result, unit=parse_unit_type(unit), + git_url=self.bench.git_url(), + git_hash=self.bench.git_hash(), ) ) return ret @@ -192,74 +276,52 @@ def teardown(self): return -class SubmitKernelSYCL(ComputeBenchmark): - def __init__(self, bench, ioq): +class SubmitKernel(ComputeBenchmark): + def __init__(self, bench, runtime: RUNTIMES, ioq, measure_completion=0): self.ioq = ioq - super().__init__(bench, "api_overhead_benchmark_sycl", "SubmitKernel") - - def name(self): - order = "in order" if self.ioq else "out of order" - return f"api_overhead_benchmark_sycl SubmitKernel {order}" - - def explicit_group(self): - return "SubmitKernel" - - def bin_args(self) -> list[str]: - return [ - f"--Ioq={self.ioq}", - "--DiscardEvents=0", - "--MeasureCompletion=0", - "--iterations=100000", - "--Profiling=0", - "--NumKernels=10", - "--KernelExecTime=1", - ] + self.runtime = runtime + self.measure_completion = measure_completion + super().__init__( + bench, f"api_overhead_benchmark_{runtime.value}", "SubmitKernel" + ) - -class SubmitKernelUR(ComputeBenchmark): - def __init__(self, bench, ioq, measureCompletion): - self.ioq = ioq - self.measureCompletion = measureCompletion - super().__init__(bench, "api_overhead_benchmark_ur", "SubmitKernel") + def get_tags(self): + return ["submit", "latency", runtime_to_tag_name(self.runtime), "micro"] def name(self): order = "in order" if self.ioq else "out of order" - return f"api_overhead_benchmark_ur SubmitKernel {order}" + ( - " with measure completion" if self.measureCompletion else "" - ) + completion_str = " with measure completion" if self.measure_completion else "" + return f"api_overhead_benchmark_{self.runtime.value} SubmitKernel {order}{completion_str}" def explicit_group(self): - return "SubmitKernel" - - def bin_args(self) -> list[str]: - return [ - f"--Ioq={self.ioq}", - "--DiscardEvents=0", - f"--MeasureCompletion={self.measureCompletion}", - "--iterations=100000", - "--Profiling=0", - "--NumKernels=10", - "--KernelExecTime=1", - ] + return ( + "SubmitKernel" + if self.measure_completion == 0 + else "SubmitKernel With Completion" + ) + def description(self) -> str: + order = "in-order" if self.ioq else "out-of-order" + runtime_name = runtime_to_name(self.runtime) -class SubmitKernelL0(ComputeBenchmark): - def __init__(self, bench, ioq): - self.ioq = ioq - super().__init__(bench, "api_overhead_benchmark_l0", "SubmitKernel") + completion_desc = "" + if self.runtime == RUNTIMES.UR: + completion_desc = f", {'including' if self.measure_completion else 'excluding'} kernel completion time" - def name(self): - order = "in order" if self.ioq else "out of order" - return f"api_overhead_benchmark_l0 SubmitKernel {order}" + l0_specific = "" + if self.runtime == RUNTIMES.LEVEL_ZERO: + l0_specific = " Uses immediate command lists" - def explicit_group(self): - return "SubmitKernel" + return ( + f"Measures CPU time overhead of submitting {order} kernels through {runtime_name} API{completion_desc}. " + f"Runs 10 simple kernels with minimal execution time to isolate API overhead from kernel execution time. {l0_specific}" + ) def bin_args(self) -> list[str]: return [ f"--Ioq={self.ioq}", "--DiscardEvents=0", - "--MeasureCompletion=0", + f"--MeasureCompletion={self.measure_completion}", "--iterations=100000", "--Profiling=0", "--NumKernels=10", @@ -280,6 +342,17 @@ def name(self): order = "in order" if self.ioq else "out of order" return f"api_overhead_benchmark_sycl ExecImmediateCopyQueue {order} from {self.source} to {self.destination}, size {self.size}" + def description(self) -> str: + order = "in-order" if self.ioq else "out-of-order" + operation = "copy-only" if self.isCopyOnly else "copy and command submission" + return ( + f"Measures SYCL {order} queue overhead for {operation} from {self.source} to " + f"{self.destination} memory with {self.size} bytes. Tests immediate execution overheads." + ) + + def get_tags(self): + return ["memory", "submit", "latency", "SYCL", "micro"] + def bin_args(self) -> list[str]: return [ "--iterations=100000", @@ -303,6 +376,16 @@ def __init__(self, bench, isCopyOnly, source, destination, size): def name(self): return f"memory_benchmark_sycl QueueInOrderMemcpy from {self.source} to {self.destination}, size {self.size}" + def description(self) -> str: + operation = "copy-only" if self.isCopyOnly else "copy and command submission" + return ( + f"Measures SYCL in-order queue memory copy performance for {operation} from " + f"{self.source} to {self.destination} with {self.size} bytes, executed 100 times per iteration." + ) + + def get_tags(self): + return ["memory", "latency", "SYCL", "micro"] + def bin_args(self) -> list[str]: return [ "--iterations=10000", @@ -324,6 +407,15 @@ def __init__(self, bench, source, destination, size): def name(self): return f"memory_benchmark_sycl QueueMemcpy from {self.source} to {self.destination}, size {self.size}" + def description(self) -> str: + return ( + f"Measures general SYCL queue memory copy performance from {self.source} to " + f"{self.destination} with {self.size} bytes per operation." + ) + + def get_tags(self): + return ["memory", "latency", "SYCL", "micro"] + def bin_args(self) -> list[str]: return [ "--iterations=10000", @@ -343,10 +435,19 @@ def __init__(self, bench, type, size, placement): def name(self): return f"memory_benchmark_sycl StreamMemory, placement {self.placement}, type {self.type}, size {self.size}" + def description(self) -> str: + return ( + f"Measures {self.placement} memory bandwidth using {self.type} pattern with " + f"{self.size} bytes. Higher values (GB/s) indicate better performance." + ) + # measurement is in GB/s def lower_is_better(self): return False + def get_tags(self): + return ["memory", "throughput", "SYCL", "micro"] + def bin_args(self) -> list[str]: return [ "--iterations=10000", @@ -356,6 +457,7 @@ def bin_args(self) -> list[str]: "--useEvents=0", "--contents=Zeros", "--multiplier=1", + "--vectorSize=1", ] @@ -366,6 +468,15 @@ def __init__(self, bench): def name(self): return f"miscellaneous_benchmark_sycl VectorSum" + def description(self) -> str: + return ( + "Measures performance of vector addition across 3D grid (512x256x256 elements) " + "using SYCL." + ) + + def get_tags(self): + return ["math", "throughput", "SYCL", "micro"] + def bin_args(self) -> list[str]: return [ "--iterations=1000", @@ -402,6 +513,19 @@ def name(self): + (" without events" if not self.useEvents else "") ) + def description(self) -> str: + src_type = "device" if self.srcUSM == 1 else "host" + dst_type = "device" if self.dstUSM == 1 else "host" + events = "with" if self.useEvents else "without" + return ( + f"Measures multithreaded memory copy performance with {self.numThreads} threads " + f"each performing {self.numOpsPerThread} operations on {self.allocSize} bytes " + f"from {src_type} to {dst_type} memory {events} events." + ) + + def get_tags(self): + return ["memory", "latency", "UR", "micro"] + def bin_args(self) -> list[str]: return [ "--Ioq=1", @@ -417,12 +541,6 @@ def bin_args(self) -> list[str]: ] -class RUNTIMES(Enum): - SYCL = "sycl" - LEVEL_ZERO = "l0" - UR = "ur" - - class GraphApiSinKernelGraph(ComputeBenchmark): def __init__(self, bench, runtime: RUNTIMES, withGraphs, numKernels): self.withGraphs = withGraphs @@ -435,9 +553,29 @@ def __init__(self, bench, runtime: RUNTIMES, withGraphs, numKernels): def explicit_group(self): return f"SinKernelGraph {self.numKernels}" + def description(self) -> str: + execution = "using graphs" if self.withGraphs else "without graphs" + return ( + f"Measures {self.runtime.value.upper()} performance when executing {self.numKernels} " + f"sin kernels {execution}. Tests overhead and benefits of graph-based execution." + ) + def name(self): return f"graph_api_benchmark_{self.runtime.value} SinKernelGraph graphs:{self.withGraphs}, numKernels:{self.numKernels}" + def unstable(self) -> str: + return "This benchmark combines both eager and graph execution, and may not be representative of real use cases." + + def get_tags(self): + return [ + "graph", + runtime_to_tag_name(self.runtime), + "proxy", + "submit", + "memory", + "latency", + ] + def bin_args(self) -> list[str]: return [ "--iterations=10000", @@ -448,26 +586,115 @@ def bin_args(self) -> list[str]: ] -class GraphApiSubmitExecGraph(ComputeBenchmark): - def __init__(self, bench, ioq, submit, numKernels): - self.ioq = ioq - self.submit = submit +class GraphApiSubmitGraph(ComputeBenchmark): + def __init__( + self, bench, runtime: RUNTIMES, inOrderQueue, numKernels, measureCompletionTime + ): + self.inOrderQueue = inOrderQueue self.numKernels = numKernels - super().__init__(bench, "graph_api_benchmark_sycl", "SubmitExecGraph") + self.runtime = runtime + self.measureCompletionTime = measureCompletionTime + super().__init__(bench, f"graph_api_benchmark_{runtime.value}", "SubmitGraph") + + def explicit_group(self): + return f"SubmitGraph {self.numKernels}" + + def description(self) -> str: + return ( + f"Measures {self.runtime.value.upper()} performance when executing {self.numKernels} " + f"trivial kernels using graphs. Tests overhead and benefits of graph-based execution." + ) + + def name(self): + return f"graph_api_benchmark_{self.runtime.value} SubmitGraph numKernels:{self.numKernels} ioq {self.inOrderQueue} measureCompletion {self.measureCompletionTime}" + + def get_tags(self): + return [ + "graph", + runtime_to_tag_name(self.runtime), + "micro", + "submit", + "latency", + ] + + def bin_args(self) -> list[str]: + return [ + "--iterations=10000", + f"--NumKernels={self.numKernels}", + f"--MeasureCompletionTime={self.measureCompletionTime}", + f"--InOrderQueue={self.inOrderQueue}", + "--Profiling=0", + "--KernelExecutionTime=1", + ] + + +class UllsEmptyKernel(ComputeBenchmark): + def __init__(self, bench, runtime: RUNTIMES, wgc, wgs): + self.wgc = wgc + self.wgs = wgs + self.runtime = runtime + super().__init__(bench, f"ulls_benchmark_{runtime.value}", "EmptyKernel") + + def explicit_group(self): + return f"EmptyKernel {self.wgc} {self.wgs}" + + def description(self) -> str: + return "" def name(self): - return f"graph_api_benchmark_sycl SubmitExecGraph ioq:{self.ioq}, submit:{self.submit}, numKernels:{self.numKernels}" + return f"ulls_benchmark_{self.runtime.value} EmptyKernel wgc:{self.wgc}, wgs:{self.wgs}" + + def get_tags(self): + return [runtime_to_tag_name(self.runtime), "micro", "latency", "submit"] + + def bin_args(self) -> list[str]: + return [ + "--iterations=10000", + f"--wgs={self.wgs}", + f"--wgc={self.wgs}", + ] + + +class UllsKernelSwitch(ComputeBenchmark): + def __init__( + self, + bench, + runtime: RUNTIMES, + count, + kernelTime, + barrier, + hostVisible, + ioq, + ctrBasedEvents, + ): + self.count = count + self.kernelTime = kernelTime + self.barrier = barrier + self.hostVisible = hostVisible + self.ctrBasedEvents = ctrBasedEvents + self.runtime = runtime + self.ioq = ioq + super().__init__(bench, f"ulls_benchmark_{runtime.value}", "KernelSwitch") def explicit_group(self): - if self.submit: - return "SubmitGraph" - else: - return "ExecGraph" + return f"KernelSwitch {self.count} {self.kernelTime}" + + def description(self) -> str: + return "" + + def name(self): + return f"ulls_benchmark_{self.runtime.value} KernelSwitch count {self.count} kernelTime {self.kernelTime}" + + def get_tags(self): + return [runtime_to_tag_name(self.runtime), "micro", "latency", "submit"] def bin_args(self) -> list[str]: return [ - "--iterations=100", - f"--measureSubmit={self.submit}", + "--iterations=1000", + f"--count={self.count}", + f"--kernelTime={self.kernelTime}", + f"--barrier={self.barrier}", + f"--hostVisible={self.hostVisible}", f"--ioq={self.ioq}", - f"--numKernels={self.numKernels}", + f"--ctrBasedEvents={self.ctrBasedEvents}", ] diff --git a/devops/scripts/benchmarks/benches/llamacpp.py b/devops/scripts/benchmarks/benches/llamacpp.py index 6524c95a9f56..d5b250b9eb94 100644 --- a/devops/scripts/benchmarks/benches/llamacpp.py +++ b/devops/scripts/benchmarks/benches/llamacpp.py @@ -1,4 +1,4 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -8,10 +8,10 @@ from pathlib import Path from utils.utils import download, git_clone from .base import Benchmark, Suite -from .result import Result +from utils.result import Result from utils.utils import run, create_build_path from options import options -from .oneapi import get_oneapi +from utils.oneapi import get_oneapi import os @@ -25,6 +25,12 @@ def __init__(self, directory): def name(self) -> str: return "llama.cpp bench" + def git_url(self) -> str: + return "https://github.com/ggerganov/llama.cpp" + + def git_hash(self) -> str: + return "1ee9eea094fe5846c7d8d770aa7caa749d246b23" + def setup(self): if options.sycl is None: return @@ -32,8 +38,8 @@ def setup(self): repo_path = git_clone( self.directory, "llamacpp-repo", - "https://github.com/ggerganov/llama.cpp", - "1ee9eea094fe5846c7d8d770aa7caa749d246b23", + self.git_url(), + self.git_hash(), ) self.models_dir = os.path.join(self.directory, "models") @@ -43,6 +49,7 @@ def setup(self): self.models_dir, "https://huggingface.co/microsoft/Phi-3-mini-4k-instruct-gguf/resolve/main/Phi-3-mini-4k-instruct-q4.gguf", "Phi-3-mini-4k-instruct-q4.gguf", + checksum="fc4f45c9729874a33a527465b2ec78189a18e5726b7121182623feeae38632ace4f280617b01d4a04875acf49d263ee4", ) self.oneapi = get_oneapi() @@ -62,11 +69,11 @@ def setup(self): f'-DCMAKE_CXX_FLAGS=-I"{self.oneapi.mkl_include()}"', f"-DCMAKE_SHARED_LINKER_FLAGS=-L{self.oneapi.compiler_lib()} -L{self.oneapi.mkl_lib()}", ] - print(f"{self.__class__.__name__}: Run {configure_command}") + run(configure_command, add_sycl=True) - print(f"{self.__class__.__name__}: Run cmake --build {self.build_path} -j") + run( - f"cmake --build {self.build_path} -j", + f"cmake --build {self.build_path} -j {options.build_jobs}", add_sycl=True, ld_library=self.oneapi.ld_libraries(), ) @@ -75,7 +82,7 @@ def benchmarks(self) -> list[Benchmark]: if options.sycl is None: return [] - if options.ur_adapter == "cuda": + if options.ur_adapter == "cuda" or options.ur_adapter == "hip": return [] return [LlamaBench(self)] @@ -92,6 +99,17 @@ def setup(self): def name(self): return f"llama.cpp" + def description(self) -> str: + return ( + "Performance testing tool for llama.cpp that measures LLM inference speed in tokens per second. " + "Runs both prompt processing (initial context processing) and text generation benchmarks with " + "different batch sizes. Higher values indicate better performance. Uses the Phi-3-mini-4k-instruct " + "quantized model and leverages SYCL with oneDNN for acceleration." + ) + + def get_tags(self): + return ["SYCL", "application", "inference", "throughput"] + def lower_is_better(self): return False @@ -130,6 +148,8 @@ def run(self, env_vars) -> list[Result]: env=env_vars, stdout=result, unit="token/s", + git_url=self.bench.git_url(), + git_hash=self.bench.git_hash(), ) ) return results diff --git a/devops/scripts/benchmarks/benches/result.py b/devops/scripts/benchmarks/benches/result.py deleted file mode 100644 index 52a098d91c24..000000000000 --- a/devops/scripts/benchmarks/benches/result.py +++ /dev/null @@ -1,40 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. -# See LICENSE.TXT -# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception - -from dataclasses import dataclass -from typing import Optional -from dataclasses_json import dataclass_json -from datetime import datetime - - -@dataclass_json -@dataclass -class Result: - label: str - value: float - command: str - env: str - stdout: str - passed: bool = True - unit: str = "" - explicit_group: str = "" - # stddev can be optionally set by the benchmark, - # if not set, it will be calculated automatically. - stddev: float = 0.0 - # values below should not be set by the benchmark - name: str = "" - lower_is_better: bool = True - git_hash: str = "" - date: Optional[datetime] = None - suite: str = "Unknown" - - -@dataclass_json -@dataclass -class BenchmarkRun: - results: list[Result] - name: str = "This PR" - git_hash: str = "" - date: datetime = None diff --git a/devops/scripts/benchmarks/benches/syclbench.py b/devops/scripts/benchmarks/benches/syclbench.py index f7cf571a7ecd..f6a04918b81d 100644 --- a/devops/scripts/benchmarks/benches/syclbench.py +++ b/devops/scripts/benchmarks/benches/syclbench.py @@ -1,4 +1,4 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -8,7 +8,7 @@ import io from utils.utils import run, git_clone, create_build_path from .base import Benchmark, Suite -from .result import Result +from utils.result import Result from options import options @@ -23,6 +23,12 @@ def __init__(self, directory): def name(self) -> str: return "SYCL-Bench" + def git_url(self) -> str: + return "https://github.com/unisa-hpc/sycl-bench.git" + + def git_hash(self) -> str: + return "31fc70be6266193c4ba60eb1fe3ce26edee4ca5b" + def setup(self): if options.sycl is None: return @@ -31,8 +37,8 @@ def setup(self): repo_path = git_clone( self.directory, "sycl-bench-repo", - "https://github.com/mateuszpn/sycl-bench.git", - "1e6ab2cfd004a72c5336c26945965017e06eab71", + self.git_url(), + self.git_hash(), ) configure_command = [ @@ -50,8 +56,13 @@ def setup(self): f"-DCMAKE_CXX_FLAGS=-fsycl -fsycl-targets=nvptx64-nvidia-cuda" ] + if options.ur_adapter == "hip": + configure_command += [ + f"-DCMAKE_CXX_FLAGS=-fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend --offload-arch={options.hip_arch}" + ] + run(configure_command, add_sycl=True) - run(f"cmake --build {build_path} -j", add_sycl=True) + run(f"cmake --build {build_path} -j {options.build_jobs}", add_sycl=True) self.built = True @@ -65,14 +76,14 @@ def benchmarks(self) -> list[Benchmark]: DagTaskS(self), HostDevBandwidth(self), LocalMem(self), - Pattern_L2(self), - Reduction(self), + # Pattern_L2(self), # validation failure + # Reduction(self), # validation failure ScalarProd(self), SegmentReduction(self), - UsmAccLatency(self), + # UsmAccLatency(self), # validation failure UsmAllocLatency(self), - UsmInstrMix(self), - UsmPinnedOverhead(self), + # UsmInstrMix(self), # validation failure + # UsmPinnedOverhead(self), # validation failure VecAdd(self), # *** sycl-bench single benchmarks # TwoDConvolution(self), # run time < 1ms @@ -82,20 +93,20 @@ def benchmarks(self) -> list[Benchmark]: Atax(self), # Atomic_reduction(self), # run time < 1ms Bicg(self), - Correlation(self), - Covariance(self), - Gemm(self), - Gesumv(self), - Gramschmidt(self), + # Correlation(self), # validation failure + # Covariance(self), # validation failure + # Gemm(self), # validation failure + # Gesumv(self), # validation failure + # Gramschmidt(self), # validation failure KMeans(self), LinRegCoeff(self), # LinRegError(self), # run time < 1ms - MatmulChain(self), + # MatmulChain(self), # validation failure MolDyn(self), - Mvt(self), + # Mvt(self), # validation failure Sf(self), - Syr2k(self), - Syrk(self), + # Syr2k(self), # validation failure + # Syrk(self), # validation failure ] @@ -105,7 +116,6 @@ def __init__(self, bench, name, test): self.bench = bench self.bench_name = name self.test = test - self.done = False def bin_args(self) -> list[str]: return [] @@ -113,16 +123,26 @@ def bin_args(self) -> list[str]: def extra_env_vars(self) -> dict: return {} + def get_tags(self): + base_tags = ["SYCL", "micro"] + if "Memory" in self.bench_name or "mem" in self.bench_name.lower(): + base_tags.append("memory") + if "Reduction" in self.bench_name: + base_tags.append("math") + if "Bandwidth" in self.bench_name: + base_tags.append("throughput") + if "Latency" in self.bench_name: + base_tags.append("latency") + return base_tags + def setup(self): self.benchmark_bin = os.path.join( self.directory, "sycl-bench-build", self.bench_name ) def run(self, env_vars) -> list[Result]: - if self.done: - return self.outputfile = os.path.join(self.bench.directory, self.test + ".csv") - print(f"{self.__class__.__name__}: Results in {self.outputfile}") + command = [ f"{self.benchmark_bin}", f"--warmup-run", @@ -143,25 +163,27 @@ def run(self, env_vars) -> list[Result]: if not row[0].startswith("#"): res_list.append( Result( - label=row[0], + label=f"{self.name()} {row[0]}", value=float(row[12]) * 1000, # convert to ms passed=(row[1] == "PASS"), command=command, env=env_vars, stdout=row, unit="ms", + git_url=self.bench.git_url(), + git_hash=self.bench.git_hash(), ) ) - self.done = True - return res_list - def teardown(self): - print(f"Removing {self.outputfile}...") os.remove(self.outputfile) - return + + return res_list def name(self): - return self.test + return f"{self.bench.name()} {self.test}" + + def teardown(self): + return # multi benchmarks diff --git a/devops/scripts/benchmarks/benches/test.py b/devops/scripts/benchmarks/benches/test.py index 06eac12b2534..ad1e8c9e5773 100644 --- a/devops/scripts/benchmarks/benches/test.py +++ b/devops/scripts/benchmarks/benches/test.py @@ -1,4 +1,4 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,7 +6,7 @@ import random from utils.utils import git_clone from .base import Benchmark, Suite -from .result import Result +from utils.result import BenchmarkMetadata, Result from utils.utils import run, create_build_path from options import options import os @@ -19,35 +19,56 @@ def __init__(self): def setup(self): return + def name(self) -> str: + return "Test Suite" + def benchmarks(self) -> list[Benchmark]: bench_configs = [ - ("Memory Bandwidth", 2000, 200, "Foo Group"), - ("Latency", 100, 20, "Bar Group"), - ("Throughput", 1500, 150, "Foo Group"), - ("FLOPS", 3000, 300, "Foo Group"), - ("Cache Miss Rate", 250, 25, "Bar Group"), + ("Memory Bandwidth", 2000, 200, "Foo Group", None, None), + ("Latency", 100, 20, "Bar Group", "A Latency test note!", None), + ("Throughput", 1500, 150, "Foo Group", None, None), + ("FLOPS", 3000, 300, "Foo Group", None, "Unstable FLOPS test!"), + ("Cache Miss Rate", 250, 25, "Bar Group", "Test Note", "And another note!"), ] result = [] - for base_name, base_value, base_diff, group in bench_configs: + for base_name, base_value, base_diff, group, notes, unstable in bench_configs: for variant in range(6): value_multiplier = 1.0 + (variant * 0.2) name = f"{base_name} {variant+1}" value = base_value * value_multiplier diff = base_diff * value_multiplier - result.append(TestBench(name, value, diff, group)) + result.append( + TestBench(self, name, value, diff, group, notes, unstable) + ) return result + def additionalMetadata(self) -> dict[str, BenchmarkMetadata]: + return { + "Foo Group": BenchmarkMetadata( + type="group", + description="This is a test benchmark for Foo Group.", + notes="This is a test note for Foo Group.\n" "Look, multiple lines!", + ), + "Bar Group": BenchmarkMetadata( + type="group", + description="This is a test benchmark for Bar Group.", + unstable="This is an unstable note for Bar Group.", + ), + } + class TestBench(Benchmark): - def __init__(self, name, value, diff, group=""): + def __init__(self, suite, name, value, diff, group="", notes=None, unstable=None): + super().__init__("", suite) self.bname = name self.value = value self.diff = diff self.group = group - super().__init__("") + self.notes_text = notes + self.unstable_text = unstable def name(self): return self.bname @@ -58,6 +79,15 @@ def lower_is_better(self): def setup(self): return + def description(self) -> str: + return f"This is a test benchmark for {self.bname}." + + def notes(self) -> str: + return self.notes_text + + def unstable(self) -> str: + return self.unstable_text + def run(self, env_vars) -> list[Result]: random_value = self.value + random.uniform(-1 * (self.diff), self.diff) return [ @@ -65,7 +95,7 @@ def run(self, env_vars) -> list[Result]: label=self.name(), explicit_group=self.group, value=random_value, - command="", + command=["test", "--arg1", "foo"], env={"A": "B"}, stdout="no output", unit="ms", diff --git a/devops/scripts/benchmarks/benches/umf.py b/devops/scripts/benchmarks/benches/umf.py index c7b767f02bbe..f0b92777dd2f 100644 --- a/devops/scripts/benchmarks/benches/umf.py +++ b/devops/scripts/benchmarks/benches/umf.py @@ -1,4 +1,4 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,10 +6,10 @@ import random from utils.utils import git_clone from .base import Benchmark, Suite -from .result import Result +from utils.result import Result from utils.utils import run, create_build_path from options import options -from .oneapi import get_oneapi +from utils.oneapi import get_oneapi import os import csv import io @@ -22,8 +22,6 @@ def isUMFAvailable(): class UMFSuite(Suite): def __init__(self, directory): self.directory = directory - if not isUMFAvailable(): - print("UMF not provided. Related benchmarks will not run") def name(self) -> str: return "UMF" @@ -76,6 +74,9 @@ def setup(self): self.benchmark_bin = os.path.join(options.umf, "benchmark", self.bench_name) + def get_tags(self): + return ["UMF", "allocation", "latency", "micro"] + def run(self, env_vars) -> list[Result]: command = [ f"{self.benchmark_bin}", diff --git a/devops/scripts/benchmarks/benches/velocity.py b/devops/scripts/benchmarks/benches/velocity.py index b7d06cbe4a3a..df4082f620b8 100644 --- a/devops/scripts/benchmarks/benches/velocity.py +++ b/devops/scripts/benchmarks/benches/velocity.py @@ -1,4 +1,4 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -7,10 +7,10 @@ import shutil from utils.utils import git_clone from .base import Benchmark, Suite -from .result import Result +from utils.result import Result from utils.utils import run, create_build_path from options import options -from .oneapi import get_oneapi +from utils.oneapi import get_oneapi import shutil import os @@ -26,6 +26,12 @@ def __init__(self, directory): def name(self) -> str: return "Velocity Bench" + def git_url(self) -> str: + return "https://github.com/oneapi-src/Velocity-Bench/" + + def git_hash(self) -> str: + return "b22215c16f789100449c34bf4eaa3fb178983d69" + def setup(self): if options.sycl is None: return @@ -33,15 +39,15 @@ def setup(self): self.repo_path = git_clone( self.directory, "velocity-bench-repo", - "https://github.com/oneapi-src/Velocity-Bench/", - "b22215c16f789100449c34bf4eaa3fb178983d69", + self.git_url(), + self.git_hash(), ) def benchmarks(self) -> list[Benchmark]: if options.sycl is None: return [] - if options.ur_adapter == "cuda": + if options.ur_adapter == "cuda" or options.ur_adapter == "hip": return [ Hashtable(self), Bitcracker(self), @@ -77,6 +83,11 @@ def download_deps(self): def extra_cmake_args(self) -> list[str]: if options.ur_adapter == "cuda": return [f"-DUSE_NVIDIA_BACKEND=YES", f"-DUSE_SM=80"] + if options.ur_adapter == "hip": + return [ + f"-DUSE_AMD_BACKEND=YES", + f"-DUSE_AMDHIP_BACKEND={options.hip_arch}", + ] return [] def ld_libraries(self) -> list[str]: @@ -101,7 +112,7 @@ def setup(self): run(configure_command, {"CC": "clang", "CXX": "clang++"}, add_sycl=True) run( - f"cmake --build {build_path} -j", + f"cmake --build {build_path} -j {options.build_jobs}", add_sycl=True, ld_library=self.ld_libraries(), ) @@ -115,6 +126,12 @@ def extra_env_vars(self) -> dict: def parse_output(self, stdout: str) -> float: raise NotImplementedError() + def description(self) -> str: + return "" + + def get_tags(self): + return ["SYCL", "application"] + def run(self, env_vars) -> list[Result]: env_vars.update(self.extra_env_vars()) @@ -133,6 +150,8 @@ def run(self, env_vars) -> list[Result]: env=env_vars, stdout=result, unit=self.unit, + git_url=self.vb.git_url(), + git_hash=self.vb.git_hash(), ) ] @@ -147,6 +166,12 @@ def __init__(self, vb: VelocityBench): def name(self): return "Velocity-Bench Hashtable" + def description(self) -> str: + return ( + "Measures hash table search performance using an efficient lock-free algorithm with linear probing. " + "Reports throughput in millions of keys processed per second. Higher values indicate better performance." + ) + def bin_args(self) -> list[str]: return ["--no-verify"] @@ -162,6 +187,9 @@ def parse_output(self, stdout: str) -> float: "{self.__class__.__name__}: Failed to parse keys per second from benchmark output." ) + def get_tags(self): + return ["SYCL", "application", "throughput"] + class Bitcracker(VelocityBase): def __init__(self, vb: VelocityBench): @@ -170,6 +198,13 @@ def __init__(self, vb: VelocityBench): def name(self): return "Velocity-Bench Bitcracker" + def description(self) -> str: + return ( + "Password-cracking application for BitLocker-encrypted memory units. " + "Uses dictionary attack to find user or recovery passwords. " + "Measures total time required to process 60000 passwords." + ) + def bin_args(self) -> list[str]: self.data_path = os.path.join(self.vb.repo_path, "bitcracker", "hash_pass") @@ -193,6 +228,9 @@ def parse_output(self, stdout: str) -> float: "{self.__class__.__name__}: Failed to parse benchmark output." ) + def get_tags(self): + return ["SYCL", "application", "throughput"] + class SobelFilter(VelocityBase): def __init__(self, vb: VelocityBench): @@ -204,11 +242,19 @@ def download_deps(self): "https://github.com/oneapi-src/Velocity-Bench/raw/main/sobel_filter/res/sobel_filter_data.tgz?download=", "sobel_filter_data.tgz", untar=True, + checksum="7fc62aa729792ede80ed8ae70fb56fa443d479139c5888ed4d4047b98caec106687a0f05886a9ced77922ccba7f65e66", ) def name(self): return "Velocity-Bench Sobel Filter" + def description(self) -> str: + return ( + "Popular RGB-to-grayscale image conversion technique that applies a gaussian filter " + "to reduce edge artifacts. Processes a large 32K x 32K image and measures " + "the time required to apply the filter." + ) + def bin_args(self) -> list[str]: return [ "-i", @@ -231,6 +277,9 @@ def parse_output(self, stdout: str) -> float: "{self.__class__.__name__}: Failed to parse benchmark output." ) + def get_tags(self): + return ["SYCL", "application", "image", "throughput"] + class QuickSilver(VelocityBase): def __init__(self, vb: VelocityBench): @@ -249,6 +298,13 @@ def run(self, env_vars) -> list[Result]: def name(self): return "Velocity-Bench QuickSilver" + def description(self) -> str: + return ( + "Solves a simplified dynamic Monte Carlo particle-transport problem used in HPC. " + "Replicates memory access patterns, communication patterns, and branching of Mercury workloads. " + "Reports a figure of merit in MMS/CTT where higher values indicate better performance." + ) + def lower_is_better(self): return False @@ -271,6 +327,9 @@ def parse_output(self, stdout: str) -> float: "{self.__class__.__name__}: Failed to parse benchmark output." ) + def get_tags(self): + return ["SYCL", "application", "simulation", "throughput"] + class Easywave(VelocityBase): def __init__(self, vb: VelocityBench): @@ -279,14 +338,22 @@ def __init__(self, vb: VelocityBench): def download_deps(self): self.download( "easywave", - "https://git.gfz-potsdam.de/id2/geoperil/easyWave/-/raw/master/data/examples.tar.gz", + "https://gitlab.oca.eu/AstroGeoGPM/eazyWave/-/raw/master/data/examples.tar.gz", "examples.tar.gz", untar=True, + checksum="3b0cd0efde10122934ba6db8451b8c41f4f95a3370fc967fc5244039ef42aae7e931009af1586fa5ed2143ade8ed47b1", ) def name(self): return "Velocity-Bench Easywave" + def description(self) -> str: + return ( + "A tsunami wave simulator used for researching tsunami generation and wave propagation. " + "Measures the elapsed time in milliseconds to simulate a specified tsunami event " + "based on real-world data." + ) + def bin_args(self) -> list[str]: return [ "-grid", @@ -327,6 +394,9 @@ def parse_output(self, stdout: str) -> float: os.path.join(options.benchmark_cwd, "easywave.log") ) + def get_tags(self): + return ["SYCL", "application", "simulation"] + class CudaSift(VelocityBase): def __init__(self, vb: VelocityBench): @@ -341,6 +411,13 @@ def download_deps(self): def name(self): return "Velocity-Bench CudaSift" + def description(self) -> str: + return ( + "Implementation of the SIFT (Scale Invariant Feature Transform) algorithm " + "for detecting, describing, and matching local features in images. " + "Measures average processing time in milliseconds." + ) + def parse_output(self, stdout: str) -> float: match = re.search(r"Avg workload time = (\d+\.\d+) ms", stdout) if match: @@ -348,6 +425,9 @@ def parse_output(self, stdout: str) -> float: else: raise ValueError("Failed to parse benchmark output.") + def get_tags(self): + return ["SYCL", "application", "image"] + class DLCifar(VelocityBase): def __init__(self, vb: VelocityBench): @@ -364,6 +444,7 @@ def download_deps(self): "cifar-10-binary.tar.gz", untar=True, skip_data_dir=True, + checksum="974b1bd62da0cb3b7a42506d42b1e030c9a0cb4a0f2c359063f9c0e65267c48f0329e4493c183a348f44ddc462eaf814", ) return @@ -382,6 +463,13 @@ def extra_cmake_args(self): def name(self): return "Velocity-Bench dl-cifar" + def description(self) -> str: + return ( + "Deep learning image classification workload based on the CIFAR-10 dataset " + "of 60,000 32x32 color images in 10 classes. Uses neural networks to " + "classify input images and measures total calculation time." + ) + def parse_output(self, stdout: str) -> float: match = re.search( r"dl-cifar - total time for whole calculation: (\d+\.\d+) s", stdout @@ -391,6 +479,9 @@ def parse_output(self, stdout: str) -> float: else: raise ValueError("Failed to parse benchmark output.") + def get_tags(self): + return ["SYCL", "application", "inference", "image"] + class DLMnist(VelocityBase): def __init__(self, vb: VelocityBench): @@ -407,6 +498,7 @@ def download_deps(self): "train-images.idx3-ubyte.gz", unzip=True, skip_data_dir=True, + checksum="f40eb179f7c3d2637e789663bde56d444a23e4a0a14477a9e6ed88bc39c8ad6eaff68056c0cd9bb60daf0062b70dc8ee", ) self.download( "datasets", @@ -414,6 +506,7 @@ def download_deps(self): "train-labels.idx1-ubyte.gz", unzip=True, skip_data_dir=True, + checksum="ba9c11bf9a7f7c2c04127b8b3e568cf70dd3429d9029ca59b7650977a4ac32f8ff5041fe42bc872097487b06a6794e00", ) self.download( "datasets", @@ -421,6 +514,7 @@ def download_deps(self): "t10k-images.idx3-ubyte.gz", unzip=True, skip_data_dir=True, + checksum="1bf45877962fd391f7abb20534a30fd2203d0865309fec5f87d576dbdbefdcb16adb49220afc22a0f3478359d229449c", ) self.download( "datasets", @@ -428,6 +522,7 @@ def download_deps(self): "t10k-labels.idx1-ubyte.gz", unzip=True, skip_data_dir=True, + checksum="ccc1ee70f798a04e6bfeca56a4d0f0de8d8eeeca9f74641c1e1bfb00cf7cc4aa4d023f6ea1b40e79bb4707107845479d", ) def extra_cmake_args(self): @@ -445,6 +540,13 @@ def extra_cmake_args(self): def name(self): return "Velocity-Bench dl-mnist" + def description(self) -> str: + return ( + "Digit recognition based on the MNIST database, one of the oldest and most popular " + "databases of handwritten digits. Uses neural networks to identify digits " + "and measures total calculation time." + ) + def bin_args(self): return ["-conv_algo", "ONEDNN_AUTO"] @@ -465,6 +567,9 @@ def parse_output(self, stdout: str) -> float: else: raise ValueError("Failed to parse benchmark output.") + def get_tags(self): + return ["SYCL", "application", "inference", "image"] + class SVM(VelocityBase): def __init__(self, vb: VelocityBench): @@ -488,6 +593,13 @@ def extra_cmake_args(self): def name(self): return "Velocity-Bench svm" + def description(self) -> str: + return ( + "Implementation of Support Vector Machine, a popular classical machine learning technique. " + "Uses supervised learning models with associated algorithms to analyze data " + "for classification and regression analysis. Measures total elapsed time." + ) + def bin_args(self): return [ f"{self.code_path}/a9a", @@ -500,3 +612,6 @@ def parse_output(self, stdout: str) -> float: return float(match.group(1)) else: raise ValueError("Failed to parse benchmark output.") + + def get_tags(self): + return ["SYCL", "application", "inference"] diff --git a/devops/scripts/benchmarks/history.py b/devops/scripts/benchmarks/history.py index 7902aa4f04c3..0b80c54ad739 100644 --- a/devops/scripts/benchmarks/history.py +++ b/devops/scripts/benchmarks/history.py @@ -1,4 +1,4 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -6,14 +6,14 @@ import os import json from pathlib import Path -from benches.result import Result, BenchmarkRun +import socket +from utils.result import Result, BenchmarkRun from options import Compare, options from datetime import datetime, timezone from utils.utils import run class BenchmarkHistory: - benchmark_run_index_max = 0 runs = [] def __init__(self, dir): @@ -35,42 +35,55 @@ def load(self, n: int): # Get all JSON files in the results directory benchmark_files = list(results_dir.glob("*.json")) - # Extract index numbers and sort files by index number - def extract_index(file_path: Path) -> int: + # Extract timestamp and sort files by it + def extract_timestamp(file_path: Path) -> str: try: - return int(file_path.stem.split("_")[0]) - except (IndexError, ValueError): - return -1 + return file_path.stem.split("_")[-1] + except IndexError: + return "" - benchmark_files = [ - file for file in benchmark_files if extract_index(file) != -1 - ] - benchmark_files.sort(key=extract_index) + benchmark_files.sort(key=extract_timestamp, reverse=True) # Load the first n benchmark files benchmark_runs = [] - for file_path in benchmark_files[n::-1]: + for file_path in benchmark_files[:n]: benchmark_run = self.load_result(file_path) if benchmark_run: benchmark_runs.append(benchmark_run) - if benchmark_files: - self.benchmark_run_index_max = extract_index(benchmark_files[-1]) - self.runs = benchmark_runs def create_run(self, name: str, results: list[Result]) -> BenchmarkRun: try: - result = run("git rev-parse --short HEAD") + script_dir = os.path.dirname(os.path.abspath(__file__)) + result = run("git rev-parse --short HEAD", cwd=script_dir) git_hash = result.stdout.decode().strip() + + # Get the GitHub repo URL from git remote + remote_result = run("git remote get-url origin", cwd=script_dir) + remote_url = remote_result.stdout.decode().strip() + + # Convert SSH or HTTPS URL to owner/repo format + if remote_url.startswith("git@github.com:"): + # SSH format: git@github.com:owner/repo.git + github_repo = remote_url.split("git@github.com:")[1].rstrip(".git") + elif remote_url.startswith("https://github.com/"): + # HTTPS format: https://github.com/owner/repo.git + github_repo = remote_url.split("https://github.com/")[1].rstrip(".git") + else: + github_repo = None + except: git_hash = "unknown" + github_repo = None return BenchmarkRun( name=name, git_hash=git_hash, + github_repo=github_repo, date=datetime.now(tz=timezone.utc), results=results, + hostname=socket.gethostname(), ) def save(self, save_name, results: list[Result], to_file=True): @@ -84,12 +97,9 @@ def save(self, save_name, results: list[Result], to_file=True): results_dir = Path(os.path.join(self.dir, "results")) os.makedirs(results_dir, exist_ok=True) - self.benchmark_run_index_max += 1 - file_path = Path( - os.path.join( - results_dir, f"{self.benchmark_run_index_max}_{save_name}.json" - ) - ) + # Use formatted timestamp for the filename + timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") + file_path = Path(os.path.join(results_dir, f"{save_name}_{timestamp}.json")) with file_path.open("w") as file: json.dump(serialized, file, indent=4) print(f"Benchmark results saved to {file_path}") @@ -120,6 +130,7 @@ def compute_average(self, data: list[BenchmarkRun]): name=first_run.name, git_hash="average", date=first_run.date, # should this be different? + hostname=first_run.hostname, ) return average_benchmark_run diff --git a/devops/scripts/benchmarks/main.py b/devops/scripts/benchmarks/main.py index 4ad90b39b900..610797687931 100755 --- a/devops/scripts/benchmarks/main.py +++ b/devops/scripts/benchmarks/main.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -17,6 +17,7 @@ from history import BenchmarkHistory from utils.utils import prepare_workdir from utils.compute_runtime import * +from presets import enabled_suites, presets import argparse import re @@ -27,23 +28,27 @@ def run_iterations( - benchmark: Benchmark, env_vars, iters: int, results: dict[str, list[Result]] + benchmark: Benchmark, + env_vars, + iters: int, + results: dict[str, list[Result]], + failures: dict[str, str], ): for iter in range(iters): - print(f"running {benchmark.name()}, iteration {iter}... ", end="", flush=True) + print(f"running {benchmark.name()}, iteration {iter}... ", flush=True) bench_results = benchmark.run(env_vars) if bench_results is None: - print(f"did not finish (OK for sycl-bench).") + failures[benchmark.name()] = "benchmark produced no results!" break for bench_result in bench_results: - # TODO: report failures in markdown/html ? if not bench_result.passed: - print(f"complete ({bench_result.label}: verification FAILED)") + failures[bench_result.label] = "verification failed" + print(f"complete ({bench_result.label}: verification failed).") continue print( - f"complete ({bench_result.label}: {bench_result.value:.3f} {bench_result.unit})." + f"{benchmark.name()} complete ({bench_result.label}: {bench_result.value:.3f} {bench_result.unit})." ) bench_result.name = bench_result.label @@ -132,6 +137,18 @@ def process_results( return valid_results, processed +def collect_metadata(suites): + metadata = {} + + for s in suites: + metadata.update(s.additionalMetadata()) + suite_benchmarks = s.benchmarks() + for benchmark in suite_benchmarks: + metadata[benchmark.name()] = benchmark.get_metadata() + + return metadata + + def main(directory, additional_env_vars, save_name, compare_names, filter): prepare_workdir(directory, INTERNAL_WORKDIR_VERSION) @@ -142,22 +159,26 @@ def main(directory, additional_env_vars, save_name, compare_names, filter): options.extra_ld_libraries.extend(cr.ld_libraries()) options.extra_env_vars.update(cr.env_vars()) - suites = ( - [ - ComputeBench(directory), - VelocityBench(directory), - SyclBench(directory), - LlamaCppBench(directory), - UMFSuite(directory), - # TestSuite() - ] - if not options.dry_run - else [] - ) + suites = [ + ComputeBench(directory), + VelocityBench(directory), + SyclBench(directory), + LlamaCppBench(directory), + UMFSuite(directory), + TestSuite(), + ] + + # If dry run, we're done + if options.dry_run: + suites = [] benchmarks = [] + failures = {} for s in suites: + if s.name() not in enabled_suites(options.preset): + continue + suite_benchmarks = s.benchmarks() if filter: suite_benchmarks = [ @@ -170,25 +191,26 @@ def main(directory, additional_env_vars, save_name, compare_names, filter): print(f"Setting up {type(s).__name__}") try: s.setup() - except: + except Exception as e: + failures[s.name()] = f"Suite setup failure: {e}" print(f"{type(s).__name__} setup failed. Benchmarks won't be added.") else: print(f"{type(s).__name__} setup complete.") benchmarks += suite_benchmarks - for b in benchmarks: - print(b.name()) - for benchmark in benchmarks: try: - print(f"Setting up {benchmark.name()}... ") + if options.verbose: + print(f"Setting up {benchmark.name()}... ") benchmark.setup() - print(f"{benchmark.name()} setup complete.") + if options.verbose: + print(f"{benchmark.name()} setup complete.") except Exception as e: if options.exit_on_failure: raise e else: + failures[benchmark.name()] = f"Benchmark setup failure: {e}" print(f"failed: {e}") results = [] @@ -199,7 +221,11 @@ def main(directory, additional_env_vars, save_name, compare_names, filter): processed: list[Result] = [] for _ in range(options.iterations_stddev): run_iterations( - benchmark, merged_env_vars, options.iterations, intermediate_results + benchmark, + merged_env_vars, + options.iterations, + intermediate_results, + failures, ) valid, processed = process_results( intermediate_results, benchmark.stddev_threshold() @@ -211,12 +237,16 @@ def main(directory, additional_env_vars, save_name, compare_names, filter): if options.exit_on_failure: raise e else: + failures[benchmark.name()] = f"Benchmark run failure: {e}" print(f"failed: {e}") for benchmark in benchmarks: - print(f"tearing down {benchmark.name()}... ", end="", flush=True) + # this never has any useful information anyway, so hide it behind verbose + if options.verbose: + print(f"tearing down {benchmark.name()}... ", flush=True) benchmark.teardown() - print("complete.") + if options.verbose: + print("{benchmark.name()} teardown complete.") this_name = options.current_run_name chart_data = {} @@ -224,7 +254,10 @@ def main(directory, additional_env_vars, save_name, compare_names, filter): if not options.dry_run: chart_data = {this_name: results} - history = BenchmarkHistory(directory) + results_dir = directory + if options.custom_results_dir: + results_dir = Path(options.custom_results_dir) + history = BenchmarkHistory(results_dir) # limit how many files we load. # should this be configurable? history.load(1000) @@ -241,14 +274,18 @@ def main(directory, additional_env_vars, save_name, compare_names, filter): if options.output_markdown: markdown_content = generate_markdown( - this_name, chart_data, options.output_markdown + this_name, chart_data, failures, options.output_markdown ) - with open("benchmark_results.md", "w") as file: + md_path = options.output_directory + if options.output_directory is None: + md_path = os.getcwd() + + with open(os.path.join(md_path, "benchmark_results.md"), "w") as file: file.write(markdown_content) print( - f"Markdown with benchmark results has been written to {os.getcwd()}/benchmark_results.md" + f"Markdown with benchmark results has been written to {md_path}/benchmark_results.md" ) saved_name = save_name if save_name is not None else this_name @@ -297,7 +334,7 @@ def validate_and_parse_env_args(env_args): parser.add_argument( "--adapter", type=str, - help="Options to build the Unified Runtime as part of the benchmark", + help="Unified Runtime adapter to use.", default="level_zero", ) parser.add_argument( @@ -305,6 +342,11 @@ def validate_and_parse_env_args(env_args): help="Do not rebuild the benchmarks from scratch.", action="store_true", ) + parser.add_argument( + "--redownload", + help="Always download benchmark data dependencies, even if they already exist.", + action="store_true", + ) parser.add_argument( "--env", type=str, @@ -347,12 +389,6 @@ def validate_and_parse_env_args(env_args): help="Regex pattern to filter benchmarks by name.", default=None, ) - parser.add_argument( - "--epsilon", - type=float, - help="Threshold to consider change of performance significant", - default=options.epsilon, - ) parser.add_argument( "--verbose", help="Print output of all the commands.", action="store_true" ) @@ -381,6 +417,12 @@ def validate_and_parse_env_args(env_args): parser.add_argument( "--output-html", help="Create HTML output", action="store_true", default=False ) + parser.add_argument( + "--output-dir", + type=str, + help="Location for output files, if --output-html or --output-markdown was specified.", + default=None, + ) parser.add_argument( "--dry-run", help="Do not run any actual benchmarks", @@ -412,17 +454,42 @@ def validate_and_parse_env_args(env_args): default=options.current_run_name, ) parser.add_argument( - "--cudnn_directory", + "--cudnn-directory", type=str, help="Directory for cudnn library", default=None, ) parser.add_argument( - "--cublas_directory", + "--cublas-directory", type=str, help="Directory for cublas library", default=None, ) + parser.add_argument( + "--preset", + type=str, + choices=[p for p in presets.keys()], + help="Benchmark preset to run", + default=options.preset, + ) + parser.add_argument( + "--results-dir", + type=str, + help="Specify a custom results directory", + default=options.custom_results_dir, + ) + parser.add_argument( + "--build-jobs", + type=int, + help="Number of build jobs to run simultaneously", + default=options.build_jobs, + ) + parser.add_argument( + "--hip-arch", + type=str, + help="HIP device architecture", + default=None, + ) args = parser.parse_args() additional_env_vars = validate_and_parse_env_args(args.env) @@ -430,10 +497,10 @@ def validate_and_parse_env_args(env_args): options.workdir = args.benchmark_directory options.verbose = args.verbose options.rebuild = not args.no_rebuild + options.redownload = args.redownload options.sycl = args.sycl options.iterations = args.iterations options.timeout = args.timeout - options.epsilon = args.epsilon options.ur = args.ur options.ur_adapter = args.adapter options.exit_on_failure = args.exit_on_failure @@ -448,12 +515,21 @@ def validate_and_parse_env_args(env_args): options.current_run_name = args.relative_perf options.cudnn_directory = args.cudnn_directory options.cublas_directory = args.cublas_directory + options.preset = args.preset + options.custom_results_dir = args.results_dir + options.build_jobs = args.build_jobs + options.hip_arch = args.hip_arch if args.build_igc and args.compute_runtime is None: parser.error("--build-igc requires --compute-runtime to be set") if args.compute_runtime is not None: options.build_compute_runtime = True options.compute_runtime_tag = args.compute_runtime + if args.output_dir is not None: + if not os.path.isdir(args.output_dir): + parser.error("Specified --output-dir is not a valid path") + options.output_directory = os.path.abspath(args.output_dir) + benchmark_filter = re.compile(args.filter) if args.filter else None diff --git a/devops/scripts/benchmarks/options.py b/devops/scripts/benchmarks/options.py index 2e9267526454..a14e84e78617 100644 --- a/devops/scripts/benchmarks/options.py +++ b/devops/scripts/benchmarks/options.py @@ -1,6 +1,8 @@ from dataclasses import dataclass, field from enum import Enum +import multiprocessing +from presets import presets class Compare(Enum): LATEST = "latest" @@ -21,6 +23,7 @@ class Options: ur_adapter: str = None umf: str = None rebuild: bool = True + redownload: bool = False benchmark_cwd: str = "INVALID" timeout: float = 600 iterations: int = 3 @@ -29,10 +32,9 @@ class Options: compare_max: int = 10 # average/median over how many results output_markdown: MarkdownSize = MarkdownSize.SHORT output_html: bool = False + output_directory: str = None dry_run: bool = False - # these two should probably be merged into one setting stddev_threshold: float = 0.02 - epsilon: float = 0.02 iterations_stddev: int = 5 build_compute_runtime: bool = False extra_ld_libraries: list[str] = field(default_factory=list) @@ -40,6 +42,8 @@ class Options: compute_runtime_tag: str = "25.05.32567.12" build_igc: bool = False current_run_name: str = "This PR" - + preset: str = "Full" + custom_results_dir = None + build_jobs: int = multiprocessing.cpu_count() options = Options() diff --git a/devops/scripts/benchmarks/output_html.py b/devops/scripts/benchmarks/output_html.py index 4ba395bc3aac..e9c1f135b70c 100644 --- a/devops/scripts/benchmarks/output_html.py +++ b/devops/scripts/benchmarks/output_html.py @@ -11,7 +11,7 @@ from collections import defaultdict from dataclasses import dataclass import matplotlib.dates as mdates -from benches.result import BenchmarkRun, Result +from utils.result import BenchmarkRun, Result import numpy as np from string import Template diff --git a/devops/scripts/benchmarks/output_markdown.py b/devops/scripts/benchmarks/output_markdown.py index dd6711cec636..3295968603d0 100644 --- a/devops/scripts/benchmarks/output_markdown.py +++ b/devops/scripts/benchmarks/output_markdown.py @@ -5,7 +5,7 @@ # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception import collections -from benches.result import Result +from utils.result import Result from options import options, MarkdownSize import ast @@ -79,7 +79,7 @@ def get_improved_regressed_summary(is_improved: bool, rows_count: int): "\n
\n" "\n" f"{title} {rows_count} " - f"(threshold {options.epsilon*100:.2f}%)\n" + f"(threshold {options.stddev_threshold*100:.2f}%)\n" "\n\n" ) @@ -138,17 +138,6 @@ def generate_markdown_details( env_dict = res.env command = res.command - # If data is collected from already saved results, - # the content is parsed as strings - if isinstance(res.env, str): - # Since the scripts would be used solely on data prepared - # by our scripts, this should be safe - # However, maybe needs an additional blessing - # https://docs.python.org/3/library/ast.html#ast.literal_eval - env_dict = ast.literal_eval(res.env) - if isinstance(res.command, str): - command = ast.literal_eval(res.command) - section = ( "\n
\n" f"{res.label}\n\n" @@ -179,7 +168,7 @@ def generate_markdown_details( return "\nBenchmark details contain too many chars to display\n" -def generate_summary_table_and_chart( +def generate_summary_table( chart_data: dict[str, list[Result]], baseline_name: str, markdown_size: MarkdownSize ): summary_table = get_chart_markdown_header( @@ -276,7 +265,7 @@ def generate_summary_table_and_chart( delta = oln.diff - 1 oln.row += f" {delta*100:.2f}%" - if abs(delta) > options.epsilon: + if abs(delta) > options.stddev_threshold: if delta > 0: improved_rows.append(oln.row + " | \n") else: @@ -374,10 +363,27 @@ def generate_summary_table_and_chart( return "\n# Summary\n" "Benchmark output is too large to display\n\n" +def generate_failures_section(failures: dict[str, str]) -> str: + if not failures: + return "" + + section = "\n# Failures\n" + section += "| Name | Failure |\n" + section += "|---|---|\n" + + for name, failure in failures.items(): + section += f"| {name} | {failure} |\n" + + return section + + def generate_markdown( - name: str, chart_data: dict[str, list[Result]], markdown_size: MarkdownSize + name: str, + chart_data: dict[str, list[Result]], + failures: dict[str, str], + markdown_size: MarkdownSize, ): - (summary_line, summary_table) = generate_summary_table_and_chart( + (summary_line, summary_table) = generate_summary_table( chart_data, name, markdown_size ) @@ -396,4 +402,6 @@ def generate_markdown( ) generated_markdown += "\n# Details\n" f"{markdown_details}\n" - return generated_markdown + failures_section = generate_failures_section(failures) + + return failures_section + generated_markdown diff --git a/devops/scripts/benchmarks/presets.py b/devops/scripts/benchmarks/presets.py new file mode 100644 index 000000000000..3f191766deb8 --- /dev/null +++ b/devops/scripts/benchmarks/presets.py @@ -0,0 +1,38 @@ +# Copyright (C) 2025 Intel Corporation +# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. +# See LICENSE.TXT +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +presets: dict[str, list[str]] = { + "Full": [ + "Compute Benchmarks", + "llama.cpp bench", + "SYCL-Bench", + "Velocity Bench", + "UMF", + ], + "SYCL": [ + "Compute Benchmarks", + "llama.cpp bench", + "SYCL-Bench", + "Velocity Bench", + ], + "Minimal": [ + "Compute Benchmarks", + ], + "Normal": [ + "Compute Benchmarks", + "llama.cpp bench", + "Velocity Bench", + ], + "Test": [ + "Test Suite", + ], +} + + +def enabled_suites(preset: str) -> list[str]: + try: + return presets[preset] + except KeyError: + raise ValueError(f"Preset '{preset}' not found.") diff --git a/devops/scripts/benchmarks/utils/compute_runtime.py b/devops/scripts/benchmarks/utils/compute_runtime.py index 74d8ff4eb534..e617168f37a7 100644 --- a/devops/scripts/benchmarks/utils/compute_runtime.py +++ b/devops/scripts/benchmarks/utils/compute_runtime.py @@ -1,4 +1,4 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -62,7 +62,7 @@ def build_gmmlib(self, repo, commit): f"-DCMAKE_BUILD_TYPE=Release", ] run(configure_command) - run(f"cmake --build {self.gmmlib_build} -j") + run(f"cmake --build {self.gmmlib_build} -j {options.build_jobs}") run(f"cmake --install {self.gmmlib_build}") return self.gmmlib_install @@ -87,7 +87,7 @@ def build_level_zero(self, repo, commit): f"-DCMAKE_BUILD_TYPE=Release", ] run(configure_command) - run(f"cmake --build {self.level_zero_build} -j") + run(f"cmake --build {self.level_zero_build} -j {options.build_jobs}") run(f"cmake --install {self.level_zero_build}") return self.level_zero_install @@ -142,8 +142,11 @@ def build_igc(self, repo, commit): ] run(configure_command) - # set timeout to 30min. IGC takes A LONG time to build if building from scratch. - run(f"cmake --build {self.igc_build} -j", timeout=600 * 3) + # set timeout to 2h. IGC takes A LONG time to build if building from scratch. + run( + f"cmake --build {self.igc_build} -j {options.build_jobs}", + timeout=60 * 60 * 2, + ) # cmake --install doesn't work... run("make install", cwd=self.igc_build) return self.igc_install @@ -214,7 +217,7 @@ def build_compute_runtime(self): configure_command.append(f"-DIGC_DIR={self.igc}") run(configure_command) - run(f"cmake --build {self.compute_runtime_build} -j") + run(f"cmake --build {self.compute_runtime_build} -j {options.build_jobs}") return self.compute_runtime_build diff --git a/devops/scripts/benchmarks/benches/oneapi.py b/devops/scripts/benchmarks/utils/oneapi.py similarity index 78% rename from devops/scripts/benchmarks/benches/oneapi.py rename to devops/scripts/benchmarks/utils/oneapi.py index 0547f6646e39..fc27b9a8b2d3 100644 --- a/devops/scripts/benchmarks/benches/oneapi.py +++ b/devops/scripts/benchmarks/utils/oneapi.py @@ -1,4 +1,4 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -7,29 +7,33 @@ from utils.utils import download, run from options import options import os +import hashlib class OneAPI: - # random unique number for benchmark oneAPI installation - ONEAPI_BENCHMARK_INSTANCE_ID = 987654 - def __init__(self): self.oneapi_dir = os.path.join(options.workdir, "oneapi") Path(self.oneapi_dir).mkdir(parents=True, exist_ok=True) - # delete if some option is set? + self.oneapi_instance_id = self.generate_unique_oneapi_id(self.oneapi_dir) # can we just hardcode these links? self.install_package( "dnnl", "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/87e117ab-039b-437d-9c80-dcd5c9e675d5/intel-onednn-2025.0.0.862_offline.sh", + "6866feb5b8dfefd6ff45d6bfabed44f01d7fba8fd452480ae1fd86b92e9481ae052c24842da14f112f672f5c4859945b", ) self.install_package( "mkl", "https://registrationcenter-download.intel.com/akdlm/IRC_NAS/79153e0f-74d7-45af-b8c2-258941adf58a/intel-onemkl-2025.0.0.940_offline.sh", + "122bb84cf943ea27753cb399c81ab2ae218ebd51b789c74d273240157722925ab4d5a43cb0b5de41b854f2c5a59a4002", ) return - def install_package(self, name, url): + def generate_unique_oneapi_id(self, path): + hash_object = hashlib.md5(path.encode()) + return hash_object.hexdigest() + + def install_package(self, name, url, checksum): package_path = os.path.join(self.oneapi_dir, name) if Path(package_path).exists(): print( @@ -37,11 +41,13 @@ def install_package(self, name, url): ) return - package = download(self.oneapi_dir, url, f"package_{name}.sh") + package = download( + self.oneapi_dir, url, f"package_{name}.sh", checksum=checksum + ) try: print(f"installing {name}") run( - f"sh {package} -a -s --eula accept --install-dir {self.oneapi_dir} --instance f{self.ONEAPI_BENCHMARK_INSTANCE_ID}" + f"sh {package} -a -s --eula accept --install-dir {self.oneapi_dir} --instance {self.oneapi_instance_id}" ) except: print("oneAPI installation likely exists already") diff --git a/devops/scripts/benchmarks/utils/result.py b/devops/scripts/benchmarks/utils/result.py new file mode 100644 index 000000000000..14a2ffa905f3 --- /dev/null +++ b/devops/scripts/benchmarks/utils/result.py @@ -0,0 +1,69 @@ +# Copyright (C) 2024-2025 Intel Corporation +# Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. +# See LICENSE.TXT +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + +from dataclasses import dataclass, field +from dataclasses_json import config, dataclass_json +from datetime import datetime + + +@dataclass_json +@dataclass +class Result: + label: str + value: float + command: list[str] + env: dict[str, str] + stdout: str + passed: bool = True + unit: str = "" + explicit_group: str = "" + # stddev can be optionally set by the benchmark, + # if not set, it will be calculated automatically. + stddev: float = 0.0 + git_url: str = "" + git_hash: str = "" + # values below should not be set by the benchmark + name: str = "" + lower_is_better: bool = True + suite: str = "Unknown" + +@dataclass_json +@dataclass +class BenchmarkRun: + results: list[Result] + name: str = "This PR" + hostname: str = "Unknown" + git_hash: str = "" + github_repo: str = None + date: datetime = field( + default=None, + metadata=config(encoder=datetime.isoformat, decoder=datetime.fromisoformat), + ) + + +@dataclass_json +@dataclass +class BenchmarkTag: + name: str + description: str = "" + + +@dataclass_json +@dataclass +class BenchmarkMetadata: + type: str = "benchmark" # or 'group' + description: str = None + notes: str = None + unstable: str = None + tags: list[str] = field(default_factory=list) + + +@dataclass_json +@dataclass +class BenchmarkOutput: + runs: list[BenchmarkRun] + metadata: dict[str, BenchmarkMetadata] + tags: dict[str, BenchmarkTag] + default_compare_names: list[str] = field(default_factory=list) diff --git a/devops/scripts/benchmarks/utils/utils.py b/devops/scripts/benchmarks/utils/utils.py index 3a516e8d724f..54f2ef7fb9c1 100644 --- a/devops/scripts/benchmarks/utils/utils.py +++ b/devops/scripts/benchmarks/utils/utils.py @@ -1,4 +1,4 @@ -# Copyright (C) 2024 Intel Corporation +# Copyright (C) 2024-2025 Intel Corporation # Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM Exceptions. # See LICENSE.TXT # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception @@ -12,6 +12,7 @@ import urllib # nosec B404 from options import options from pathlib import Path +import hashlib def run( @@ -45,6 +46,12 @@ def run( env.update(env_vars) + if options.verbose: + command_str = " ".join(command) + env_str = " ".join(f"{key}={value}" for key, value in env_vars.items()) + full_command_str = f"{env_str} {command_str}".strip() + print(f"Running: {full_command_str}") + result = subprocess.run( command, cwd=cwd, @@ -107,7 +114,7 @@ def prepare_workdir(dir, version): shutil.rmtree(dir) else: raise Exception( - f"The directory {dir} exists but is a benchmark work directory." + f"The directory {dir} exists but is not a benchmark work directory." ) os.makedirs(dir) @@ -128,11 +135,26 @@ def create_build_path(directory, name): return build_path -def download(dir, url, file, untar=False, unzip=False): +def calculate_checksum(file_path): + sha_hash = hashlib.sha384() + with open(file_path, "rb") as f: + for byte_block in iter(lambda: f.read(4096), b""): + sha_hash.update(byte_block) + return sha_hash.hexdigest() + + +def download(dir, url, file, untar=False, unzip=False, checksum=""): data_file = os.path.join(dir, file) if not Path(data_file).exists(): print(f"{data_file} does not exist, downloading") urllib.request.urlretrieve(url, data_file) + calculated_checksum = calculate_checksum(data_file) + if calculated_checksum != checksum: + print( + f"Checksum mismatch: expected {checksum}, got {calculated_checksum}. Refusing to continue." + ) + exit(1) + if untar: file = tarfile.open(data_file) file.extractall(dir) diff --git a/llvm/docs/requirements-hashed.txt b/llvm/docs/requirements-hashed.txt index 636aa7d5ed25..5501de370558 100644 --- a/llvm/docs/requirements-hashed.txt +++ b/llvm/docs/requirements-hashed.txt @@ -151,9 +151,9 @@ imagesize==1.4.1 \ --hash=sha256:0d8d18d08f840c19d0ee7ca1fd82490fdc3729b7ac93f49870406ddde8ef8d8b \ --hash=sha256:69150444affb9cb0d5cc5a92b3676f0b2fb7cd9ae39e947a5e11a36b4497cd4a # via sphinx -jinja2==3.1.5 \ - --hash=sha256:4a3aee7acbbe7303aede8e9648d13b8bf88a429282aa6122a993f0ac800cb369 \ - --hash=sha256:bc5dd2abb727a5319567b7a813e6a2e7318c39f4f487cfe6c89c6f9c7d25197d +jinja2==3.1.6 \ + --hash=sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d \ + --hash=sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67 # via # myst-parser # sphinx @@ -334,10 +334,6 @@ sphinx==8.1.3 \ # sphinx-automodapi # sphinx-basic-ng # sphinx-reredirects - # sphinxcontrib-devhelp - # sphinxcontrib-htmlhelp - # sphinxcontrib-qthelp - # sphinxcontrib-serializinghtml sphinx-automodapi==0.18.0 \ --hash=sha256:022860385590768f52d4f6e19abb83b2574772d2721fb4050ecdb6e593a1a440 \ --hash=sha256:7bf9d9a2cb67a5389c51071cfd86674ca3892ca5d5943f95de4553d6f35dddae diff --git a/llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td b/llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td index 74c59fbc1837..726b27d2d010 100644 --- a/llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td +++ b/llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td @@ -91,6 +91,7 @@ def AspectExt_oneapi_bindless_images_gather : Aspect<"ext_oneapi_bindless_images def AspectExt_intel_current_clock_throttle_reasons : Aspect<"ext_intel_current_clock_throttle_reasons">; def AspectExt_intel_fan_speed : Aspect<"ext_intel_fan_speed">; def AspectExt_intel_power_limits : Aspect<"ext_intel_power_limits">; +def AspectExt_oneapi_async_memory_alloc : Aspect<"ext_oneapi_async_memory_alloc">; // Deprecated aspects def AspectInt64_base_atomics : Aspect<"int64_base_atomics">; @@ -161,7 +162,8 @@ def : TargetInfo<"__TestAspectList", AspectExt_intel_spill_memory_size, AspectExt_intel_current_clock_throttle_reasons, AspectExt_intel_fan_speed, - AspectExt_intel_power_limits], + AspectExt_intel_power_limits, + AspectExt_oneapi_async_memory_alloc], []>; // This definition serves the only purpose of testing whether the deprecated aspect list defined in here and in SYCL RT // match. diff --git a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp index abf27639a82f..c75b1e3cc4a3 100644 --- a/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp @@ -1830,7 +1830,8 @@ void AddressSanitizer::instrumentSyclStaticLocalMemory( // Instument dynamic local memory bool AddressSanitizer::instrumentSyclDynamicLocalMemory( Function &F, ArrayRef RetVec) { - InstrumentationIRBuilder IRB(F.getEntryBlock().getFirstNonPHI()); + InstrumentationIRBuilder IRB(&F.getEntryBlock(), + F.getEntryBlock().getFirstNonPHIIt()); SmallVector LocalArgs; for (auto &Arg : F.args()) { @@ -1868,7 +1869,8 @@ bool AddressSanitizer::instrumentSyclDynamicLocalMemory( // "__asan_launch" if it's an extended kernel, and store 0 if not void AddressSanitizer::instrumentInitAsanLaunchInfo( Function &F, const TargetLibraryInfo *TLI) { - InstrumentationIRBuilder IRB(F.getEntryBlock().getFirstNonPHI()); + InstrumentationIRBuilder IRB(&F.getEntryBlock(), + F.getEntryBlock().getFirstNonPHIIt()); if (F.arg_size()) { auto *LastArg = F.getArg(F.arg_size() - 1); if (LastArg->getName() == "__asan_launch") { @@ -2891,6 +2893,11 @@ void ModuleAddressSanitizer::instrumentDeviceGlobal(IRBuilder<> &IRB) { StructType *StructTy = StructType::get(IntptrTy, IntptrTy, IntptrTy); for (auto &G : M.globals()) { + // DeviceSanitizers cannot handle nameless globals, therefore we set a name + // for them so that we can handle them like regular globals. + if (G.getName().empty() && G.hasInternalLinkage()) + G.setName("nameless_global"); + if (isUnsupportedDeviceGlobal(&G)) continue; diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp index 26eccf175e8a..bfe570f42257 100644 --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -939,6 +939,11 @@ void MemorySanitizerOnSpirv::instrumentGlobalVariables() { StructType *StructTy = StructType::get(IntptrTy, IntptrTy); for (auto &G : M.globals()) { + // DeviceSanitizers cannot handle nameless globals, therefore we set a name + // for them so that we can handle them like regular globals. + if (G.getName().empty() && G.hasInternalLinkage()) + G.setName("nameless_global"); + if (isUnsupportedDeviceGlobal(&G)) { for (auto *User : G.users()) if (auto *Inst = dyn_cast(User)) @@ -5844,7 +5849,9 @@ struct MemorySanitizerVisitor : public InstVisitor { if (isa(CB) && cast(CB).isMustTailCall()) return; - if (MayCheckCall && CB.hasRetAttr(Attribute::NoUndef)) { + // Since Spirv always does eager checking, the shadow of retval must be + // zeros + if (SpirOrSpirv || (MayCheckCall && CB.hasRetAttr(Attribute::NoUndef))) { setShadow(&CB, getCleanShadow(&CB)); setOrigin(&CB, getCleanOrigin()); return; @@ -5919,7 +5926,7 @@ struct MemorySanitizerVisitor : public InstVisitor { // The caller may still expect information passed over TLS if we pass our // check - if (StoreShadow) { + if (StoreShadow && !SpirOrSpirv) { IRB.CreateAlignedStore(Shadow, ShadowPtr, kShadowTLSAlignment); if (MS.TrackOrigins && StoreOrigin) IRB.CreateStore(getOrigin(RetVal), getOriginPtrForRetval()); diff --git a/llvm/test/Instrumentation/AddressSanitizer/SPIRV/device_global.ll b/llvm/test/Instrumentation/AddressSanitizer/SPIRV/device_global.ll index a30eca4bc75b..1900d281aa02 100644 --- a/llvm/test/Instrumentation/AddressSanitizer/SPIRV/device_global.ll +++ b/llvm/test/Instrumentation/AddressSanitizer/SPIRV/device_global.ll @@ -6,8 +6,12 @@ target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256: target triple = "spir64-unknown-unknown" @dev_global = addrspace(1) global { [4 x i32] } zeroinitializer #0 +@0 = internal addrspace(1) global i32 0, align 4 ;nameless global +@1 = internal addrspace(1) global i32 0, align 4 ;nameless global ; CHECK: @dev_global = addrspace(1) global { { [4 x i32] }, [16 x i8] } +; CHECK: @nameless_global +; CHECK: @nameless_global.1 ; CHECK: @__AsanDeviceGlobalMetadata = appending local_unnamed_addr addrspace(1) global [1 x { i64, i64, i64 }] [{ i64, i64, i64 } { i64 16, i64 32, i64 ptrtoint (ptr addrspace(1) @dev_global to i64) }] attributes #0 = { "sycl-device-global-size"="16" "sycl-device-image-scope" } diff --git a/llvm/test/Instrumentation/MemorySanitizer/SPIRV/instrument_device_global.ll b/llvm/test/Instrumentation/MemorySanitizer/SPIRV/instrument_device_global.ll index 6526e50d0eff..a644864d8f2c 100644 --- a/llvm/test/Instrumentation/MemorySanitizer/SPIRV/instrument_device_global.ll +++ b/llvm/test/Instrumentation/MemorySanitizer/SPIRV/instrument_device_global.ll @@ -5,6 +5,8 @@ target triple = "spir64-unknown-unknown" @.str = external addrspace(1) constant [59 x i8] @__spirv_BuiltInGlobalInvocationId = external addrspace(1) constant <3 x i64> @dev_global_no_users = dso_local addrspace(1) global { [4 x i32] } zeroinitializer +@0 = internal global i32 0, align 4 ;nameless global +@1 = internal global i32 0, align 4 ;nameless global define spir_func void @_ZZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_ENKUlvE_clEv() { entry: @@ -12,6 +14,8 @@ entry: ret void } +; CHECK: @nameless_global +; CHECK: @nameless_global.1 ; CHECK: @__MsanDeviceGlobalMetadata ; CHECK-NOT: @__spirv_BuiltInGlobalInvocationId ; CHECK-NOT: @dev_global_no_users diff --git a/llvm/test/Instrumentation/MemorySanitizer/SPIRV/instrument_global_address_space.ll b/llvm/test/Instrumentation/MemorySanitizer/SPIRV/instrument_global_address_space.ll index 5d8977375949..3d8b1f6d3629 100644 --- a/llvm/test/Instrumentation/MemorySanitizer/SPIRV/instrument_global_address_space.ll +++ b/llvm/test/Instrumentation/MemorySanitizer/SPIRV/instrument_global_address_space.ll @@ -1,143 +1,36 @@ -; RUN: opt < %s -passes=msan -msan-instrumentation-with-call-threshold=0 -msan-eager-checks=1 -S | FileCheck %s +; RUN: opt < %s -passes=msan -msan-instrumentation-with-call-threshold=0 -msan-eager-checks=1 -msan-spir-privates=0 -S | FileCheck %s -; ModuleID = 'check_call.cpp' -source_filename = "check_call.cpp" target datalayout = "e-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024-n8:16:32:64-G1" target triple = "spir64-unknown-unknown" -$_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_E8MyKernel = comdat any - ; CHECK: @__MsanKernelMetadata = appending dso_local local_unnamed_addr addrspace(1) global ; CHECK-SAME: [[ATTR0:#[0-9]+]] -; Function Attrs: mustprogress norecurse nounwind sanitize_memory uwtable -define weak_odr dso_local spir_kernel void @_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_E8MyKernel(ptr addrspace(1) noundef align 4 %_arg_array) local_unnamed_addr #0 comdat !srcloc !85 !kernel_arg_buffer_location !86 !sycl_fixed_targets !87 { -; CHECK-LABEL: @_ZTSZZ4mainENKUlRN4sycl3_V17handlerEE_clES2_E8MyKernel +; CHECK-NOT: _tls + +define spir_kernel void @MyKernel(ptr addrspace(1) noundef align 4 %_arg_array) sanitize_memory { +; CHECK-LABEL: define spir_kernel void @MyKernel entry: -; CHECK-NOT: @__msan_param_tls - %0 = load i32, ptr addrspace(1) %_arg_array, align 4, !tbaa !88 - %arrayidx3.i = getelementptr inbounds i8, ptr addrspace(1) %_arg_array, i64 4 -; CHECK: @__msan_get_shadow - %1 = load i32, ptr addrspace(1) %arrayidx3.i, align 4, !tbaa !88 - %conv.i = sext i32 %1 to i64 - %call.i = tail call spir_func noundef i64 @_Z3fooix(i32 noundef %0, i64 noundef %conv.i) #2 - %conv4.i = trunc i64 %call.i to i32 - store i32 %conv4.i, ptr addrspace(1) %_arg_array, align 4, !tbaa !88 + %0 = load i32, ptr addrspace(1) %_arg_array, align 4 + ; CHECK: %1 = ptrtoint ptr addrspace(1) %_arg_array to i64 + ; CHECK-NEXT: %2 = call i64 @__msan_get_shadow(i64 %1, i32 1, ptr addrspace(2) null) + ; CHECK-NEXT: %3 = inttoptr i64 %2 to ptr addrspace(1) + ; CHECK-NEXT: %_msld = load i32, ptr addrspace(1) %3, align 4 + ; CHECK-NEXT: call void @__msan_maybe_warning_4(i32 zeroext %_msld, i64 zeroext 0, ptr addrspace(2) null, i32 0, ptr addrspace(2) @__msan_kernel) + %call = call spir_func i32 @foo(i32 %0) + ; CHECK: %4 = ptrtoint ptr addrspace(1) %_arg_array to i64 + ; CHECK-NEXT: %5 = call i64 @__msan_get_shadow(i64 %4, i32 1, ptr addrspace(2) null) + ; CHECK-NEXT: %6 = inttoptr i64 %5 to ptr addrspace(1) + ; CHECK-NEXT: store i32 0, ptr addrspace(1) %6, align 4 + store i32 %call, ptr addrspace(1) %_arg_array, align 4 ret void } -; Function Attrs: mustprogress noinline norecurse nounwind sanitize_memory uwtable -define linkonce_odr dso_local spir_func noundef i64 @_Z3fooix(i32 noundef %data1, i64 noundef %data2) local_unnamed_addr #1 !srcloc !92 { -; CHECK-LABEL: @_Z3fooix +define spir_func i32 @foo(i32 %data) sanitize_memory { +; CHECK-LABEL: define spir_func i32 @foo entry: - %conv = sext i32 %data1 to i64 - %add = add nsw i64 %data2, %conv - ret i64 %add + ret i32 %data } ; CHECK: attributes [[ATTR0]] ; CHECK-SAME: "sycl-device-global-size"="32" "sycl-device-image-scope" "sycl-host-access"="0" "sycl-unique-id"="_Z20__MsanKernelMetadata" - -attributes #0 = { mustprogress norecurse nounwind sanitize_memory uwtable "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "sycl-module-id"="check_call.cpp" "sycl-single-task" "uniform-work-group-size"="true" } -attributes #1 = { mustprogress noinline norecurse nounwind sanitize_memory uwtable "frame-pointer"="all" "no-trapping-math"="true" "stack-protector-buffer-size"="8" } -attributes #2 = { nounwind } - -!llvm.module.flags = !{!0, !1, !2, !3} -!opencl.spir.version = !{!4} -!spirv.Source = !{!5} -!sycl_aspects = !{!6, !7, !8, !9, !10, !11, !12, !13, !14, !15, !16, !17, !18, !19, !20, !21, !22, !23, !24, !25, !26, !27, !28, !29, !30, !31, !32, !33, !34, !35, !36, !37, !38, !39, !40, !41, !42, !43, !44, !45, !46, !47, !48, !49, !50, !51, !52, !53, !54, !55, !56, !57, !58, !59, !60, !61, !62, !63, !64, !65, !66, !67, !68, !69, !70, !71, !72, !73, !74, !75, !76, !77, !78, !79, !80, !81, !82, !83} -!llvm.ident = !{!84} - -!0 = !{i32 1, !"wchar_size", i32 4} -!1 = !{i32 1, !"sycl-device", i32 1} -!2 = !{i32 7, !"uwtable", i32 2} -!3 = !{i32 7, !"frame-pointer", i32 2} -!4 = !{i32 1, i32 2} -!5 = !{i32 4, i32 100000} -!6 = !{!"cpu", i32 1} -!7 = !{!"gpu", i32 2} -!8 = !{!"accelerator", i32 3} -!9 = !{!"custom", i32 4} -!10 = !{!"fp16", i32 5} -!11 = !{!"fp64", i32 6} -!12 = !{!"image", i32 9} -!13 = !{!"online_compiler", i32 10} -!14 = !{!"online_linker", i32 11} -!15 = !{!"queue_profiling", i32 12} -!16 = !{!"usm_device_allocations", i32 13} -!17 = !{!"usm_host_allocations", i32 14} -!18 = !{!"usm_shared_allocations", i32 15} -!19 = !{!"usm_system_allocations", i32 17} -!20 = !{!"ext_intel_pci_address", i32 18} -!21 = !{!"ext_intel_gpu_eu_count", i32 19} -!22 = !{!"ext_intel_gpu_eu_simd_width", i32 20} -!23 = !{!"ext_intel_gpu_slices", i32 21} -!24 = !{!"ext_intel_gpu_subslices_per_slice", i32 22} -!25 = !{!"ext_intel_gpu_eu_count_per_subslice", i32 23} -!26 = !{!"ext_intel_max_mem_bandwidth", i32 24} -!27 = !{!"ext_intel_mem_channel", i32 25} -!28 = !{!"usm_atomic_host_allocations", i32 26} -!29 = !{!"usm_atomic_shared_allocations", i32 27} -!30 = !{!"atomic64", i32 28} -!31 = !{!"ext_intel_device_info_uuid", i32 29} -!32 = !{!"ext_oneapi_srgb", i32 30} -!33 = !{!"ext_oneapi_native_assert", i32 31} -!34 = !{!"host_debuggable", i32 32} -!35 = !{!"ext_intel_gpu_hw_threads_per_eu", i32 33} -!36 = !{!"ext_oneapi_cuda_async_barrier", i32 34} -!37 = !{!"ext_intel_free_memory", i32 36} -!38 = !{!"ext_intel_device_id", i32 37} -!39 = !{!"ext_intel_memory_clock_rate", i32 38} -!40 = !{!"ext_intel_memory_bus_width", i32 39} -!41 = !{!"emulated", i32 40} -!42 = !{!"ext_intel_legacy_image", i32 41} -!43 = !{!"ext_oneapi_bindless_images", i32 42} -!44 = !{!"ext_oneapi_bindless_images_shared_usm", i32 43} -!45 = !{!"ext_oneapi_bindless_images_1d_usm", i32 44} -!46 = !{!"ext_oneapi_bindless_images_2d_usm", i32 45} -!47 = !{!"ext_oneapi_external_memory_import", i32 46} -!48 = !{!"ext_oneapi_external_semaphore_import", i32 48} -!49 = !{!"ext_oneapi_mipmap", i32 50} -!50 = !{!"ext_oneapi_mipmap_anisotropy", i32 51} -!51 = !{!"ext_oneapi_mipmap_level_reference", i32 52} -!52 = !{!"ext_intel_esimd", i32 53} -!53 = !{!"ext_oneapi_ballot_group", i32 54} -!54 = !{!"ext_oneapi_fixed_size_group", i32 55} -!55 = !{!"ext_oneapi_opportunistic_group", i32 56} -!56 = !{!"ext_oneapi_tangle_group", i32 57} -!57 = !{!"ext_intel_matrix", i32 58} -!58 = !{!"ext_oneapi_is_composite", i32 59} -!59 = !{!"ext_oneapi_is_component", i32 60} -!60 = !{!"ext_oneapi_graph", i32 61} -!61 = !{!"ext_intel_fpga_task_sequence", i32 62} -!62 = !{!"ext_oneapi_limited_graph", i32 63} -!63 = !{!"ext_oneapi_private_alloca", i32 64} -!64 = !{!"ext_oneapi_cubemap", i32 65} -!65 = !{!"ext_oneapi_cubemap_seamless_filtering", i32 66} -!66 = !{!"ext_oneapi_bindless_sampled_image_fetch_1d_usm", i32 67} -!67 = !{!"ext_oneapi_bindless_sampled_image_fetch_1d", i32 68} -!68 = !{!"ext_oneapi_bindless_sampled_image_fetch_2d_usm", i32 69} -!69 = !{!"ext_oneapi_bindless_sampled_image_fetch_2d", i32 70} -!70 = !{!"ext_oneapi_bindless_sampled_image_fetch_3d", i32 72} -!71 = !{!"ext_oneapi_queue_profiling_tag", i32 73} -!72 = !{!"ext_oneapi_virtual_mem", i32 74} -!73 = !{!"ext_oneapi_cuda_cluster_group", i32 75} -!74 = !{!"ext_oneapi_image_array", i32 76} -!75 = !{!"ext_oneapi_unique_addressing_per_dim", i32 77} -!76 = !{!"ext_oneapi_bindless_images_sample_1d_usm", i32 78} -!77 = !{!"ext_oneapi_bindless_images_sample_2d_usm", i32 79} -!78 = !{!"ext_oneapi_atomic16", i32 80} -!79 = !{!"ext_oneapi_virtual_functions", i32 81} -!80 = !{!"host", i32 0} -!81 = !{!"int64_base_atomics", i32 7} -!82 = !{!"int64_extended_atomics", i32 8} -!83 = !{!"usm_restricted_shared_allocations", i32 16} -!84 = !{!"clang version 20.0.0git (https://github.com/intel/llvm.git 7384106e6410c6f038b2a9d6367a32b55278c638)"} -!85 = !{i32 563} -!86 = !{i32 -1} -!87 = !{} -!88 = !{!89, !89, i64 0} -!89 = !{!"int", !90, i64 0} -!90 = !{!"omnipotent char", !91, i64 0} -!91 = !{!"Simple C++ TBAA"} -!92 = !{i32 345} diff --git a/llvm/utils/git/requirements.txt b/llvm/utils/git/requirements.txt index 6ffb7fe14c43..dd522365b2f1 100644 --- a/llvm/utils/git/requirements.txt +++ b/llvm/utils/git/requirements.txt @@ -173,39 +173,38 @@ charset-normalizer==3.3.2 \ --hash=sha256:fd1abc0d89e30cc4e02e4064dc67fcc51bd941eb395c502aac3ec19fab46b519 \ --hash=sha256:ff8fa367d09b717b2a17a052544193ad76cd49979c805768879cb63d9ca50561 # via requests -cryptography==43.0.1 \ - --hash=sha256:0270572b8bd2c833c3981724b8ee9747b3ec96f699a9665470018594301439ee \ - --hash=sha256:111a0d8553afcf8eb02a4fea6ca4f59d48ddb34497aa8706a6cf536f1a5ec576 \ - --hash=sha256:16a48c23a62a2f4a285699dba2e4ff2d1cff3115b9df052cdd976a18856d8e3d \ - --hash=sha256:1b95b98b0d2af784078fa69f637135e3c317091b615cd0905f8b8a087e86fa30 \ - --hash=sha256:1f71c10d1e88467126f0efd484bd44bca5e14c664ec2ede64c32f20875c0d413 \ - --hash=sha256:2424ff4c4ac7f6b8177b53c17ed5d8fa74ae5955656867f5a8affaca36a27abb \ - --hash=sha256:2bce03af1ce5a5567ab89bd90d11e7bbdff56b8af3acbbec1faded8f44cb06da \ - --hash=sha256:329906dcc7b20ff3cad13c069a78124ed8247adcac44b10bea1130e36caae0b4 \ - --hash=sha256:37dd623507659e08be98eec89323469e8c7b4c1407c85112634ae3dbdb926fdd \ - --hash=sha256:3eaafe47ec0d0ffcc9349e1708be2aaea4c6dd4978d76bf6eb0cb2c13636c6fc \ - --hash=sha256:5e6275c09d2badf57aea3afa80d975444f4be8d3bc58f7f80d2a484c6f9485c8 \ - --hash=sha256:6fe07eec95dfd477eb9530aef5bead34fec819b3aaf6c5bd6d20565da607bfe1 \ - --hash=sha256:7367d7b2eca6513681127ebad53b2582911d1736dc2ffc19f2c3ae49997496bc \ - --hash=sha256:7cde5f38e614f55e28d831754e8a3bacf9ace5d1566235e39d91b35502d6936e \ - --hash=sha256:9481ffe3cf013b71b2428b905c4f7a9a4f76ec03065b05ff499bb5682a8d9ad8 \ - --hash=sha256:98d8dc6d012b82287f2c3d26ce1d2dd130ec200c8679b6213b3c73c08b2b7940 \ - --hash=sha256:a011a644f6d7d03736214d38832e030d8268bcff4a41f728e6030325fea3e400 \ - --hash=sha256:a2913c5375154b6ef2e91c10b5720ea6e21007412f6437504ffea2109b5a33d7 \ - --hash=sha256:a30596bae9403a342c978fb47d9b0ee277699fa53bbafad14706af51fe543d16 \ - --hash=sha256:b03c2ae5d2f0fc05f9a2c0c997e1bc18c8229f392234e8a0194f202169ccd278 \ - --hash=sha256:b6cd2203306b63e41acdf39aa93b86fb566049aeb6dc489b70e34bcd07adca74 \ - --hash=sha256:b7ffe927ee6531c78f81aa17e684e2ff617daeba7f189f911065b2ea2d526dec \ - --hash=sha256:b8cac287fafc4ad485b8a9b67d0ee80c66bf3574f655d3b97ef2e1082360faf1 \ - --hash=sha256:ba334e6e4b1d92442b75ddacc615c5476d4ad55cc29b15d590cc6b86efa487e2 \ - --hash=sha256:ba3e4a42397c25b7ff88cdec6e2a16c2be18720f317506ee25210f6d31925f9c \ - --hash=sha256:c41fb5e6a5fe9ebcd58ca3abfeb51dffb5d83d6775405305bfa8715b76521922 \ - --hash=sha256:cd2030f6650c089aeb304cf093f3244d34745ce0cfcc39f20c6fbfe030102e2a \ - --hash=sha256:cd65d75953847815962c84a4654a84850b2bb4aed3f26fadcc1c13892e1e29f6 \ - --hash=sha256:e4985a790f921508f36f81831817cbc03b102d643b5fcb81cd33df3fa291a1a1 \ - --hash=sha256:e807b3188f9eb0eaa7bbb579b462c5ace579f1cedb28107ce8b48a9f7ad3679e \ - --hash=sha256:f12764b8fffc7a123f641d7d049d382b73f96a34117e0b637b80643169cec8ac \ - --hash=sha256:f8837fe1d6ac4a8052a9a8ddab256bc006242696f03368a4009be7ee3075cdb7 +cryptography==44.0.1 \ + --hash=sha256:00918d859aa4e57db8299607086f793fa7813ae2ff5a4637e318a25ef82730f7 \ + --hash=sha256:1e8d181e90a777b63f3f0caa836844a1182f1f265687fac2115fcf245f5fbec3 \ + --hash=sha256:1f9a92144fa0c877117e9748c74501bea842f93d21ee00b0cf922846d9d0b183 \ + --hash=sha256:21377472ca4ada2906bc313168c9dc7b1d7ca417b63c1c3011d0c74b7de9ae69 \ + --hash=sha256:24979e9f2040c953a94bf3c6782e67795a4c260734e5264dceea65c8f4bae64a \ + --hash=sha256:2a46a89ad3e6176223b632056f321bc7de36b9f9b93b2cc1cccf935a3849dc62 \ + --hash=sha256:322eb03ecc62784536bc173f1483e76747aafeb69c8728df48537eb431cd1911 \ + --hash=sha256:436df4f203482f41aad60ed1813811ac4ab102765ecae7a2bbb1dbb66dcff5a7 \ + --hash=sha256:4f422e8c6a28cf8b7f883eb790695d6d45b0c385a2583073f3cec434cc705e1a \ + --hash=sha256:53f23339864b617a3dfc2b0ac8d5c432625c80014c25caac9082314e9de56f41 \ + --hash=sha256:5fed5cd6102bb4eb843e3315d2bf25fede494509bddadb81e03a859c1bc17b83 \ + --hash=sha256:610a83540765a8d8ce0f351ce42e26e53e1f774a6efb71eb1b41eb01d01c3d12 \ + --hash=sha256:6c8acf6f3d1f47acb2248ec3ea261171a671f3d9428e34ad0357148d492c7864 \ + --hash=sha256:6f76fdd6fd048576a04c5210d53aa04ca34d2ed63336d4abd306d0cbe298fddf \ + --hash=sha256:72198e2b5925155497a5a3e8c216c7fb3e64c16ccee11f0e7da272fa93b35c4c \ + --hash=sha256:887143b9ff6bad2b7570da75a7fe8bbf5f65276365ac259a5d2d5147a73775f2 \ + --hash=sha256:888fcc3fce0c888785a4876ca55f9f43787f4c5c1cc1e2e0da71ad481ff82c5b \ + --hash=sha256:8e6a85a93d0642bd774460a86513c5d9d80b5c002ca9693e63f6e540f1815ed0 \ + --hash=sha256:94f99f2b943b354a5b6307d7e8d19f5c423a794462bde2bf310c770ba052b1c4 \ + --hash=sha256:9b336599e2cb77b1008cb2ac264b290803ec5e8e89d618a5e978ff5eb6f715d9 \ + --hash=sha256:a2d8a7045e1ab9b9f803f0d9531ead85f90c5f2859e653b61497228b18452008 \ + --hash=sha256:b8272f257cf1cbd3f2e120f14c68bff2b6bdfcc157fafdee84a1b795efd72862 \ + --hash=sha256:bf688f615c29bfe9dfc44312ca470989279f0e94bb9f631f85e3459af8efc009 \ + --hash=sha256:d9c5b9f698a83c8bd71e0f4d3f9f839ef244798e5ffe96febfa9714717db7af7 \ + --hash=sha256:dd7c7e2d71d908dc0f8d2027e1604102140d84b155e658c20e8ad1304317691f \ + --hash=sha256:df978682c1504fc93b3209de21aeabf2375cb1571d4e61907b3e7a2540e83026 \ + --hash=sha256:e403f7f766ded778ecdb790da786b418a9f2394f36e8cc8b796cc056ab05f44f \ + --hash=sha256:eb3889330f2a4a148abead555399ec9a32b13b7c8ba969b72d8e500eb7ef84cd \ + --hash=sha256:f4daefc971c2d1f82f03097dc6f216744a6cd2ac0f04c68fb935ea2ba2a0d420 \ + --hash=sha256:f51f5705ab27898afda1aaa430f34ad90dc117421057782022edf0600bec5f14 \ + --hash=sha256:fd0ee90072861e276b0ff08bd627abec29e32a53b2be44e41dbcdf87cbee2b00 # via pyjwt deprecated==1.2.14 \ --hash=sha256:6fac8b097794a90302bdbb17b9b815e732d3c4720583ff1b198499d78470466c \ diff --git a/llvm/utils/git/requirements_formatting.txt b/llvm/utils/git/requirements_formatting.txt index 3fcdd816d58e..df8b60be4199 100644 --- a/llvm/utils/git/requirements_formatting.txt +++ b/llvm/utils/git/requirements_formatting.txt @@ -201,34 +201,38 @@ click==8.1.7 \ --hash=sha256:ae74fb96c20a0277a1d615f1e4d73c8414f5a98db8b799a7931d1582f3390c28 \ --hash=sha256:ca9853ad459e787e2192211578cc907e7594e294c7ccc834310722b41b9ca6de # via black -cryptography==43.0.1 \ - --hash=sha256:014f58110f53237ace6a408b5beb6c427b64e084eb451ef25a28308270086494 \ - --hash=sha256:1bbcce1a551e262dfbafb6e6252f1ae36a248e615ca44ba302df077a846a8806 \ - --hash=sha256:203e92a75716d8cfb491dc47c79e17d0d9207ccffcbcb35f598fbe463ae3444d \ - --hash=sha256:27e613d7077ac613e399270253259d9d53872aaf657471473ebfc9a52935c062 \ - --hash=sha256:2bd51274dcd59f09dd952afb696bf9c61a7a49dfc764c04dd33ef7a6b502a1e2 \ - --hash=sha256:38926c50cff6f533f8a2dae3d7f19541432610d114a70808f0926d5aaa7121e4 \ - --hash=sha256:511f4273808ab590912a93ddb4e3914dfd8a388fed883361b02dea3791f292e1 \ - --hash=sha256:58d4e9129985185a06d849aa6df265bdd5a74ca6e1b736a77959b498e0505b85 \ - --hash=sha256:5b43d1ea6b378b54a1dc99dd8a2b5be47658fe9a7ce0a58ff0b55f4b43ef2b84 \ - --hash=sha256:61ec41068b7b74268fa86e3e9e12b9f0c21fcf65434571dbb13d954bceb08042 \ - --hash=sha256:666ae11966643886c2987b3b721899d250855718d6d9ce41b521252a17985f4d \ - --hash=sha256:68aaecc4178e90719e95298515979814bda0cbada1256a4485414860bd7ab962 \ - --hash=sha256:7c05650fe8023c5ed0d46793d4b7d7e6cd9c04e68eabe5b0aeea836e37bdcec2 \ - --hash=sha256:80eda8b3e173f0f247f711eef62be51b599b5d425c429b5d4ca6a05e9e856baa \ - --hash=sha256:8385d98f6a3bf8bb2d65a73e17ed87a3ba84f6991c155691c51112075f9ffc5d \ - --hash=sha256:88cce104c36870d70c49c7c8fd22885875d950d9ee6ab54df2745f83ba0dc365 \ - --hash=sha256:9d3cdb25fa98afdd3d0892d132b8d7139e2c087da1712041f6b762e4f807cc96 \ - --hash=sha256:a575913fb06e05e6b4b814d7f7468c2c660e8bb16d8d5a1faf9b33ccc569dd47 \ - --hash=sha256:ac119bb76b9faa00f48128b7f5679e1d8d437365c5d26f1c2c3f0da4ce1b553d \ - --hash=sha256:c1332724be35d23a854994ff0b66530119500b6053d0bd3363265f7e5e77288d \ - --hash=sha256:d03a475165f3134f773d1388aeb19c2d25ba88b6a9733c5c590b9ff7bbfa2e0c \ - --hash=sha256:d75601ad10b059ec832e78823b348bfa1a59f6b8d545db3a24fd44362a1564cb \ - --hash=sha256:de41fd81a41e53267cb020bb3a7212861da53a7d39f863585d13ea11049cf277 \ - --hash=sha256:e710bf40870f4db63c3d7d929aa9e09e4e7ee219e703f949ec4073b4294f6172 \ - --hash=sha256:ea25acb556320250756e53f9e20a4177515f012c9eaea17eb7587a8c4d8ae034 \ - --hash=sha256:f98bf604c82c416bc829e490c700ca1553eafdf2912a91e23a79d97d9801372a \ - --hash=sha256:fba1007b3ef89946dbbb515aeeb41e30203b004f0b4b00e5e16078b518563289 +cryptography==44.0.1 \ + --hash=sha256:00918d859aa4e57db8299607086f793fa7813ae2ff5a4637e318a25ef82730f7 \ + --hash=sha256:1e8d181e90a777b63f3f0caa836844a1182f1f265687fac2115fcf245f5fbec3 \ + --hash=sha256:1f9a92144fa0c877117e9748c74501bea842f93d21ee00b0cf922846d9d0b183 \ + --hash=sha256:21377472ca4ada2906bc313168c9dc7b1d7ca417b63c1c3011d0c74b7de9ae69 \ + --hash=sha256:24979e9f2040c953a94bf3c6782e67795a4c260734e5264dceea65c8f4bae64a \ + --hash=sha256:2a46a89ad3e6176223b632056f321bc7de36b9f9b93b2cc1cccf935a3849dc62 \ + --hash=sha256:322eb03ecc62784536bc173f1483e76747aafeb69c8728df48537eb431cd1911 \ + --hash=sha256:436df4f203482f41aad60ed1813811ac4ab102765ecae7a2bbb1dbb66dcff5a7 \ + --hash=sha256:4f422e8c6a28cf8b7f883eb790695d6d45b0c385a2583073f3cec434cc705e1a \ + --hash=sha256:53f23339864b617a3dfc2b0ac8d5c432625c80014c25caac9082314e9de56f41 \ + --hash=sha256:5fed5cd6102bb4eb843e3315d2bf25fede494509bddadb81e03a859c1bc17b83 \ + --hash=sha256:610a83540765a8d8ce0f351ce42e26e53e1f774a6efb71eb1b41eb01d01c3d12 \ + --hash=sha256:6c8acf6f3d1f47acb2248ec3ea261171a671f3d9428e34ad0357148d492c7864 \ + --hash=sha256:6f76fdd6fd048576a04c5210d53aa04ca34d2ed63336d4abd306d0cbe298fddf \ + --hash=sha256:72198e2b5925155497a5a3e8c216c7fb3e64c16ccee11f0e7da272fa93b35c4c \ + --hash=sha256:887143b9ff6bad2b7570da75a7fe8bbf5f65276365ac259a5d2d5147a73775f2 \ + --hash=sha256:888fcc3fce0c888785a4876ca55f9f43787f4c5c1cc1e2e0da71ad481ff82c5b \ + --hash=sha256:8e6a85a93d0642bd774460a86513c5d9d80b5c002ca9693e63f6e540f1815ed0 \ + --hash=sha256:94f99f2b943b354a5b6307d7e8d19f5c423a794462bde2bf310c770ba052b1c4 \ + --hash=sha256:9b336599e2cb77b1008cb2ac264b290803ec5e8e89d618a5e978ff5eb6f715d9 \ + --hash=sha256:a2d8a7045e1ab9b9f803f0d9531ead85f90c5f2859e653b61497228b18452008 \ + --hash=sha256:b8272f257cf1cbd3f2e120f14c68bff2b6bdfcc157fafdee84a1b795efd72862 \ + --hash=sha256:bf688f615c29bfe9dfc44312ca470989279f0e94bb9f631f85e3459af8efc009 \ + --hash=sha256:d9c5b9f698a83c8bd71e0f4d3f9f839ef244798e5ffe96febfa9714717db7af7 \ + --hash=sha256:dd7c7e2d71d908dc0f8d2027e1604102140d84b155e658c20e8ad1304317691f \ + --hash=sha256:df978682c1504fc93b3209de21aeabf2375cb1571d4e61907b3e7a2540e83026 \ + --hash=sha256:e403f7f766ded778ecdb790da786b418a9f2394f36e8cc8b796cc056ab05f44f \ + --hash=sha256:eb3889330f2a4a148abead555399ec9a32b13b7c8ba969b72d8e500eb7ef84cd \ + --hash=sha256:f4daefc971c2d1f82f03097dc6f216744a6cd2ac0f04c68fb935ea2ba2a0d420 \ + --hash=sha256:f51f5705ab27898afda1aaa430f34ad90dc117421057782022edf0600bec5f14 \ + --hash=sha256:fd0ee90072861e276b0ff08bd627abec29e32a53b2be44e41dbcdf87cbee2b00 # via pyjwt darker==1.7.2 \ --hash=sha256:ec5b7c382d9537611c164f3ecca2e1b8a7923bc5a02bf22f6e7f6c8bcbdf593a \ diff --git a/sycl-jit/common/include/Kernel.h b/sycl-jit/common/include/Kernel.h index 17e96b8bc2be..25885c775a96 100644 --- a/sycl-jit/common/include/Kernel.h +++ b/sycl-jit/common/include/Kernel.h @@ -380,7 +380,7 @@ struct FrozenPropertyValue { FrozenPropertyValue(std::string_view Name, uint32_t Value) : Name{Name}, IsUIntValue{true}, UIntValue{Value}, Bytes{0} {} FrozenPropertyValue(std::string_view Name, const uint8_t *Ptr, size_t Size) - : Name{Name}, IsUIntValue{false}, Bytes{Size} { + : Name{Name}, IsUIntValue{false}, UIntValue{0}, Bytes{Size} { std::memcpy(Bytes.begin(), Ptr, Size); } }; diff --git a/sycl-jit/jit-compiler/lib/translation/KernelTranslation.cpp b/sycl-jit/jit-compiler/lib/translation/KernelTranslation.cpp index f00fe2f8761b..c0d9d3ae6ba8 100644 --- a/sycl-jit/jit-compiler/lib/translation/KernelTranslation.cpp +++ b/sycl-jit/jit-compiler/lib/translation/KernelTranslation.cpp @@ -133,8 +133,13 @@ KernelTranslator::loadKernels(llvm::LLVMContext &LLVMCtx, // read last. This could cause problems if different modules contain // definitions with the same name, but different body/content. // Check that this is not problematic. - Linker::linkModules(*Result, std::move(NewMod), - Linker::Flags::OverrideFromSrc); + const bool HasErrors = Linker::linkModules( + *Result, std::move(NewMod), Linker::Flags::OverrideFromSrc); + if (HasErrors) { + return createStringError(inconvertibleErrorCode(), + "Failed to link modules"); + } + if (AddressBits != BinInfo.AddressBits) { return createStringError( inconvertibleErrorCode(), @@ -300,9 +305,9 @@ KernelTranslator::translateToPTX(SYCLKernelInfo &KernelInfo, llvm::Module &Mod, } // FIXME: Check whether we can provide more accurate target information here - auto *TargetMachine = Target->createTargetMachine( + std::unique_ptr TargetMachine(Target->createTargetMachine( TargetTriple, CPU, Features, {}, llvm::Reloc::PIC_, std::nullopt, - llvm::CodeGenOptLevel::Default); + llvm::CodeGenOptLevel::Default)); llvm::legacy::PassManager PM; @@ -380,9 +385,9 @@ KernelTranslator::translateToAMDGCN(SYCLKernelInfo &KernelInfo, } // FIXME: Check whether we can provide more accurate target information here - auto *TargetMachine = Target->createTargetMachine( + std::unique_ptr TargetMachine(Target->createTargetMachine( TargetTriple, CPU, Features, {}, llvm::Reloc::PIC_, std::nullopt, - llvm::CodeGenOptLevel::Default); + llvm::CodeGenOptLevel::Default)); std::string AMDObj; { diff --git a/sycl-jit/passes/target/TargetFusionInfo.cpp b/sycl-jit/passes/target/TargetFusionInfo.cpp index db1f6327fe25..0f4262707aaf 100644 --- a/sycl-jit/passes/target/TargetFusionInfo.cpp +++ b/sycl-jit/passes/target/TargetFusionInfo.cpp @@ -458,6 +458,7 @@ class NVPTXAMDGCNTargetFusionInfoBase : public TargetFusionInfoImpl { SmallPtrSet DeletedFuncs{Funcs.begin(), Funcs.end()}; SmallVector ValidKernels; auto *OldAnnotations = LLVMMod->getNamedMetadata(MDName); + assert(OldAnnotations && "Failed to retrieve old annotations"); for (auto *Op : OldAnnotations->operands()) { if (auto *TOp = dyn_cast(Op)) { if (auto *COp = dyn_cast_if_present( diff --git a/sycl/include/sycl/context.hpp b/sycl/include/sycl/context.hpp index 0fa88b8b74d6..d434794c862d 100644 --- a/sycl/include/sycl/context.hpp +++ b/sycl/include/sycl/context.hpp @@ -16,6 +16,7 @@ #include // for OwnerLessBase #include // for platform #include // for property_list +#include // for usm::alloc #include // for ur_native_handle_t #ifdef __SYCL_INTERNAL_API @@ -36,6 +37,10 @@ inline namespace _V1 { class device; class platform; +namespace ext::oneapi::experimental { +class memory_pool; +} // namespace ext::oneapi::experimental + namespace detail { class context_impl; } @@ -245,6 +250,19 @@ class __SYCL_EXPORT context : public detail::OwnerLessBase { /// \return a vector of valid SYCL device instances. std::vector get_devices() const; + /// Gets default memory pool associated with a device and context. + /// + /// \return a memory pool for a particular device and context. + sycl::ext::oneapi::experimental::memory_pool + ext_oneapi_get_default_memory_pool(const device &dev, + sycl::usm::alloc kind) const; + + /// Gets default memory pool associated with the context and allocation kind. + /// + /// \return a memory pool associated with this context. + sycl::ext::oneapi::experimental::memory_pool + ext_oneapi_get_default_memory_pool(sycl::usm::alloc kind) const; + private: /// Constructs a SYCL context object from a valid context_impl instance. context(std::shared_ptr Impl); diff --git a/sycl/include/sycl/detail/cg_types.hpp b/sycl/include/sycl/detail/cg_types.hpp index c8f7a4ef261c..fa144d8b0a79 100644 --- a/sycl/include/sycl/detail/cg_types.hpp +++ b/sycl/include/sycl/detail/cg_types.hpp @@ -65,6 +65,8 @@ enum class CGType : unsigned int { SemaphoreSignal = 25, ProfilingTag = 26, EnqueueNativeCommand = 27, + AsyncAlloc = 28, + AsyncFree = 29, }; template struct check_fn_signature { @@ -164,14 +166,11 @@ class HostKernelBase { // Class which stores specific lambda object. template class HostKernel : public HostKernelBase { - using IDBuilder = sycl::detail::Builder; KernelType MKernel; - // Allowing accessing MKernel from 'ResetHostKernelHelper' method of - // 'sycl::handler' - friend class sycl::handler; public: - HostKernel(KernelType Kernel) : MKernel(Kernel) {} + HostKernel(const KernelType &Kernel) : MKernel(Kernel) {} + HostKernel(KernelType &&Kernel) : MKernel(std::move(Kernel)) {} char *getPtr() override { return reinterpret_cast(&MKernel); } @@ -182,6 +181,7 @@ class HostKernel : public HostKernelBase { // kernel code instructions with source code lines. // NOTE: InstatiateKernelOnHost() should not be called. void InstantiateKernelOnHost() override { + using IDBuilder = sycl::detail::Builder; if constexpr (std::is_same_v) { runKernelWithoutArg(MKernel); } else if constexpr (std::is_same_v>) { diff --git a/sycl/include/sycl/detail/property_helper.hpp b/sycl/include/sycl/detail/property_helper.hpp index 2896de2ec66a..57470b22417e 100644 --- a/sycl/include/sycl/detail/property_helper.hpp +++ b/sycl/include/sycl/detail/property_helper.hpp @@ -51,8 +51,10 @@ enum DataLessPropKind { GraphDependOnAllLeaves = 24, GraphUpdatable = 25, GraphEnableProfiling = 26, + MemPoolReadOnly = 27, + MemPoolZeroInit = 28, // Indicates the last known dataless property. - LastKnownDataLessPropKind = 26, + LastKnownDataLessPropKind = 28, // Exceeding 32 may cause ABI breaking change on some of OSes. DataLessPropKindSize = 32 }; @@ -67,7 +69,9 @@ enum PropWithDataKind { AccPropBufferLocation = 5, QueueComputeIndex = 6, GraphNodeDependencies = 7, - PropWithDataKindSize = 8 + MemPoolInitialThreshold = 8, + MemPoolMaximumSize = 9, + PropWithDataKindSize = 10 }; // Base class for dataless properties, needed to check that the type of an diff --git a/sycl/include/sycl/ext/oneapi/experimental/async_alloc/async_alloc.hpp b/sycl/include/sycl/ext/oneapi/experimental/async_alloc/async_alloc.hpp new file mode 100644 index 000000000000..11c57c2115e6 --- /dev/null +++ b/sycl/include/sycl/ext/oneapi/experimental/async_alloc/async_alloc.hpp @@ -0,0 +1,95 @@ +//==----------- async_alloc.hpp --- SYCL asynchronous allocation -----------==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#pragma once +#include // for code_location +#include // for handler +#include // for queue +#include // for usm::alloc + +namespace sycl { +inline namespace _V1 { +namespace ext::oneapi::experimental { + +// Forward declare memory_pool. +class memory_pool; + +/** + * @brief Asynchronousy allocate memory from a default pool. + * + * @param q The queue with which to enqueue the asynchronous allocation. + * @param kind The kind of memory pool allocation - device, host, shared, etc. + * @param size The size in bytes to allocate. + * + * @return Generic pointer to allocated USM memory. + */ +__SYCL_EXPORT void *async_malloc(const sycl::queue &q, sycl::usm::alloc kind, + size_t size, + const sycl::detail::code_location &CodeLoc = + sycl::detail::code_location::current()); + +/** + * @brief Asynchronously allocate memory from a default pool. + * + * @param h The handler with which to enqueue the asynchronous allocation. + * @param kind The kind of memory pool allocation - device, host, shared, etc. + * @param size The size in bytes to allocate. + * + * @return Generic pointer to allocated USM memory. + */ +__SYCL_EXPORT void *async_malloc(sycl::handler &h, sycl::usm::alloc kind, + size_t size); + +/** + * @brief Asynchronously allocate memory from a specified pool. + * + * @param q The queue with which to enqueue the asynchronous allocation. + * @param size The size in bytes to allocate. + * @param pool The pool with which to allocate from. + * + * @return Generic pointer to allocated USM memory. + */ +__SYCL_EXPORT void * +async_malloc_from_pool(const sycl::queue &q, size_t size, + const memory_pool &pool, + const sycl::detail::code_location &CodeLoc = + sycl::detail::code_location::current()); + +/** + * @brief Asynchronously allocate memory from a specified pool. + * + * @param h The handler with which to enqueue the asynchronous allocation. + * @param size The size in bytes to allocate. + * @param pool The pool with which to allocate from. + * + * @return Generic pointer to allocated USM memory. + */ +__SYCL_EXPORT void *async_malloc_from_pool(sycl::handler &h, size_t size, + const memory_pool &pool); + +/** + * @brief Asynchronously free memory. + * + * @param q The queue with which to enqueue the asynchronous free. + * @param ptr The generic pointer to be freed. + */ +__SYCL_EXPORT void async_free(const sycl::queue &q, void *ptr, + const sycl::detail::code_location &CodeLoc = + sycl::detail::code_location::current()); + +/** + * @brief Asynchronously free memory. + * + * @param h The handler with which to enqueue the asynchronous free. + * @param ptr The generic pointer to be freed. + */ +__SYCL_EXPORT void async_free(sycl::handler &h, void *ptr); + +} // namespace ext::oneapi::experimental +} // namespace _V1 +} // namespace sycl diff --git a/sycl/include/sycl/ext/oneapi/experimental/async_alloc/memory_pool.hpp b/sycl/include/sycl/ext/oneapi/experimental/async_alloc/memory_pool.hpp new file mode 100644 index 000000000000..e548187bd4f7 --- /dev/null +++ b/sycl/include/sycl/ext/oneapi/experimental/async_alloc/memory_pool.hpp @@ -0,0 +1,122 @@ +//==----------- memory_pool.hpp --- SYCL asynchronous allocation -----------==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#pragma once +#include // for context +#include // for device +#include +#include // for queue +#include // for usm::alloc + +namespace sycl { +inline namespace _V1 { +namespace ext::oneapi::experimental { + +// Forward declare memory_pool_impl. +namespace detail { +class memory_pool_impl; +} // namespace detail + +/// Memory pool +class __SYCL_EXPORT memory_pool { + +public: + // NOT SUPPORTED: Host side pools unsupported. + memory_pool(const sycl::context &, sycl::usm::alloc kind, + const property_list & = {}) { + if (kind == sycl::usm::alloc::device || kind == sycl::usm::alloc::shared) + throw sycl::exception(sycl::make_error_code(sycl::errc::invalid), + "Device and shared allocation kinds are disallowed " + "without specifying a device!"); + if (kind == sycl::usm::alloc::unknown) + throw sycl::exception(sycl::make_error_code(sycl::errc::invalid), + "Unknown allocation kinds are disallowed!"); + + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Host allocated pools are unsupported!"); + } + + memory_pool(const sycl::context &ctx, const sycl::device &dev, + sycl::usm::alloc kind, const property_list &props = {}); + + memory_pool(const sycl::queue &q, sycl::usm::alloc kind, + const property_list &props = {}) + : memory_pool(q.get_context(), q.get_device(), kind, props) {} + + // NOT SUPPORTED: Creating a pool from an existing allocation is unsupported. + memory_pool(const sycl::context &, void *, size_t, + const property_list & = {}) { + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Creating a pool from an existing allocation is unsupported!"); + } + + ~memory_pool() = default; + + // Copy constructible/assignable, move constructible/assignable. + memory_pool(const memory_pool &) = default; + memory_pool(memory_pool &&) = default; + memory_pool &operator=(const memory_pool &) = default; + memory_pool &operator=(memory_pool &&) = default; + + // Equality comparison. + bool operator==(const memory_pool &rhs) const { return impl == rhs.impl; } + bool operator!=(const memory_pool &rhs) const { return !(*this == rhs); } + + // Impl handles getters and setters. + sycl::context get_context() const; + sycl::device get_device() const; + sycl::usm::alloc get_alloc_kind() const; + size_t get_threshold() const; + size_t get_reserved_size_current() const; + size_t get_used_size_current() const; + + void increase_threshold_to(size_t newThreshold); + + // Property getters. + template bool has_property() const noexcept { + return getPropList().template has_property(); + } + template PropertyT get_property() const { + return getPropList().template get_property(); + } + +protected: + std::shared_ptr impl; + + memory_pool(std::shared_ptr Impl) : impl(Impl) {} + + template + friend const decltype(Obj::impl) & + sycl::detail::getSyclObjImpl(const Obj &SyclObject); + + template + friend T sycl::detail::createSyclObjFromImpl( + std::add_rvalue_reference_t ImplObj); + template + friend T sycl::detail::createSyclObjFromImpl( + std::add_lvalue_reference_t ImplObj); + + const property_list &getPropList() const; +}; + +} // namespace ext::oneapi::experimental +} // namespace _V1 +} // namespace sycl + +namespace std { +template <> struct hash { + size_t operator()( + const sycl::ext::oneapi::experimental::memory_pool &mem_pool) const { + return hash>()( + sycl::detail::getSyclObjImpl(mem_pool)); + } +}; +} // namespace std diff --git a/sycl/include/sycl/ext/oneapi/experimental/async_alloc/memory_pool_properties.hpp b/sycl/include/sycl/ext/oneapi/experimental/async_alloc/memory_pool_properties.hpp new file mode 100644 index 000000000000..89cd11f36fda --- /dev/null +++ b/sycl/include/sycl/ext/oneapi/experimental/async_alloc/memory_pool_properties.hpp @@ -0,0 +1,80 @@ +//==------ memory_pool_properties.hpp --- SYCL asynchronous allocation -----==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#pragma once +#include +#include + +namespace sycl { +inline namespace _V1 { +namespace ext::oneapi::experimental { + +// Forward declare memory_pool. +class memory_pool; + +namespace property::memory_pool { + +// Property that determines the initial threshold of a memory pool. +struct initial_threshold : public sycl::detail::PropertyWithData< + sycl::detail::MemPoolInitialThreshold> { + initial_threshold(size_t initialThreshold) + : initialThreshold(initialThreshold) {}; + size_t get_initial_threshold() { return initialThreshold; } + +private: + size_t initialThreshold; +}; + +// Property that determines the maximum size of a memory pool. +struct maximum_size + : public sycl::detail::PropertyWithData { + maximum_size(size_t maxSize) : maxSize(maxSize) {}; + size_t get_maximum_size() { return maxSize; } + +private: + size_t maxSize; +}; + +// Property that provides a performance hint that all allocations from this pool +// will only be read from within SYCL kernel functions. +struct read_only + : public sycl::detail::DataLessProperty { + read_only() = default; +}; + +// Property that initial allocations to a pool (not subsequent allocations +// from prior frees) are iniitialised to zero. +struct zero_init + : public sycl::detail::DataLessProperty { + zero_init() = default; +}; +} // namespace property::memory_pool +} // namespace ext::oneapi::experimental + +template <> +struct is_property< + sycl::ext::oneapi::experimental::property::memory_pool::initial_threshold> + : std::true_type {}; + +template <> +struct is_property< + sycl::ext::oneapi::experimental::property::memory_pool::maximum_size> + : std::true_type {}; + +template <> +struct is_property< + sycl::ext::oneapi::experimental::property::memory_pool::read_only> + : std::true_type {}; + +template <> +struct is_property< + sycl::ext::oneapi::experimental::property::memory_pool::zero_init> + : std::true_type {}; + +} // namespace _V1 +} // namespace sycl diff --git a/sycl/include/sycl/ext/oneapi/experimental/graph.hpp b/sycl/include/sycl/ext/oneapi/experimental/graph.hpp index 2ef49b7f16d5..59f69fa63e83 100644 --- a/sycl/include/sycl/ext/oneapi/experimental/graph.hpp +++ b/sycl/include/sycl/ext/oneapi/experimental/graph.hpp @@ -62,7 +62,8 @@ enum class UnsupportedGraphFeatures { sycl_ext_oneapi_bindless_images = 7, sycl_ext_oneapi_experimental_cuda_cluster_launch = 8, sycl_ext_codeplay_enqueue_native_command = 9, - sycl_ext_oneapi_work_group_scratch_memory = 10 + sycl_ext_oneapi_work_group_scratch_memory = 10, + sycl_ext_oneapi_async_alloc = 11 }; inline const char * @@ -91,6 +92,8 @@ UnsupportedFeatureToString(UnsupportedGraphFeatures Feature) { return "sycl_ext_codeplay_enqueue_native_command"; case UGF::sycl_ext_oneapi_work_group_scratch_memory: return "sycl_ext_oneapi_work_group_scratch_memory"; + case UGF::sycl_ext_oneapi_async_alloc: + return "sycl_ext_oneapi_async_alloc"; } assert(false && "Unhandled graphs feature"); diff --git a/sycl/include/sycl/handler.hpp b/sycl/include/sycl/handler.hpp index ff2a90673432..2f7bbdfebc1f 100644 --- a/sycl/include/sycl/handler.hpp +++ b/sycl/include/sycl/handler.hpp @@ -149,9 +149,13 @@ class pipe; } namespace ext ::oneapi ::experimental { -template -class work_group_memory; +template class work_group_memory; struct image_descriptor; +__SYCL_EXPORT void async_free(sycl::handler &h, void *ptr); +__SYCL_EXPORT void *async_malloc(sycl::handler &h, sycl::usm::alloc kind, + size_t size); +__SYCL_EXPORT void *async_malloc_from_pool(sycl::handler &h, size_t size, + const memory_pool &pool); } // namespace ext::oneapi::experimental namespace ext::oneapi::experimental::detail { @@ -715,14 +719,17 @@ class __SYCL_EXPORT handler { /// \param KernelFunc is a SYCL kernel function /// \param ParamDescs is the vector of kernel parameter descriptors. template - void StoreLambda(KernelType KernelFunc) { + typename LambdaArgType, typename KernelTypeUniversalRef> + void StoreLambda(KernelTypeUniversalRef &&KernelFunc) { constexpr bool IsCallableWithKernelHandler = detail::KernelLambdaHasKernelHandlerArgT::value; - MHostKernel = std::make_unique< - detail::HostKernel>(KernelFunc); + // Not using `std::make_unique` to avoid unnecessary instantiations of + // `std::unique_ptr>`. Only + // `std::unique_ptr` is necessary. + MHostKernel.reset(new detail::HostKernel( + std::forward(KernelFunc))); constexpr bool KernelHasName = detail::getKernelName() != nullptr && @@ -736,7 +743,7 @@ class __SYCL_EXPORT handler { #ifdef __INTEL_SYCL_USE_INTEGRATION_HEADERS static_assert( !KernelHasName || - sizeof(KernelFunc) == detail::getKernelSize(), + sizeof(KernelType) == detail::getKernelSize(), "Unexpected kernel lambda size. This can be caused by an " "external host compiler producing a lambda with an " "unexpected layout. This is a limitation of the compiler." @@ -750,7 +757,7 @@ class __SYCL_EXPORT handler { #endif // Empty name indicates that the compilation happens without integration // header, so don't perform things that require it. - if (KernelHasName) { + if constexpr (KernelHasName) { // TODO support ESIMD in no-integration-header case too. clearArgs(); extractArgsAndReqsFromLambda(MHostKernel->getPtr(), @@ -767,7 +774,7 @@ class __SYCL_EXPORT handler { // If the kernel lambda is callable with a kernel_handler argument, manifest // the associated kernel handler. - if (IsCallableWithKernelHandler) { + if constexpr (IsCallableWithKernelHandler) { getOrInsertHandlerKernelBundle(/*Insert=*/true); } } @@ -1130,7 +1137,7 @@ class __SYCL_EXPORT handler { typename KernelName, typename KernelType, int Dims, typename PropertiesT = ext::oneapi::experimental::empty_properties_t> void parallel_for_lambda_impl(range UserRange, PropertiesT Props, - KernelType KernelFunc) { + const KernelType &KernelFunc) { #ifndef __SYCL_DEVICE_ONLY__ throwIfActionIsCreated(); throwOnKernelParameterMisuse(); @@ -1542,19 +1549,22 @@ class __SYCL_EXPORT handler { // methods side. template - static void kernel_single_task_unpack(handler *h, ArgsTy... Args) { - h->kernel_single_task(Args...); + static void kernel_single_task_unpack(handler *h, ArgsTy &&...Args) { + h->kernel_single_task( + std::forward(Args)...); } template - static void kernel_parallel_for_unpack(handler *h, ArgsTy... Args) { - h->kernel_parallel_for(Args...); + static void kernel_parallel_for_unpack(handler *h, ArgsTy &&...Args) { + h->kernel_parallel_for( + std::forward(Args)...); } template static void kernel_parallel_for_work_group_unpack(handler *h, - ArgsTy... Args) { - h->kernel_parallel_for_work_group(Args...); + ArgsTy &&...Args) { + h->kernel_parallel_for_work_group( + std::forward(Args)...); } }; @@ -1619,9 +1629,9 @@ class __SYCL_EXPORT handler { void kernel_single_task_wrapper(const KernelType &KernelFunc) { unpack::value>( - KernelFunc, [&](auto Unpacker, auto... args) { + KernelFunc, [&](auto Unpacker, auto &&...args) { Unpacker.template kernel_single_task_unpack( - args...); + std::forward(args)...); }); } @@ -1632,9 +1642,10 @@ class __SYCL_EXPORT handler { unpack::value>( - KernelFunc, [&](auto Unpacker, auto... args) { + KernelFunc, [&](auto Unpacker, auto &&...args) { Unpacker.template kernel_parallel_for_unpack(args...); + KernelType>( + std::forward(args)...); }); } @@ -1645,9 +1656,10 @@ class __SYCL_EXPORT handler { unpack::value>( - KernelFunc, [&](auto Unpacker, auto... args) { + KernelFunc, [&](auto Unpacker, auto &&...args) { Unpacker.template kernel_parallel_for_work_group_unpack< - KernelName, ElementType, KernelType>(args...); + KernelName, ElementType, KernelType>( + std::forward(args)...); }); } @@ -1897,21 +1909,21 @@ class __SYCL_EXPORT handler { void parallel_for(range<1> NumWorkItems, const KernelType &KernelFunc) { parallel_for_lambda_impl( NumWorkItems, ext::oneapi::experimental::empty_properties_t{}, - std::move(KernelFunc)); + KernelFunc); } template void parallel_for(range<2> NumWorkItems, const KernelType &KernelFunc) { parallel_for_lambda_impl( NumWorkItems, ext::oneapi::experimental::empty_properties_t{}, - std::move(KernelFunc)); + KernelFunc); } template void parallel_for(range<3> NumWorkItems, const KernelType &KernelFunc) { parallel_for_lambda_impl( NumWorkItems, ext::oneapi::experimental::empty_properties_t{}, - std::move(KernelFunc)); + KernelFunc); } /// Enqueues a command to the SYCL runtime to invoke \p Func once. @@ -3872,6 +3884,18 @@ class __SYCL_EXPORT handler { friend class detail::HandlerAccess; + // Friend free-functions for asynchronous allocation and freeing. + __SYCL_EXPORT friend void + ext::oneapi::experimental::async_free(sycl::handler &h, void *ptr); + + __SYCL_EXPORT friend void * + ext::oneapi::experimental::async_malloc(sycl::handler &h, + sycl::usm::alloc kind, size_t size); + + __SYCL_EXPORT friend void *ext::oneapi::experimental::async_malloc_from_pool( + sycl::handler &h, size_t size, + const ext::oneapi::experimental::memory_pool &pool); + protected: /// Registers event dependencies in this command group. void depends_on(const detail::EventImplPtr &Event); diff --git a/sycl/include/sycl/info/aspects.def b/sycl/include/sycl/info/aspects.def index b1d5330498ad..457ea5628ed6 100644 --- a/sycl/include/sycl/info/aspects.def +++ b/sycl/include/sycl/info/aspects.def @@ -77,4 +77,5 @@ __SYCL_ASPECT(ext_oneapi_bindless_images_gather, 83) __SYCL_ASPECT(ext_intel_current_clock_throttle_reasons, 84) __SYCL_ASPECT(ext_intel_fan_speed, 85) __SYCL_ASPECT(ext_intel_power_limits, 86) +__SYCL_ASPECT(ext_oneapi_async_memory_alloc, 87) diff --git a/sycl/source/CMakeLists.txt b/sycl/source/CMakeLists.txt index 6e0d1f93c06d..2570921a2d56 100644 --- a/sycl/source/CMakeLists.txt +++ b/sycl/source/CMakeLists.txt @@ -307,6 +307,9 @@ set(SYCL_COMMON_SOURCES "stream.cpp" "spirv_ops.cpp" "virtual_mem.cpp" + "detail/memory_pool_impl.cpp" + "detail/async_alloc.cpp" + "detail/memory_pool.cpp" "$<$:detail/windows_ur.cpp>" "$<$,$>:detail/posix_ur.cpp>" ) diff --git a/sycl/source/context.cpp b/sycl/source/context.cpp index 43dcd7c87b0b..6878b0ce2442 100644 --- a/sycl/source/context.cpp +++ b/sycl/source/context.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -133,5 +134,41 @@ const property_list &context::getPropList() const { return impl->getPropList(); } +sycl::ext::oneapi::experimental::memory_pool +context::ext_oneapi_get_default_memory_pool(const device &dev, + sycl::usm::alloc kind) const { + if (kind == sycl::usm::alloc::host) + throw sycl::exception( + sycl::make_error_code(sycl::errc::invalid), + "Default host memory pool requested but device supplied!"); + if (kind == sycl::usm::alloc::unknown) + throw sycl::exception(sycl::make_error_code(sycl::errc::invalid), + "Unknown allocation kinds are disallowed!"); + + if (kind != sycl::usm::alloc::device) + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Only device allocated memory pools are supported!"); + + return detail::createSyclObjFromImpl< + sycl::ext::oneapi::experimental::memory_pool>( + impl->get_default_memory_pool(*this, dev, kind)); +} + +sycl::ext::oneapi::experimental::memory_pool +context::ext_oneapi_get_default_memory_pool(sycl::usm::alloc kind) const { + if (kind == sycl::usm::alloc::device || kind == sycl::usm::alloc::shared) + throw sycl::exception(sycl::make_error_code(sycl::errc::invalid), + "Device and shared allocation kinds are disallowed " + "without specifying a device!"); + if (kind == sycl::usm::alloc::unknown) + throw sycl::exception(sycl::make_error_code(sycl::errc::invalid), + "Unknown allocation kinds are disallowed!"); + + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Host allocated pools are unsupported!"); +} + } // namespace _V1 } // namespace sycl diff --git a/sycl/source/detail/async_alloc.cpp b/sycl/source/detail/async_alloc.cpp new file mode 100644 index 000000000000..57ce7a71b713 --- /dev/null +++ b/sycl/source/detail/async_alloc.cpp @@ -0,0 +1,156 @@ +//==----------- async_alloc.cpp --- SYCL asynchronous allocation -----------==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include +#include +#include +#include +#include +#include +#include + +namespace sycl { +inline namespace _V1 { +namespace ext::oneapi::experimental { + +namespace { +std::vector +getUrEvents(const std::vector> &DepEvents) { + std::vector RetUrEvents; + for (const std::shared_ptr &EventImpl : DepEvents) { + ur_event_handle_t Handle = EventImpl->getHandle(); + if (Handle != nullptr) + RetUrEvents.push_back(Handle); + } + return RetUrEvents; +} +} // namespace + +__SYCL_EXPORT +void *async_malloc(sycl::handler &h, sycl::usm::alloc kind, size_t size) { + + if (kind == sycl::usm::alloc::unknown) + throw sycl::exception(sycl::make_error_code(sycl::errc::invalid), + "Unknown allocation kinds are disallowed!"); + + // Non-device allocations are unsupported. + if (kind != sycl::usm::alloc::device) + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Only device backed asynchronous allocations are supported!"); + + h.throwIfGraphAssociated< + ext::oneapi::experimental::detail::UnsupportedGraphFeatures:: + sycl_ext_oneapi_async_alloc>(); + + auto &Adapter = h.getContextImplPtr()->getAdapter(); + auto &Q = h.MQueue->getHandleRef(); + + // Get events to wait on. + auto depEvents = getUrEvents(h.impl->CGData.MEvents); + uint32_t numEvents = h.impl->CGData.MEvents.size(); + + void *alloc = nullptr; + ur_event_handle_t Event; + Adapter->call( + Q, (ur_usm_pool_handle_t)0, size, nullptr, numEvents, depEvents.data(), + &alloc, &Event); + + // Async malloc must return a void* immediately. + // Set up CommandGroup which is a no-op and pass the + // event from the alloc. + h.impl->MAllocSize = size; + h.impl->MAsyncAllocEvent = Event; + h.setType(detail::CGType::AsyncAlloc); + + return alloc; +} + +__SYCL_EXPORT void *async_malloc(const sycl::queue &q, sycl::usm::alloc kind, + size_t size, + const sycl::detail::code_location &CodeLoc) { + void *temp = nullptr; + submit( + q, + [&](sycl::handler &h) { + // In order queues must wait on the previous event before calling alloc. + if (q.is_in_order() && q.ext_oneapi_get_last_event()) + h.depends_on(q.ext_oneapi_get_last_event().value()); + temp = async_malloc(h, kind, size); + }, + CodeLoc); + return temp; +} + +__SYCL_EXPORT void *async_malloc_from_pool(sycl::handler &h, size_t size, + const memory_pool &pool) { + + h.throwIfGraphAssociated< + ext::oneapi::experimental::detail::UnsupportedGraphFeatures:: + sycl_ext_oneapi_async_alloc>(); + + auto &Adapter = h.getContextImplPtr()->getAdapter(); + auto &Q = h.MQueue->getHandleRef(); + auto &memPoolImpl = sycl::detail::getSyclObjImpl(pool); + + // Get events to wait on. + auto depEvents = getUrEvents(h.impl->CGData.MEvents); + uint32_t numEvents = h.impl->CGData.MEvents.size(); + + void *alloc = nullptr; + ur_event_handle_t Event; + Adapter->call( + Q, memPoolImpl.get()->get_handle(), size, nullptr, numEvents, + depEvents.data(), &alloc, &Event); + + // Async malloc must return a void* immediately. + // Set up CommandGroup which is a no-op and pass the event from the alloc. + h.impl->MAllocSize = size; + h.impl->MMemPool = memPoolImpl; + h.impl->MAsyncAllocEvent = Event; + h.setType(detail::CGType::AsyncAlloc); + + return alloc; +} + +__SYCL_EXPORT void * +async_malloc_from_pool(const sycl::queue &q, size_t size, + const memory_pool &pool, + const sycl::detail::code_location &CodeLoc) { + void *temp = nullptr; + submit( + q, + [&](sycl::handler &h) { + // In order queues must wait on the previous event before calling alloc. + if (q.is_in_order() && q.ext_oneapi_get_last_event()) + h.depends_on(q.ext_oneapi_get_last_event().value()); + temp = async_malloc_from_pool(h, size, pool); + }, + CodeLoc); + return temp; +} + +__SYCL_EXPORT void async_free(sycl::handler &h, void *ptr) { + h.throwIfGraphAssociated< + ext::oneapi::experimental::detail::UnsupportedGraphFeatures:: + sycl_ext_oneapi_async_alloc>(); + + h.impl->MFreePtr = ptr; + h.setType(detail::CGType::AsyncFree); +} + +__SYCL_EXPORT void async_free(const sycl::queue &q, void *ptr, + const sycl::detail::code_location &CodeLoc) { + submit(q, [&](sycl::handler &h) { async_free(h, ptr); }, CodeLoc); +} + +} // namespace ext::oneapi::experimental +} // namespace _V1 +} // namespace sycl diff --git a/sycl/source/detail/cg.hpp b/sycl/source/detail/cg.hpp index 8d3a5e56ac71..f8923d1af6d5 100644 --- a/sycl/source/detail/cg.hpp +++ b/sycl/source/detail/cg.hpp @@ -15,6 +15,7 @@ #include // for ur_rect_region_t, ur_rect_offset_t #include // for event_impl #include // for queue_impl +#include #include #include // for kernel_impl #include // for kernel_bundle_impl @@ -667,6 +668,49 @@ class CGSemaphoreSignal : public CG { std::optional getSignalValue() const { return MSignalValue; } }; +/// "Async Alloc" command group class. +class CGAsyncAlloc : public CG { + + // These members are unused but kept in case of logging. + size_t MSize; + std::shared_ptr MMemPool; + + // Resulting event carried from async alloc execution. + ur_event_handle_t MEvent; + +public: + CGAsyncAlloc( + size_t size, + std::shared_ptr + MemPool, + ur_event_handle_t event, CG::StorageInitHelper CGData, + detail::code_location loc = {}) + : CG(CGType::AsyncAlloc, std::move(CGData), std::move(loc)), MSize(size), + MMemPool(MemPool), MEvent(event) {} + + std::shared_ptr + getMemPool() const { + return MMemPool; + } + + size_t getSize() const { return MSize; } + + ur_event_handle_t getEvent() const { return MEvent; } +}; + +/// "Async Free" command group class. +class CGAsyncFree : public CG { + void *MFreePtr; + +public: + CGAsyncFree(void *ptr, CG::StorageInitHelper CGData, + detail::code_location loc = {}) + : CG(CGType::AsyncFree, std::move(CGData), std::move(loc)), + MFreePtr(ptr) {} + + void *getPtr() const { return MFreePtr; } +}; + /// "Execute command-buffer" command group class. class CGExecCommandBuffer : public CG { public: diff --git a/sycl/source/detail/config.hpp b/sycl/source/detail/config.hpp index 3e0a591e27d1..df50ba01adbc 100644 --- a/sycl/source/detail/config.hpp +++ b/sycl/source/detail/config.hpp @@ -647,7 +647,7 @@ template <> class SYCLConfig { public: static std::string get() { - const std::string DefaultValue{""}; + std::string DefaultValue{""}; const char *ValStr = getCachedValue(); @@ -675,7 +675,7 @@ template <> class SYCLConfig { public: static std::string get() { - const std::string DefaultValue{""}; + std::string DefaultValue{""}; const char *ValStr = getCachedValue(); diff --git a/sycl/source/detail/context_impl.cpp b/sycl/source/detail/context_impl.cpp index 7fa6d962c2b7..a8048919c028 100644 --- a/sycl/source/detail/context_impl.cpp +++ b/sycl/source/detail/context_impl.cpp @@ -562,6 +562,47 @@ void context_impl::verifyProps(const property_list &Props) const { NoAllowedPropertiesCheck); } +// The handle for a device default pool is retrieved once on first request. +// Subsequent requests are returned immediately without calling the backend. +std::shared_ptr +context_impl::get_default_memory_pool(const context &Context, + const device &Device, + const usm::alloc &Kind) { + + assert(Kind == usm::alloc::device); + + std::shared_ptr DevImpl = + sycl::detail::getSyclObjImpl(Device); + ur_device_handle_t DeviceHandle = DevImpl->getHandleRef(); + const sycl::detail::AdapterPtr &Adapter = this->getAdapter(); + + // Check dev is already in our list of device pool pairs. + if (auto it = std::find_if(MMemPoolImplPtrs.begin(), MMemPoolImplPtrs.end(), + [&](auto &pair) { return Device == pair.first; }); + it != MMemPoolImplPtrs.end()) { + // Check if the shared_ptr of memory_pool_impl has not been destroyed. + if (!it->second.expired()) + return it->second.lock(); + } + + // The memory_pool_impl does not exist for this device yet. + ur_usm_pool_handle_t PoolHandle; + Adapter->call( + this->getHandleRef(), DeviceHandle, &PoolHandle); + + auto MemPoolImplPtr = std::make_shared< + sycl::ext::oneapi::experimental::detail::memory_pool_impl>( + Context, Device, sycl::usm::alloc::device, PoolHandle, + true /*Default pool*/, property_list{}); + + // Hold onto a weak_ptr of the memory_pool_impl. Prevents circular + // dependencies between the context_impl and memory_pool_impl. + MMemPoolImplPtrs.push_back(std::pair(Device, MemPoolImplPtr)); + + return MemPoolImplPtr; +} + } // namespace detail } // namespace _V1 } // namespace sycl diff --git a/sycl/source/detail/context_impl.hpp b/sycl/source/detail/context_impl.hpp index d573d19977cc..80ae2ce4b006 100644 --- a/sycl/source/detail/context_impl.hpp +++ b/sycl/source/detail/context_impl.hpp @@ -9,6 +9,7 @@ #pragma once #include #include +#include #include #include #include @@ -247,6 +248,10 @@ class context_impl { const property_list &getPropList() const { return MPropList; } + std::shared_ptr + get_default_memory_pool(const context &Context, const device &Device, + const usm::alloc &Kind); + private: bool MOwnedByRuntime; async_handler MAsyncHandler; @@ -259,6 +264,14 @@ class context_impl { mutable KernelProgramCache MKernelProgramCache; mutable PropertySupport MSupportBufferLocationByDevices; + // Device pools. + // Weak_ptr preventing circular dependency between memory_pool_impl and + // context_impl. + std::vector>> + MMemPoolImplPtrs; + std::set MAssociatedDeviceGlobals; std::mutex MAssociatedDeviceGlobalsMutex; diff --git a/sycl/source/detail/device_impl.cpp b/sycl/source/detail/device_impl.cpp index da9efe7e430a..28a7982c6d4a 100644 --- a/sycl/source/detail/device_impl.cpp +++ b/sycl/source/detail/device_impl.cpp @@ -671,8 +671,7 @@ bool device_impl::has(aspect Aspect) const { ur_bool_t support = false; bool call_successful = getAdapter()->call_nocheck( - MDevice, - UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_1D_USM_SUPPORT_EXP, + MDevice, UR_DEVICE_INFO_BINDLESS_SAMPLE_1D_USM_SUPPORT_EXP, sizeof(ur_bool_t), &support, nullptr) == UR_RESULT_SUCCESS; return call_successful && support; } @@ -680,8 +679,7 @@ bool device_impl::has(aspect Aspect) const { ur_bool_t support = false; bool call_successful = getAdapter()->call_nocheck( - MDevice, - UR_DEVICE_INFO_BINDLESS_SAMPLED_IMAGE_FETCH_2D_USM_SUPPORT_EXP, + MDevice, UR_DEVICE_INFO_BINDLESS_SAMPLE_2D_USM_SUPPORT_EXP, sizeof(ur_bool_t), &support, nullptr) == UR_RESULT_SUCCESS; return call_successful && support; } @@ -821,6 +819,14 @@ bool device_impl::has(aspect Aspect) const { bool isCompatibleBE = BE == sycl::backend::ext_oneapi_level_zero; return is_gpu() && isCompatibleBE; } + case aspect::ext_oneapi_async_memory_alloc: { + ur_bool_t support = false; + bool call_successful = + getAdapter()->call_nocheck( + MDevice, UR_DEVICE_INFO_ASYNC_USM_ALLOCATIONS_SUPPORT_EXP, + sizeof(ur_bool_t), &support, nullptr) == UR_RESULT_SUCCESS; + return call_successful && support; + } } return false; // This device aspect has not been implemented yet. diff --git a/sycl/source/detail/graph_impl.hpp b/sycl/source/detail/graph_impl.hpp index 518ccbd90dfe..6045cc9ededa 100644 --- a/sycl/source/detail/graph_impl.hpp +++ b/sycl/source/detail/graph_impl.hpp @@ -306,6 +306,10 @@ class node_impl : public std::enable_shared_from_this { return createCGCopy(); case sycl::detail::CGType::ExecCommandBuffer: return createCGCopy(); + case sycl::detail::CGType::AsyncAlloc: + return createCGCopy(); + case sycl::detail::CGType::AsyncFree: + return createCGCopy(); case sycl::detail::CGType::None: return nullptr; } diff --git a/sycl/source/detail/handler_impl.hpp b/sycl/source/detail/handler_impl.hpp index 92d8f2aed975..b247e6e8f963 100644 --- a/sycl/source/detail/handler_impl.hpp +++ b/sycl/source/detail/handler_impl.hpp @@ -202,6 +202,16 @@ class handler_impl { /// Potential event mode for the result event of the command. ext::oneapi::experimental::event_mode_enum MEventMode = ext::oneapi::experimental::event_mode_enum::none; + + /// Memory pool and allocation size for asynchronous allocation - held for + /// potential logging. + /// Event computed from async alloc which is passed through for processing. + std::shared_ptr MMemPool; + size_t MAllocSize; + ur_event_handle_t MAsyncAllocEvent; + + // Allocation ptr to be freed asynchronously. + void *MFreePtr = nullptr; }; } // namespace detail diff --git a/sycl/source/detail/jit_compiler.cpp b/sycl/source/detail/jit_compiler.cpp index 3ccd0b6a1c06..e24e49cf6846 100644 --- a/sycl/source/detail/jit_compiler.cpp +++ b/sycl/source/detail/jit_compiler.cpp @@ -137,7 +137,7 @@ translateBinaryImageFormat(ur::DeviceBinaryType Type) { } } -::jit_compiler::BinaryFormat getTargetFormat(QueueImplPtr &Queue) { +::jit_compiler::BinaryFormat getTargetFormat(const QueueImplPtr &Queue) { auto Backend = Queue->getDeviceImplPtr()->getBackend(); switch (Backend) { case backend::ext_oneapi_level_zero: @@ -154,7 +154,7 @@ ::jit_compiler::BinaryFormat getTargetFormat(QueueImplPtr &Queue) { } } -::jit_compiler::TargetInfo getTargetInfo(QueueImplPtr &Queue) { +::jit_compiler::TargetInfo getTargetInfo(const QueueImplPtr &Queue) { ::jit_compiler::BinaryFormat Format = getTargetFormat(Queue); return ::jit_compiler::TargetInfo::get( Format, static_cast<::jit_compiler::DeviceArchitecture>( @@ -659,7 +659,7 @@ updatePromotedArgs(const ::jit_compiler::SYCLKernelInfo &FusedKernelInfo, } ur_kernel_handle_t jit_compiler::materializeSpecConstants( - QueueImplPtr Queue, const RTDeviceBinaryImage *BinImage, + const QueueImplPtr &Queue, const RTDeviceBinaryImage *BinImage, const std::string &KernelName, const std::vector &SpecConstBlob) { #ifndef _WIN32 @@ -1042,16 +1042,13 @@ jit_compiler::fuseKernels(QueueImplPtr Queue, FusedOrCachedKernelName); std::shared_ptr KernelBundleImplPtr; - if (TargetFormat == ::jit_compiler::BinaryFormat::SPIRV) { - detail::getSyclObjImpl(get_kernel_bundle( - Queue->get_context(), {Queue->get_device()}, {FusedKernelId})); - } std::unique_ptr FusedCG; FusedCG.reset(new detail::CGExecKernel( NDRDesc, nullptr, nullptr, std::move(KernelBundleImplPtr), - std::move(CGData), std::move(FusedArgs), FusedOrCachedKernelName, {}, {}, - CGType::Kernel, KernelCacheConfig, false /* KernelIsCooperative */, + std::move(CGData), std::move(FusedArgs), + std::move(FusedOrCachedKernelName), {}, {}, CGType::Kernel, + KernelCacheConfig, false /* KernelIsCooperative */, false /* KernelUsesClusterLaunch*/, 0 /* KernelWorkGroupMemorySize */)); return FusedCG; } diff --git a/sycl/source/detail/jit_compiler.hpp b/sycl/source/detail/jit_compiler.hpp index 1b85afc1d4cd..ba5911820bc7 100644 --- a/sycl/source/detail/jit_compiler.hpp +++ b/sycl/source/detail/jit_compiler.hpp @@ -44,7 +44,7 @@ class jit_compiler { fuseKernels(QueueImplPtr Queue, std::vector &InputKernels, const property_list &); ur_kernel_handle_t - materializeSpecConstants(QueueImplPtr Queue, + materializeSpecConstants(const QueueImplPtr &Queue, const RTDeviceBinaryImage *BinImage, const std::string &KernelName, const std::vector &SpecConstBlob); diff --git a/sycl/source/detail/memory_pool.cpp b/sycl/source/detail/memory_pool.cpp new file mode 100644 index 000000000000..e97254ceab6b --- /dev/null +++ b/sycl/source/detail/memory_pool.cpp @@ -0,0 +1,68 @@ +//==----------- memory_pool.cpp --- SYCL asynchronous allocation -----------==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include +#include + +namespace sycl { +inline namespace _V1 { +namespace ext::oneapi::experimental { + +__SYCL_EXPORT sycl::context memory_pool::get_context() const { + return impl->get_context(); +} +__SYCL_EXPORT sycl::device memory_pool::get_device() const { + return impl->get_device(); +} +__SYCL_EXPORT sycl::usm::alloc memory_pool::get_alloc_kind() const { + return impl->get_alloc_kind(); +} + +__SYCL_EXPORT size_t memory_pool::get_threshold() const { + return impl->get_threshold(); +} + +const property_list &memory_pool::getPropList() const { + return impl->getPropList(); +} + +__SYCL_EXPORT size_t memory_pool::get_reserved_size_current() const { + return impl->get_reserved_size_current(); +} + +__SYCL_EXPORT size_t memory_pool::get_used_size_current() const { + return impl->get_used_size_current(); +} + +__SYCL_EXPORT void memory_pool::increase_threshold_to(size_t newThreshold) { + // Only increase. + if (newThreshold > get_threshold()) + impl->set_new_threshold(newThreshold); +} + +__SYCL_EXPORT memory_pool::memory_pool(const sycl::context &ctx, + const sycl::device &dev, + sycl::usm::alloc kind, + const property_list &props) { + + if (kind == sycl::usm::alloc::host) + throw sycl::exception( + sycl::make_error_code(sycl::errc::invalid), + "Host allocated memory pools selected but device supplied!"); + + if (kind != sycl::usm::alloc::device) + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Only device allocated memory pools are supported!"); + + impl = std::make_shared(ctx, dev, kind, props); +} + +} // namespace ext::oneapi::experimental +} // namespace _V1 +} // namespace sycl diff --git a/sycl/source/detail/memory_pool_impl.cpp b/sycl/source/detail/memory_pool_impl.cpp new file mode 100644 index 000000000000..68bfe9977b11 --- /dev/null +++ b/sycl/source/detail/memory_pool_impl.cpp @@ -0,0 +1,223 @@ +//==----------- memory_pool_impl.cpp --- SYCL asynchronous allocation ------==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include +#include +#include +#include +#include +#include + +namespace sycl { +inline namespace _V1 { +namespace ext::oneapi::experimental { +namespace detail { + +// <--- Helpers ---> +namespace { +ur_usm_pool_handle_t +create_memory_pool_device(const sycl::context &ctx, const sycl::device &dev, + const size_t threshold, const size_t maxSize, + const bool readOnly, const bool zeroInit) { + + std::shared_ptr CtxImpl = + sycl::detail::getSyclObjImpl(ctx); + ur_context_handle_t C = CtxImpl->getHandleRef(); + std::shared_ptr DevImpl = + sycl::detail::getSyclObjImpl(dev); + ur_device_handle_t Device = DevImpl->getHandleRef(); + const sycl::detail::AdapterPtr &Adapter = CtxImpl->getAdapter(); + + ur_usm_pool_limits_desc_t LimitsDesc{UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC, + nullptr, maxSize, threshold}; + + ur_usm_pool_flags_t Flags = {UR_USM_POOL_FLAG_USE_NATIVE_MEMORY_POOL_EXP}; + if (readOnly) + Flags += UR_USM_POOL_FLAG_READ_ONLY_EXP; + if (zeroInit) + Flags += UR_USM_POOL_FLAG_ZERO_INITIALIZE_BLOCK; + + ur_usm_pool_desc_t PoolDesc{UR_STRUCTURE_TYPE_USM_POOL_DESC, &LimitsDesc, + Flags}; + + ur_usm_pool_handle_t poolHandle; + + Adapter + ->call( + C, Device, &PoolDesc, &poolHandle); + + return poolHandle; +} + +void destroy_memory_pool(const sycl::context &ctx, const sycl::device &dev, + ur_usm_pool_handle_t &poolHandle) { + + std::shared_ptr CtxImpl = + sycl::detail::getSyclObjImpl(ctx); + ur_context_handle_t C = CtxImpl->getHandleRef(); + std::shared_ptr DevImpl = + sycl::detail::getSyclObjImpl(dev); + ur_device_handle_t Device = DevImpl->getHandleRef(); + const sycl::detail::AdapterPtr &Adapter = CtxImpl->getAdapter(); + + Adapter + ->call( + C, Device, poolHandle); +} +} // namespace + +// <--- Memory pool impl ---> +memory_pool_impl::memory_pool_impl(const sycl::context &ctx, + const sycl::device &dev, + const sycl::usm::alloc kind, + const property_list &props) + : MContextImplPtr(sycl::detail::getSyclObjImpl(ctx)), MDevice(dev), + MKind(kind), MPropList(props) { + size_t maxSize = 0; + size_t threshold = 0; + bool readOnly = false; + bool zeroInit = false; + + // Get properties. + if (props.has_property()) + maxSize = props.get_property() + .get_maximum_size(); + + if (props.has_property()) + threshold = props.get_property() + .get_initial_threshold(); + + if (props.has_property()) + readOnly = true; + + if (props.has_property()) + zeroInit = true; + + if (kind == sycl::usm::alloc::device) + MPoolHandle = create_memory_pool_device(ctx, dev, threshold, maxSize, + readOnly, zeroInit); + else + throw sycl::exception( + sycl::make_error_code(sycl::errc::feature_not_supported), + "Only device allocated memory pools are supported!"); +} + +memory_pool_impl::memory_pool_impl(const sycl::context &ctx, + const sycl::device &dev, + const sycl::usm::alloc kind, + ur_usm_pool_handle_t poolHandle, + const bool isDefaultPool, + const property_list &props) + : MContextImplPtr(sycl::detail::getSyclObjImpl(ctx)), MDevice(dev), + MKind(kind), MPoolHandle(poolHandle), MIsDefaultPool(isDefaultPool), + MPropList(props) {} + +memory_pool_impl::~memory_pool_impl() { + + // Default memory pools cannot be destroyed. + if (MIsDefaultPool) + return; + + ur_usm_pool_handle_t handle = this->get_handle(); + sycl::context ctx = this->get_context(); + sycl::device dev = this->get_device(); + destroy_memory_pool(ctx, dev, handle); +} + +size_t memory_pool_impl::get_threshold() const { + const sycl::detail::AdapterPtr &Adapter = MContextImplPtr->getAdapter(); + + size_t threshold = 0; + Adapter + ->call( + MPoolHandle, UR_USM_POOL_INFO_RELEASE_THRESHOLD_EXP, &threshold, + nullptr); + + return threshold; +} + +size_t memory_pool_impl::get_reserved_size_current() const { + const sycl::detail::AdapterPtr &Adapter = MContextImplPtr->getAdapter(); + + size_t resSizeCurrent = 0; + Adapter + ->call( + MPoolHandle, UR_USM_POOL_INFO_RESERVED_CURRENT_EXP, &resSizeCurrent, + nullptr); + + return resSizeCurrent; +} + +size_t memory_pool_impl::get_reserved_size_high() const { + const sycl::detail::AdapterPtr &Adapter = MContextImplPtr->getAdapter(); + + size_t resSizeHigh = 0; + Adapter + ->call( + MPoolHandle, UR_USM_POOL_INFO_RESERVED_HIGH_EXP, &resSizeHigh, + nullptr); + + return resSizeHigh; +} + +size_t memory_pool_impl::get_used_size_current() const { + const sycl::detail::AdapterPtr &Adapter = MContextImplPtr->getAdapter(); + + size_t usedSizeCurrent = 0; + Adapter + ->call( + MPoolHandle, UR_USM_POOL_INFO_USED_CURRENT_EXP, &usedSizeCurrent, + nullptr); + + return usedSizeCurrent; +} + +size_t memory_pool_impl::get_used_size_high() const { + const sycl::detail::AdapterPtr &Adapter = MContextImplPtr->getAdapter(); + + size_t usedSizeHigh = 0; + Adapter + ->call( + MPoolHandle, UR_USM_POOL_INFO_USED_HIGH_EXP, &usedSizeHigh, nullptr); + + return usedSizeHigh; +} + +void memory_pool_impl::set_new_threshold(size_t newThreshold) { + const sycl::detail::AdapterPtr &Adapter = MContextImplPtr->getAdapter(); + + Adapter + ->call( + MPoolHandle, UR_USM_POOL_INFO_RELEASE_THRESHOLD_EXP, &newThreshold, + 8 /*uint64_t*/); +} + +void memory_pool_impl::reset_reserved_size_high() { + const sycl::detail::AdapterPtr &Adapter = MContextImplPtr->getAdapter(); + + uint64_t resetVal = 0; // Reset to zero + Adapter + ->call( + MPoolHandle, UR_USM_POOL_INFO_RESERVED_HIGH_EXP, + static_cast(&resetVal), 8 /*uint64_t*/); +} + +void memory_pool_impl::reset_used_size_high() { + const sycl::detail::AdapterPtr &Adapter = MContextImplPtr->getAdapter(); + + uint64_t resetVal = 0; // Reset to zero + Adapter + ->call( + MPoolHandle, UR_USM_POOL_INFO_USED_HIGH_EXP, + static_cast(&resetVal), 8 /*uint64_t*/); +} + +} // namespace detail +} // namespace ext::oneapi::experimental +} // namespace _V1 +} // namespace sycl diff --git a/sycl/source/detail/memory_pool_impl.hpp b/sycl/source/detail/memory_pool_impl.hpp new file mode 100644 index 000000000000..38837311dcd5 --- /dev/null +++ b/sycl/source/detail/memory_pool_impl.hpp @@ -0,0 +1,65 @@ +//==----------- memory_pool_impl.hpp --- SYCL asynchronous allocation ------==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#pragma once +#include // for context +#include // for device +#include // for queue +#include // for usm::alloc + +namespace sycl { +inline namespace _V1 { +namespace ext::oneapi::experimental { +namespace detail { + +class memory_pool_impl { +public: + memory_pool_impl(const sycl::context &ctx, const sycl::device &dev, + const sycl::usm::alloc kind, const property_list &props); + memory_pool_impl(const sycl::context &ctx, const sycl::device &dev, + const sycl::usm::alloc kind, ur_usm_pool_handle_t poolHandle, + const bool isDefaultPool, const property_list &props); + + ~memory_pool_impl(); + + memory_pool_impl(const memory_pool_impl &) = delete; + memory_pool_impl &operator=(const memory_pool_impl &) = delete; + + ur_usm_pool_handle_t get_handle() const { return MPoolHandle; } + sycl::device get_device() const { return MDevice; } + sycl::context get_context() const { + return sycl::detail::createSyclObjFromImpl(MContextImplPtr); + } + sycl::usm::alloc get_alloc_kind() const { return MKind; } + const property_list &getPropList() const { return MPropList; } + + // Returns backend specific values. + size_t get_allocation_chunk_size() const; + size_t get_threshold() const; + size_t get_reserved_size_current() const; + size_t get_reserved_size_high() const; + size_t get_used_size_current() const; + size_t get_used_size_high() const; + + void set_new_threshold(size_t newThreshold); + void reset_reserved_size_high(); + void reset_used_size_high(); + +private: + std::shared_ptr MContextImplPtr; + sycl::device MDevice; + sycl::usm::alloc MKind; + ur_usm_pool_handle_t MPoolHandle{0}; + bool MIsDefaultPool = false; + property_list MPropList; +}; + +} // namespace detail +} // namespace ext::oneapi::experimental +} // namespace _V1 +} // namespace sycl diff --git a/sycl/source/detail/program_manager/program_manager.cpp b/sycl/source/detail/program_manager/program_manager.cpp index 04c138d1b458..775f3dc3e677 100644 --- a/sycl/source/detail/program_manager/program_manager.cpp +++ b/sycl/source/detail/program_manager/program_manager.cpp @@ -73,7 +73,7 @@ ProgramManager &ProgramManager::getInstance() { } static ur_program_handle_t -createBinaryProgram(const ContextImplPtr Context, +createBinaryProgram(const ContextImplPtr &Context, const std::vector &Devices, const uint8_t **Binaries, size_t *Lengths, const std::vector &Metadata) { @@ -104,7 +104,7 @@ createBinaryProgram(const ContextImplPtr Context, return Program; } -static ur_program_handle_t createSpirvProgram(const ContextImplPtr Context, +static ur_program_handle_t createSpirvProgram(const ContextImplPtr &Context, const unsigned char *Data, size_t DataLen) { ur_program_handle_t Program = nullptr; @@ -369,7 +369,8 @@ static void appendCompileOptionsFromImage(std::string &CompileOpts, appendCompileOptionsForGRFSizeProperties(CompileOpts, Img, isEsimdImage); - const auto PlatformImpl = detail::getSyclObjImpl(Devs[0].get_platform()); + platform Platform = Devs[0].get_platform(); + const auto &PlatformImpl = detail::getSyclObjImpl(Platform); // Add optimization flags. auto str = getUint32PropAsOptStr(Img, "optLevel"); @@ -945,7 +946,7 @@ ur_program_handle_t ProgramManager::getBuiltURProgram( } std::vector URDevices; - for (auto Dev : Devs) + for (auto &Dev : Devs) URDevices.push_back(getSyclObjImpl(Dev).get()->getHandleRef()); ProgramPtr BuiltProgram = @@ -1700,7 +1701,7 @@ static inline bool isDeviceImageCompressed(sycl_device_binary Bin) { } ProgramManager::ProgramPtr ProgramManager::build( - ProgramPtr Program, const ContextImplPtr Context, + ProgramPtr Program, const ContextImplPtr &Context, const std::string &CompileOptions, const std::string &LinkOptions, std::vector &Devices, uint32_t DeviceLibReqMask, const std::vector &ExtraProgramsToLink, diff --git a/sycl/source/detail/program_manager/program_manager.hpp b/sycl/source/detail/program_manager/program_manager.hpp index f2fe311308ee..6ec30d1f74f6 100644 --- a/sycl/source/detail/program_manager/program_manager.hpp +++ b/sycl/source/detail/program_manager/program_manager.hpp @@ -350,7 +350,7 @@ class ProgramManager { using ProgramPtr = std::unique_ptr, decltype(&::urProgramRelease)>; - ProgramPtr build(ProgramPtr Program, const ContextImplPtr Context, + ProgramPtr build(ProgramPtr Program, const ContextImplPtr &Context, const std::string &CompileOptions, const std::string &LinkOptions, std::vector &Devices, diff --git a/sycl/source/detail/queue_impl.cpp b/sycl/source/detail/queue_impl.cpp index bbd2aada2564..6df1e1ea4bf6 100644 --- a/sycl/source/detail/queue_impl.cpp +++ b/sycl/source/detail/queue_impl.cpp @@ -126,7 +126,7 @@ static event prepareSYCLEventAssociatedWithQueue( static event createDiscardedEvent() { EventImplPtr EventImpl = std::make_shared(event_impl::HES_Discarded); - return createSyclObjFromImpl(EventImpl); + return createSyclObjFromImpl(std::move(EventImpl)); } const std::vector & @@ -386,7 +386,7 @@ event queue_impl::submit_impl(const detail::type_erased_cgfo_ty &CGF, addEvent(Event); - auto EventImpl = detail::getSyclObjImpl(Event); + const auto &EventImpl = detail::getSyclObjImpl(Event); for (auto &Stream : Streams) { // We don't want stream flushing to be blocking operation that is why submit // a host task to print stream buffer. It will fire up as soon as the kernel diff --git a/sycl/source/detail/queue_impl.hpp b/sycl/source/detail/queue_impl.hpp index 0b08213c2a0f..d42cb1c87e6c 100644 --- a/sycl/source/detail/queue_impl.hpp +++ b/sycl/source/detail/queue_impl.hpp @@ -804,10 +804,15 @@ class queue_impl { // Note that host_task events can never be discarded, so this will not // insert barriers between host_task enqueues. if (EventToBuildDeps->isDiscarded() && - getSyclObjImpl(Handler)->MCGType == CGType::CodeplayHostTask) + Handler.getType() == CGType::CodeplayHostTask) EventToBuildDeps = insertHelperBarrier(Handler); - if (!EventToBuildDeps->isDiscarded()) + // depends_on after an async alloc is explicitly disallowed. Async alloc + // handles in order queue dependencies preemptively, so we skip them. + // Note: This could be improved by moving the handling of dependencies + // to before calling the CGF. + if (!EventToBuildDeps->isDiscarded() && + !(Handler.getType() == CGType::AsyncAlloc)) Handler.depends_on(EventToBuildDeps); } diff --git a/sycl/source/detail/scheduler/commands.cpp b/sycl/source/detail/scheduler/commands.cpp index 0ef4b58de33f..93b78628c13b 100644 --- a/sycl/source/detail/scheduler/commands.cpp +++ b/sycl/source/detail/scheduler/commands.cpp @@ -3733,6 +3733,36 @@ ur_result_t ExecCGCommand::enqueueImpQueue() { MQueue->getHandleRef(), SemSignal->getExternalSemaphore(), OptSignalValue.has_value(), SignalValue, 0, nullptr, nullptr); } + case CGType::AsyncAlloc: { + // NO-OP. Async alloc calls adapter immediately in order to return a valid + // ptr directly. Any explicit/implicit dependencies are handled at that + // point, including in order queue deps. + + // Set event carried from async alloc execution. + CGAsyncAlloc *AsyncAlloc = (CGAsyncAlloc *)MCommandGroup.get(); + if (Event) + *Event = AsyncAlloc->getEvent(); + + SetEventHandleOrDiscard(); + + return UR_RESULT_SUCCESS; + } + case CGType::AsyncFree: { + CGAsyncFree *AsyncFree = (CGAsyncFree *)MCommandGroup.get(); + const detail::AdapterPtr &Adapter = MQueue->getAdapter(); + void *ptr = AsyncFree->getPtr(); + + if (auto Result = + Adapter->call_nocheck( + MQueue->getHandleRef(), nullptr, ptr, RawEvents.size(), + RawEvents.data(), Event); + Result != UR_RESULT_SUCCESS) + return Result; + + SetEventHandleOrDiscard(); + + return UR_RESULT_SUCCESS; + } case CGType::None: { if (RawEvents.empty()) { // urEnqueueEventsWait with zero events acts like a barrier which is NOT diff --git a/sycl/source/detail/scheduler/scheduler.cpp b/sycl/source/detail/scheduler/scheduler.cpp index 856cbdc3cca1..c36ff2acbb21 100644 --- a/sycl/source/detail/scheduler/scheduler.cpp +++ b/sycl/source/detail/scheduler/scheduler.cpp @@ -587,7 +587,7 @@ void Scheduler::cleanupAuxiliaryResources(BlockingT Blocking) { } ur_kernel_handle_t Scheduler::completeSpecConstMaterialization( - [[maybe_unused]] QueueImplPtr Queue, + [[maybe_unused]] const QueueImplPtr &Queue, [[maybe_unused]] const RTDeviceBinaryImage *BinImage, [[maybe_unused]] const std::string &KernelName, [[maybe_unused]] std::vector &SpecConstBlob) { diff --git a/sycl/source/detail/scheduler/scheduler.hpp b/sycl/source/detail/scheduler/scheduler.hpp index f3ce947b32e5..43c70ea55e2f 100644 --- a/sycl/source/detail/scheduler/scheduler.hpp +++ b/sycl/source/detail/scheduler/scheduler.hpp @@ -453,7 +453,7 @@ class Scheduler { void deferMemObjRelease(const std::shared_ptr &MemObj); ur_kernel_handle_t completeSpecConstMaterialization( - QueueImplPtr Queue, const RTDeviceBinaryImage *BinImage, + const QueueImplPtr &Queue, const RTDeviceBinaryImage *BinImage, const std::string &KernelName, std::vector &SpecConstBlob); void releaseResources(BlockingT Blocking = BlockingT::BLOCKING); diff --git a/sycl/source/feature_test.hpp.in b/sycl/source/feature_test.hpp.in index 1dd60594fbb9..cccc8d462be5 100644 --- a/sycl/source/feature_test.hpp.in +++ b/sycl/source/feature_test.hpp.in @@ -41,6 +41,7 @@ inline namespace _V1 { #define SYCL_EXT_ONEAPI_ENQUEUE_BARRIER 1 #define SYCL_EXT_ONEAPI_FREE_FUNCTION_QUERIES 1 #define SYCL_EXT_ONEAPI_BINDLESS_IMAGES 6 +#define SYCL_EXT_ONEAPI_ASYNC_MEMORY_ALLOC 1 #define SYCL_EXT_ONEAPI_GROUP_ALGORITHMS 1 #define SYCL_EXT_ONEAPI_GROUP_SORT 2 #define SYCL_EXT_ONEAPI_KERNEL_COMPILER 1 diff --git a/sycl/source/handler.cpp b/sycl/source/handler.cpp index 9eee74d397cb..5103e5524669 100644 --- a/sycl/source/handler.cpp +++ b/sycl/source/handler.cpp @@ -713,6 +713,15 @@ event handler::finalize() { impl->MExternalSemaphore, impl->MSignalValue, std::move(impl->CGData), MCodeLoc)); break; + case detail::CGType::AsyncAlloc: + CommandGroup.reset(new detail::CGAsyncAlloc( + impl->MAllocSize, impl->MMemPool, impl->MAsyncAllocEvent, + std::move(impl->CGData), MCodeLoc)); + break; + case detail::CGType::AsyncFree: + CommandGroup.reset(new detail::CGAsyncFree( + impl->MFreePtr, std::move(impl->CGData), MCodeLoc)); + break; case detail::CGType::None: CommandGroup.reset(new detail::CG(detail::CGType::None, std::move(impl->CGData), MCodeLoc)); @@ -1708,6 +1717,15 @@ void handler::depends_on(const detail::EventImplPtr &EventImpl) { "Queue operation cannot depend on discarded event."); } + // Async alloc calls adapter immediately. Any explicit/implicit dependencies + // are handled at that point, including in order queue deps. Further calls to + // depends_on after an async alloc are explicitly disallowed. + if (getType() == CGType::AsyncAlloc) { + throw sycl::exception(make_error_code(errc::invalid), + "Cannot submit a dependency after an asynchronous " + "allocation has already been executed!"); + } + auto EventGraph = EventImpl->getCommandGraph(); if (MQueue && EventGraph) { auto QueueGraph = MQueue->getCommandGraph(); diff --git a/sycl/test-e2e/AsyncAlloc/device/async_alloc.cpp b/sycl/test-e2e/AsyncAlloc/device/async_alloc.cpp new file mode 100644 index 000000000000..04d70ae525d4 --- /dev/null +++ b/sycl/test-e2e/AsyncAlloc/device/async_alloc.cpp @@ -0,0 +1,144 @@ +// RUN: %{build} -o %t.out +// RUN: %{run} %t.out + +#include +#include +#include + +#include + +// Uncomment to print additional test information +// #define VERBOSE_PRINT + +// Uncomment to validate memory reuse +// This relies on unguaranteed behaviour and is off by default +// #define MEM_REUSE_CHECK + +namespace syclexp = sycl::ext::oneapi::experimental; +class first_kernel; +class second_kernel; + +int main() { + +// Check feature test macro +#if defined(SYCL_EXT_ONEAPI_ASYNC_MEMORY_ALLOC) + assert(SYCL_EXT_ONEAPI_ASYNC_MEMORY_ALLOC == 1); +#if defined(VERBOSE_PRINT) + std::cout << "SYCL_EXT_ONEAPI_ASYNC_MEMORY_ALLOC is defined!" << std::endl; +#endif +#else + std::cerr + << "SYCL_EXT_ONEAPI_ASYNC_MEMORY_ALLOC feature test macro is not defined!" + << std::endl; + return 4; +#endif // defined(SYCL_EXT_ONEAPI_ASYNC_MEMORY_ALLOC) + + sycl::device Dev; + sycl::property_list QProp{sycl::property::queue::in_order()}; + sycl::queue Q(QProp); + sycl::context Ctx = Q.get_context(); + size_t Width = 8; + std::vector Out(Width); + +#ifdef MEM_REUSE_CHECK + std::vector Expected(Width); + // Expected is the sum of two sets of tids + // Since freeing doesn't reset the memory + for (int i = 0; i < Width; i++) { + Expected[i] = 2 * i; + } +#endif + + try { + // Check aspect + bool AsyncSupport = Dev.has(sycl::aspect::ext_oneapi_async_memory_alloc); + + if (!AsyncSupport) { + std::cerr << "ext_oneapi_async_memory_alloc aspect not supported when it " + "should be! \n"; + return 5; + } + +#ifdef VERBOSE_PRINT + std::cout << "async memory alloc support: " << AsyncSupport << "\n"; +#endif + + // <--- First allocation, use, and free ---> + + // Allocate in pool + void *FirstAlloc = + syclexp::async_malloc(Q, sycl::usm::alloc::device, Width); + + // Use allocation in kernel + Q.submit([&](sycl::handler &CGH) { + CGH.parallel_for( + sycl::nd_range<1>{{Width}, {Width}}, [=](sycl::nd_item<1> It) { + size_t Dim0 = It.get_local_id(0); + *((char *)FirstAlloc + Dim0) = static_cast(Dim0); + }); + }); + + // Free memory back to pool + syclexp::async_free(Q, FirstAlloc); + + // <--- Second allocation, use, and free ---> + + // Re-use allocation in pool + void *SecondAlloc = + syclexp::async_malloc(Q, sycl::usm::alloc::device, Width); + + // Re-use allocation in kernel + Q.submit([&](sycl::handler &CGH) { + CGH.parallel_for( + sycl::nd_range<1>{{Width}, {Width}}, [=](sycl::nd_item<1> It) { + size_t Dim0 = It.get_local_id(0); + *((char *)SecondAlloc + Dim0) = + *((char *)SecondAlloc + Dim0) + static_cast(Dim0); + }); + }); + + Q.memcpy(Out.data(), FirstAlloc, Width); + + // Free memory back to pool + syclexp::async_free(Q, SecondAlloc); + + // Wait and thus release memory back to OS + Q.wait_and_throw(); + + } catch (sycl::exception &E) { + std::cerr << "SYCL exception caught! : " << E.what() << "\n"; + return 2; + } catch (...) { + std::cerr << "Unknown exception caught!\n"; + return 3; + } + + bool Validated = true; +#ifdef MEM_REUSE_CHECK + for (int i = 0; i < Width; i++) { + bool Mismatch = false; + if (Out[i] != Expected[i]) { + Mismatch = true; + Validated = false; + } + + if (Mismatch) { +#ifdef VERBOSE_PRINT + std::cerr << "Result mismatch! Expected: " + << static_cast(Expected[i]) + << ", Actual: " << static_cast(Out[i]) << std::endl; +#else + break; +#endif + } + } +#endif + + if (Validated) { + std::cout << "Test passed!" << std::endl; + return 0; + } + + std::cerr << "Test failed!" << std::endl; + return 1; +} diff --git a/sycl/test-e2e/AsyncAlloc/device/async_alloc_from_default_pool.cpp b/sycl/test-e2e/AsyncAlloc/device/async_alloc_from_default_pool.cpp new file mode 100644 index 000000000000..ba7aa96876a2 --- /dev/null +++ b/sycl/test-e2e/AsyncAlloc/device/async_alloc_from_default_pool.cpp @@ -0,0 +1,123 @@ +// RUN: %{build} -o %t.out +// RUN: %{run} %t.out + +#include +#include +#include + +#include +#include + +// Uncomment to print additional test information +// #define VERBOSE_PRINT + +// Uncomment to validate memory reuse +// This relies on unguaranteed behaviour and is off by default +// #define MEM_REUSE_CHECK + +namespace syclexp = sycl::ext::oneapi::experimental; +class first_kernel; +class second_kernel; + +int main() { + + sycl::device Dev; + sycl::property_list QProp{sycl::property::queue::in_order()}; + sycl::queue Q(QProp); + sycl::context Ctx = Q.get_context(); + size_t Width = 8; + std::vector Out(Width); + +#ifdef MEM_REUSE_CHECK + // Expected is the sum of two sets of tids + // Since freeing doesn't reset the memory + std::vector Expected(Width); + for (int i = 0; i < Width; i++) { + Expected[i] = 2 * i; + } +#endif + + try { + + // Create pool + syclexp::memory_pool MemPool = + Ctx.ext_oneapi_get_default_memory_pool(Dev, sycl::usm::alloc::device); + + // <--- First allocation, use, and free ---> + + // Allocate in pool -- no pool specified, use detault + void *FirstAlloc = + syclexp::async_malloc(Q, sycl::usm::alloc::device, Width); + + // Use allocation in kernel + Q.submit([&](sycl::handler &CGH) { + CGH.parallel_for( + sycl::nd_range<1>{{Width}, {Width}}, [=](sycl::nd_item<1> It) { + size_t Dim0 = It.get_local_id(0); + *((char *)FirstAlloc + Dim0) = static_cast(Dim0); + }); + }); + + // Free memory back to pool + syclexp::async_free(Q, FirstAlloc); + + // <--- Second allocation, use, and free ---> + + // Re-use allocation in pool -- default pool specified + void *SecondAlloc = syclexp::async_malloc_from_pool(Q, Width, MemPool); + + // Re-use allocation in kernel + Q.submit([&](sycl::handler &CGH) { + CGH.parallel_for( + sycl::nd_range<1>{{Width}, {Width}}, [=](sycl::nd_item<1> It) { + size_t Dim0 = It.get_local_id(0); + *((char *)SecondAlloc + Dim0) = + *((char *)SecondAlloc + Dim0) + static_cast(Dim0); + }); + }); + + Q.memcpy(Out.data(), SecondAlloc, Width); + + // Free memory back to pool + syclexp::async_free(Q, SecondAlloc); + + // Wait and thus release memory back to OS + Q.wait_and_throw(); + + } catch (sycl::exception &E) { + std::cerr << "SYCL exception caught! : " << E.what() << "\n"; + return 2; + } catch (...) { + std::cerr << "Unknown exception caught!\n"; + return 3; + } + + bool Validated = true; +#ifdef MEM_REUSE_CHECK + for (int i = 0; i < Width; i++) { + bool Mismatch = false; + if (Out[i] != Expected[i]) { + Mismatch = true; + Validated = false; + } + + if (Mismatch) { +#ifdef VERBOSE_PRINT + std::cerr << "Result mismatch! Expected: " + << static_cast(Expected[i]) + << ", Actual: " << static_cast(Out[i]) << std::endl; +#else + break; +#endif + } + } +#endif + + if (Validated) { + std::cout << "Test passed!" << std::endl; + return 0; + } + + std::cerr << "Test failed!" << std::endl; + return 1; +} diff --git a/sycl/test-e2e/AsyncAlloc/device/async_alloc_from_pool.cpp b/sycl/test-e2e/AsyncAlloc/device/async_alloc_from_pool.cpp new file mode 100644 index 000000000000..c15d2e3d8bfd --- /dev/null +++ b/sycl/test-e2e/AsyncAlloc/device/async_alloc_from_pool.cpp @@ -0,0 +1,121 @@ +// RUN: %{build} -o %t.out +// RUN: %{run} %t.out + +#include +#include +#include + +#include +#include + +// Uncomment to print additional test information +// #define VERBOSE_PRINT + +// Uncomment to validate memory reuse +// This relies on unguaranteed behaviour and is off by default +// #define MEM_REUSE_CHECK + +namespace syclexp = sycl::ext::oneapi::experimental; +class first_kernel; +class second_kernel; + +int main() { + + sycl::device Dev; + sycl::property_list QProp{sycl::property::queue::in_order()}; + sycl::queue Q(QProp); + sycl::context Ctx = Q.get_context(); + size_t Width = 8; + std::vector Out(Width); + +#ifdef MEM_REUSE_CHECK + // Expected is the sum of two sets of tids + // Since freeing doesn't reset the memory + std::vector Expected(Width); + for (int i = 0; i < Width; i++) { + Expected[i] = 2 * i; + } +#endif + + try { + + // Create pool + syclexp::memory_pool MemPool(Ctx, Dev, sycl::usm::alloc::device); + + // <--- First allocation, use, and free ---> + + // Allocate in pool + void *FirstAlloc = syclexp::async_malloc_from_pool(Q, Width, MemPool); + + // Use allocation in kernel + Q.submit([&](sycl::handler &CGH) { + CGH.parallel_for( + sycl::nd_range<1>{{Width}, {Width}}, [=](sycl::nd_item<1> It) { + size_t Dim0 = It.get_local_id(0); + *((char *)FirstAlloc + Dim0) = static_cast(Dim0); + }); + }); + + // Free memory back to pool + syclexp::async_free(Q, FirstAlloc); + + // <--- Second allocation, use, and free ---> + + // Re-use allocation in pool + void *SecondAlloc = syclexp::async_malloc_from_pool(Q, Width, MemPool); + + // Re-use allocation in kernel + Q.submit([&](sycl::handler &CGH) { + CGH.parallel_for( + sycl::nd_range<1>{{Width}, {Width}}, [=](sycl::nd_item<1> It) { + size_t Dim0 = It.get_local_id(0); + *((char *)SecondAlloc + Dim0) = + *((char *)SecondAlloc + Dim0) + static_cast(Dim0); + }); + }); + + Q.memcpy(Out.data(), SecondAlloc, Width); + + // Free memory back to pool + syclexp::async_free(Q, SecondAlloc); + + // Wait and thus release memory back to OS + Q.wait_and_throw(); + + } catch (sycl::exception &E) { + std::cerr << "SYCL exception caught! : " << E.what() << "\n"; + return 2; + } catch (...) { + std::cerr << "Unknown exception caught!\n"; + return 3; + } + + bool Validated = true; +#ifdef MEM_REUSE_CHECK + for (int i = 0; i < Width; i++) { + bool Mismatch = false; + if (Out[i] != Expected[i]) { + Mismatch = true; + Validated = false; + } + + if (Mismatch) { +#ifdef VERBOSE_PRINT + std::cerr << "Result mismatch! Expected: " + << static_cast(Expected[i]) + << ", Actual: " << static_cast(Out[i]) << std::endl; +#else + break; +#endif + } + } +#endif + + if (Validated) { + std::cout << "Test passed!" << std::endl; + return 0; + } + + std::cerr << "Test failed!" << std::endl; + return 1; +} diff --git a/sycl/test-e2e/AsyncAlloc/device/async_alloc_zero_init.cpp b/sycl/test-e2e/AsyncAlloc/device/async_alloc_zero_init.cpp new file mode 100644 index 000000000000..99b662ed4149 --- /dev/null +++ b/sycl/test-e2e/AsyncAlloc/device/async_alloc_zero_init.cpp @@ -0,0 +1,84 @@ +// RUN: %{build} -o %t.out +// RUN: %{run} %t.out + +#include +#include +#include + +#include +#include + +// Uncomment to print additional test information +// #define VERBOSE_PRINT + +namespace syclexp = sycl::ext::oneapi::experimental; +class first_kernel; + +int main() { + + sycl::device Dev; + sycl::property_list QProp{sycl::property::queue::in_order()}; + sycl::queue Q(QProp); + sycl::context Ctx = Q.get_context(); + size_t Width = 8; + std::vector Out(Width); + std::vector Expected(Width); + // Expect all zeroes + for (int i = 0; i < Width; i++) { + Expected[i] = 0; + } + + try { + + // Create pool with zero_init property + syclexp::property::memory_pool::zero_init ZeroInit; + syclexp::memory_pool MemPool(Ctx, Dev, sycl::usm::alloc::device, ZeroInit); + + // <--- First allocation, use, and free ---> + + // Allocate in pool + void *FirstAlloc = syclexp::async_malloc_from_pool(Q, Width, MemPool); + + Q.memcpy(Out.data(), FirstAlloc, Width); + + // Free memory back to pool + syclexp::async_free(Q, FirstAlloc); + + // Wait and thus release memory back to OS + Q.wait_and_throw(); + + } catch (sycl::exception &E) { + std::cerr << "SYCL exception caught! : " << E.what() << "\n"; + return 2; + } catch (...) { + std::cerr << "Unknown exception caught!\n"; + return 3; + } + + bool Validated = true; + for (int i = 0; i < Width; i++) { + bool Mismatch = false; + if (Out[i] != Expected[i]) { + Mismatch = true; + Validated = false; + } + + if (Mismatch) { +#ifdef VERBOSE_PRINT + std::cerr << "Result mismatch! Expected: " + << static_cast(Expected[i]) + << ", Actual: " << static_cast(Out[i]) << std::endl; +#else + break; +#endif + } + } + + if (Validated) { + std::cout << "Test passed!" << std::endl; + return 0; + } + + std::cerr << "Test failed!" << std::endl; + return 1; +} diff --git a/sycl/test-e2e/AsyncAlloc/device/memory_pool.cpp b/sycl/test-e2e/AsyncAlloc/device/memory_pool.cpp new file mode 100644 index 000000000000..34ba69f85dae --- /dev/null +++ b/sycl/test-e2e/AsyncAlloc/device/memory_pool.cpp @@ -0,0 +1,168 @@ +// RUN: %{build} -o %t.out +// RUN: %{run} %t.out + +#include +#include +#include + +#include +#include + +// Uncomment to print additional test information +// #define VERBOSE_PRINT +namespace syclexp = sycl::ext::oneapi::experimental; + +int main() { + + sycl::device Dev; + sycl::property_list QProp{sycl::property::queue::in_order()}; + sycl::queue Q(QProp); + sycl::context Ctx = Q.get_context(); + + try { + + // Pool properties + syclexp::property::memory_pool::initial_threshold InitialThreshold(1024); + syclexp::property::memory_pool::maximum_size MaximumSize(4096); + syclexp::property::memory_pool::read_only ReadOnly; + syclexp::property::memory_pool::zero_init ZeroInit; + sycl::property_list PoolProps{InitialThreshold, MaximumSize, ReadOnly, + ZeroInit}; + + // Create pools -- device only + sycl::usm::alloc Kind = sycl::usm::alloc::device; + syclexp::memory_pool MemPool1(Ctx, Dev, Kind, PoolProps); + syclexp::memory_pool MemPool2(Q, sycl::usm::alloc::device); + + // std::hash specialization to ensure `memory_pool` follows common reference + // semantics + assert(std::hash{}(MemPool1) != + std::hash{}(MemPool2)); + + // Copy construct + syclexp::memory_pool MemPoolCopyConstruct(MemPool1); + + // Copy assign + syclexp::memory_pool MemPoolCopyAssign = MemPoolCopyConstruct; + + // Move construct + syclexp::memory_pool MemPoolMoveConstruct(std::move(MemPool2)); + + // Move assign + syclexp::memory_pool MemPoolMoveAssign = std::move(MemPoolMoveConstruct); + + // Equality operators + assert(MemPoolCopyAssign == MemPool1 && "Pool equality is incorrect!"); + assert(MemPoolMoveAssign != MemPool1 && "Pool inequality is incorrect!"); + + // Check pool getters + assert(Ctx == MemPool1.get_context() && + "Stored pool context is incorrect!"); + assert(Dev == MemPool1.get_device() && "Stored pool device is incorrect!"); + assert(Kind == MemPool1.get_alloc_kind() && + "Stored pool allocation kind is incorrect!"); + + // Check property has-ers/getters + assert(MemPool1.has_property< + syclexp::property::memory_pool::initial_threshold>() && + "Pool does not have property when it should!"); + assert( + MemPool1.has_property() && + "Pool does not have property when it should!"); + assert(MemPool1.has_property() && + "Pool does not have property when it should!"); + assert(MemPool1.has_property() && + "Pool does not have property when it should!"); + assert(!MemPoolMoveAssign.has_property< + syclexp::property::memory_pool::initial_threshold>() && + "Pool has property when it should not!"); + assert(!MemPoolMoveAssign + .has_property() && + "Pool has property when it should not!"); + assert(!MemPoolMoveAssign + .has_property() && + "Pool has property when it should not!"); + assert(!MemPoolMoveAssign + .has_property() && + "Pool has property when it should not!"); + + assert(MemPool1.get_property< + syclexp::property::memory_pool::initial_threshold>() + .get_initial_threshold() == + InitialThreshold.get_initial_threshold() && + "Pool property values do not match!"); + assert(MemPool1.get_property() + .get_maximum_size() == MaximumSize.get_maximum_size() && + "Pool property values do not match!"); + + size_t ReleaseThresholdGet = MemPool1.get_threshold(); + size_t ReservedSizeCurrent = MemPool1.get_reserved_size_current(); + size_t UsedSizeCurrent = MemPool1.get_used_size_current(); +#ifdef VERBOSE_PRINT + std::cout << "Memory pool release threshold: " << ReleaseThresholdGet + << std::endl; + std::cout << "Memory pool current reserved size: " << ReservedSizeCurrent + << std::endl; + std::cout << "Memory pool current used size: " << UsedSizeCurrent + << std::endl; +#endif + + // Set new threshold -- then check getter + size_t NewThreshold = 2048; + MemPool1.increase_threshold_to(NewThreshold); + ReleaseThresholdGet = MemPool1.get_threshold(); +#ifdef VERBOSE_PRINT + std::cout << "Newly set memory pool release threshold: " + << ReleaseThresholdGet << std::endl; +#endif + + // Allocate memory to check queries + void *dummyPtr = syclexp::async_malloc_from_pool(Q, 2048, MemPool1); + + ReservedSizeCurrent = MemPool1.get_reserved_size_current(); + UsedSizeCurrent = MemPool1.get_used_size_current(); +#ifdef VERBOSE_PRINT + std::cout << "Memory pool current reserved size: " << ReservedSizeCurrent + << std::endl; + std::cout << "Memory pool current used size: " << UsedSizeCurrent + << std::endl; +#endif + + // We don't know what the exact sizes of each could be - but they must each + // be greater than 0 + assert(ReservedSizeCurrent > 0 && + "Pool reserved size has not increased despite allocating memory!"); + assert(UsedSizeCurrent > 0 && + "Pool used size has not increased despite allocating memory!"); + + // Free that allocation and wait to release back to OS + syclexp::async_free(Q, dummyPtr); + Q.wait_and_throw(); + + // Default memory pool + syclexp::memory_pool DefaultPool = + Ctx.ext_oneapi_get_default_memory_pool(Dev, sycl::usm::alloc::device); + DefaultPool.increase_threshold_to(1024); + + // Check default memory pool getter is equal + syclexp::memory_pool DefaultPoolCopy = + Ctx.ext_oneapi_get_default_memory_pool(Dev, sycl::usm::alloc::device); + assert(DefaultPool == DefaultPoolCopy && + "Default pool is not equivalent between calls!"); + + // Check equivalent thresholds between the two copies + assert(DefaultPool.get_threshold() == DefaultPoolCopy.get_threshold() && + "Default pool does not have equivalent thresholds between retrieved " + "copies!"); + + } catch (sycl::exception &E) { + std::cerr << "SYCL exception caught! : " << E.what() << "\n"; + return 1; + } catch (...) { + std::cerr << "Unknown exception caught!\n"; + return 2; + } + + std::cout << "Test passed!" << std::endl; + return 0; +} diff --git a/sycl/test-e2e/AsyncAlloc/device/ooo_queue_async_alloc.cpp b/sycl/test-e2e/AsyncAlloc/device/ooo_queue_async_alloc.cpp new file mode 100644 index 000000000000..d21a034f5cfc --- /dev/null +++ b/sycl/test-e2e/AsyncAlloc/device/ooo_queue_async_alloc.cpp @@ -0,0 +1,134 @@ +// RUN: %{build} -o %t.out +// RUN: %{run} %t.out + +#include +#include + +#include +#include +#include + +// Uncomment to print additional test information +// #define VERBOSE_PRINT + +// Uncomment to validate memory reuse +// This relies on unguaranteed behaviour and should be off by default +// #define MEM_REUSE_CHECK + +namespace syclexp = sycl::ext::oneapi::experimental; +class first_kernel; +class second_kernel; + +int main() { + + sycl::queue Q; + size_t Width = 8; + std::vector Out(Width); + +#ifdef MEM_REUSE_CHECK + std::vector Expected(Width); + // Expected is the sum of two sets of tids + // Since freeing doesn't reset the memory + for (int i = 0; i < Width; i++) { + Expected[i] = 2 * i; + } +#endif + + try { + + // <--- First allocation, use, and free ---> + + // Allocate in pool + void *FirstAlloc = nullptr; + + sycl::event E1 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + FirstAlloc = syclexp::async_malloc(CGH, sycl::usm::alloc::device, Width); + }); + + // Use allocation in kernel + sycl::event E2 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + CGH.parallel_for( + sycl::nd_range<1>{{Width}, {Width}}, [=](sycl::nd_item<1> It) { + size_t Dim0 = It.get_local_id(0); + *((char *)FirstAlloc + Dim0) = static_cast(Dim0); + }); + CGH.depends_on(E1); + }); + + // Free memory back to pool + sycl::event E3 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + syclexp::async_free(CGH, FirstAlloc); + CGH.depends_on(E2); + }); + + // <--- Second allocation, use, and free ---> + + // Re-use allocation in pool + void *SecondAlloc = nullptr; + sycl::event E4 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + CGH.depends_on(E3); + SecondAlloc = syclexp::async_malloc(CGH, sycl::usm::alloc::device, Width); + }); + + // Re-use allocation in kernel + sycl::event E5 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + CGH.parallel_for( + sycl::nd_range<1>{{Width}, {Width}}, [=](sycl::nd_item<1> It) { + size_t Dim0 = It.get_local_id(0); + *((char *)SecondAlloc + Dim0) = + *((char *)SecondAlloc + Dim0) + static_cast(Dim0); + }); + CGH.depends_on(E4); + }); + + sycl::event E6 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + syclexp::memcpy(CGH, Out.data(), SecondAlloc, Width); + CGH.depends_on(E5); + }); + + // Free memory back to pool + sycl::event E7 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + syclexp::async_free(CGH, SecondAlloc); + CGH.depends_on(E6); + }); + + // Wait and thus release memory back to OS + Q.wait_and_throw(); + + } catch (sycl::exception &E) { + std::cerr << "SYCL exception caught! : " << E.what() << "\n"; + return 2; + } catch (...) { + std::cerr << "Unknown exception caught!\n"; + return 3; + } + + bool Validated = true; +#ifdef MEM_REUSE_CHECK + for (int i = 0; i < Width; i++) { + bool Mismatch = false; + if (Out[i] != Expected[i]) { + Mismatch = true; + Validated = false; + } + + if (Mismatch) { +#ifdef VERBOSE_PRINT + std::cerr << "Result mismatch! Expected: " + << static_cast(Expected[i]) + << ", Actual: " << static_cast(Out[i]) << std::endl; +#else + break; +#endif + } + } +#endif + + if (Validated) { + std::cout << "Test passed!" << std::endl; + return 0; + } + + std::cerr << "Test failed!" << std::endl; + return 1; +} diff --git a/sycl/test-e2e/AsyncAlloc/device/ooo_queue_async_alloc_from_pool.cpp b/sycl/test-e2e/AsyncAlloc/device/ooo_queue_async_alloc_from_pool.cpp new file mode 100644 index 000000000000..91dec2d7b7df --- /dev/null +++ b/sycl/test-e2e/AsyncAlloc/device/ooo_queue_async_alloc_from_pool.cpp @@ -0,0 +1,139 @@ +// RUN: %{build} -o %t.out +// RUN: %{run} %t.out + +#include +#include +#include + +#include +#include +#include + +// Uncomment to print additional test information +// #define VERBOSE_PRINT + +// Uncomment to validate memory reuse +// This relies on unguaranteed behaviour and should be off by default +// #define MEM_REUSE_CHECK + +namespace syclexp = sycl::ext::oneapi::experimental; +class first_kernel; +class second_kernel; + +int main() { + + sycl::queue Q; + size_t Width = 8; + std::vector Out(Width); + +#ifdef MEM_REUSE_CHECK + std::vector Expected(Width); + // Expected is the sum of two sets of tids + // Since freeing doesn't reset the memory + for (int i = 0; i < Width; i++) { + Expected[i] = 2 * i; + } +#endif + + try { + + // Create pool + syclexp::memory_pool MemPool(Q.get_context(), Q.get_device(), + sycl::usm::alloc::device); + + // <--- First allocation, use, and free ---> + + // Allocate in pool + void *FirstAlloc = nullptr; + + sycl::event E1 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + FirstAlloc = syclexp::async_malloc_from_pool(CGH, Width, MemPool); + }); + + // Use allocation in kernel + sycl::event E2 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + CGH.parallel_for( + sycl::nd_range<1>{{Width}, {Width}}, [=](sycl::nd_item<1> It) { + size_t Dim0 = It.get_local_id(0); + *((char *)FirstAlloc + Dim0) = static_cast(Dim0); + }); + CGH.depends_on(E1); + }); + + // Free memory back to pool + sycl::event E3 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + syclexp::async_free(CGH, FirstAlloc); + CGH.depends_on(E2); + }); + + // <--- Second allocation, use, and free ---> + + // Re-use allocation in pool + void *SecondAlloc = nullptr; + sycl::event E4 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + CGH.depends_on(E3); + SecondAlloc = syclexp::async_malloc_from_pool(CGH, Width, MemPool); + }); + + // Re-use allocation in kernel + sycl::event E5 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + CGH.parallel_for( + sycl::nd_range<1>{{Width}, {Width}}, [=](sycl::nd_item<1> It) { + size_t Dim0 = It.get_local_id(0); + *((char *)SecondAlloc + Dim0) = + *((char *)SecondAlloc + Dim0) + static_cast(Dim0); + }); + CGH.depends_on(E4); + }); + + sycl::event E6 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + syclexp::memcpy(CGH, Out.data(), SecondAlloc, Width); + CGH.depends_on(E5); + }); + + // Free memory back to pool + sycl::event E7 = syclexp::submit_with_event(Q, [&](sycl::handler &CGH) { + syclexp::async_free(CGH, SecondAlloc); + CGH.depends_on(E6); + }); + + // Wait and thus release memory back to OS + Q.wait_and_throw(); + + } catch (sycl::exception &E) { + std::cerr << "SYCL exception caught! : " << E.what() << "\n"; + return 2; + } catch (...) { + std::cerr << "Unknown exception caught!\n"; + return 3; + } + + bool Validated = true; +#ifdef MEM_REUSE_CHECK + for (int i = 0; i < Width; i++) { + bool Mismatch = false; + if (Out[i] != Expected[i]) { + Mismatch = true; + Validated = false; + } + + if (Mismatch) { +#ifdef VERBOSE_PRINT + std::cerr << "Result mismatch! Expected: " + << static_cast(Expected[i]) + << ", Actual: " << static_cast(Out[i]) << std::endl; +#else + break; +#endif + } + } +#endif + + if (Validated) { + std::cout << "Test passed!" << std::endl; + return 0; + } + + std::cerr << "Test failed!" << std::endl; + return 1; +} diff --git a/sycl/test-e2e/AsyncAlloc/lit.local.cfg b/sycl/test-e2e/AsyncAlloc/lit.local.cfg new file mode 100644 index 000000000000..2d2d5495be23 --- /dev/null +++ b/sycl/test-e2e/AsyncAlloc/lit.local.cfg @@ -0,0 +1 @@ +config.required_features += ['aspect-ext_oneapi_async_memory_alloc'] diff --git a/sycl/test-e2e/Basic/test_num_kernel_copies.cpp b/sycl/test-e2e/Basic/test_num_kernel_copies.cpp new file mode 100644 index 000000000000..7c1781e873a3 --- /dev/null +++ b/sycl/test-e2e/Basic/test_num_kernel_copies.cpp @@ -0,0 +1,43 @@ +// RUN: %{build} -o %t.out +// RUN: %{run} %t.out + +#include + +size_t copy_count = 0; +size_t move_count = 0; + +template class kernel { +public: + kernel() {}; + kernel(const kernel &other) { copy_count++; }; + kernel(kernel &&other) { ++move_count; } + + void operator()(sycl::id<1> id) const {} + void operator()(sycl::nd_item<1> id) const {} + void operator()() const {} +}; +template struct sycl::is_device_copyable> : std::true_type {}; + +int main(int argc, char **argv) { + sycl::queue q; + + kernel<0> krn0; + q.parallel_for(sycl::range<1>{1}, krn0); + assert(copy_count == 1); + assert(move_count == 0); + copy_count = 0; + + kernel<1> krn1; + q.parallel_for(sycl::nd_range<1>{1, 1}, krn1); + assert(copy_count == 1); + assert(move_count == 0); + copy_count = 0; + + kernel<2> krn2; + q.single_task(krn2); + assert(copy_count == 1); + assert(move_count == 0); + copy_count = 0; + + return 0; +} diff --git a/sycl/test-e2e/MemorySanitizer/check_device_global.cpp b/sycl/test-e2e/MemorySanitizer/check_device_global.cpp index 232c25bba4ee..af6e66fb3408 100644 --- a/sycl/test-e2e/MemorySanitizer/check_device_global.cpp +++ b/sycl/test-e2e/MemorySanitizer/check_device_global.cpp @@ -6,13 +6,6 @@ // RUN: %{build} %device_msan_flags -O2 -g -o %t3.out // RUN: %{run} not %t3.out 2>&1 | FileCheck %s -// XFAIL: spirv-backend && gpu && run-mode -// XFAIL-TRACKER: CMPLRLLVM-64705 - -// Test is flaky on required platforms, disable until it can be fixed -// UNSUPPORTED: true -// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/16978 - #include #include #include diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp index ffbc4739d1b7..dd1a2372e4df 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_amdgcn.cpp @@ -1,7 +1,7 @@ -// REQUIRES: target-amd, opencl, gpu, cpu +// UNSUPPORTED: windows +// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17515 +// There are no ROCm libs on win machines, so the compilation fails. -// RUN: %clangxx -fsycl -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx906 -fsycl-targets=amdgcn-amd-amdhsa %S/Inputs/is_compatible_with_env.cpp -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=amdgcn-amd-amdhsa -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx1030 %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=hip:gpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} not %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out +// RUN: %if !hip %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp index eff33e350278..b92e3e3df6ce 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_nvptx64.cpp @@ -1,7 +1,7 @@ -// REQUIRES: target-nvidia, opencl, gpu, cpu +// UNSUPPORTED: windows +// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17515 +// There are no CUDA libs on win machines, so the compilation fails. // RUN: %clangxx -fsycl -fsycl-targets=nvptx64-nvidia-cuda %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=cuda:gpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} not %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out +// RUN: %if !cuda %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp index eb7f4b005616..a3617244b4ad 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_several_targets.cpp @@ -1,7 +1,9 @@ -// REQUIRES: ocloc, any-device-is-level_zero, any-device-is-gpu, any-device-is-cpu +// REQUIRES: opencl-aot, ocloc -// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out +// UNSUPPORTED: windows +// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17515 +// There is no CPU device on win yet, so opencl-aot fails to compile the kernel. -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run-unfiltered-devices} not %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run-unfiltered-devices} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run-unfiltered-devices} %t.out +// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64,spir64_gen -Xsycl-target-backend=spir64_gen %gpu_aot_target_opts %S/Inputs/is_compatible_with_env.cpp -o %t.out + +// RUN: %if !(level_zero || opencl) %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp index 465a79056906..c2f13ebdc4af 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64.cpp @@ -1,7 +1,3 @@ -// REQUIRES: cuda, opencl, gpu, cpu - // RUN: %clangxx -fsycl -fsycl-targets=spir64 %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=cuda:gpu %{run} not %t.out +// RUN: %if hip || cuda %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp index 5adb27e0ae69..d33c4da4354d 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_gen.cpp @@ -1,7 +1,5 @@ -// REQUIRES: ocloc, gpu, level_zero, cpu +// REQUIRES: ocloc -// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out +// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen -Xsycl-target-backend=spir64_gen "-device *" %S/Inputs/is_compatible_with_env.cpp -o %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} not %t.out +// RUN: %if !(level_zero || opencl && gpu) %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp index 0a6f2c39df8a..08fba6fcf9f2 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_spir64_x86_64.cpp @@ -1,7 +1,9 @@ -// REQUIRES: opencl-aot, cpu, gpu, level_zero +// REQUIRES: opencl-aot -// RUN: %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/is_compatible_with_env.cpp -o %t.out +// UNSUPPORTED: windows +// UNSUPPORTED-TRACKER: https://github.com/intel/llvm/issues/17515 +// There is no CPU device on win yet, so opencl-aot fails to compile the kernel. -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:cpu %{run} %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=opencl:gpu %{run} not %t.out -// RUN: env ONEAPI_DEVICE_SELECTOR=level_zero:gpu %{run} not %t.out +// RUN: %{run-aux} %clangxx -fsycl -fsycl-targets=spir64_x86_64 %S/Inputs/is_compatible_with_env.cpp -o %t.out + +// RUN: %if !cpu %{ not %} %{run} %t.out diff --git a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_with_aspects.cpp b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_with_aspects.cpp index bd2a4485f75e..5f1e6b138b82 100644 --- a/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_with_aspects.cpp +++ b/sycl/test-e2e/OptionalKernelFeatures/is_compatible/is_compatible_with_aspects.cpp @@ -1,4 +1,3 @@ -// requires: cpu, gpu, accelerator // RUN: %{build} -Wno-error=incorrect-sub-group-size %O0 -o %t.out // RUN: %{run} %t.out @@ -7,11 +6,10 @@ [[sycl::device_has(sycl::aspect::cpu)]] void foo(){}; [[sycl::device_has(sycl::aspect::gpu)]] void bar(){}; -[[sycl::device_has(sycl::aspect::accelerator)]] void baz(){}; class KernelCPU; class KernelGPU; -class KernelACC; + class GoodWGSize; class WrongReqWGSize; @@ -40,13 +38,6 @@ int main() { Compatible &= Dev.is_gpu(); Called = true; } - if (sycl::is_compatible(Dev)) { - Q.submit( - [&](sycl::handler &h) { h.single_task([=]() { baz(); }); }); - Q.wait(); - Compatible &= Dev.is_accelerator(); - Called = true; - } if (sycl::is_compatible(Dev)) { Q.submit([&](sycl::handler &h) { diff --git a/sycl/test-e2e/ThreadSanitizer/check_buffer.cpp b/sycl/test-e2e/ThreadSanitizer/check_buffer.cpp new file mode 100644 index 000000000000..86b96f9b60fd --- /dev/null +++ b/sycl/test-e2e/ThreadSanitizer/check_buffer.cpp @@ -0,0 +1,33 @@ +// REQUIRES: linux, cpu || (gpu && level_zero) +// ALLOW_RETRIES: 10 +// RUN: %{build} %device_tsan_flags -O0 -g -o %t1.out +// RUN: %{run} %t1.out 2>&1 | FileCheck %s +// RUN: %{build} %device_tsan_flags -O2 -g -o %t2.out +// RUN: %{run} %t2.out 2>&1 | FileCheck %s + +#include + +static const int N = 16; + +int main() { + sycl::queue q; + + std::vector v(N); + + { + // We intentionally test sycl::buffer uses host ptr and trigger data write + // back here because in unified runtime we intercept sycl::buffer with usm, + // we need to cover that pattern here. + sycl::buffer buf(v.data(), v.size()); + q.submit([&](sycl::handler &h) { + auto A = buf.get_access(h); + h.parallel_for(sycl::nd_range<1>(N, 1), + [=](sycl::nd_item<1>) { A[0]++; }); + }).wait(); + // CHECK: WARNING: DeviceSanitizer: data race + // CHECK-NEXT: When write of size 4 at 0x{{.*}} in kernel <{{.*}}Test> + // CHECK-NEXT: #0 {{.*}}check_buffer.cpp:[[@LINE-4]] + } + + return 0; +} diff --git a/sycl/test-e2e/ThreadSanitizer/check_sub_buffer.cpp b/sycl/test-e2e/ThreadSanitizer/check_sub_buffer.cpp new file mode 100644 index 000000000000..62b7c894276b --- /dev/null +++ b/sycl/test-e2e/ThreadSanitizer/check_sub_buffer.cpp @@ -0,0 +1,33 @@ +// REQUIRES: linux, cpu || (gpu && level_zero) +// ALLOW_RETRIES: 10 +// RUN: %{build} %device_tsan_flags -O0 -g -o %t1.out +// RUN: %{run} %t1.out 2>&1 | FileCheck %s +// RUN: %{build} %device_tsan_flags -O2 -g -o %t2.out +// RUN: %{run} %t2.out 2>&1 | FileCheck %s + +#include + +int main() { + constexpr size_t size_x = 16; + + std::vector v(size_x); + for (size_t i = 0; i < size_x; i++) + v[i] = i; + + { + sycl::queue q; + sycl::buffer buf(v.data(), v.size()); + sycl::buffer sub_buf(buf, {size_x / 2}, {size_x / 2}); + + q.submit([&](sycl::handler &cgh) { + auto accessor = sub_buf.get_access(cgh); + cgh.parallel_for(sycl::nd_range<1>(size_x / 2, 1), + [=](sycl::nd_item<1>) { accessor[0]++; }); + }).wait(); + // CHECK: WARNING: DeviceSanitizer: data race + // CHECK-NEXT: When write of size 4 at 0x{{.*}} in kernel <{{.*}}Test> + // CHECK-NEXT: #0 {{.*}}check_sub_buffer.cpp:[[@LINE-4]] + } + + return 0; +} diff --git a/sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM_host.cpp b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM_host.cpp new file mode 100644 index 000000000000..13739cba0cfc --- /dev/null +++ b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM_host.cpp @@ -0,0 +1,102 @@ +// REQUIRES: aspect-ext_oneapi_bindless_images +// REQUIRES: aspect-ext_oneapi_bindless_sampled_image_fetch_1d_usm +// UNSUPPORTED: target-amd +// UNSUPPORTED-INTENDED: Sampled fetch not currently supported on AMD + +// RUN: %{build} -o %t.out +// RUN: %{run-unfiltered-devices} env NEOReadDebugKeys=1 UseBindlessMode=1 UseExternalAllocatorForSshAndDsh=1 %t.out + +#include +#include +#include +#include + +class kernel_sampled_fetch; + +// Uncomment to print additional test information +// #define VERBOSE_PRINT + +int main() { + sycl::device dev; + sycl::queue q(dev); + auto ctxt = q.get_context(); + + // Declare image size, and expected output and actual output vectors + constexpr size_t width = 32; + constexpr size_t widthInBytes = width * sizeof(float); + std::vector out(width); + std::vector expected(width); + for (int i = 0; i < width; ++i) { + expected[i] = static_cast(i); + } + + namespace syclexp = sycl::ext::oneapi::experimental; + + try { + // Extension: image descriptor + syclexp::image_descriptor desc({width}, 1, sycl::image_channel_type::fp32); + + // Extension: Image creation requires a sampler, but it will have no effect + // on the result, as we will use `fetch_image` in the kernel. + syclexp::bindless_image_sampler samp( + sycl::addressing_mode::repeat, + sycl::coordinate_normalization_mode::normalized, + sycl::filtering_mode::linear); + + // Allocate Host USM and initialize with expected data + float *imgMem = sycl::malloc_host(width, q); + memcpy(imgMem, expected.data(), widthInBytes); + + // Extension: create the image backed by Host USM and return the handle + auto imgHandle = syclexp::create_image(imgMem, 0, samp, desc, q); + + // Create a buffer to output the result from `fetch_image` + sycl::buffer outBuf(out.data(), sycl::range{width}); + q.submit([&](sycl::handler &cgh) { + sycl::accessor outAcc{outBuf, cgh, sycl::write_only}; + + cgh.parallel_for(width, [=](sycl::id<1> id) { + // Extension: fetch data from sampled image handle + outAcc[id] = syclexp::fetch_image(imgHandle, int(id[0])); + }); + }); + + q.wait_and_throw(); + + // Extension: cleanup + syclexp::destroy_image_handle(imgHandle, dev, ctxt); + sycl::free(imgMem, ctxt); + } catch (sycl::exception e) { + std::cerr << "SYCL exception caught! : " << e.what() << "\n"; + return 1; + } catch (...) { + std::cerr << "Unknown exception caught!\n"; + return 2; + } + + // collect and validate output + bool validated = true; + for (int i = 0; i < width; i++) { + bool mismatch = false; + if (out[i] != expected[i]) { + mismatch = true; + validated = false; + } + + if (mismatch) { +#ifdef VERBOSE_PRINT + std::cout << "Result mismatch! Expected: " << expected[i] + << ", Actual: " << out[i] << std::endl; +#else + break; +#endif + } + } + if (validated) { + std::cout << "Test passed!" << std::endl; + return 0; + } + + std::cout << "Test failed!" << std::endl; + return 3; +} diff --git a/sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM.cpp b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM_shared.cpp similarity index 100% rename from sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM.cpp rename to sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM_shared.cpp diff --git a/sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D_USM.cpp b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D_USM_device.cpp similarity index 100% rename from sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D_USM.cpp rename to sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D_USM_device.cpp diff --git a/sycl/test-e2e/bindless_images/sampling_1D_USM_host.cpp b/sycl/test-e2e/bindless_images/sampling_1D_USM_host.cpp new file mode 100644 index 000000000000..0ab34b97332d --- /dev/null +++ b/sycl/test-e2e/bindless_images/sampling_1D_USM_host.cpp @@ -0,0 +1,126 @@ +// REQUIRES: aspect-ext_oneapi_bindless_images +// REQUIRES: aspect-ext_oneapi_bindless_images_sample_1d_usm + +// UNSUPPORTED: hip +// UNSUPPORTED-INTENDED: Host USM backed image support is not yet enabled in UR +// adapter. Also, when provionally enabled, the test crashes upon image +// creation, whereas Device USM backed images do not crash. This issue is +// undetermined. + +// RUN: %{build} -o %t.out +// RUN: %{run-unfiltered-devices} env NEOReadDebugKeys=1 UseBindlessMode=1 UseExternalAllocatorForSshAndDsh=1 %t.out + +#include +#include +#include + +#include +#include + +// Uncomment to print additional test information +// #define VERBOSE_PRINT + +class sample_host_usm_image_kernel; + +int main() { + + sycl::device dev; + sycl::queue q(dev); + auto ctxt = q.get_context(); + + // declare image data + size_t width = 32; + size_t widthInBytes = width * sizeof(float); + std::vector out(width); + std::vector expected(width); + for (int i = 0; i < width; ++i) { + expected[i] = static_cast(i); + } + + try { + sycl::ext::oneapi::experimental::bindless_image_sampler samp( + sycl::addressing_mode::clamp, + sycl::coordinate_normalization_mode::normalized, + sycl::filtering_mode::linear); + + // Extension: image descriptor + sycl::ext::oneapi::experimental::image_descriptor desc( + {width}, 1, sycl::image_channel_type::fp32); + + // Host USM allocation + float *imgMem = sycl::malloc_host(width, ctxt); + + if (imgMem == nullptr) { + std::cerr << "Error allocating host USM!" << std::endl; + return 1; + } + + // Initialize input data + for (int i = 0; i < width; ++i) { + imgMem[i] = static_cast(i); + } + + // Extension: create the image and return the handle + sycl::ext::oneapi::experimental::sampled_image_handle imgHandle = + sycl::ext::oneapi::experimental::create_image(imgMem, 0 /* pitch */, + samp, desc, dev, ctxt); + + sycl::buffer buf((float *)out.data(), sycl::range<1>{width}); + q.submit([&](sycl::handler &cgh) { + auto outAcc = + buf.get_access(cgh, sycl::range<1>{width}); + + cgh.parallel_for( + sycl::nd_range<1>{{width}, {width}}, [=](sycl::nd_item<1> it) { + size_t dim0 = it.get_local_id(0); + + // Normalize coordinates -- +0.5 to look towards centre of pixel + float fdim0 = float(dim0 + 0.5f) / (float)width; + + // Extension: sample image data from handle + float px = sycl::ext::oneapi::experimental::sample_image( + imgHandle, (float)fdim0); + + outAcc[sycl::id<1>{dim0}] = px; + }); + }); + + q.wait_and_throw(); + + // Extension: cleanup + sycl::ext::oneapi::experimental::destroy_image_handle(imgHandle, dev, ctxt); + sycl::free(imgMem, ctxt); + } catch (sycl::exception e) { + std::cerr << "SYCL exception caught! : " << e.what() << "\n"; + return 1; + } catch (...) { + std::cerr << "Unknown exception caught!\n"; + return 2; + } + + // collect and validate output + bool validated = true; + for (int i = 0; i < width; i++) { + bool mismatch = false; + if (out[i] != expected[i]) { + mismatch = true; + validated = false; + } + + if (mismatch) { +#ifdef VERBOSE_PRINT + std::cout << "Result mismatch! Expected: " << expected[i] + << ", Actual: " << out[i] << std::endl; +#else + break; +#endif + } + } + if (validated) { + std::cout << "Test passed!" << std::endl; + return 0; + } + + std::cout << "Test failed!" << std::endl; + return 3; +} diff --git a/sycl/test/abi/sycl_symbols_linux.dump b/sycl/test/abi/sycl_symbols_linux.dump index d16f2d2b7a13..d617ead2079d 100644 --- a/sycl/test/abi/sycl_symbols_linux.dump +++ b/sycl/test/abi/sycl_symbols_linux.dump @@ -2989,7 +2989,14 @@ _ZN4sycl3_V13ext5intel12experimental9pipe_base13get_pipe_nameB5cxx11EPKv _ZN4sycl3_V13ext5intel12experimental9pipe_base17wait_non_blockingERKNS0_5eventE _ZN4sycl3_V13ext5intel12experimental9pipe_base18get_pipe_name_implEPKv _ZN4sycl3_V13ext6oneapi10level_zero6detail11make_deviceERKNS0_8platformEm +_ZN4sycl3_V13ext6oneapi12experimental10async_freeERKNS0_5queueEPvRKNS0_6detail13code_locationE +_ZN4sycl3_V13ext6oneapi12experimental10async_freeERNS0_7handlerEPv _ZN4sycl3_V13ext6oneapi12experimental10mem_adviseENS0_5queueEPvmiRKNS0_6detail13code_locationE +_ZN4sycl3_V13ext6oneapi12experimental11memory_pool21increase_threshold_toEm +_ZN4sycl3_V13ext6oneapi12experimental11memory_poolC1ERKNS0_7contextERKNS0_6deviceENS0_3usm5allocERKNS0_13property_listE +_ZN4sycl3_V13ext6oneapi12experimental11memory_poolC2ERKNS0_7contextERKNS0_6deviceENS0_3usm5allocERKNS0_13property_listE +_ZN4sycl3_V13ext6oneapi12experimental12async_mallocERKNS0_5queueENS0_3usm5allocEmRKNS0_6detail13code_locationE +_ZN4sycl3_V13ext6oneapi12experimental12async_mallocERNS0_7handlerENS0_3usm5allocEm _ZN4sycl3_V13ext6oneapi12experimental12create_imageENS3_16image_mem_handleERKNS3_16image_descriptorERKNS0_5queueE _ZN4sycl3_V13ext6oneapi12experimental12create_imageENS3_16image_mem_handleERKNS3_16image_descriptorERKNS0_6deviceERKNS0_7contextE _ZN4sycl3_V13ext6oneapi12experimental12create_imageENS3_16image_mem_handleERKNS3_22bindless_image_samplerERKNS3_16image_descriptorERKNS0_5queueE @@ -3026,6 +3033,8 @@ _ZN4sycl3_V13ext6oneapi12experimental21dynamic_command_group16set_active_indexEm _ZN4sycl3_V13ext6oneapi12experimental21dynamic_command_groupC1ERKNS3_13command_graphILNS3_11graph_stateE0EEERKSt6vectorISt8functionIFvRNS0_7handlerEEESaISF_EE _ZN4sycl3_V13ext6oneapi12experimental21dynamic_command_groupC2ERKNS3_13command_graphILNS3_11graph_stateE0EEERKSt6vectorISt8functionIFvRNS0_7handlerEEESaISF_EE _ZN4sycl3_V13ext6oneapi12experimental21get_composite_devicesEv +_ZN4sycl3_V13ext6oneapi12experimental22async_malloc_from_poolERKNS0_5queueEmRKNS3_11memory_poolERKNS0_6detail13code_locationE +_ZN4sycl3_V13ext6oneapi12experimental22async_malloc_from_poolERNS0_7handlerEmRKNS3_11memory_poolE _ZN4sycl3_V13ext6oneapi12experimental22get_image_channel_typeENS3_16image_mem_handleERKNS0_5queueE _ZN4sycl3_V13ext6oneapi12experimental22get_image_channel_typeENS3_16image_mem_handleERKNS0_6deviceERKNS0_7contextE _ZN4sycl3_V13ext6oneapi12experimental22get_image_num_channelsENS3_16image_mem_handleERKNS0_5queueE @@ -3621,6 +3630,13 @@ _ZNK4sycl3_V114interop_handle22ext_codeplay_has_graphEv _ZNK4sycl3_V115device_selector13select_deviceEv _ZNK4sycl3_V116default_selectorclERKNS0_6deviceE _ZNK4sycl3_V120accelerator_selectorclERKNS0_6deviceE +_ZNK4sycl3_V13ext6oneapi12experimental11memory_pool10get_deviceEv +_ZNK4sycl3_V13ext6oneapi12experimental11memory_pool11getPropListEv +_ZNK4sycl3_V13ext6oneapi12experimental11memory_pool11get_contextEv +_ZNK4sycl3_V13ext6oneapi12experimental11memory_pool13get_thresholdEv +_ZNK4sycl3_V13ext6oneapi12experimental11memory_pool14get_alloc_kindEv +_ZNK4sycl3_V13ext6oneapi12experimental11memory_pool21get_used_size_currentEv +_ZNK4sycl3_V13ext6oneapi12experimental11memory_pool25get_reserved_size_currentEv _ZNK4sycl3_V13ext6oneapi12experimental12physical_mem10get_deviceEv _ZNK4sycl3_V13ext6oneapi12experimental12physical_mem11get_contextEv _ZNK4sycl3_V13ext6oneapi12experimental12physical_mem3mapEmmNS3_19address_access_modeEm @@ -3973,21 +3989,21 @@ _ZNK4sycl3_V16kernel16get_backend_infoINS0_4info6device15backend_versionEEENS0_6 _ZNK4sycl3_V16kernel16get_backend_infoINS0_4info6device7versionEEENS0_6detail20is_backend_info_descIT_E11return_typeEv _ZNK4sycl3_V16kernel16get_backend_infoINS0_4info8platform7versionEEENS0_6detail20is_backend_info_descIT_E11return_typeEv _ZNK4sycl3_V16kernel17get_kernel_bundleEv +_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific14num_sub_groupsEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi1EEE +_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific14num_sub_groupsEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi2EEE +_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific14num_sub_groupsEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi3EEE +_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific18max_sub_group_sizeEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi1EEE +_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific18max_sub_group_sizeEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi2EEE +_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific18max_sub_group_sizeEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi3EEE _ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific19max_num_work_groupsEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi1EEEm _ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific19max_num_work_groupsEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi2EEEm _ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific19max_num_work_groupsEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi3EEEm -_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific23max_num_work_group_syncEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueE -_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific23max_num_work_group_syncEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi3EEEm _ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific19max_work_group_sizeEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueE -_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific19max_work_item_sizesILi3EEEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueE -_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific18max_sub_group_sizeEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi1EEE -_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific14num_sub_groupsEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi3EEE _ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific19max_work_item_sizesILi1EEEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueE -_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific18max_sub_group_sizeEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi2EEE _ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific19max_work_item_sizesILi2EEEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueE -_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific14num_sub_groupsEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi1EEE -_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific14num_sub_groupsEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi2EEE -_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific18max_sub_group_sizeEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi3EEE +_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific19max_work_item_sizesILi3EEEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueE +_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific23max_num_work_group_syncEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueE +_ZNK4sycl3_V16kernel19ext_oneapi_get_infoINS0_3ext6oneapi12experimental4info21kernel_queue_specific23max_num_work_group_syncEEENS0_6detail34is_kernel_queue_specific_info_descIT_E11return_typeENS0_5queueERKNS0_5rangeILi3EEEm _ZNK4sycl3_V16kernel3getEv _ZNK4sycl3_V16kernel8get_infoINS0_3ext5intel4info22kernel_device_specific17spill_memory_sizeEEENS0_6detail35is_kernel_device_specific_info_descIT_E11return_typeERKNS0_6deviceE _ZNK4sycl3_V16kernel8get_infoINS0_4info22kernel_device_specific15work_group_sizeEEENS0_6detail35is_kernel_device_specific_info_descIT_E11return_typeERKNS0_6deviceE @@ -4016,6 +4032,8 @@ _ZNK4sycl3_V17context12get_platformEv _ZNK4sycl3_V17context16get_backend_infoINS0_4info6device15backend_versionEEENS0_6detail20is_backend_info_descIT_E11return_typeEv _ZNK4sycl3_V17context16get_backend_infoINS0_4info6device7versionEEENS0_6detail20is_backend_info_descIT_E11return_typeEv _ZNK4sycl3_V17context16get_backend_infoINS0_4info8platform7versionEEENS0_6detail20is_backend_info_descIT_E11return_typeEv +_ZNK4sycl3_V17context34ext_oneapi_get_default_memory_poolENS0_3usm5allocE +_ZNK4sycl3_V17context34ext_oneapi_get_default_memory_poolERKNS0_6deviceENS0_3usm5allocE _ZNK4sycl3_V17context3getEv _ZNK4sycl3_V17context8get_infoINS0_4info7context15reference_countEEENS0_6detail20is_context_info_descIT_E11return_typeEv _ZNK4sycl3_V17context8get_infoINS0_4info7context31atomic_fence_order_capabilitiesEEENS0_6detail20is_context_info_descIT_E11return_typeEv diff --git a/sycl/test/abi/sycl_symbols_windows.dump b/sycl/test/abi/sycl_symbols_windows.dump index 20eed583e5e4..cb6bebb417c8 100644 --- a/sycl/test/abi/sycl_symbols_windows.dump +++ b/sycl/test/abi/sycl_symbols_windows.dump @@ -11,21 +11,21 @@ ??$create_sub_devices@$0BAIH@@device@_V1@sycl@@QEBA?AV?$vector@Vdevice@_V1@sycl@@V?$allocator@Vdevice@_V1@sycl@@@std@@@std@@AEBV?$vector@_KV?$allocator@_K@std@@@4@@Z ??$create_sub_devices@$0BAII@@device@_V1@sycl@@QEBA?AV?$vector@Vdevice@_V1@sycl@@V?$allocator@Vdevice@_V1@sycl@@@std@@@std@@W4partition_affinity_domain@info@12@@Z ??$create_sub_devices@$0BAIJ@@device@_V1@sycl@@QEBA?AV?$vector@Vdevice@_V1@sycl@@V?$allocator@Vdevice@_V1@sycl@@@std@@@std@@XZ -??$ext_oneapi_get_info@Umax_work_group_size@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBA_KVqueue@12@@Z ??$ext_oneapi_get_info@U?$max_work_item_sizes@$00@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBA?AV?$id@$00@12@Vqueue@12@@Z -??$ext_oneapi_get_info@Umax_sub_group_size@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$01@12@@Z -??$ext_oneapi_get_info@U?$max_work_item_sizes@$02@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBA?AV?$id@$02@12@Vqueue@12@@Z ??$ext_oneapi_get_info@U?$max_work_item_sizes@$01@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBA?AV?$id@$01@12@Vqueue@12@@Z -??$ext_oneapi_get_info@Umax_sub_group_size@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$00@12@@Z -??$ext_oneapi_get_info@Unum_sub_groups@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$01@12@@Z -??$ext_oneapi_get_info@Unum_sub_groups@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$00@12@@Z -??$ext_oneapi_get_info@Umax_sub_group_size@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$02@12@@Z -??$ext_oneapi_get_info@Unum_sub_groups@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$02@12@@Z +??$ext_oneapi_get_info@U?$max_work_item_sizes@$02@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBA?AV?$id@$02@12@Vqueue@12@@Z ??$ext_oneapi_get_info@Umax_num_work_group_sync@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBA_KVqueue@12@@Z ??$ext_oneapi_get_info@Umax_num_work_group_sync@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBA_KVqueue@12@AEBV?$range@$02@12@_K@Z ??$ext_oneapi_get_info@Umax_num_work_groups@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBA_KVqueue@12@AEBV?$range@$00@12@_K@Z ??$ext_oneapi_get_info@Umax_num_work_groups@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBA_KVqueue@12@AEBV?$range@$01@12@_K@Z ??$ext_oneapi_get_info@Umax_num_work_groups@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBA_KVqueue@12@AEBV?$range@$02@12@_K@Z +??$ext_oneapi_get_info@Umax_sub_group_size@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$00@12@@Z +??$ext_oneapi_get_info@Umax_sub_group_size@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$01@12@@Z +??$ext_oneapi_get_info@Umax_sub_group_size@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$02@12@@Z +??$ext_oneapi_get_info@Umax_work_group_size@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBA_KVqueue@12@@Z +??$ext_oneapi_get_info@Unum_sub_groups@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$00@12@@Z +??$ext_oneapi_get_info@Unum_sub_groups@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$01@12@@Z +??$ext_oneapi_get_info@Unum_sub_groups@kernel_queue_specific@info@experimental@oneapi@ext@_V1@sycl@@@kernel@_V1@sycl@@QEBAIVqueue@12@AEBV?$range@$02@12@@Z ??$get_backend_info@Ubackend_version@device@info@_V1@sycl@@@context@_V1@sycl@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ ??$get_backend_info@Ubackend_version@device@info@_V1@sycl@@@device@_V1@sycl@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ ??$get_backend_info@Ubackend_version@device@info@_V1@sycl@@@event@_V1@sycl@@QEBA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ @@ -355,12 +355,6 @@ ??0dynamic_parameter_base@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@$$QEAV0123456@@Z ??0dynamic_parameter_base@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBV0123456@@Z ??0dynamic_parameter_base@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@V?$command_graph@$0A@@23456@_KPEBX@Z -??4?$hash@Vdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@AEBU01@@Z -??4?$hash@Vdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@$$QEAU01@@Z -??R?$hash@Vdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@std@@QEBA_KAEBVdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@Z -??R?$hash@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@QEBA_KAEBVnode@experimental@oneapi@ext@_V1@sycl@@@Z -??4?$hash@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@$$QEAU01@@Z -??4?$hash@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@AEBU01@@Z ??0event@_V1@sycl@@AEAA@V?$shared_ptr@Vevent_impl@detail@_V1@sycl@@@std@@@Z ??0event@_V1@sycl@@QEAA@$$QEAV012@@Z ??0event@_V1@sycl@@QEAA@AEBV012@@Z @@ -440,6 +434,13 @@ ??0kernel_id@_V1@sycl@@AEAA@PEBD@Z ??0kernel_id@_V1@sycl@@QEAA@$$QEAV012@@Z ??0kernel_id@_V1@sycl@@QEAA@AEBV012@@Z +??0memory_pool@experimental@oneapi@ext@_V1@sycl@@IEAA@V?$shared_ptr@Vmemory_pool_impl@detail@experimental@oneapi@ext@_V1@sycl@@@std@@@Z +??0memory_pool@experimental@oneapi@ext@_V1@sycl@@QEAA@$$QEAV012345@@Z +??0memory_pool@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBV012345@@Z +??0memory_pool@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBVcontext@45@AEBVdevice@45@W4alloc@usm@45@AEBVproperty_list@45@@Z +??0memory_pool@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBVcontext@45@PEAX_KAEBVproperty_list@45@@Z +??0memory_pool@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBVcontext@45@W4alloc@usm@45@AEBVproperty_list@45@@Z +??0memory_pool@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBVqueue@45@W4alloc@usm@45@AEBVproperty_list@45@@Z ??0modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@IEAA@AEBV?$shared_ptr@Vgraph_impl@detail@experimental@oneapi@ext@_V1@sycl@@@std@@@Z ??0modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@$$QEAV0123456@@Z ??0modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@AEBV0123456@@Z @@ -515,6 +516,7 @@ ??1kernel@_V1@sycl@@QEAA@XZ ??1kernel_bundle_plain@detail@_V1@sycl@@QEAA@XZ ??1kernel_id@_V1@sycl@@QEAA@XZ +??1memory_pool@experimental@oneapi@ext@_V1@sycl@@QEAA@XZ ??1modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAA@XZ ??1node@experimental@oneapi@ext@_V1@sycl@@QEAA@XZ ??1physical_mem@experimental@oneapi@ext@_V1@sycl@@QEAA@XZ @@ -545,6 +547,10 @@ ??4?$OwnerLessBase@Vqueue@_V1@sycl@@@detail@_V1@sycl@@QEAAAEAV0123@AEBV0123@@Z ??4?$OwnerLessBase@Vstream@_V1@sycl@@@detail@_V1@sycl@@QEAAAEAV0123@$$QEAV0123@@Z ??4?$OwnerLessBase@Vstream@_V1@sycl@@@detail@_V1@sycl@@QEAAAEAV0123@AEBV0123@@Z +??4?$hash@Vdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@$$QEAU01@@Z +??4?$hash@Vdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@AEBU01@@Z +??4?$hash@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@$$QEAU01@@Z +??4?$hash@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@QEAAAEAU01@AEBU01@@Z ??4?$hash@Vqueue@_V1@sycl@@@std@@QEAAAEAU01@$$QEAU01@@Z ??4?$hash@Vqueue@_V1@sycl@@@std@@QEAAAEAU01@AEBU01@@Z ??4AccessorBaseHost@detail@_V1@sycl@@QEAAAEAV0123@$$QEAV0123@@Z @@ -605,6 +611,8 @@ ??4kernel_bundle_plain@detail@_V1@sycl@@QEAAAEAV0123@AEBV0123@@Z ??4kernel_id@_V1@sycl@@QEAAAEAV012@$$QEAV012@@Z ??4kernel_id@_V1@sycl@@QEAAAEAV012@AEBV012@@Z +??4memory_pool@experimental@oneapi@ext@_V1@sycl@@QEAAAEAV012345@$$QEAV012345@@Z +??4memory_pool@experimental@oneapi@ext@_V1@sycl@@QEAAAEAV012345@AEBV012345@@Z ??4modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAAAEAV0123456@$$QEAV0123456@@Z ??4modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAAAEAV0123456@AEBV0123456@@Z ??4node@experimental@oneapi@ext@_V1@sycl@@QEAAAEAV012345@$$QEAV012345@@Z @@ -628,6 +636,7 @@ ??8kernel@_V1@sycl@@QEBA_NAEBV012@@Z ??8kernel_bundle_plain@detail@_V1@sycl@@QEBA_NAEBV0123@@Z ??8kernel_id@_V1@sycl@@QEBA_NAEBV012@@Z +??8memory_pool@experimental@oneapi@ext@_V1@sycl@@QEBA_NAEBV012345@@Z ??8physical_mem@experimental@oneapi@ext@_V1@sycl@@QEBA_NAEBV012345@@Z ??8platform@_V1@sycl@@QEBA_NAEBV012@@Z ??8queue@_V1@sycl@@QEBA_NAEBV012@@Z @@ -641,11 +650,14 @@ ??9kernel@_V1@sycl@@QEBA_NAEBV012@@Z ??9kernel_bundle_plain@detail@_V1@sycl@@QEBA_NAEBV0123@@Z ??9kernel_id@_V1@sycl@@QEBA_NAEBV012@@Z +??9memory_pool@experimental@oneapi@ext@_V1@sycl@@QEBA_NAEBV012345@@Z ??9physical_mem@experimental@oneapi@ext@_V1@sycl@@QEBA_NAEBV012345@@Z ??9platform@_V1@sycl@@QEBA_NAEBV012@@Z ??9queue@_V1@sycl@@QEBA_NAEBV012@@Z ??9sampler@_V1@sycl@@QEBA_NAEBV012@@Z ??9stream@_V1@sycl@@QEBA_NAEBV012@@Z +??R?$hash@Vdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@std@@QEBA_KAEBVdynamic_command_group@experimental@oneapi@ext@_V1@sycl@@@Z +??R?$hash@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@QEBA_KAEBVnode@experimental@oneapi@ext@_V1@sycl@@@Z ??R?$hash@Vqueue@_V1@sycl@@@std@@QEBA_KAEBVqueue@_V1@sycl@@@Z ??Raccelerator_selector@_V1@sycl@@UEBAHAEBVdevice@12@@Z ??Rcpu_selector@_V1@sycl@@UEBAHAEBVdevice@12@@Z @@ -3764,6 +3776,12 @@ ?associateWithHandler@handler@_V1@sycl@@AEAAXPEAVSampledImageAccessorBaseHost@detail@23@W4image_target@23@@Z ?associateWithHandler@handler@_V1@sycl@@AEAAXPEAVUnsampledImageAccessorBaseHost@detail@23@W4image_target@23@@Z ?associateWithHandlerCommon@handler@_V1@sycl@@AEAAXV?$shared_ptr@VAccessorImplHost@detail@_V1@sycl@@@std@@H@Z +?async_free@experimental@oneapi@ext@_V1@sycl@@YAXAEAVhandler@45@PEAX@Z +?async_free@experimental@oneapi@ext@_V1@sycl@@YAXAEBVqueue@45@PEAXAEBUcode_location@detail@45@@Z +?async_malloc@experimental@oneapi@ext@_V1@sycl@@YAPEAXAEAVhandler@45@W4alloc@usm@45@_K@Z +?async_malloc@experimental@oneapi@ext@_V1@sycl@@YAPEAXAEBVqueue@45@W4alloc@usm@45@_KAEBUcode_location@detail@45@@Z +?async_malloc_from_pool@experimental@oneapi@ext@_V1@sycl@@YAPEAXAEAVhandler@45@_KAEBVmemory_pool@12345@@Z +?async_malloc_from_pool@experimental@oneapi@ext@_V1@sycl@@YAPEAXAEBVqueue@45@_KAEBVmemory_pool@12345@AEBUcode_location@detail@45@@Z ?begin@exception_list@_V1@sycl@@QEBA?AV?$_Vector_const_iterator@V?$_Vector_val@U?$_Simple_types@Vexception_ptr@std@@@std@@@std@@@std@@XZ ?begin@kernel_bundle_plain@detail@_V1@sycl@@IEBAPEBVdevice_image_plain@234@XZ ?begin_recording@modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAAXAEAVqueue@67@AEBVproperty_list@67@@Z @@ -3814,6 +3832,7 @@ ?end_recording@modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAAXAEBV?$vector@Vqueue@_V1@sycl@@V?$allocator@Vqueue@_V1@sycl@@@std@@@std@@@Z ?end_recording@modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEAAXXZ ?eventNeeded@handler@_V1@sycl@@AEBA_NXZ +?ext_codeplay_has_graph@interop_handle@_V1@sycl@@QEBA_NXZ ?ext_codeplay_supports_fusion@queue@_V1@sycl@@QEBA_NXZ ?ext_intel_read_host_pipe@handler@_V1@sycl@@AEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@PEAX_K_N@Z ?ext_intel_read_host_pipe@handler@_V1@sycl@@AEAAXVstring_view@detail@23@PEAX_K_N@Z @@ -3887,11 +3906,12 @@ ?ext_oneapi_empty@queue@_V1@sycl@@QEBA_NXZ ?ext_oneapi_enable_peer_access@device@_V1@sycl@@QEAAXAEBV123@@Z ?ext_oneapi_fill2d_impl@handler@_V1@sycl@@AEAAXPEAX_KPEBX111@Z -?ext_oneapi_get_backend_impl@device_image_plain@detail@_V1@sycl@@IEBA?AW4backend@34@XZ ?ext_oneapi_get_backend_content_view_impl@device_image_plain@detail@_V1@sycl@@IEBA?AU?$pair@PEBW4byte@std@@PEBW412@@std@@XZ +?ext_oneapi_get_backend_impl@device_image_plain@detail@_V1@sycl@@IEBA?AW4backend@34@XZ ?ext_oneapi_get_composite_devices@platform@_V1@sycl@@QEBA?AV?$vector@Vdevice@_V1@sycl@@V?$allocator@Vdevice@_V1@sycl@@@std@@@std@@XZ ?ext_oneapi_get_default_context@platform@_V1@sycl@@QEBA?AVcontext@23@XZ -?khr_get_default_context@platform@_V1@sycl@@QEBA?AVcontext@23@XZ +?ext_oneapi_get_default_memory_pool@context@_V1@sycl@@QEBA?AVmemory_pool@experimental@oneapi@ext@23@AEBVdevice@23@W4alloc@usm@23@@Z +?ext_oneapi_get_default_memory_pool@context@_V1@sycl@@QEBA?AVmemory_pool@experimental@oneapi@ext@23@W4alloc@usm@23@@Z ?ext_oneapi_get_device_global_address@kernel_bundle_plain@detail@_V1@sycl@@AEAAPEAXVstring_view@234@AEBVdevice@34@@Z ?ext_oneapi_get_device_global_address@kernel_bundle_plain@detail@_V1@sycl@@QEAAPEAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@AEBVdevice@34@@Z ?ext_oneapi_get_device_global_size@kernel_bundle_plain@detail@_V1@sycl@@AEAA_KVstring_view@234@@Z @@ -4023,11 +4043,10 @@ ?getNative@queue@_V1@sycl@@QEBA_KAEAH@Z ?getNativeContext@interop_handle@_V1@sycl@@AEBA_KXZ ?getNativeDevice@interop_handle@_V1@sycl@@AEBA_KXZ +?getNativeGraph@interop_handle@_V1@sycl@@AEBA_KXZ ?getNativeImpl@kernel@_V1@sycl@@AEBA_KXZ ?getNativeMem@interop_handle@_V1@sycl@@AEBA_KPEAVAccessorImplHost@detail@23@@Z ?getNativeQueue@interop_handle@_V1@sycl@@AEBA_KAEAH@Z -?getNativeGraph@interop_handle@_V1@sycl@@AEBA_KXZ -?ext_codeplay_has_graph@interop_handle@_V1@sycl@@QEBA_NXZ ?getNativeVector@buffer_plain@detail@_V1@sycl@@IEBA?AV?$vector@_KV?$allocator@_K@std@@@std@@W4backend@34@@Z ?getNativeVector@event@_V1@sycl@@AEBA?AV?$vector@_KV?$allocator@_K@std@@@std@@XZ ?getNumOfDims@LocalAccessorBaseHost@detail@_V1@sycl@@QEAAHXZ @@ -4048,6 +4067,7 @@ ?getPropList@buffer_plain@detail@_V1@sycl@@IEBAAEBVproperty_list@34@XZ ?getPropList@context@_V1@sycl@@AEBAAEBVproperty_list@23@XZ ?getPropList@image_plain@detail@_V1@sycl@@IEBAAEBVproperty_list@34@XZ +?getPropList@memory_pool@experimental@oneapi@ext@_V1@sycl@@IEBAAEBVproperty_list@56@XZ ?getPropList@queue@_V1@sycl@@AEBAAEBVproperty_list@23@XZ ?getPropList@sampler@_V1@sycl@@AEBAAEBVproperty_list@23@XZ ?getPropList@stream@_V1@sycl@@AEBAAEBVproperty_list@23@XZ @@ -4074,6 +4094,7 @@ ?get_access_mode@experimental@oneapi@ext@_V1@sycl@@YA?AW4address_access_mode@12345@PEBX_KAEBVcontext@45@@Z ?get_active_index@dynamic_command_group@experimental@oneapi@ext@_V1@sycl@@QEBA_KXZ ?get_addressing_mode@sampler@_V1@sycl@@QEBA?AW4addressing_mode@23@XZ +?get_alloc_kind@memory_pool@experimental@oneapi@ext@_V1@sycl@@QEBA?AW4alloc@usm@56@XZ ?get_allocator_internal@buffer_plain@detail@_V1@sycl@@IEBAAEBV?$unique_ptr@VSYCLMemObjAllocator@detail@_V1@sycl@@U?$default_delete@VSYCLMemObjAllocator@detail@_V1@sycl@@@std@@@std@@XZ ?get_allocator_internal@image_plain@detail@_V1@sycl@@IEBAAEBV?$unique_ptr@VSYCLMemObjAllocator@detail@_V1@sycl@@U?$default_delete@VSYCLMemObjAllocator@detail@_V1@sycl@@@std@@@std@@XZ ?get_backend@context@_V1@sycl@@QEBA?AW4backend@23@XZ @@ -4091,12 +4112,14 @@ ?get_context@image_mem@experimental@oneapi@ext@_V1@sycl@@QEBA?AVcontext@56@XZ ?get_context@kernel@_V1@sycl@@QEBA?AVcontext@23@XZ ?get_context@kernel_bundle_plain@detail@_V1@sycl@@QEBA?AVcontext@34@XZ +?get_context@memory_pool@experimental@oneapi@ext@_V1@sycl@@QEBA?AVcontext@56@XZ ?get_context@physical_mem@experimental@oneapi@ext@_V1@sycl@@QEBA?AVcontext@56@XZ ?get_context@queue@_V1@sycl@@QEBA?AVcontext@23@XZ ?get_coordinate_normalization_mode@sampler@_V1@sycl@@QEBA?AW4coordinate_normalization_mode@23@XZ ?get_count@image_plain@detail@_V1@sycl@@IEBA_KXZ ?get_descriptor@image_mem@experimental@oneapi@ext@_V1@sycl@@QEBAAEBUimage_descriptor@23456@XZ ?get_device@image_mem@experimental@oneapi@ext@_V1@sycl@@QEBA?AVdevice@56@XZ +?get_device@memory_pool@experimental@oneapi@ext@_V1@sycl@@QEBA?AVdevice@56@XZ ?get_device@physical_mem@experimental@oneapi@ext@_V1@sycl@@QEBA?AVdevice@56@XZ ?get_device@queue@_V1@sycl@@QEBA?AVdevice@23@XZ ?get_devices@context@_V1@sycl@@QEBA?AV?$vector@Vdevice@_V1@sycl@@V?$allocator@Vdevice@_V1@sycl@@@std@@@std@@XZ @@ -4144,14 +4167,17 @@ ?get_queue@fusion_wrapper@experimental@codeplay@ext@_V1@sycl@@QEBA?AVqueue@56@XZ ?get_range@image_mem@experimental@oneapi@ext@_V1@sycl@@QEBA?AV?$range@$02@56@XZ ?get_range@image_plain@detail@_V1@sycl@@IEBA?AV?$range@$02@34@XZ +?get_reserved_size_current@memory_pool@experimental@oneapi@ext@_V1@sycl@@QEBA_KXZ ?get_root_nodes@modifiable_command_graph@detail@experimental@oneapi@ext@_V1@sycl@@QEBA?AV?$vector@Vnode@experimental@oneapi@ext@_V1@sycl@@V?$allocator@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@@std@@XZ ?get_size@image_plain@detail@_V1@sycl@@IEBA_KXZ ?get_size@stream@_V1@sycl@@QEBA_KXZ ?get_specialization_constant_impl@kernel_bundle_plain@detail@_V1@sycl@@IEBAXPEBDPEAX@Z ?get_stream_mode@stream@_V1@sycl@@QEBA?AW4stream_manipulator@23@XZ ?get_successors@node@experimental@oneapi@ext@_V1@sycl@@QEBA?AV?$vector@Vnode@experimental@oneapi@ext@_V1@sycl@@V?$allocator@Vnode@experimental@oneapi@ext@_V1@sycl@@@std@@@std@@XZ +?get_threshold@memory_pool@experimental@oneapi@ext@_V1@sycl@@QEBA_KXZ ?get_type@image_mem@experimental@oneapi@ext@_V1@sycl@@QEBA?AW4image_type@23456@XZ ?get_type@node@experimental@oneapi@ext@_V1@sycl@@QEBA?AW4node_type@23456@XZ +?get_used_size_current@memory_pool@experimental@oneapi@ext@_V1@sycl@@QEBA_KXZ ?get_wait_list@event@_V1@sycl@@QEAA?AV?$vector@Vevent@_V1@sycl@@V?$allocator@Vevent@_V1@sycl@@@std@@@std@@XZ ?get_width@stream@_V1@sycl@@QEBA_KXZ ?get_work_item_buffer_size@stream@_V1@sycl@@QEBA_KXZ @@ -4175,6 +4201,7 @@ ?has_kernel_bundle_impl@detail@_V1@sycl@@YA_NAEBVcontext@23@AEBV?$vector@Vdevice@_V1@sycl@@V?$allocator@Vdevice@_V1@sycl@@@std@@@std@@AEBV?$vector@Vkernel_id@_V1@sycl@@V?$allocator@Vkernel_id@_V1@sycl@@@std@@@6@W4bundle_state@23@@Z ?has_kernel_bundle_impl@detail@_V1@sycl@@YA_NAEBVcontext@23@AEBV?$vector@Vdevice@_V1@sycl@@V?$allocator@Vdevice@_V1@sycl@@@std@@@std@@W4bundle_state@23@@Z ?has_specialization_constant_impl@kernel_bundle_plain@detail@_V1@sycl@@IEBA_NPEBD@Z +?increase_threshold_to@memory_pool@experimental@oneapi@ext@_V1@sycl@@QEAAX_K@Z ?internalProfilingTagImpl@handler@_V1@sycl@@AEAAXXZ ?isBackendSupportedFillSize@handler@_V1@sycl@@CA_N_K@Z ?isConstOrGlobal@handler@_V1@sycl@@CA_NW4target@access@23@@Z @@ -4198,6 +4225,7 @@ ?is_source_kernel_bundle_supported@detail@experimental@oneapi@ext@_V1@sycl@@YA_NW4backend@56@W4source_language@23456@@Z ?is_specialization_constant_set@kernel_bundle_plain@detail@_V1@sycl@@IEBA_NPEBD@Z ?join_impl@detail@_V1@sycl@@YA?AV?$shared_ptr@Vkernel_bundle_impl@detail@_V1@sycl@@@std@@AEBV?$vector@V?$shared_ptr@Vkernel_bundle_impl@detail@_V1@sycl@@@std@@V?$allocator@V?$shared_ptr@Vkernel_bundle_impl@detail@_V1@sycl@@@std@@@2@@5@W4bundle_state@23@@Z +?khr_get_default_context@platform@_V1@sycl@@QEBA?AVcontext@23@XZ ?lgamma_r_impl@detail@_V1@sycl@@YA?AVhalf@half_impl@123@V45123@PEAH@Z ?lgamma_r_impl@detail@_V1@sycl@@YAMMPEAH@Z ?lgamma_r_impl@detail@_V1@sycl@@YANNPEAH@Z diff --git a/sycl/test/include_deps/sycl_accessor.hpp.cpp b/sycl/test/include_deps/sycl_accessor.hpp.cpp index 3105135fe054..af86805dc146 100644 --- a/sycl/test/include_deps/sycl_accessor.hpp.cpp +++ b/sycl/test/include_deps/sycl_accessor.hpp.cpp @@ -86,5 +86,6 @@ // CHECK-NEXT: detail/string_view.hpp // CHECK-NEXT: detail/util.hpp // CHECK-NEXT: device_selector.hpp +// CHECK-NEXT: usm/usm_enums.hpp // CHECK-NEXT: properties/buffer_properties.def // CHECK-EMPTY: diff --git a/sycl/test/include_deps/sycl_detail_core.hpp.cpp b/sycl/test/include_deps/sycl_detail_core.hpp.cpp index e1aaefbf594d..f0573a71d825 100644 --- a/sycl/test/include_deps/sycl_detail_core.hpp.cpp +++ b/sycl/test/include_deps/sycl_detail_core.hpp.cpp @@ -87,6 +87,7 @@ // CHECK-NEXT: detail/string_view.hpp // CHECK-NEXT: detail/util.hpp // CHECK-NEXT: device_selector.hpp +// CHECK-NEXT: usm/usm_enums.hpp // CHECK-NEXT: properties/buffer_properties.def // CHECK-NEXT: queue.hpp // CHECK-NEXT: detail/assert_happened.hpp diff --git a/sycl/test/include_deps/update_test.sh b/sycl/test/include_deps/update_test.sh old mode 100644 new mode 100755 diff --git a/sycl/test/self-contained-headers/lit.local.cfg b/sycl/test/self-contained-headers/lit.local.cfg index d61551742dd8..9641fdb48839 100644 --- a/sycl/test/self-contained-headers/lit.local.cfg +++ b/sycl/test/self-contained-headers/lit.local.cfg @@ -7,9 +7,6 @@ config.test_format = SYCLHeadersTest() # standalone. `os.path.join` is required here so the filtering works # cross-platform config.sycl_headers_xfail = [ - os.path.join( - "sycl", "ext", "oneapi", "experimental", "backend", "cuda.hpp" - ), os.path.join( "sycl", "ext", "intel", "esimd", "detail", "types_elementary.hpp" ), diff --git a/sycl/test/self-contained-headers/sycl/ext/oneapi/experimental/backend/cuda.hpp.cpp b/sycl/test/self-contained-headers/sycl/ext/oneapi/experimental/backend/cuda.hpp.cpp new file mode 100644 index 000000000000..09a56af7faa7 --- /dev/null +++ b/sycl/test/self-contained-headers/sycl/ext/oneapi/experimental/backend/cuda.hpp.cpp @@ -0,0 +1,9 @@ +// RUN: %clangxx -fsycl -fsyntax-only -Xclang -verify %s +// expected-no-diagnostics +// +// Check that the experimental CUDA interop header doesn't have any warnings. +// This is a special test because this header requires a specific macro to be +// set when it is included. + +#define SYCL_EXT_ONEAPI_BACKEND_CUDA_EXPERIMENTAL +#include diff --git a/sycl/tools/sycl-trace/CMakeLists.txt b/sycl/tools/sycl-trace/CMakeLists.txt index b45ae195b290..d0ee6a98a0d9 100644 --- a/sycl/tools/sycl-trace/CMakeLists.txt +++ b/sycl/tools/sycl-trace/CMakeLists.txt @@ -175,5 +175,4 @@ install(TARGETS sycl-trace sycl_ur_trace_collector ${EXTRA_TARGETS_TO_INSTALL} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT sycl-trace LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT sycl-trace ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT sycl-trace -) - +) \ No newline at end of file diff --git a/sycl/unittests/Extensions/CMakeLists.txt b/sycl/unittests/Extensions/CMakeLists.txt index e1788eaa6e89..b415ae27dbfa 100644 --- a/sycl/unittests/Extensions/CMakeLists.txt +++ b/sycl/unittests/Extensions/CMakeLists.txt @@ -29,3 +29,4 @@ add_subdirectory(VirtualFunctions) add_subdirectory(VirtualMemory) add_subdirectory(NumComputeUnits) add_subdirectory(FreeFunctionCommands) +add_subdirectory(KernelQueries) diff --git a/sycl/unittests/Extensions/CommandGraph/Common.hpp b/sycl/unittests/Extensions/CommandGraph/Common.hpp index f9c25088a622..9e9551df2632 100644 --- a/sycl/unittests/Extensions/CommandGraph/Common.hpp +++ b/sycl/unittests/Extensions/CommandGraph/Common.hpp @@ -18,6 +18,8 @@ #include +#include + using namespace sycl; using namespace sycl::ext::oneapi; diff --git a/sycl/unittests/Extensions/CommandGraph/Exceptions.cpp b/sycl/unittests/Extensions/CommandGraph/Exceptions.cpp index ddb9236e5047..d6977dd3ddbe 100644 --- a/sycl/unittests/Extensions/CommandGraph/Exceptions.cpp +++ b/sycl/unittests/Extensions/CommandGraph/Exceptions.cpp @@ -213,6 +213,115 @@ void addImagesCopies(experimental::detail::modifiable_command_graph &G, } ASSERT_EQ(ExceptionCode, sycl::errc::invalid); } + +/// Tries to add nodes including asynchronous allocation instructions to the +/// graph G. It tests that an invalid exception has been thrown since the +/// sycl_ext_oneapi_async_alloc can not be used along with SYCL Graph. +/// +/// @param G Modifiable graph to add commands to. +/// @param Q Queue to submit nodes to. +/// @param Size Size in bytes to allocate. +/// @param MemPool Memory pool to allocate to. +/// @param Ptr Generic pointer to allocated memory. +template +void addAsyncAlloc(experimental::detail::modifiable_command_graph &G, queue &Q, + size_t Size, + sycl::ext::oneapi::experimental::memory_pool &memPool, + [[maybe_unused]] void *Ptr) { + // simple alloc with specified pool + std::error_code ExceptionCode = make_error_code(sycl::errc::success); + try { + if constexpr (PathKind == OperationPath::RecordReplay) { + Q.submit([&](handler &CGH) { + Ptr = sycl::ext::oneapi::experimental::async_malloc_from_pool(CGH, Size, + memPool); + }); + } + if constexpr (PathKind == OperationPath::Shortcut) { + Ptr = sycl::ext::oneapi::experimental::async_malloc_from_pool(Q, Size, + memPool); + } + if constexpr (PathKind == OperationPath::Explicit) { + G.add([&](handler &CGH) { + Ptr = sycl::ext::oneapi::experimental::async_malloc_from_pool(CGH, Size, + memPool); + }); + } + } catch (exception &Exception) { + ExceptionCode = Exception.code(); + } + + ASSERT_EQ(ExceptionCode, sycl::errc::invalid); +} + +/// Tries to add nodes including asynchronous allocation instructions to the +/// graph G. It tests that an invalid exception has been thrown since the +/// sycl_ext_oneapi_async_alloc can not be used along with SYCL Graph. +/// +/// @param G Modifiable graph to add commands to. +/// @param Q Queue to submit nodes to. +/// @param Size Size in bytes to allocate. +/// @param Ptr Generic pointer to allocated memory. +template +void addAsyncAlloc(experimental::detail::modifiable_command_graph &G, queue &Q, + size_t Size, [[maybe_unused]] void *Ptr) { + // simple alloc + std::error_code ExceptionCode = make_error_code(sycl::errc::success); + try { + if constexpr (PathKind == OperationPath::RecordReplay) { + Q.submit([&](handler &CGH) { + Ptr = sycl::ext::oneapi::experimental::async_malloc( + CGH, sycl::usm::alloc::device, Size); + }); + } + if constexpr (PathKind == OperationPath::Shortcut) { + Ptr = sycl::ext::oneapi::experimental::async_malloc( + Q, sycl::usm::alloc::device, Size); + } + if constexpr (PathKind == OperationPath::Explicit) { + G.add([&](handler &CGH) { + Ptr = sycl::ext::oneapi::experimental::async_malloc( + CGH, sycl::usm::alloc::device, Size); + }); + } + } catch (exception &Exception) { + ExceptionCode = Exception.code(); + } + + ASSERT_EQ(ExceptionCode, sycl::errc::invalid); +} + +/// Tries to add nodes including asynchronous free instructions to the graph G. +/// It tests that an invalid exception has been thrown since the +/// sycl_ext_oneapi_async_alloc can not be used along with SYCL Graph. +/// +/// @param G Modifiable graph to add commands to. +/// @param Q Queue to submit nodes to. +/// @param Ptr Pointer to asynchronously allocated memory to free. +template +void addAsyncFree(experimental::detail::modifiable_command_graph &G, queue &Q, + void *Ptr) { + // simple free + std::error_code ExceptionCode = make_error_code(sycl::errc::success); + try { + if constexpr (PathKind == OperationPath::RecordReplay) { + Q.submit([&](handler &CGH) { + sycl::ext::oneapi::experimental::async_free(CGH, Ptr); + }); + } + if constexpr (PathKind == OperationPath::Shortcut) { + sycl::ext::oneapi::experimental::async_free(Q, Ptr); + } + if constexpr (PathKind == OperationPath::Explicit) { + G.add([&](handler &CGH) { + sycl::ext::oneapi::experimental::async_free(CGH, Ptr); + }); + } + } catch (exception &Exception) { + ExceptionCode = Exception.code(); + } + ASSERT_EQ(ExceptionCode, sycl::errc::invalid); +} } // anonymous namespace TEST_F(CommandGraphTest, ExplicitBarrierException) { @@ -871,3 +980,34 @@ TEST_F(CommandGraphTest, DynamicCommandGroupMismatchAccessorEdges) { experimental::dynamic_command_group DynCG(Graph, {CGFA, CGFB}); ASSERT_THROW(Graph.add(DynCG), sycl::exception); } + +// ext_oneapi_async_alloc isn't currently supported with SYCL graphs +TEST_F(CommandGraphTest, AsyncAllocExceptionCheck) { + auto Context = Queue.get_context(); + auto Device = Queue.get_device(); + + // Create pool + sycl::ext::oneapi::experimental::memory_pool MemPool( + Context, Device, sycl::usm::alloc::device); + + void *Ptr1 = nullptr; + void *Ptr2 = nullptr; + + Graph.begin_recording(Queue); + + addAsyncAlloc(Graph, Queue, 1024, MemPool, Ptr1); + addAsyncAlloc(Graph, Queue, 1024, Ptr2); + + addAsyncFree(Graph, Queue, Ptr1); + addAsyncFree(Graph, Queue, Ptr2); + + Graph.end_recording(); + + void *Ptr3 = nullptr; + void *Ptr4 = nullptr; + addAsyncAlloc(Graph, Queue, 1024, MemPool, Ptr3); + addAsyncAlloc(Graph, Queue, 1024, Ptr4); + + addAsyncFree(Graph, Queue, Ptr3); + addAsyncFree(Graph, Queue, Ptr4); +} diff --git a/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt b/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt new file mode 100644 index 000000000000..0b82e66e73f7 --- /dev/null +++ b/sycl/unittests/Extensions/KernelQueries/CMakeLists.txt @@ -0,0 +1,3 @@ +add_sycl_unittest(KernelQueriesTests OBJECT + SpillMemorySize.cpp +) diff --git a/sycl/unittests/Extensions/KernelQueries/SpillMemorySize.cpp b/sycl/unittests/Extensions/KernelQueries/SpillMemorySize.cpp new file mode 100644 index 000000000000..9ef918908d11 --- /dev/null +++ b/sycl/unittests/Extensions/KernelQueries/SpillMemorySize.cpp @@ -0,0 +1,91 @@ +//==----------------------- SpillMemorySize.cpp ----------------------------==// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +#include +#include +#include +#include +#include +#include + +using namespace sycl; + +namespace { +ur_result_t redefinedKernelGetInfo(void *pParams) { + constexpr size_t DeviceNum = 1; + auto params = *static_cast(pParams); + + if (*params.ppropName == UR_KERNEL_INFO_SPILL_MEM_SIZE) { + if (*params.ppPropValue == nullptr) { + size_t *ResultValuesNumber = + reinterpret_cast(*params.ppPropSizeRet); + *ResultValuesNumber = DeviceNum * sizeof(uint32_t); + } else { + constexpr uint32_t Device2SpillMap[] = {42}; + assert(*params.ppropSize == sizeof(Device2SpillMap)); + + std::memcpy(*params.ppPropValue, Device2SpillMap, + sizeof(Device2SpillMap)); + } + } + return UR_RESULT_SUCCESS; +} +} // namespace + +class KernelQueriesTests : public ::testing::Test { +public: + KernelQueriesTests() + : Mock{}, + Queue{sycl::context(sycl::platform()), sycl::default_selector_v} {} + + inline sycl::kernel GetTestKernel() { + auto KB = sycl::get_kernel_bundle( + Queue.get_context()); + return KB.get_kernel>(); + } + +protected: + void SetUp() override { + mock::getCallbacks().set_after_callback("urKernelGetInfo", + &redefinedKernelGetInfo); + } + + sycl::unittest::UrMock Mock; + sycl::queue Queue; +}; + +TEST(KernelQueriesBasicTests, NoAspect) { + sycl::unittest::UrMock<> Mock; + sycl::queue q{sycl::context(sycl::platform()), sycl::default_selector_v}; + auto KB = + sycl::get_kernel_bundle(q.get_context()); + auto kernel = KB.get_kernel>(); + const auto dev = q.get_device(); + try { + kernel.template get_info< + sycl::ext::intel::info::kernel_device_specific::spill_memory_size>(dev); + FAIL() << "Exception was expected."; + } catch (const sycl::exception &E) { + // Intention of this test is to ensure that whenever a device does not + // expose an aspect required by the query an exception is thrown. + ASSERT_EQ(E.code(), + sycl::make_error_code(sycl::errc::feature_not_supported)); + } +} + +TEST_F(KernelQueriesTests, SpillMemorySize) { + sycl::kernel kernel = GetTestKernel(); + const auto dev = Queue.get_device(); + const auto spillMemSz = kernel.get_info< + sycl::ext::intel::info::kernel_device_specific::spill_memory_size>(dev); + + static_assert(std::is_same_v, size_t>, + "spill_memory_size query must return size_t"); + + EXPECT_EQ(spillMemSz, size_t{42}); +} diff --git a/sycl/unittests/Extensions/KernelQueries/test_plan.md b/sycl/unittests/Extensions/KernelQueries/test_plan.md new file mode 100644 index 000000000000..2f685f8f0c2e --- /dev/null +++ b/sycl/unittests/Extensions/KernelQueries/test_plan.md @@ -0,0 +1,53 @@ +# Test plan for [`sycl ext intel kernel queries`][spec-link] extension + +## Testing scope + +### Device coverage + +The unit tests should be launched on every supported device configuration we +have. + +### Type coverage + +Each query is templated on a single template type argument `Param` +with some queries being template overloads of each other. +Each query has a restriction on the value of `Param` defined +in the relevant section of the spec. +Each `Param` defines a related sycl aspect that signals whether the device +supports it. + +Param must be one of the following types defined in +`sycl::ext::intel::info::kernel_device_specific` namespace: +- `spill_memory_size` + +The tests should cover all of these types. + +## Tests + +### Unit tests + +#### Interface tests + +These tests are intended to check that all classes and methods defined by the +extension have correct implementation, i.e.: right signatures, right return +types, all necessary constraints are checked/enforced, etc. + +These tests should check the following: + +- that each query is not available when the template argument `Param` has + a value different than the one in the spec. +- that each query can be called with the appropriate value for `Param` and the + appropriate argument types as defined by its signature. +- the return types of all queries match the spec. + +Tests in this category may not perform some useful actions to exercise the +extension functionality in full, but instead they are focused on making sure +that all APIs are consistent with respect to other APIs. + +#### Check behavior in the case of unsupported aspects + +Verigy that a synchronous `exception` with the error code +`errc::feature_not_supported` is thrown if an aspect is not supported by the +device. + +[spec-link]: https://github.com/intel/llvm/blob/sycl/sycl/doc/extensions/supported/sycl_ext_intel_kernel_queries.asciidoc diff --git a/unified-runtime/include/ur_api.h b/unified-runtime/include/ur_api.h index 99ef08162eb9..814cdd58413f 100644 --- a/unified-runtime/include/ur_api.h +++ b/unified-runtime/include/ur_api.h @@ -441,8 +441,6 @@ typedef enum ur_function_t { UR_FUNCTION_USM_POOL_CREATE_EXP = 254, /// Enumerator for ::urUSMPoolDestroyExp UR_FUNCTION_USM_POOL_DESTROY_EXP = 255, - /// Enumerator for ::urUSMPoolSetThresholdExp - UR_FUNCTION_USM_POOL_SET_THRESHOLD_EXP = 256, /// Enumerator for ::urUSMPoolGetDefaultDevicePoolExp UR_FUNCTION_USM_POOL_GET_DEFAULT_DEVICE_POOL_EXP = 257, /// Enumerator for ::urUSMPoolSetDevicePoolExp @@ -457,6 +455,8 @@ typedef enum ur_function_t { UR_FUNCTION_COMMAND_BUFFER_APPEND_NATIVE_COMMAND_EXP = 263, /// Enumerator for ::urCommandBufferGetNativeHandleExp UR_FUNCTION_COMMAND_BUFFER_GET_NATIVE_HANDLE_EXP = 264, + /// Enumerator for ::urUSMPoolSetInfoExp + UR_FUNCTION_USM_POOL_SET_INFO_EXP = 265, /// @cond UR_FUNCTION_FORCE_UINT32 = 0x7fffffff /// @endcond @@ -1820,7 +1820,9 @@ typedef struct ur_device_binary_t { typedef enum ur_device_type_t { /// The default device type as preferred by the runtime UR_DEVICE_TYPE_DEFAULT = 1, - /// Devices of all types + /// Devices of all types, for use with ::urDeviceGet() and + /// ::urDeviceGetSelected(). This value will never be returned when + /// querying about a device. UR_DEVICE_TYPE_ALL = 2, /// Graphics Processing Unit UR_DEVICE_TYPE_GPU = 3, @@ -9314,35 +9316,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolDestroyExp( /// [in] handle to USM memory pool to be destroyed ur_usm_pool_handle_t hPool); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Set a new release threshold for a USM memory pool. -/// -/// @details -/// - Set a new release threshold for a USM memory pool. -/// -/// @returns -/// - ::UR_RESULT_SUCCESS -/// - ::UR_RESULT_ERROR_UNINITIALIZED -/// - ::UR_RESULT_ERROR_DEVICE_LOST -/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC -/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `NULL == hContext` -/// + `NULL == hDevice` -/// + `NULL == hPool` -/// - ::UR_RESULT_ERROR_INVALID_VALUE -/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE -/// + If any device associated with `hContext` reports `false` for -/// ::UR_DEVICE_INFO_USM_POOL_SUPPORT -UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolSetThresholdExp( - /// [in] handle of the context object - ur_context_handle_t hContext, - /// [in] handle of the device object - ur_device_handle_t hDevice, - /// [in] handle to USM memory pool for the threshold to be set - ur_usm_pool_handle_t hPool, - /// [in] release threshold to be set - size_t newThreshold); - /////////////////////////////////////////////////////////////////////////////// /// @brief Get the default pool for a device. /// @@ -9390,7 +9363,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `pPropValue == NULL && pPropSizeRet == NULL` -/// - ::UR_RESULT_ERROR_INVALID_DEVICE /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolGetInfoExp( @@ -9403,6 +9375,42 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolGetInfoExp( /// [out][optional] returned query value size size_t *pPropSizeRet); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Set a property for a USM memory pool. +/// +/// @details +/// - Set a property for a USM memory pool. +/// +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_UNINITIALIZED +/// - ::UR_RESULT_ERROR_DEVICE_LOST +/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC +/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `NULL == hPool` +/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION +/// + `::UR_USM_POOL_INFO_USED_HIGH_EXP < propName` +/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER +/// + `NULL == pPropValue` +/// + `pPropValue == NULL` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + If `propName` is not supported by the adapter. +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If any device associated with `hContext` reports `false` for +/// ::UR_DEVICE_INFO_USM_POOL_SUPPORT +/// - ::UR_RESULT_ERROR_INVALID_DEVICE +/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES +/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY +UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolSetInfoExp( + /// [in] handle to USM memory pool for the property to be set + ur_usm_pool_handle_t hPool, + /// [in] setting property name + ur_usm_pool_info_t propName, + /// [in] pointer to value to assign + void *pPropValue, + /// [in] size of value to assign + size_t propSize); + /////////////////////////////////////////////////////////////////////////////// /// @brief Set the current pool for a device. /// @@ -14323,17 +14331,6 @@ typedef struct ur_usm_pool_destroy_exp_params_t { ur_usm_pool_handle_t *phPool; } ur_usm_pool_destroy_exp_params_t; -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function parameters for urUSMPoolSetThresholdExp -/// @details Each entry is a pointer to the parameter passed to the function; -/// allowing the callback the ability to modify the parameter's value -typedef struct ur_usm_pool_set_threshold_exp_params_t { - ur_context_handle_t *phContext; - ur_device_handle_t *phDevice; - ur_usm_pool_handle_t *phPool; - size_t *pnewThreshold; -} ur_usm_pool_set_threshold_exp_params_t; - /////////////////////////////////////////////////////////////////////////////// /// @brief Function parameters for urUSMPoolGetDefaultDevicePoolExp /// @details Each entry is a pointer to the parameter passed to the function; @@ -14355,6 +14352,17 @@ typedef struct ur_usm_pool_get_info_exp_params_t { size_t **ppPropSizeRet; } ur_usm_pool_get_info_exp_params_t; +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function parameters for urUSMPoolSetInfoExp +/// @details Each entry is a pointer to the parameter passed to the function; +/// allowing the callback the ability to modify the parameter's value +typedef struct ur_usm_pool_set_info_exp_params_t { + ur_usm_pool_handle_t *phPool; + ur_usm_pool_info_t *ppropName; + void **ppPropValue; + size_t *ppropSize; +} ur_usm_pool_set_info_exp_params_t; + /////////////////////////////////////////////////////////////////////////////// /// @brief Function parameters for urUSMPoolSetDevicePoolExp /// @details Each entry is a pointer to the parameter passed to the function; diff --git a/unified-runtime/include/ur_api_funcs.def b/unified-runtime/include/ur_api_funcs.def index fae5de7650d9..de3e0a5e38d9 100644 --- a/unified-runtime/include/ur_api_funcs.def +++ b/unified-runtime/include/ur_api_funcs.def @@ -151,9 +151,9 @@ _UR_API(urUSMPoolRelease) _UR_API(urUSMPoolGetInfo) _UR_API(urUSMPoolCreateExp) _UR_API(urUSMPoolDestroyExp) -_UR_API(urUSMPoolSetThresholdExp) _UR_API(urUSMPoolGetDefaultDevicePoolExp) _UR_API(urUSMPoolGetInfoExp) +_UR_API(urUSMPoolSetInfoExp) _UR_API(urUSMPoolSetDevicePoolExp) _UR_API(urUSMPoolGetDevicePoolExp) _UR_API(urUSMPoolTrimToExp) diff --git a/unified-runtime/include/ur_ddi.h b/unified-runtime/include/ur_ddi.h index 3be83fa459d4..68dc0a265d28 100644 --- a/unified-runtime/include/ur_ddi.h +++ b/unified-runtime/include/ur_ddi.h @@ -1306,11 +1306,6 @@ typedef ur_result_t(UR_APICALL *ur_pfnUSMPoolCreateExp_t)( typedef ur_result_t(UR_APICALL *ur_pfnUSMPoolDestroyExp_t)( ur_context_handle_t, ur_device_handle_t, ur_usm_pool_handle_t); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Function-pointer for urUSMPoolSetThresholdExp -typedef ur_result_t(UR_APICALL *ur_pfnUSMPoolSetThresholdExp_t)( - ur_context_handle_t, ur_device_handle_t, ur_usm_pool_handle_t, size_t); - /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urUSMPoolGetDefaultDevicePoolExp typedef ur_result_t(UR_APICALL *ur_pfnUSMPoolGetDefaultDevicePoolExp_t)( @@ -1322,6 +1317,12 @@ typedef ur_result_t(UR_APICALL *ur_pfnUSMPoolGetInfoExp_t)(ur_usm_pool_handle_t, ur_usm_pool_info_t, void *, size_t *); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Function-pointer for urUSMPoolSetInfoExp +typedef ur_result_t(UR_APICALL *ur_pfnUSMPoolSetInfoExp_t)(ur_usm_pool_handle_t, + ur_usm_pool_info_t, + void *, size_t); + /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urUSMPoolSetDevicePoolExp typedef ur_result_t(UR_APICALL *ur_pfnUSMPoolSetDevicePoolExp_t)( @@ -1360,9 +1361,9 @@ typedef ur_result_t(UR_APICALL *ur_pfnUSMReleaseExp_t)(ur_context_handle_t, typedef struct ur_usm_exp_dditable_t { ur_pfnUSMPoolCreateExp_t pfnPoolCreateExp; ur_pfnUSMPoolDestroyExp_t pfnPoolDestroyExp; - ur_pfnUSMPoolSetThresholdExp_t pfnPoolSetThresholdExp; ur_pfnUSMPoolGetDefaultDevicePoolExp_t pfnPoolGetDefaultDevicePoolExp; ur_pfnUSMPoolGetInfoExp_t pfnPoolGetInfoExp; + ur_pfnUSMPoolSetInfoExp_t pfnPoolSetInfoExp; ur_pfnUSMPoolSetDevicePoolExp_t pfnPoolSetDevicePoolExp; ur_pfnUSMPoolGetDevicePoolExp_t pfnPoolGetDevicePoolExp; ur_pfnUSMPoolTrimToExp_t pfnPoolTrimToExp; diff --git a/unified-runtime/include/ur_print.h b/unified-runtime/include/ur_print.h index 520adad880b6..d42a2eab1628 100644 --- a/unified-runtime/include/ur_print.h +++ b/unified-runtime/include/ur_print.h @@ -2847,16 +2847,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintUsmPoolDestroyExpParams( const struct ur_usm_pool_destroy_exp_params_t *params, char *buffer, const size_t buff_size, size_t *out_size); -/////////////////////////////////////////////////////////////////////////////// -/// @brief Print ur_usm_pool_set_threshold_exp_params_t struct -/// @returns -/// - ::UR_RESULT_SUCCESS -/// - ::UR_RESULT_ERROR_INVALID_SIZE -/// - `buff_size < out_size` -UR_APIEXPORT ur_result_t UR_APICALL urPrintUsmPoolSetThresholdExpParams( - const struct ur_usm_pool_set_threshold_exp_params_t *params, char *buffer, - const size_t buff_size, size_t *out_size); - /////////////////////////////////////////////////////////////////////////////// /// @brief Print ur_usm_pool_get_default_device_pool_exp_params_t struct /// @returns @@ -2877,6 +2867,16 @@ UR_APIEXPORT ur_result_t UR_APICALL urPrintUsmPoolGetInfoExpParams( const struct ur_usm_pool_get_info_exp_params_t *params, char *buffer, const size_t buff_size, size_t *out_size); +/////////////////////////////////////////////////////////////////////////////// +/// @brief Print ur_usm_pool_set_info_exp_params_t struct +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_INVALID_SIZE +/// - `buff_size < out_size` +UR_APIEXPORT ur_result_t UR_APICALL urPrintUsmPoolSetInfoExpParams( + const struct ur_usm_pool_set_info_exp_params_t *params, char *buffer, + const size_t buff_size, size_t *out_size); + /////////////////////////////////////////////////////////////////////////////// /// @brief Print ur_usm_pool_set_device_pool_exp_params_t struct /// @returns diff --git a/unified-runtime/include/ur_print.hpp b/unified-runtime/include/ur_print.hpp index 051d24001fa4..98ed3d9990c1 100644 --- a/unified-runtime/include/ur_print.hpp +++ b/unified-runtime/include/ur_print.hpp @@ -1210,9 +1210,6 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_function_t value) { case UR_FUNCTION_USM_POOL_DESTROY_EXP: os << "UR_FUNCTION_USM_POOL_DESTROY_EXP"; break; - case UR_FUNCTION_USM_POOL_SET_THRESHOLD_EXP: - os << "UR_FUNCTION_USM_POOL_SET_THRESHOLD_EXP"; - break; case UR_FUNCTION_USM_POOL_GET_DEFAULT_DEVICE_POOL_EXP: os << "UR_FUNCTION_USM_POOL_GET_DEFAULT_DEVICE_POOL_EXP"; break; @@ -1234,6 +1231,9 @@ inline std::ostream &operator<<(std::ostream &os, enum ur_function_t value) { case UR_FUNCTION_COMMAND_BUFFER_GET_NATIVE_HANDLE_EXP: os << "UR_FUNCTION_COMMAND_BUFFER_GET_NATIVE_HANDLE_EXP"; break; + case UR_FUNCTION_USM_POOL_SET_INFO_EXP: + os << "UR_FUNCTION_USM_POOL_SET_INFO_EXP"; + break; default: os << "unknown enumerator"; break; @@ -17531,13 +17531,13 @@ inline std::ostream &operator<<( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Print operator for the ur_usm_pool_set_threshold_exp_params_t type +/// @brief Print operator for the +/// ur_usm_pool_get_default_device_pool_exp_params_t type /// @returns /// std::ostream & inline std::ostream & -operator<<(std::ostream &os, - [[maybe_unused]] const struct ur_usm_pool_set_threshold_exp_params_t - *params) { +operator<<(std::ostream &os, [[maybe_unused]] const struct + ur_usm_pool_get_default_device_pool_exp_params_t *params) { os << ".hContext = "; @@ -17549,51 +17549,50 @@ operator<<(std::ostream &os, ur::details::printPtr(os, *(params->phDevice)); os << ", "; - os << ".hPool = "; - - ur::details::printPtr(os, *(params->phPool)); - - os << ", "; - os << ".newThreshold = "; + os << ".pPool = "; - os << *(params->pnewThreshold); + ur::details::printPtr(os, *(params->ppPool)); return os; } /////////////////////////////////////////////////////////////////////////////// -/// @brief Print operator for the -/// ur_usm_pool_get_default_device_pool_exp_params_t type +/// @brief Print operator for the ur_usm_pool_get_info_exp_params_t type /// @returns /// std::ostream & -inline std::ostream & -operator<<(std::ostream &os, [[maybe_unused]] const struct - ur_usm_pool_get_default_device_pool_exp_params_t *params) { +inline std::ostream &operator<<( + std::ostream &os, + [[maybe_unused]] const struct ur_usm_pool_get_info_exp_params_t *params) { - os << ".hContext = "; + os << ".hPool = "; - ur::details::printPtr(os, *(params->phContext)); + ur::details::printPtr(os, *(params->phPool)); os << ", "; - os << ".hDevice = "; + os << ".propName = "; - ur::details::printPtr(os, *(params->phDevice)); + os << *(params->ppropName); os << ", "; - os << ".pPool = "; + os << ".pPropValue = "; - ur::details::printPtr(os, *(params->ppPool)); + ur::details::printPtr(os, *(params->ppPropValue)); + + os << ", "; + os << ".pPropSizeRet = "; + + ur::details::printPtr(os, *(params->ppPropSizeRet)); return os; } /////////////////////////////////////////////////////////////////////////////// -/// @brief Print operator for the ur_usm_pool_get_info_exp_params_t type +/// @brief Print operator for the ur_usm_pool_set_info_exp_params_t type /// @returns /// std::ostream & inline std::ostream &operator<<( std::ostream &os, - [[maybe_unused]] const struct ur_usm_pool_get_info_exp_params_t *params) { + [[maybe_unused]] const struct ur_usm_pool_set_info_exp_params_t *params) { os << ".hPool = "; @@ -17610,9 +17609,9 @@ inline std::ostream &operator<<( ur::details::printPtr(os, *(params->ppPropValue)); os << ", "; - os << ".pPropSizeRet = "; + os << ".propSize = "; - ur::details::printPtr(os, *(params->ppPropSizeRet)); + os << *(params->ppropSize); return os; } @@ -21020,9 +21019,6 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os, case UR_FUNCTION_USM_POOL_DESTROY_EXP: { os << (const struct ur_usm_pool_destroy_exp_params_t *)params; } break; - case UR_FUNCTION_USM_POOL_SET_THRESHOLD_EXP: { - os << (const struct ur_usm_pool_set_threshold_exp_params_t *)params; - } break; case UR_FUNCTION_USM_POOL_GET_DEFAULT_DEVICE_POOL_EXP: { os << (const struct ur_usm_pool_get_default_device_pool_exp_params_t *) params; @@ -21030,6 +21026,9 @@ inline ur_result_t UR_APICALL printFunctionParams(std::ostream &os, case UR_FUNCTION_USM_POOL_GET_INFO_EXP: { os << (const struct ur_usm_pool_get_info_exp_params_t *)params; } break; + case UR_FUNCTION_USM_POOL_SET_INFO_EXP: { + os << (const struct ur_usm_pool_set_info_exp_params_t *)params; + } break; case UR_FUNCTION_USM_POOL_SET_DEVICE_POOL_EXP: { os << (const struct ur_usm_pool_set_device_pool_exp_params_t *)params; } break; diff --git a/unified-runtime/scripts/core/EXP-ASYNC-ALLOC.rst b/unified-runtime/scripts/core/EXP-ASYNC-ALLOC.rst index ee6bb3fcf8c9..b6c8025152f7 100644 --- a/unified-runtime/scripts/core/EXP-ASYNC-ALLOC.rst +++ b/unified-runtime/scripts/core/EXP-ASYNC-ALLOC.rst @@ -70,9 +70,9 @@ Functions * ${x}EnqueueUSMFreeExp * ${x}USMPoolCreateExp * ${x}USMPoolDestroyExp -* ${x}USMPoolSetThresholdExp * ${x}USMPoolGetDefaultDevicePoolExp * ${x}USMPoolGetInfoExp +* ${x}USMPoolSetInfoExp * ${x}USMPoolSetDevicePoolExp * ${x}USMPoolGetDevicePoolExp * ${x}USMPoolTrimToExp @@ -94,6 +94,9 @@ Changelog | | DEVICE_INFO_ASYNC_USM_ALLOCATIONS_SUPPORT_EXP for | | | better consistency with other UR enums | +----------+----------------------------------------------------------+ +| 1.3 | Remove USMPoolSetThresholdExp | +| | Replace with USMPoolSetInfoExp | ++----------+----------------------------------------------------------+ Support -------------------------------------------------------------------------------- diff --git a/unified-runtime/scripts/core/device.yml b/unified-runtime/scripts/core/device.yml index bd8553ae8adb..a0c93262eb73 100644 --- a/unified-runtime/scripts/core/device.yml +++ b/unified-runtime/scripts/core/device.yml @@ -94,7 +94,10 @@ etors: value: "1" desc: "The default device type as preferred by the runtime" - name: ALL - desc: "Devices of all types" + desc: | + Devices of all types, for use with $xDeviceGet() and + $xDeviceGetSelected(). This value will never be returned when + querying about a device. - name: GPU desc: "Graphics Processing Unit" - name: CPU diff --git a/unified-runtime/scripts/core/exp-async-alloc.yml b/unified-runtime/scripts/core/exp-async-alloc.yml index 7d13de1ebdae..61a796e18446 100644 --- a/unified-runtime/scripts/core/exp-async-alloc.yml +++ b/unified-runtime/scripts/core/exp-async-alloc.yml @@ -315,33 +315,6 @@ returns: - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: - "If any device associated with `hContext` reports `false` for $X_DEVICE_INFO_USM_POOL_SUPPORT" ---- #-------------------------------------------------------------------------- -type: function -desc: "Set a new release threshold for a USM memory pool." -class: $xUSM -name: PoolSetThresholdExp -ordinal: "0" -details: - - "Set a new release threshold for a USM memory pool." -params: - - type: $x_context_handle_t - name: hContext - desc: "[in] handle of the context object" - - type: $x_device_handle_t - name: hDevice - desc: "[in] handle of the device object" - - type: $x_usm_pool_handle_t - name: hPool - desc: "[in] handle to USM memory pool for the threshold to be set" - - type: size_t - name: newThreshold - desc: "[in] release threshold to be set" -returns: - - $X_RESULT_ERROR_INVALID_NULL_HANDLE - - $X_RESULT_ERROR_INVALID_VALUE - - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: - - "If any device associated with `hContext` reports `false` for $X_DEVICE_INFO_USM_POOL_SUPPORT" - --- #-------------------------------------------------------------------------- type: function desc: "Get the default pool for a device." @@ -392,6 +365,37 @@ returns: - "If `propName` is not supported by the adapter." - $X_RESULT_ERROR_INVALID_NULL_POINTER: - "`pPropValue == NULL && pPropSizeRet == NULL`" + - $X_RESULT_ERROR_OUT_OF_RESOURCES + - $X_RESULT_ERROR_OUT_OF_HOST_MEMORY + +--- #-------------------------------------------------------------------------- +type: function +desc: "Set a property for a USM memory pool." +class: $xUSM +name: PoolSetInfoExp +ordinal: "0" +details: + - "Set a property for a USM memory pool." +params: + - type: $x_usm_pool_handle_t + name: hPool + desc: "[in] handle to USM memory pool for the property to be set" + - type: $x_usm_pool_info_t + name: propName + desc: "[in] setting property name" + - type: void* + name: pPropValue + desc: "[in] pointer to value to assign" + - type: size_t + name: propSize + desc: "[in] size of value to assign" +returns: + - $X_RESULT_ERROR_UNSUPPORTED_ENUMERATION: + - "If `propName` is not supported by the adapter." + - $X_RESULT_ERROR_INVALID_NULL_POINTER: + - "`pPropValue == NULL`" + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: + - "If any device associated with `hContext` reports `false` for $X_DEVICE_INFO_USM_POOL_SUPPORT" - $X_RESULT_ERROR_INVALID_DEVICE - $X_RESULT_ERROR_OUT_OF_RESOURCES - $X_RESULT_ERROR_OUT_OF_HOST_MEMORY diff --git a/unified-runtime/scripts/core/manifests.yml b/unified-runtime/scripts/core/manifests.yml index 42a28b9a1f36..6b9647852dae 100644 --- a/unified-runtime/scripts/core/manifests.yml +++ b/unified-runtime/scripts/core/manifests.yml @@ -8,7 +8,7 @@ # See YaML.md for syntax definition # # NOTE: device_types must be explictly listed. Refrain from using -# $X_DEVICE_TYPE_ALL. See https://github.com/intel/llvm/issues/17527. +# $X_DEVICE_TYPE_ALL. --- #-------------------------------------------------------------------------- type: header desc: "Intel $OneApi Unified Runtime adapter manifests" diff --git a/unified-runtime/scripts/core/registry.yml b/unified-runtime/scripts/core/registry.yml index 7ce99f73a1ad..9c8a61184dfb 100644 --- a/unified-runtime/scripts/core/registry.yml +++ b/unified-runtime/scripts/core/registry.yml @@ -619,9 +619,6 @@ etors: - name: USM_POOL_DESTROY_EXP desc: Enumerator for $xUSMPoolDestroyExp value: '255' -- name: USM_POOL_SET_THRESHOLD_EXP - desc: Enumerator for $xUSMPoolSetThresholdExp - value: '256' - name: USM_POOL_GET_DEFAULT_DEVICE_POOL_EXP desc: Enumerator for $xUSMPoolGetDefaultDevicePoolExp value: '257' @@ -643,6 +640,9 @@ etors: - name: COMMAND_BUFFER_GET_NATIVE_HANDLE_EXP desc: Enumerator for $xCommandBufferGetNativeHandleExp value: '264' +- name: USM_POOL_SET_INFO_EXP + desc: Enumerator for $xUSMPoolSetInfoExp + value: '265' --- type: enum desc: Defines structure types diff --git a/unified-runtime/source/adapters/cuda/CMakeLists.txt b/unified-runtime/source/adapters/cuda/CMakeLists.txt index 48305f1adfe0..a8401c71a5dc 100644 --- a/unified-runtime/source/adapters/cuda/CMakeLists.txt +++ b/unified-runtime/source/adapters/cuda/CMakeLists.txt @@ -119,8 +119,9 @@ target_link_libraries(${TARGET_NAME} PRIVATE ${PROJECT_NAME}::umf Threads::Threads cudadrv + CUDA::nvml ) target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../" -) +) \ No newline at end of file diff --git a/unified-runtime/source/adapters/cuda/async_alloc.cpp b/unified-runtime/source/adapters/cuda/async_alloc.cpp index ddc76fb499e1..1826ebe531c5 100644 --- a/unified-runtime/source/adapters/cuda/async_alloc.cpp +++ b/unified-runtime/source/adapters/cuda/async_alloc.cpp @@ -17,11 +17,50 @@ #include "usm.hpp" UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMDeviceAllocExp( - ur_queue_handle_t, ur_usm_pool_handle_t, const size_t, - const ur_exp_async_usm_alloc_properties_t *, uint32_t, - const ur_event_handle_t *, void **, ur_event_handle_t *) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; + ur_queue_handle_t hQueue, ur_usm_pool_handle_t hPool, const size_t size, + const ur_exp_async_usm_alloc_properties_t *, uint32_t numEventsInWaitList, + const ur_event_handle_t *phEventWaitList, void **ppMem, + ur_event_handle_t *phEvent) try { + std::unique_ptr RetImplEvent{nullptr}; + + ScopedContext Active(hQueue->getDevice()); + uint32_t StreamToken; + ur_stream_guard_ Guard; + CUstream CuStream = hQueue->getNextComputeStream( + numEventsInWaitList, phEventWaitList, Guard, &StreamToken); + + UR_CHECK_ERROR(enqueueEventsWait(hQueue, CuStream, numEventsInWaitList, + phEventWaitList)); + + if (phEvent) { + RetImplEvent = + std::unique_ptr(ur_event_handle_t_::makeNative( + UR_COMMAND_KERNEL_LAUNCH, hQueue, CuStream, StreamToken)); + UR_CHECK_ERROR(RetImplEvent->start()); + } + + // Allocate to the device pool if specified. Otherwise, allocate to the + // current device pool. + if (hPool) { + assert(hPool->usesCudaPool()); + UR_CHECK_ERROR( + cuMemAllocFromPoolAsync(reinterpret_cast(ppMem), size, + hPool->getCudaPool(), CuStream)); + } else { + UR_CHECK_ERROR(cuMemAllocAsync(reinterpret_cast(ppMem), size, + CuStream)); + } + + if (phEvent) { + UR_CHECK_ERROR(RetImplEvent->record()); + *phEvent = RetImplEvent.release(); + } + + return UR_RESULT_SUCCESS; +} catch (ur_result_t Err) { + return Err; } + UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMHostAllocExp( ur_queue_handle_t, ur_usm_pool_handle_t, const size_t, const ur_exp_async_usm_alloc_properties_t *, uint32_t, @@ -36,8 +75,36 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMSharedAllocExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } -UR_APIEXPORT ur_result_t UR_APICALL -urEnqueueUSMFreeExp(ur_queue_handle_t, ur_usm_pool_handle_t, void *, uint32_t, - const ur_event_handle_t *, ur_event_handle_t *) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMFreeExp( + ur_queue_handle_t hQueue, [[maybe_unused]] ur_usm_pool_handle_t hPool, + void *pMem, uint32_t numEventsInWaitList, + const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) try { + std::unique_ptr RetImplEvent{nullptr}; + + ScopedContext Active(hQueue->getDevice()); + uint32_t StreamToken; + ur_stream_guard_ Guard; + CUstream CuStream = hQueue->getNextComputeStream( + numEventsInWaitList, phEventWaitList, Guard, &StreamToken); + + UR_CHECK_ERROR(enqueueEventsWait(hQueue, CuStream, numEventsInWaitList, + phEventWaitList)); + + if (phEvent) { + RetImplEvent = + std::unique_ptr(ur_event_handle_t_::makeNative( + UR_COMMAND_KERNEL_LAUNCH, hQueue, CuStream, StreamToken)); + UR_CHECK_ERROR(RetImplEvent->start()); + } + + UR_CHECK_ERROR(cuMemFreeAsync(reinterpret_cast(pMem), CuStream)); + + if (phEvent) { + UR_CHECK_ERROR(RetImplEvent->record()); + *phEvent = RetImplEvent.release(); + } + + return UR_RESULT_SUCCESS; +} catch (ur_result_t Err) { + return Err; } diff --git a/unified-runtime/source/adapters/cuda/common.cpp b/unified-runtime/source/adapters/cuda/common.cpp index d347d544be1a..08d8e090268b 100644 --- a/unified-runtime/source/adapters/cuda/common.cpp +++ b/unified-runtime/source/adapters/cuda/common.cpp @@ -12,6 +12,7 @@ #include "logger/ur_logger.hpp" #include +#include #include @@ -36,6 +37,23 @@ ur_result_t mapErrorUR(CUresult Result) { } } +ur_result_t mapErrorUR(nvmlReturn_t Result) { + switch (Result) { + case NVML_SUCCESS: + return UR_RESULT_SUCCESS; + case NVML_ERROR_NOT_SUPPORTED: + return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; + case NVML_ERROR_GPU_IS_LOST: + return UR_RESULT_ERROR_DEVICE_LOST; + case NVML_ERROR_MEMORY: + return UR_RESULT_ERROR_OUT_OF_HOST_MEMORY; + case NVML_ERROR_INSUFFICIENT_RESOURCES: + return UR_RESULT_ERROR_OUT_OF_RESOURCES; + default: + return UR_RESULT_ERROR_UNKNOWN; + } +} + void checkErrorUR(CUresult Result, const char *Function, int Line, const char *File) { if (Result == CUDA_SUCCESS || Result == CUDA_ERROR_DEINITIALIZED) { @@ -63,6 +81,30 @@ void checkErrorUR(CUresult Result, const char *Function, int Line, throw mapErrorUR(Result); } +void checkErrorUR(nvmlReturn_t Result, const char *Function, int Line, + const char *File) { + if (Result == NVML_SUCCESS) { + return; + } + + const char *ErrorString = nullptr; + ErrorString = nvmlErrorString(Result); + std::stringstream SS; + SS << "\nUR NVML ERROR:" + << "\n\tValue: " << Result + << "\n\tDescription: " << ErrorString + << "\n\tFunction: " << Function << "\n\tSource Location: " << File + << ":" << Line << "\n"; + logger::error("{}", SS.str()); + + if (std::getenv("PI_CUDA_ABORT") != nullptr || + std::getenv("UR_CUDA_ABORT") != nullptr) { + std::abort(); + } + + throw mapErrorUR(Result); +} + void checkErrorUR(ur_result_t Result, const char *Function, int Line, const char *File) { if (Result == UR_RESULT_SUCCESS) { diff --git a/unified-runtime/source/adapters/cuda/common.hpp b/unified-runtime/source/adapters/cuda/common.hpp index dd7c0ce78706..0cd51f910561 100644 --- a/unified-runtime/source/adapters/cuda/common.hpp +++ b/unified-runtime/source/adapters/cuda/common.hpp @@ -10,6 +10,7 @@ #pragma once #include +#include #include #include @@ -35,6 +36,9 @@ ur_result_t mapErrorUR(CUresult Result); void checkErrorUR(CUresult Result, const char *Function, int Line, const char *File); +void checkErrorUR(nvmlReturn_t Result, const char *Function, int Line, + const char *File); + void checkErrorUR(ur_result_t Result, const char *Function, int Line, const char *File); diff --git a/unified-runtime/source/adapters/cuda/device.cpp b/unified-runtime/source/adapters/cuda/device.cpp index 64704638b8ba..6a55efa8919f 100644 --- a/unified-runtime/source/adapters/cuda/device.cpp +++ b/unified-runtime/source/adapters/cuda/device.cpp @@ -18,6 +18,7 @@ #include "logger/ur_logger.hpp" #include "platform.hpp" #include "ur_util.hpp" +#include int getAttribute(ur_device_handle_t device, CUdevice_attribute attribute) { int value; @@ -1085,11 +1086,64 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, case UR_DEVICE_INFO_GPU_EU_COUNT_PER_SUBSLICE: case UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU: case UR_DEVICE_INFO_IP_VERSION: - case UR_DEVICE_INFO_CURRENT_CLOCK_THROTTLE_REASONS: - case UR_DEVICE_INFO_FAN_SPEED: - case UR_DEVICE_INFO_MIN_POWER_LIMIT: - case UR_DEVICE_INFO_MAX_POWER_LIMIT: return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; + case UR_DEVICE_INFO_CURRENT_CLOCK_THROTTLE_REASONS: { + unsigned long long ClocksEventReasons; + UR_CHECK_ERROR(nvmlDeviceGetCurrentClocksEventReasons(hDevice->getNVML(), + &ClocksEventReasons)); + ur_device_throttle_reasons_flags_t ThrottleReasons = 0; + constexpr unsigned long long NVMLThrottleFlags[] = { + nvmlClocksThrottleReasonSwPowerCap, + nvmlClocksThrottleReasonHwThermalSlowdown || + nvmlClocksThrottleReasonSwThermalSlowdown, + nvmlClocksThrottleReasonHwPowerBrakeSlowdown, + nvmlClocksThrottleReasonApplicationsClocksSetting}; + + constexpr ur_device_throttle_reasons_flags_t UrThrottleFlags[] = { + UR_DEVICE_THROTTLE_REASONS_FLAG_POWER_CAP, + UR_DEVICE_THROTTLE_REASONS_FLAG_THERMAL_LIMIT, + UR_DEVICE_THROTTLE_REASONS_FLAG_PSU_ALERT, + UR_DEVICE_THROTTLE_REASONS_FLAG_SW_RANGE}; + + for (size_t i = 0; + i < sizeof(NVMLThrottleFlags) / sizeof(NVMLThrottleFlags[0]); ++i) { + if (ClocksEventReasons & NVMLThrottleFlags[i]) { + ThrottleReasons |= UrThrottleFlags[i]; + ClocksEventReasons &= ~NVMLThrottleFlags[i]; + } + } + if (ClocksEventReasons) { + ThrottleReasons |= UR_DEVICE_THROTTLE_REASONS_FLAG_OTHER; + } + return ReturnValue(ThrottleReasons); + } + case UR_DEVICE_INFO_MIN_POWER_LIMIT: + case UR_DEVICE_INFO_MAX_POWER_LIMIT: { + unsigned int minLimit, maxLimit; + auto NVMLHandle = hDevice->getNVML(); + auto NVMLError = nvmlDeviceGetPowerManagementLimitConstraints( + NVMLHandle, &minLimit, &maxLimit); + if (NVMLError == NVML_ERROR_NOT_SUPPORTED) { + if (propName == UR_DEVICE_INFO_MAX_POWER_LIMIT) { + UR_CHECK_ERROR( + nvmlDeviceGetPowerManagementLimit(NVMLHandle, &maxLimit)); + return ReturnValue(static_cast(maxLimit)); + } else if (propName == UR_DEVICE_INFO_MIN_POWER_LIMIT) { + return ReturnValue(static_cast(-1)); + } + } + if (propName == UR_DEVICE_INFO_MAX_POWER_LIMIT) { + return ReturnValue(static_cast(maxLimit)); + } else if (propName == UR_DEVICE_INFO_MIN_POWER_LIMIT) { + return ReturnValue(static_cast(minLimit)); + } + break; + } + case UR_DEVICE_INFO_FAN_SPEED: { + unsigned int Speed; + UR_CHECK_ERROR(nvmlDeviceGetFanSpeed(hDevice->getNVML(), &Speed)); + return ReturnValue(static_cast(Speed)); + } case UR_DEVICE_INFO_2D_BLOCK_ARRAY_CAPABILITIES_EXP: return ReturnValue( static_cast(0)); @@ -1125,7 +1179,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, return ReturnValue(true); case UR_DEVICE_INFO_MULTI_DEVICE_COMPILE_SUPPORT_EXP: return ReturnValue(false); - + case UR_DEVICE_INFO_ASYNC_USM_ALLOCATIONS_SUPPORT_EXP: + return ReturnValue(true); default: break; } diff --git a/unified-runtime/source/adapters/cuda/device.hpp b/unified-runtime/source/adapters/cuda/device.hpp index e94291367b41..d5716a839b9d 100644 --- a/unified-runtime/source/adapters/cuda/device.hpp +++ b/unified-runtime/source/adapters/cuda/device.hpp @@ -36,13 +36,14 @@ struct ur_device_handle_t_ { int MaxChosenLocalMem{0}; bool MaxLocalMemSizeChosen{false}; uint32_t NumComputeUnits{0}; + std::once_flag NVMLInitFlag; + std::optional NVMLDevice; public: ur_device_handle_t_(native_type cuDevice, CUcontext cuContext, CUevent evBase, ur_platform_handle_t platform, uint32_t DevIndex) : CuDevice(cuDevice), CuContext(cuContext), EvBase(evBase), RefCount{1}, Platform(platform), DeviceIndex{DevIndex} { - UR_CHECK_ERROR(cuDeviceGetAttribute( &MaxRegsPerBlock, CU_DEVICE_ATTRIBUTE_MAX_REGISTERS_PER_BLOCK, cuDevice)); @@ -102,11 +103,28 @@ struct ur_device_handle_t_ { if (MemoryProviderShared) { umfMemoryProviderDestroy(MemoryProviderShared); } + if (NVMLDevice.has_value()) { + UR_CHECK_ERROR(nvmlShutdown()); + } cuDevicePrimaryCtxRelease(CuDevice); } native_type get() const noexcept { return CuDevice; }; + nvmlDevice_t getNVML() { + // Initialization happens lazily once per device object. Call to nvmlInit by + // different objects will just increase the reference count. Each object's + // destructor calls shutdown method, so once there will be no NVML users + // left, resources will be released. + std::call_once(NVMLInitFlag, [this]() { + UR_CHECK_ERROR(nvmlInit()); + nvmlDevice_t Handle; + UR_CHECK_ERROR(nvmlDeviceGetHandleByIndex(DeviceIndex, &Handle)); + NVMLDevice = Handle; + }); + return NVMLDevice.value(); + }; + CUcontext getNativeContext() const noexcept { return CuContext; }; uint32_t getReferenceCount() const noexcept { return RefCount; } diff --git a/unified-runtime/source/adapters/cuda/ur_interface_loader.cpp b/unified-runtime/source/adapters/cuda/ur_interface_loader.cpp index 35c7cf5dfbb1..16f2875102de 100644 --- a/unified-runtime/source/adapters/cuda/ur_interface_loader.cpp +++ b/unified-runtime/source/adapters/cuda/ur_interface_loader.cpp @@ -365,7 +365,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetUSMExpProcAddrTable( pDdiTable->pfnPoolCreateExp = urUSMPoolCreateExp; pDdiTable->pfnPoolDestroyExp = urUSMPoolDestroyExp; pDdiTable->pfnPoolGetDefaultDevicePoolExp = urUSMPoolGetDefaultDevicePoolExp; - pDdiTable->pfnPoolSetThresholdExp = urUSMPoolSetThresholdExp; + pDdiTable->pfnPoolSetInfoExp = urUSMPoolSetInfoExp; pDdiTable->pfnPoolGetInfoExp = urUSMPoolGetInfoExp; pDdiTable->pfnPoolSetDevicePoolExp = urUSMPoolSetDevicePoolExp; pDdiTable->pfnPoolGetDevicePoolExp = urUSMPoolGetDevicePoolExp; diff --git a/unified-runtime/source/adapters/cuda/usm.cpp b/unified-runtime/source/adapters/cuda/usm.cpp index 5ee1ee5aecba..54d7f3cb5ed9 100644 --- a/unified-runtime/source/adapters/cuda/usm.cpp +++ b/unified-runtime/source/adapters/cuda/usm.cpp @@ -414,33 +414,202 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolGetInfo( } } -UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolCreateExp(ur_context_handle_t, - ur_device_handle_t, - ur_usm_pool_desc_t *, - ur_usm_pool_handle_t *) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, + ur_device_handle_t Device, + ur_usm_pool_desc_t *PoolDesc) + : Context{Context}, Device{Device} { + if (!(PoolDesc->flags & UR_USM_POOL_FLAG_USE_NATIVE_MEMORY_POOL_EXP)) + throw UsmAllocationException(UR_RESULT_ERROR_INVALID_ARGUMENT); + + CUmemPoolProps MemPoolProps{}; + size_t threshold = 0; + + const void *pNext = PoolDesc->pNext; + while (pNext != nullptr) { + const ur_base_desc_t *BaseDesc = static_cast(pNext); + switch (BaseDesc->stype) { + case UR_STRUCTURE_TYPE_USM_POOL_LIMITS_DESC: { + const ur_usm_pool_limits_desc_t *Limits = + reinterpret_cast(BaseDesc); + MemPoolProps.maxSize = + Limits->maxPoolableSize; // CUDA lazily reserves memory for pools in + // 32MB chunks. maxSize is elevated to the + // next 32MB multiple. Each 32MB chunk is + // only reserved when it's needed for the + // first time (cuMemAllocFromPoolAsync). + + maxSize = Limits->maxPoolableSize; + size_t chunkSize = 33554432; // 32MB + size_t remainder = Limits->maxPoolableSize % chunkSize; + if (remainder != 0) { + maxSize = maxSize + chunkSize - remainder; + } + + threshold = Limits->minDriverAllocSize; + break; + } + default: { + throw UsmAllocationException(UR_RESULT_ERROR_INVALID_ARGUMENT); + } + } + pNext = BaseDesc->pNext; + } + + MemPoolProps.allocType = CU_MEM_ALLOCATION_TYPE_PINNED; + // Clarification of what id means here: + // https://forums.developer.nvidia.com/t/incomplete-description-in-cumemlocation-v1-struct-reference/318701 + MemPoolProps.location.id = Device->getIndex(); + MemPoolProps.location.type = CU_MEM_LOCATION_TYPE_DEVICE; + UR_CHECK_ERROR(cuMemPoolCreate(&CUmemPool, &MemPoolProps)); + + // Release threshold is not a property when creating a pool. + // It must be set separately. + UR_CHECK_ERROR(urUSMPoolSetInfoExp(this, + UR_USM_POOL_INFO_RELEASE_THRESHOLD_EXP, + &threshold, 8 /*uint64_t*/)); } -UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t, - ur_device_handle_t, - ur_usm_pool_handle_t) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, + ur_device_handle_t Device, + CUmemoryPool CUmemPool) + : Context{Context}, Device{Device}, CUmemPool(CUmemPool) {} + +UR_APIEXPORT ur_result_t UR_APICALL +urUSMPoolCreateExp(ur_context_handle_t Context, ur_device_handle_t Device, + ur_usm_pool_desc_t *pPoolDesc, ur_usm_pool_handle_t *pPool) { + // This entry point only supports native mem pools. + if (!(pPoolDesc->flags & UR_USM_POOL_FLAG_USE_NATIVE_MEMORY_POOL_EXP)) + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; + // Zero-init is on by default in CUDA. + // Read-only has no support in CUDA. + try { + *pPool = reinterpret_cast( + new ur_usm_pool_handle_t_(Context, Device, pPoolDesc)); + } catch (ur_result_t err) { + return err; + } catch (...) { + return UR_RESULT_ERROR_UNKNOWN; + } + return UR_RESULT_SUCCESS; } -UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolSetThresholdExp( - ur_context_handle_t, ur_device_handle_t, ur_usm_pool_handle_t, size_t) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +UR_APIEXPORT ur_result_t UR_APICALL +urUSMPoolDestroyExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, + ur_usm_pool_handle_t hPool) { + + UR_ASSERT(std::find(hContext->getDevices().begin(), + hContext->getDevices().end(), + hDevice) != hContext->getDevices().end(), + UR_RESULT_ERROR_INVALID_CONTEXT); + ScopedContext Active(hDevice); + + try { + UR_CHECK_ERROR(cuMemPoolDestroy(hPool->getCudaPool())); + } catch (ur_result_t Err) { + return Err; + } catch (...) { + return UR_RESULT_ERROR_UNKNOWN; + } + + return UR_RESULT_SUCCESS; } UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( - ur_context_handle_t, ur_device_handle_t, ur_usm_pool_handle_t *) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; + ur_context_handle_t hContext, ur_device_handle_t hDevice, + ur_usm_pool_handle_t *pPool) { + + UR_ASSERT(std::find(hContext->getDevices().begin(), + hContext->getDevices().end(), + hDevice) != hContext->getDevices().end(), + UR_RESULT_ERROR_INVALID_CONTEXT); + ScopedContext Active(hDevice); + + try { + CUmemoryPool cuPool; + UR_CHECK_ERROR(cuDeviceGetDefaultMemPool(&cuPool, hDevice->get())); + + *pPool = reinterpret_cast( + new ur_usm_pool_handle_t_(hContext, hDevice, cuPool)); + } catch (ur_result_t Err) { + return Err; + } catch (...) { + return UR_RESULT_ERROR_UNKNOWN; + } + + return UR_RESULT_SUCCESS; } -UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolGetInfoExp(ur_usm_pool_handle_t, - ur_usm_pool_info_t, - void *, size_t *) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +UR_APIEXPORT ur_result_t UR_APICALL +urUSMPoolGetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, + void *pPropValue, size_t *pPropSizeRet) { + + CUmemPool_attribute attr; + + switch (propName) { + case UR_USM_POOL_INFO_RELEASE_THRESHOLD_EXP: + attr = CU_MEMPOOL_ATTR_RELEASE_THRESHOLD; + break; + case UR_USM_POOL_INFO_RESERVED_CURRENT_EXP: + attr = CU_MEMPOOL_ATTR_RESERVED_MEM_CURRENT; + break; + case UR_USM_POOL_INFO_RESERVED_HIGH_EXP: + attr = CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH; + break; + case UR_USM_POOL_INFO_USED_CURRENT_EXP: + attr = CU_MEMPOOL_ATTR_USED_MEM_CURRENT; + break; + case UR_USM_POOL_INFO_USED_HIGH_EXP: + attr = CU_MEMPOOL_ATTR_USED_MEM_HIGH; + break; + default: + // Unknown enumerator + return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; + } + + uint64_t value = 0; + UR_CHECK_ERROR( + cuMemPoolGetAttribute(hPool->getCudaPool(), attr, (void *)&value)); + + if (pPropValue) { + *(size_t *)pPropValue = value; + } + if (pPropSizeRet) { + *(size_t *)pPropSizeRet = sizeof(size_t); + } + + return UR_RESULT_SUCCESS; +} + +UR_APIEXPORT ur_result_t UR_APICALL +urUSMPoolSetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, + void *pPropValue, size_t) { + + CUmemPool_attribute attr; + + // All current values are expected to be of size uint64_t + switch (propName) { + case UR_USM_POOL_INFO_RELEASE_THRESHOLD_EXP: + attr = CU_MEMPOOL_ATTR_RELEASE_THRESHOLD; + break; + case UR_USM_POOL_INFO_RESERVED_HIGH_EXP: + attr = CU_MEMPOOL_ATTR_RESERVED_MEM_HIGH; + break; + case UR_USM_POOL_INFO_USED_HIGH_EXP: + attr = CU_MEMPOOL_ATTR_USED_MEM_HIGH; + break; + default: + // Unknown enumerator + return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; + } + try { + UR_CHECK_ERROR( + cuMemPoolSetAttribute(hPool->getCudaPool(), attr, pPropValue)); + } catch (ur_result_t Err) { + return Err; + } catch (...) { + return UR_RESULT_ERROR_UNKNOWN; + } + return UR_RESULT_SUCCESS; } UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp( @@ -453,9 +622,22 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } -UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolTrimToExp(ur_context_handle_t, - ur_device_handle_t, - ur_usm_pool_handle_t, - size_t) { - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; +UR_APIEXPORT ur_result_t UR_APICALL +urUSMPoolTrimToExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, + ur_usm_pool_handle_t hPool, size_t minBytesToKeep) { + UR_ASSERT(std::find(hContext->getDevices().begin(), + hContext->getDevices().end(), + hDevice) != hContext->getDevices().end(), + UR_RESULT_ERROR_INVALID_CONTEXT); + ScopedContext Active(hDevice); + + try { + UR_CHECK_ERROR(cuMemPoolTrimTo(hPool->getCudaPool(), minBytesToKeep)); + } catch (ur_result_t Err) { + return Err; + } catch (...) { + return UR_RESULT_ERROR_UNKNOWN; + } + + return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/adapters/cuda/usm.hpp b/unified-runtime/source/adapters/cuda/usm.hpp index 8258043d2bf3..e61e6164cee8 100644 --- a/unified-runtime/source/adapters/cuda/usm.hpp +++ b/unified-runtime/source/adapters/cuda/usm.hpp @@ -15,10 +15,13 @@ usm::DisjointPoolAllConfigs InitializeDisjointPoolConfig(); +// A ur_usm_pool_handle_t can represent different types of memory pools. It may +// sit on top of a UMF pool or a CUmemoryPool, but not both. struct ur_usm_pool_handle_t_ { std::atomic_uint32_t RefCount = 1; ur_context_handle_t Context = nullptr; + ur_device_handle_t Device = nullptr; usm::DisjointPoolAllConfigs DisjointPoolConfigs = usm::DisjointPoolAllConfigs(); @@ -27,9 +30,20 @@ struct ur_usm_pool_handle_t_ { umf::pool_unique_handle_t SharedMemPool; umf::pool_unique_handle_t HostMemPool; + CUmemoryPool CUmemPool{0}; + size_t maxSize = 0; + ur_usm_pool_handle_t_(ur_context_handle_t Context, ur_usm_pool_desc_t *PoolDesc); + // Explicit device pool. + ur_usm_pool_handle_t_(ur_context_handle_t Context, ur_device_handle_t Device, + ur_usm_pool_desc_t *PoolDesc); + + // Explicit device default pool. + ur_usm_pool_handle_t_(ur_context_handle_t Context, ur_device_handle_t Device, + CUmemoryPool CUmemPool); + uint32_t incrementReferenceCount() noexcept { return ++RefCount; } uint32_t decrementReferenceCount() noexcept { return --RefCount; } @@ -37,6 +51,10 @@ struct ur_usm_pool_handle_t_ { uint32_t getReferenceCount() const noexcept { return RefCount; } bool hasUMFPool(umf_memory_pool_t *umf_pool); + + // To be used if ur_usm_pool_handle_t represents a CUmemoryPool. + bool usesCudaPool() const { return CUmemPool != CUmemoryPool{0}; }; + CUmemoryPool getCudaPool() { return CUmemPool; }; }; // Exception type to pass allocation errors diff --git a/unified-runtime/source/adapters/hip/ur_interface_loader.cpp b/unified-runtime/source/adapters/hip/ur_interface_loader.cpp index 9c510f3ca532..d360c5c11bb1 100644 --- a/unified-runtime/source/adapters/hip/ur_interface_loader.cpp +++ b/unified-runtime/source/adapters/hip/ur_interface_loader.cpp @@ -362,7 +362,7 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetUSMExpProcAddrTable( pDdiTable->pfnPoolCreateExp = urUSMPoolCreateExp; pDdiTable->pfnPoolDestroyExp = urUSMPoolDestroyExp; pDdiTable->pfnPoolGetDefaultDevicePoolExp = urUSMPoolGetDefaultDevicePoolExp; - pDdiTable->pfnPoolSetThresholdExp = urUSMPoolSetThresholdExp; + pDdiTable->pfnPoolSetInfoExp = urUSMPoolSetInfoExp; pDdiTable->pfnPoolGetInfoExp = urUSMPoolGetInfoExp; pDdiTable->pfnPoolSetDevicePoolExp = urUSMPoolSetDevicePoolExp; pDdiTable->pfnPoolGetDevicePoolExp = urUSMPoolGetDevicePoolExp; diff --git a/unified-runtime/source/adapters/hip/usm.cpp b/unified-runtime/source/adapters/hip/usm.cpp index 7412d4b1eb8b..60b86c730076 100644 --- a/unified-runtime/source/adapters/hip/usm.cpp +++ b/unified-runtime/source/adapters/hip/usm.cpp @@ -492,8 +492,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t, return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } -UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolSetThresholdExp( - ur_context_handle_t, ur_device_handle_t, ur_usm_pool_handle_t, size_t) { +UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolSetInfoExp(ur_usm_pool_handle_t, + ur_usm_pool_info_t, + void *, size_t) { return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/ur_interface_loader.cpp b/unified-runtime/source/adapters/level_zero/ur_interface_loader.cpp index c50c067c414e..ede76fa63baf 100644 --- a/unified-runtime/source/adapters/level_zero/ur_interface_loader.cpp +++ b/unified-runtime/source/adapters/level_zero/ur_interface_loader.cpp @@ -456,10 +456,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urGetUSMExpProcAddrTable( pDdiTable->pfnPoolCreateExp = ur::level_zero::urUSMPoolCreateExp; pDdiTable->pfnPoolDestroyExp = ur::level_zero::urUSMPoolDestroyExp; - pDdiTable->pfnPoolSetThresholdExp = ur::level_zero::urUSMPoolSetThresholdExp; pDdiTable->pfnPoolGetDefaultDevicePoolExp = ur::level_zero::urUSMPoolGetDefaultDevicePoolExp; pDdiTable->pfnPoolGetInfoExp = ur::level_zero::urUSMPoolGetInfoExp; + pDdiTable->pfnPoolSetInfoExp = ur::level_zero::urUSMPoolSetInfoExp; pDdiTable->pfnPoolSetDevicePoolExp = ur::level_zero::urUSMPoolSetDevicePoolExp; pDdiTable->pfnPoolGetDevicePoolExp = diff --git a/unified-runtime/source/adapters/level_zero/ur_interface_loader.hpp b/unified-runtime/source/adapters/level_zero/ur_interface_loader.hpp index 38239fe7a015..78eb006d4d2f 100644 --- a/unified-runtime/source/adapters/level_zero/ur_interface_loader.hpp +++ b/unified-runtime/source/adapters/level_zero/ur_interface_loader.hpp @@ -493,16 +493,15 @@ ur_result_t urUSMPoolCreateExp(ur_context_handle_t hContext, ur_result_t urUSMPoolDestroyExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool); -ur_result_t urUSMPoolSetThresholdExp(ur_context_handle_t hContext, - ur_device_handle_t hDevice, - ur_usm_pool_handle_t hPool, - size_t newThreshold); ur_result_t urUSMPoolGetDefaultDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool); ur_result_t urUSMPoolGetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t *pPropSizeRet); +ur_result_t urUSMPoolSetInfoExp(ur_usm_pool_handle_t hPool, + ur_usm_pool_info_t propName, void *pPropValue, + size_t propSize); ur_result_t urUSMPoolSetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool); diff --git a/unified-runtime/source/adapters/level_zero/usm.cpp b/unified-runtime/source/adapters/level_zero/usm.cpp index 66c70c0da428..e2b4513dd978 100644 --- a/unified-runtime/source/adapters/level_zero/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/usm.cpp @@ -639,9 +639,8 @@ ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t Context, return UR_RESULT_SUCCESS; } -ur_result_t UR_APICALL urUSMPoolSetThresholdExp(ur_context_handle_t, - ur_device_handle_t, - ur_usm_pool_handle_t, size_t) { +ur_result_t UR_APICALL urUSMPoolSetInfoExp(ur_usm_pool_handle_t, + ur_usm_pool_info_t, void *, size_t) { return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/api.cpp b/unified-runtime/source/adapters/level_zero/v2/api.cpp index b77865c19f87..bb35f5238b6c 100644 --- a/unified-runtime/source/adapters/level_zero/v2/api.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/api.cpp @@ -207,10 +207,9 @@ ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t hContext, return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } -ur_result_t UR_APICALL urUSMPoolSetThresholdExp(ur_context_handle_t hContext, - ur_device_handle_t hDevice, - ur_usm_pool_handle_t hPool, - size_t newThreshold) { +ur_result_t UR_APICALL urUSMPoolSetInfoExp(ur_usm_pool_handle_t hPool, + ur_usm_pool_info_t propName, + void *pPropValue, size_t propSize) { URLOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/mock/ur_mockddi.cpp b/unified-runtime/source/adapters/mock/ur_mockddi.cpp index c670a37fbecb..805b612dd69a 100644 --- a/unified-runtime/source/adapters/mock/ur_mockddi.cpp +++ b/unified-runtime/source/adapters/mock/ur_mockddi.cpp @@ -7640,23 +7640,22 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Intercept function for urUSMPoolSetThresholdExp -__urdlllocal ur_result_t UR_APICALL urUSMPoolSetThresholdExp( +/// @brief Intercept function for urUSMPoolGetDefaultDevicePoolExp +__urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( /// [in] handle of the context object ur_context_handle_t hContext, /// [in] handle of the device object ur_device_handle_t hDevice, - /// [in] handle to USM memory pool for the threshold to be set - ur_usm_pool_handle_t hPool, - /// [in] release threshold to be set - size_t newThreshold) try { + /// [out] pointer to USM memory pool + ur_usm_pool_handle_t *pPool) try { ur_result_t result = UR_RESULT_SUCCESS; - ur_usm_pool_set_threshold_exp_params_t params = {&hContext, &hDevice, &hPool, - &newThreshold}; + ur_usm_pool_get_default_device_pool_exp_params_t params = {&hContext, + &hDevice, &pPool}; auto beforeCallback = reinterpret_cast( - mock::getCallbacks().get_before_callback("urUSMPoolSetThresholdExp")); + mock::getCallbacks().get_before_callback( + "urUSMPoolGetDefaultDevicePoolExp")); if (beforeCallback) { result = beforeCallback(¶ms); if (result != UR_RESULT_SUCCESS) { @@ -7665,11 +7664,13 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetThresholdExp( } auto replaceCallback = reinterpret_cast( - mock::getCallbacks().get_replace_callback("urUSMPoolSetThresholdExp")); + mock::getCallbacks().get_replace_callback( + "urUSMPoolGetDefaultDevicePoolExp")); if (replaceCallback) { result = replaceCallback(¶ms); } else { + *pPool = mock::createDummyHandle(); result = UR_RESULT_SUCCESS; } @@ -7678,7 +7679,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetThresholdExp( } auto afterCallback = reinterpret_cast( - mock::getCallbacks().get_after_callback("urUSMPoolSetThresholdExp")); + mock::getCallbacks().get_after_callback( + "urUSMPoolGetDefaultDevicePoolExp")); if (afterCallback) { return afterCallback(¶ms); } @@ -7689,22 +7691,23 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetThresholdExp( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Intercept function for urUSMPoolGetDefaultDevicePoolExp -__urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( - /// [in] handle of the context object - ur_context_handle_t hContext, - /// [in] handle of the device object - ur_device_handle_t hDevice, - /// [out] pointer to USM memory pool - ur_usm_pool_handle_t *pPool) try { +/// @brief Intercept function for urUSMPoolGetInfoExp +__urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( + /// [in] handle to USM memory pool for property retrieval + ur_usm_pool_handle_t hPool, + /// [in] queried property name + ur_usm_pool_info_t propName, + /// [out][optional] returned query value + void *pPropValue, + /// [out][optional] returned query value size + size_t *pPropSizeRet) try { ur_result_t result = UR_RESULT_SUCCESS; - ur_usm_pool_get_default_device_pool_exp_params_t params = {&hContext, - &hDevice, &pPool}; + ur_usm_pool_get_info_exp_params_t params = {&hPool, &propName, &pPropValue, + &pPropSizeRet}; auto beforeCallback = reinterpret_cast( - mock::getCallbacks().get_before_callback( - "urUSMPoolGetDefaultDevicePoolExp")); + mock::getCallbacks().get_before_callback("urUSMPoolGetInfoExp")); if (beforeCallback) { result = beforeCallback(¶ms); if (result != UR_RESULT_SUCCESS) { @@ -7713,13 +7716,11 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( } auto replaceCallback = reinterpret_cast( - mock::getCallbacks().get_replace_callback( - "urUSMPoolGetDefaultDevicePoolExp")); + mock::getCallbacks().get_replace_callback("urUSMPoolGetInfoExp")); if (replaceCallback) { result = replaceCallback(¶ms); } else { - *pPool = mock::createDummyHandle(); result = UR_RESULT_SUCCESS; } @@ -7728,8 +7729,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( } auto afterCallback = reinterpret_cast( - mock::getCallbacks().get_after_callback( - "urUSMPoolGetDefaultDevicePoolExp")); + mock::getCallbacks().get_after_callback("urUSMPoolGetInfoExp")); if (afterCallback) { return afterCallback(¶ms); } @@ -7740,23 +7740,23 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( } /////////////////////////////////////////////////////////////////////////////// -/// @brief Intercept function for urUSMPoolGetInfoExp -__urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( - /// [in] handle to USM memory pool for property retrieval +/// @brief Intercept function for urUSMPoolSetInfoExp +__urdlllocal ur_result_t UR_APICALL urUSMPoolSetInfoExp( + /// [in] handle to USM memory pool for the property to be set ur_usm_pool_handle_t hPool, - /// [in] queried property name + /// [in] setting property name ur_usm_pool_info_t propName, - /// [out][optional] returned query value + /// [in] pointer to value to assign void *pPropValue, - /// [out][optional] returned query value size - size_t *pPropSizeRet) try { + /// [in] size of value to assign + size_t propSize) try { ur_result_t result = UR_RESULT_SUCCESS; - ur_usm_pool_get_info_exp_params_t params = {&hPool, &propName, &pPropValue, - &pPropSizeRet}; + ur_usm_pool_set_info_exp_params_t params = {&hPool, &propName, &pPropValue, + &propSize}; auto beforeCallback = reinterpret_cast( - mock::getCallbacks().get_before_callback("urUSMPoolGetInfoExp")); + mock::getCallbacks().get_before_callback("urUSMPoolSetInfoExp")); if (beforeCallback) { result = beforeCallback(¶ms); if (result != UR_RESULT_SUCCESS) { @@ -7765,7 +7765,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( } auto replaceCallback = reinterpret_cast( - mock::getCallbacks().get_replace_callback("urUSMPoolGetInfoExp")); + mock::getCallbacks().get_replace_callback("urUSMPoolSetInfoExp")); if (replaceCallback) { result = replaceCallback(¶ms); } else { @@ -7778,7 +7778,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( } auto afterCallback = reinterpret_cast( - mock::getCallbacks().get_after_callback("urUSMPoolGetInfoExp")); + mock::getCallbacks().get_after_callback("urUSMPoolSetInfoExp")); if (afterCallback) { return afterCallback(¶ms); } @@ -12499,13 +12499,13 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetUSMExpProcAddrTable( pDdiTable->pfnPoolDestroyExp = driver::urUSMPoolDestroyExp; - pDdiTable->pfnPoolSetThresholdExp = driver::urUSMPoolSetThresholdExp; - pDdiTable->pfnPoolGetDefaultDevicePoolExp = driver::urUSMPoolGetDefaultDevicePoolExp; pDdiTable->pfnPoolGetInfoExp = driver::urUSMPoolGetInfoExp; + pDdiTable->pfnPoolSetInfoExp = driver::urUSMPoolSetInfoExp; + pDdiTable->pfnPoolSetDevicePoolExp = driver::urUSMPoolSetDevicePoolExp; pDdiTable->pfnPoolGetDevicePoolExp = driver::urUSMPoolGetDevicePoolExp; diff --git a/unified-runtime/source/adapters/native_cpu/usm.cpp b/unified-runtime/source/adapters/native_cpu/usm.cpp index 6185178df321..8a0a86f75fbd 100644 --- a/unified-runtime/source/adapters/native_cpu/usm.cpp +++ b/unified-runtime/source/adapters/native_cpu/usm.cpp @@ -169,8 +169,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t, DIE_NO_IMPLEMENTATION; } -UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolSetThresholdExp( - ur_context_handle_t, ur_device_handle_t, ur_usm_pool_handle_t, size_t) { +UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolSetInfoExp(ur_usm_pool_handle_t, + ur_usm_pool_info_t, + void *, size_t) { DIE_NO_IMPLEMENTATION; } diff --git a/unified-runtime/source/adapters/opencl/command_buffer.cpp b/unified-runtime/source/adapters/opencl/command_buffer.cpp index 7eaed4ec8bbc..69c4d34f09e2 100644 --- a/unified-runtime/source/adapters/opencl/command_buffer.cpp +++ b/unified-runtime/source/adapters/opencl/command_buffer.cpp @@ -36,8 +36,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urCommandBufferCreateExp( ur_queue_handle_t Queue = nullptr; ur_queue_properties_t QueueProperties = {UR_STRUCTURE_TYPE_QUEUE_PROPERTIES, nullptr, 0}; - const bool IsInOrder = - pCommandBufferDesc ? pCommandBufferDesc->isInOrder : false; + const bool IsInOrder = pCommandBufferDesc->isInOrder; if (!IsInOrder) { QueueProperties.flags = UR_QUEUE_FLAG_OUT_OF_ORDER_EXEC_MODE_ENABLE; } diff --git a/unified-runtime/source/adapters/opencl/usm.cpp b/unified-runtime/source/adapters/opencl/usm.cpp index e708a19b73dd..1e435bd74daf 100644 --- a/unified-runtime/source/adapters/opencl/usm.cpp +++ b/unified-runtime/source/adapters/opencl/usm.cpp @@ -742,8 +742,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t, return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } -UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolSetThresholdExp( - ur_context_handle_t, ur_device_handle_t, ur_usm_pool_handle_t, size_t) { +UR_APIEXPORT ur_result_t UR_APICALL urUSMPoolSetInfoExp(ur_usm_pool_handle_t, + ur_usm_pool_info_t, + void *, size_t) { return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/common/ur_util.hpp b/unified-runtime/source/common/ur_util.hpp index a60e601b78ab..281524244de1 100644 --- a/unified-runtime/source/common/ur_util.hpp +++ b/unified-runtime/source/common/ur_util.hpp @@ -270,7 +270,7 @@ inline std::optional getenv_to_map(const char *env_var_name, if (map.find(key) != map.end()) { map[key].insert(map[key].end(), values_vec.begin(), values_vec.end()); } else { - map[key] = values_vec; + map[key] = std::move(values_vec); } } return map; diff --git a/unified-runtime/source/loader/CMakeLists.txt b/unified-runtime/source/loader/CMakeLists.txt index 6df0679c7d1a..cf72ac10029b 100644 --- a/unified-runtime/source/loader/CMakeLists.txt +++ b/unified-runtime/source/loader/CMakeLists.txt @@ -163,6 +163,8 @@ if(UR_ENABLE_SANITIZER) ${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer/msan/msan_report.hpp ${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer/msan/msan_shadow.cpp ${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer/msan/msan_shadow.hpp + ${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer/tsan/tsan_buffer.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer/tsan/tsan_buffer.hpp ${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer/tsan/tsan_ddi.cpp ${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer/tsan/tsan_ddi.hpp ${CMAKE_CURRENT_SOURCE_DIR}/layers/sanitizer/tsan/tsan_interceptor.cpp diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp index 36179f6647c4..af4f1f8896bf 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp @@ -1496,7 +1496,7 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy( /// must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMMemcpy = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy; - URLOG_CTX(DEBUG, "==== pfnUSMMemcpy"); + URLOG_CTX(DEBUG, "==== urEnqueueUSMMemcpy"); std::vector Events; ur_event_handle_t Event{}; @@ -1637,7 +1637,7 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( /// phEvent must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMMemcpy2D = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy2D; - URLOG_CTX(DEBUG, "==== pfnUSMMemcpy2D"); + URLOG_CTX(DEBUG, "==== urEnqueueUSMMemcpy2D"); std::vector Events; ur_event_handle_t Event{}; diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp new file mode 100644 index 000000000000..6cef9273f548 --- /dev/null +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp @@ -0,0 +1,210 @@ +/* + * + * Copyright (C) 2025 Intel Corporation + * + * Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM + * Exceptions. See LICENSE.TXT + * + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + * + * @file tsan_buffer.cpp + * + */ + +#include "tsan_buffer.hpp" +#include "sanitizer_common/sanitizer_utils.hpp" +#include "tsan_interceptor.hpp" +#include "ur_sanitizer_layer.hpp" + +namespace ur_sanitizer_layer { +namespace tsan { + +ur_result_t EnqueueMemCopyRectHelper( + ur_queue_handle_t Queue, char *pSrc, char *pDst, ur_rect_offset_t SrcOffset, + ur_rect_offset_t DstOffset, ur_rect_region_t Region, size_t SrcRowPitch, + size_t SrcSlicePitch, size_t DstRowPitch, size_t DstSlicePitch, + bool Blocking, uint32_t NumEventsInWaitList, + const ur_event_handle_t *EventWaitList, ur_event_handle_t *Event) { + // If user doesn't determine src/dst row pitch and slice pitch, just use + // region for it. + if (SrcRowPitch == 0) { + SrcRowPitch = Region.width; + } + + if (SrcSlicePitch == 0) { + SrcSlicePitch = SrcRowPitch * Region.height; + } + + if (DstRowPitch == 0) { + DstRowPitch = Region.width; + } + + if (DstSlicePitch == 0) { + DstSlicePitch = DstRowPitch * Region.height; + } + + // Calculate the src and dst addresses that actually will be copied. + char *SrcOrigin = pSrc + SrcOffset.x + SrcRowPitch * SrcOffset.y + + SrcSlicePitch * SrcOffset.z; + char *DstOrigin = pDst + DstOffset.x + DstRowPitch * DstOffset.y + + DstSlicePitch * DstOffset.z; + + ur_device_handle_t Device = GetDevice(Queue); + std::shared_ptr DeviceInfo = + getTsanInterceptor()->getDeviceInfo(Device); + std::vector Events; + + // For now, USM doesn't support 3D memory copy operation, so we can only + // loop call 2D memory copy function to implement it. + for (size_t i = 0; i < Region.depth; i++) { + ur_event_handle_t NewEvent{}; + UR_CALL(getContext()->urDdiTable.Enqueue.pfnUSMMemcpy2D( + Queue, false, DstOrigin + (i * DstSlicePitch), DstRowPitch, + SrcOrigin + (i * SrcSlicePitch), SrcRowPitch, Region.width, + Region.height, NumEventsInWaitList, EventWaitList, &NewEvent)); + Events.push_back(NewEvent); + } + + if (Blocking) { + UR_CALL(getContext()->urDdiTable.Event.pfnWait(Events.size(), &Events[0])); + } + + if (Event) { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnEventsWait(Queue, Events.size(), + &Events[0], Event)); + } + + return UR_RESULT_SUCCESS; +} + +ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { + // Sub-buffers don't maintain own allocations but rely on parent buffer. + if (SubBuffer) { + UR_CALL(SubBuffer->Parent->getHandle(Device, Handle)); + Handle += SubBuffer->Origin; + return UR_RESULT_SUCCESS; + } + + // Device may be null, we follow the L0 adapter's practice to use the first + // device + if (!Device) { + auto Devices = GetDevices(Context); + assert(Devices.size() > 0 && "Devices should not be empty"); + Device = Devices[0]; + } + assert((void *)Device != nullptr && "Device cannot be nullptr"); + + std::scoped_lock Guard(Mutex); + auto &Allocation = Allocations[Device]; + ur_result_t URes = UR_RESULT_SUCCESS; + if (!Allocation) { + ur_usm_desc_t USMDesc{}; + USMDesc.align = getAlignment(); + ur_usm_pool_handle_t Pool{}; + URes = getTsanInterceptor()->allocateMemory(Context, Device, &USMDesc, Pool, + Size, AllocType::DEVICE_USM, + ur_cast(&Allocation)); + if (URes != UR_RESULT_SUCCESS) { + URLOG_CTX(ERR, "Failed to allocate {} bytes memory for buffer {}", + Size, this); + return URes; + } + + if (HostPtr) { + ManagedQueue Queue(Context, Device); + URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( + Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); + if (URes != UR_RESULT_SUCCESS) { + URLOG_CTX(ERR, + "Failed to copy {} bytes data from host " + "pointer {} to buffer {}", + Size, HostPtr, this); + return URes; + } + } + } + + Handle = Allocation; + + if (!LastSyncedDevice.hDevice) { + LastSyncedDevice = MemBuffer::Device_t{Device, Handle}; + return URes; + } + + // If the device required to allocate memory is not the previous one, we + // need to do data migration. + if (Device != LastSyncedDevice.hDevice) { + auto &HostAllocation = Allocations[nullptr]; + if (!HostAllocation) { + ur_usm_desc_t USMDesc{}; + USMDesc.align = getAlignment(); + ur_usm_pool_handle_t Pool{}; + URes = getContext()->urDdiTable.USM.pfnHostAlloc( + Context, &USMDesc, Pool, Size, ur_cast(&HostAllocation)); + if (URes != UR_RESULT_SUCCESS) { + URLOG_CTX(ERR, + "Failed to allocate {} bytes host " + "USM for buffer {} migration", + Size, this); + return URes; + } + } + + // Copy data from last synced device to host + { + ManagedQueue Queue(Context, LastSyncedDevice.hDevice); + URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( + Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, + nullptr, nullptr); + if (URes != UR_RESULT_SUCCESS) { + URLOG_CTX(ERR, "Failed to migrate memory buffer data"); + return URes; + } + } + + // Sync data back to device + { + ManagedQueue Queue(Context, Device); + URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( + Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); + if (URes != UR_RESULT_SUCCESS) { + URLOG_CTX(ERR, "Failed to migrate memory buffer data"); + return URes; + } + } + } + + LastSyncedDevice = MemBuffer::Device_t{Device, Handle}; + + return URes; +} + +ur_result_t MemBuffer::free() { + for (const auto &[_, Ptr] : Allocations) { + ur_result_t URes = getContext()->urDdiTable.USM.pfnFree(Context, Ptr); + if (URes != UR_RESULT_SUCCESS) { + URLOG_CTX(ERR, "Failed to free buffer handle {}", Ptr); + return URes; + } + } + Allocations.clear(); + return UR_RESULT_SUCCESS; +} + +size_t MemBuffer::getAlignment() { + // Choose an alignment that is at most 128 and is the next power of 2 + // for sizes less than 128. + // TODO: If we don't set the alignment size explicitly, the device will + // usually choose a very large size (more than 1k). Then sanitizer will + // allocate extra unnessary memory. Not sure if this will impact + // performance. + size_t MsbIdx = 63 - __builtin_clzl(Size); + size_t Alignment = (1ULL << (MsbIdx + 1)); + if (Alignment > 128) { + Alignment = 128; + } + return Alignment; +} + +} // namespace tsan +} // namespace ur_sanitizer_layer diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.hpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.hpp new file mode 100644 index 000000000000..9a9f642f7ae2 --- /dev/null +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.hpp @@ -0,0 +1,84 @@ +/* + * + * Copyright (C) 2025 Intel Corporation + * + * Part of the Unified-Runtime Project, under the Apache License v2.0 with LLVM + * Exceptions. See LICENSE.TXT + * + * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception + * + * @file tsan_buffer.hpp + * + */ + +#pragma once + +#include +#include +#include + +#include "ur/ur.hpp" + +namespace ur_sanitizer_layer { +namespace tsan { + +struct MemBuffer { + // Buffer constructor + MemBuffer(ur_context_handle_t Context, size_t Size, char *HostPtr) + : Context(Context), Size(Size), HostPtr(HostPtr) {} + + // Sub-buffer constructor + MemBuffer(std::shared_ptr Parent, size_t Origin, size_t Size) + : Context(Parent->Context), Size(Size), + SubBuffer{{std::move(Parent), Origin}} {} + + ur_result_t getHandle(ur_device_handle_t Device, char *&Handle); + + ur_result_t free(); + + size_t getAlignment(); + + std::unordered_map Allocations; + + enum AccessMode { UNKNOWN, READ_WRITE, READ_ONLY, WRITE_ONLY }; + + struct Mapping { + size_t Offset; + size_t Size; + }; + + std::unordered_map Mappings; + + ur_context_handle_t Context; + + struct Device_t { + ur_device_handle_t hDevice; + char *MemHandle; + }; + Device_t LastSyncedDevice{}; + + size_t Size; + + char *HostPtr{}; + + struct SubBuffer_t { + std::shared_ptr Parent; + size_t Origin; + }; + + std::optional SubBuffer; + + std::atomic RefCount = 1; + + ur_shared_mutex Mutex; +}; + +ur_result_t EnqueueMemCopyRectHelper( + ur_queue_handle_t Queue, char *pSrc, char *pDst, ur_rect_offset_t SrcOffset, + ur_rect_offset_t DstOffset, ur_rect_region_t Region, size_t SrcRowPitch, + size_t SrcSlicePitch, size_t DstRowPitch, size_t DstSlicePitch, + bool Blocking, uint32_t NumEventsInWaitList, + const ur_event_handle_t *EventWaitList, ur_event_handle_t *Event); + +} // namespace tsan +} // namespace ur_sanitizer_layer diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp index 9aaeea827b89..69ad0ebe501c 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp @@ -130,7 +130,6 @@ ur_result_t urContextRelease( return UR_RESULT_SUCCESS; } -/////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urProgramBuild ur_result_t urProgramBuild( /// [in] handle of the context object @@ -149,26 +148,6 @@ ur_result_t urProgramBuild( return UR_RESULT_SUCCESS; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Intercept function for urProgramBuildExp -ur_result_t urProgramBuildExp( - /// [in] Handle of the program to build. - ur_program_handle_t hProgram, - /// [in] number of devices - uint32_t numDevices, - /// [in][range(0, numDevices)] pointer to array of device handles - ur_device_handle_t *phDevices, - /// [in][optional] pointer to build options null-terminated string. - const char *pOptions) { - URLOG_CTX(DEBUG, "==== urProgramBuildExp"); - - UR_CALL(getContext()->urDdiTable.ProgramExp.pfnBuildExp(hProgram, numDevices, - phDevices, pOptions)); - UR_CALL(getTsanInterceptor()->registerProgram(hProgram)); - - return UR_RESULT_SUCCESS; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urProgramLink ur_result_t urProgramLink( @@ -193,6 +172,25 @@ ur_result_t urProgramLink( } /////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urProgramBuildExp +ur_result_t urProgramBuildExp( + /// [in] Handle of the program to build. + ur_program_handle_t hProgram, + /// [in] number of devices + uint32_t numDevices, + /// [in][range(0, numDevices)] pointer to array of device handles + ur_device_handle_t *phDevices, + /// [in][optional] pointer to build options null-terminated string. + const char *pOptions) { + URLOG_CTX(DEBUG, "==== urProgramBuildExp"); + + UR_CALL(getContext()->urDdiTable.ProgramExp.pfnBuildExp(hProgram, numDevices, + phDevices, pOptions)); + UR_CALL(getTsanInterceptor()->registerProgram(hProgram)); + + return UR_RESULT_SUCCESS; +} + /// @brief Intercept function for urProgramLinkExp ur_result_t urProgramLinkExp( /// [in] handle of the context instance. @@ -219,6 +217,840 @@ ur_result_t urProgramLinkExp( return UR_RESULT_SUCCESS; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urMemBufferCreate +ur_result_t urMemBufferCreate( + /// [in] handle of the context object + ur_context_handle_t hContext, + /// [in] allocation and usage information flags + ur_mem_flags_t flags, + /// [in] size in bytes of the memory object to be allocated + size_t size, + /// [in][optional] pointer to buffer creation properties + const ur_buffer_properties_t *pProperties, + /// [out] pointer to handle of the memory buffer created + ur_mem_handle_t *phBuffer) { + if (nullptr == phBuffer) { + return UR_RESULT_ERROR_INVALID_NULL_POINTER; + } + + URLOG_CTX(DEBUG, "==== urMemBufferCreate"); + + void *Host = nullptr; + if (pProperties) { + Host = pProperties->pHost; + } + + char *hostPtrOrNull = + (flags & UR_MEM_FLAG_USE_HOST_POINTER) ? ur_cast(Host) : nullptr; + + std::shared_ptr pMemBuffer = + std::make_shared(hContext, size, hostPtrOrNull); + + if (Host && (flags & UR_MEM_FLAG_ALLOC_COPY_HOST_POINTER)) { + std::shared_ptr CtxInfo = + getTsanInterceptor()->getContextInfo(hContext); + for (const auto &hDevice : CtxInfo->DeviceList) { + ManagedQueue InternalQueue(hContext, hDevice); + char *Handle = nullptr; + UR_CALL(pMemBuffer->getHandle(hDevice, Handle)); + UR_CALL(getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( + InternalQueue, true, Handle, Host, size, 0, nullptr, nullptr)); + } + } + + ur_result_t result = getTsanInterceptor()->insertMemBuffer(pMemBuffer); + *phBuffer = ur_cast(pMemBuffer.get()); + + return result; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urMemRetain +ur_result_t urMemRetain( + /// [in] handle of the memory object to get access + ur_mem_handle_t hMem) { + URLOG_CTX(DEBUG, "==== urMemRetain"); + + if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { + MemBuffer->RefCount++; + } else { + UR_CALL(getContext()->urDdiTable.Mem.pfnRetain(hMem)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urMemRelease +ur_result_t urMemRelease( + /// [in] handle of the memory object to release + ur_mem_handle_t hMem) { + URLOG_CTX(DEBUG, "==== urMemRelease"); + + if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { + if (--MemBuffer->RefCount != 0) { + return UR_RESULT_SUCCESS; + } + UR_CALL(MemBuffer->free()); + UR_CALL(getTsanInterceptor()->eraseMemBuffer(hMem)); + } else { + UR_CALL(getContext()->urDdiTable.Mem.pfnRelease(hMem)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urMemBufferPartition +ur_result_t urMemBufferPartition( + + /// [in] handle of the buffer object to allocate from + ur_mem_handle_t hBuffer, + /// [in] allocation and usage information flags + ur_mem_flags_t flags, + /// [in] buffer creation type + ur_buffer_create_type_t bufferCreateType, + /// [in] pointer to buffer create region information + const ur_buffer_region_t *pRegion, + /// [out] pointer to the handle of sub buffer created + ur_mem_handle_t *phMem) { + URLOG_CTX(DEBUG, "==== urMemBufferPartition"); + + if (auto ParentBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { + if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { + return UR_RESULT_ERROR_INVALID_BUFFER_SIZE; + } + std::shared_ptr SubBuffer = std::make_shared( + ParentBuffer, pRegion->origin, pRegion->size); + UR_CALL(getTsanInterceptor()->insertMemBuffer(SubBuffer)); + *phMem = reinterpret_cast(SubBuffer.get()); + } else { + UR_CALL(getContext()->urDdiTable.Mem.pfnBufferPartition( + hBuffer, flags, bufferCreateType, pRegion, phMem)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urMemGetNativeHandle +ur_result_t urMemGetNativeHandle( + /// [in] handle of the mem. + ur_mem_handle_t hMem, ur_device_handle_t hDevice, + /// [out] a pointer to the native handle of the mem. + ur_native_handle_t *phNativeMem) { + URLOG_CTX(DEBUG, "==== urMemGetNativeHandle"); + + if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { + char *Handle = nullptr; + UR_CALL(MemBuffer->getHandle(hDevice, Handle)); + *phNativeMem = ur_cast(Handle); + } else { + UR_CALL(getContext()->urDdiTable.Mem.pfnGetNativeHandle(hMem, hDevice, + phNativeMem)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urMemGetInfo +ur_result_t urMemGetInfo( + /// [in] handle to the memory object being queried. + ur_mem_handle_t hMemory, + /// [in] type of the info to retrieve. + ur_mem_info_t propName, + /// [in] the number of bytes of memory pointed to by pPropValue. + size_t propSize, + /// [out][optional][typename(propName, propSize)] array of bytes holding the + /// info. If propSize is less than the real number of bytes needed to return + /// the info then the ::UR_RESULT_ERROR_INVALID_SIZE error is returned and + /// pPropValue is not used. + void *pPropValue, + /// [out][optional] pointer to the actual size in bytes of the queried + /// propName. + size_t *pPropSizeRet) { + URLOG_CTX(DEBUG, "==== urMemGetInfo"); + + if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMemory)) { + UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); + switch (propName) { + case UR_MEM_INFO_CONTEXT: { + return ReturnValue(MemBuffer->Context); + } + case UR_MEM_INFO_SIZE: { + return ReturnValue(size_t{MemBuffer->Size}); + } + default: { + return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; + } + } + } else { + UR_CALL(getContext()->urDdiTable.Mem.pfnGetInfo(hMemory, propName, propSize, + pPropValue, pPropSizeRet)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urEnqueueMemBufferRead +ur_result_t urEnqueueMemBufferRead( + /// [in] handle of the queue object + ur_queue_handle_t hQueue, + /// [in][bounds(offset, size)] handle of the buffer object + ur_mem_handle_t hBuffer, + /// [in] indicates blocking (true), non-blocking (false) + bool blockingRead, + /// [in] offset in bytes in the buffer object + size_t offset, + /// [in] size in bytes of data being read + size_t size, + /// [in] pointer to host memory where data is to be read into + void *pDst, + /// [in] size of the event wait list + uint32_t numEventsInWaitList, + /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of + /// events that must be complete before this command can be executed. If + /// nullptr, the numEventsInWaitList must be 0, indicating that this + /// command does not wait on any event to complete. + const ur_event_handle_t *phEventWaitList, + /// [out][optional] return an event object that identifies this particular + /// command instance. + ur_event_handle_t *phEvent) { + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferRead"); + + if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { + ur_device_handle_t Device = GetDevice(hQueue); + char *pSrc = nullptr; + UR_CALL(MemBuffer->getHandle(Device, pSrc)); + UR_CALL(getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( + hQueue, blockingRead, pDst, pSrc + offset, size, numEventsInWaitList, + phEventWaitList, phEvent)); + } else { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnMemBufferRead( + hQueue, hBuffer, blockingRead, offset, size, pDst, numEventsInWaitList, + phEventWaitList, phEvent)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urEnqueueMemBufferWrite +ur_result_t urEnqueueMemBufferWrite( + /// [in] handle of the queue object + ur_queue_handle_t hQueue, + /// [in][bounds(offset, size)] handle of the buffer object + ur_mem_handle_t hBuffer, + /// [in] indicates blocking (true), non-blocking (false) + bool blockingWrite, + /// [in] offset in bytes in the buffer object + size_t offset, + /// [in] size in bytes of data being written + size_t size, + /// [in] pointer to host memory where data is to be written from + const void *pSrc, + /// [in] size of the event wait list + uint32_t numEventsInWaitList, + /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of + /// events that must be complete before this command can be executed. If + /// nullptr, the numEventsInWaitList must be 0, indicating that this + /// command does not wait on any event to complete. + const ur_event_handle_t *phEventWaitList, + /// [out][optional] return an event object that identifies this particular + /// command instance. + ur_event_handle_t *phEvent) { + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWrite"); + + if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { + ur_device_handle_t Device = GetDevice(hQueue); + char *pDst = nullptr; + std::vector Events; + ur_event_handle_t Event{}; + UR_CALL(MemBuffer->getHandle(Device, pDst)); + UR_CALL(getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( + hQueue, blockingWrite, pDst + offset, pSrc, size, numEventsInWaitList, + phEventWaitList, &Event)); + Events.push_back(Event); + + if (phEvent) { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnEventsWait( + hQueue, Events.size(), Events.data(), phEvent)); + } + } else { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnMemBufferWrite( + hQueue, hBuffer, blockingWrite, offset, size, pSrc, numEventsInWaitList, + phEventWaitList, phEvent)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urEnqueueMemBufferReadRect +ur_result_t urEnqueueMemBufferReadRect( + /// [in] handle of the queue object + ur_queue_handle_t hQueue, + /// [in][bounds(bufferOrigin, region)] handle of the buffer object + ur_mem_handle_t hBuffer, + /// [in] indicates blocking (true), non-blocking (false) + bool blockingRead, + /// [in] 3D offset in the buffer + ur_rect_offset_t bufferOrigin, + /// [in] 3D offset in the host region + ur_rect_offset_t hostOrigin, + /// [in] 3D rectangular region descriptor: width, height, depth + ur_rect_region_t region, + /// [in] length of each row in bytes in the buffer object + size_t bufferRowPitch, + /// [in] length of each 2D slice in bytes in the buffer object being read + size_t bufferSlicePitch, + /// [in] length of each row in bytes in the host memory region pointed by + /// dst + size_t hostRowPitch, + /// [in] length of each 2D slice in bytes in the host memory region pointed + /// by dst + size_t hostSlicePitch, + /// [in] pointer to host memory where data is to be read into + void *pDst, + /// [in] size of the event wait list + uint32_t numEventsInWaitList, + /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of + /// events that must be complete before this command can be executed. If + /// nullptr, the numEventsInWaitList must be 0, indicating that this + /// command does not wait on any event to complete. + const ur_event_handle_t *phEventWaitList, + /// [out][optional] return an event object that identifies this particular + /// command instance. + ur_event_handle_t *phEvent) { + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferReadRect"); + + if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { + char *SrcHandle = nullptr; + ur_device_handle_t Device = GetDevice(hQueue); + UR_CALL(MemBuffer->getHandle(Device, SrcHandle)); + + UR_CALL(EnqueueMemCopyRectHelper( + hQueue, SrcHandle, ur_cast(pDst), bufferOrigin, hostOrigin, + region, bufferRowPitch, bufferSlicePitch, hostRowPitch, hostSlicePitch, + blockingRead, numEventsInWaitList, phEventWaitList, phEvent)); + } else { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnMemBufferReadRect( + hQueue, hBuffer, blockingRead, bufferOrigin, hostOrigin, region, + bufferRowPitch, bufferSlicePitch, hostRowPitch, hostSlicePitch, pDst, + numEventsInWaitList, phEventWaitList, phEvent)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urEnqueueMemBufferWriteRect +ur_result_t urEnqueueMemBufferWriteRect( + /// [in] handle of the queue object + ur_queue_handle_t hQueue, + /// [in][bounds(bufferOrigin, region)] handle of the buffer object + ur_mem_handle_t hBuffer, + /// [in] indicates blocking (true), non-blocking (false) + bool blockingWrite, + /// [in] 3D offset in the buffer + ur_rect_offset_t bufferOrigin, + /// [in] 3D offset in the host region + ur_rect_offset_t hostOrigin, + /// [in] 3D rectangular region descriptor: width, height, depth + ur_rect_region_t region, + /// [in] length of each row in bytes in the buffer object + size_t bufferRowPitch, + /// [in] length of each 2D slice in bytes in the buffer object being written + size_t bufferSlicePitch, + /// [in] length of each row in bytes in the host memory region pointed by + /// src + size_t hostRowPitch, + /// [in] length of each 2D slice in bytes in the host memory region pointed + /// by src + size_t hostSlicePitch, + /// [in] pointer to host memory where data is to be written from + void *pSrc, + /// [in] size of the event wait list + uint32_t numEventsInWaitList, + /// [in][optional][range(0, numEventsInWaitList)] points to a list of + /// events that must be complete before this command can be executed. If + /// nullptr, the numEventsInWaitList must be 0, indicating that this + /// command does not wait on any event to complete. + const ur_event_handle_t *phEventWaitList, + /// [out][optional] return an event object that identifies this particular + /// command instance. + ur_event_handle_t *phEvent) { + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWriteRect"); + + if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { + char *DstHandle = nullptr; + ur_device_handle_t Device = GetDevice(hQueue); + UR_CALL(MemBuffer->getHandle(Device, DstHandle)); + + UR_CALL(EnqueueMemCopyRectHelper( + hQueue, ur_cast(pSrc), DstHandle, hostOrigin, bufferOrigin, + region, hostRowPitch, hostSlicePitch, bufferRowPitch, bufferSlicePitch, + blockingWrite, numEventsInWaitList, phEventWaitList, phEvent)); + } else { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnMemBufferWriteRect( + hQueue, hBuffer, blockingWrite, bufferOrigin, hostOrigin, region, + bufferRowPitch, bufferSlicePitch, hostRowPitch, hostSlicePitch, pSrc, + numEventsInWaitList, phEventWaitList, phEvent)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urEnqueueMemBufferCopy +ur_result_t urEnqueueMemBufferCopy( + /// [in] handle of the queue object + ur_queue_handle_t hQueue, + /// [in][bounds(srcOffset, size)] handle of the src buffer object + ur_mem_handle_t hBufferSrc, + /// [in][bounds(dstOffset, size)] handle of the dest buffer object + ur_mem_handle_t hBufferDst, + /// [in] offset into hBufferSrc to begin copying from + size_t srcOffset, + /// [in] offset info hBufferDst to begin copying into + size_t dstOffset, + /// [in] size in bytes of data being copied + size_t size, + /// [in] size of the event wait list + uint32_t numEventsInWaitList, + /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of + /// events that must be complete before this command can be executed. If + /// nullptr, the numEventsInWaitList must be 0, indicating that this + /// command does not wait on any event to complete. + const ur_event_handle_t *phEventWaitList, + /// [out][optional] return an event object that identifies this particular + /// command instance. + ur_event_handle_t *phEvent) { + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopy"); + + auto SrcBuffer = getTsanInterceptor()->getMemBuffer(hBufferSrc); + auto DstBuffer = getTsanInterceptor()->getMemBuffer(hBufferDst); + + UR_ASSERT((SrcBuffer && DstBuffer) || (!SrcBuffer && !DstBuffer), + UR_RESULT_ERROR_INVALID_MEM_OBJECT); + + if (SrcBuffer && DstBuffer) { + ur_device_handle_t Device = GetDevice(hQueue); + std::shared_ptr DeviceInfo = + getTsanInterceptor()->getDeviceInfo(Device); + char *SrcHandle = nullptr; + UR_CALL(SrcBuffer->getHandle(Device, SrcHandle)); + + char *DstHandle = nullptr; + UR_CALL(DstBuffer->getHandle(Device, DstHandle)); + + std::vector Events; + ur_event_handle_t Event{}; + UR_CALL(getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( + hQueue, false, DstHandle + dstOffset, SrcHandle + srcOffset, size, + numEventsInWaitList, phEventWaitList, &Event)); + Events.push_back(Event); + + if (phEvent) { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnEventsWait( + hQueue, Events.size(), Events.data(), phEvent)); + } + } else { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnMemBufferCopy( + hQueue, hBufferSrc, hBufferDst, srcOffset, dstOffset, size, + numEventsInWaitList, phEventWaitList, phEvent)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urEnqueueMemBufferCopyRect +ur_result_t urEnqueueMemBufferCopyRect( + /// [in] handle of the queue object + ur_queue_handle_t hQueue, + /// [in][bounds(srcOrigin, region)] handle of the source buffer object + ur_mem_handle_t hBufferSrc, + /// [in][bounds(dstOrigin, region)] handle of the dest buffer object + ur_mem_handle_t hBufferDst, + /// [in] 3D offset in the source buffer + ur_rect_offset_t srcOrigin, + /// [in] 3D offset in the destination buffer + ur_rect_offset_t dstOrigin, + /// [in] source 3D rectangular region descriptor: width, height, depth + ur_rect_region_t region, + /// [in] length of each row in bytes in the source buffer object + size_t srcRowPitch, + /// [in] length of each 2D slice in bytes in the source buffer object + size_t srcSlicePitch, + /// [in] length of each row in bytes in the destination buffer object + size_t dstRowPitch, + /// [in] length of each 2D slice in bytes in the destination buffer object + size_t dstSlicePitch, + /// [in] size of the event wait list + uint32_t numEventsInWaitList, + /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of + /// events that must be complete before this command can be executed. If + /// nullptr, the numEventsInWaitList must be 0, indicating that this + /// command does not wait on any event to complete. + const ur_event_handle_t *phEventWaitList, + /// [out][optional] return an event object that identifies this particular + /// command instance. + ur_event_handle_t *phEvent) { + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopyRect"); + + auto SrcBuffer = getTsanInterceptor()->getMemBuffer(hBufferSrc); + auto DstBuffer = getTsanInterceptor()->getMemBuffer(hBufferDst); + + UR_ASSERT((SrcBuffer && DstBuffer) || (!SrcBuffer && !DstBuffer), + UR_RESULT_ERROR_INVALID_MEM_OBJECT); + + if (SrcBuffer && DstBuffer) { + ur_device_handle_t Device = GetDevice(hQueue); + char *SrcHandle = nullptr; + UR_CALL(SrcBuffer->getHandle(Device, SrcHandle)); + + char *DstHandle = nullptr; + UR_CALL(DstBuffer->getHandle(Device, DstHandle)); + + UR_CALL(EnqueueMemCopyRectHelper( + hQueue, SrcHandle, DstHandle, srcOrigin, dstOrigin, region, srcRowPitch, + srcSlicePitch, dstRowPitch, dstSlicePitch, false, numEventsInWaitList, + phEventWaitList, phEvent)); + } else { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnMemBufferCopyRect( + hQueue, hBufferSrc, hBufferDst, srcOrigin, dstOrigin, region, + srcRowPitch, srcSlicePitch, dstRowPitch, dstSlicePitch, + numEventsInWaitList, phEventWaitList, phEvent)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urEnqueueMemBufferFill +ur_result_t urEnqueueMemBufferFill( + /// [in] handle of the queue object + ur_queue_handle_t hQueue, + /// [in][bounds(offset, size)] handle of the buffer object + ur_mem_handle_t hBuffer, + /// [in] pointer to the fill pattern + const void *pPattern, + /// [in] size in bytes of the pattern + size_t patternSize, + /// [in] offset into the buffer + size_t offset, + /// [in] fill size in bytes, must be a multiple of patternSize + size_t size, + /// [in] size of the event wait list + uint32_t numEventsInWaitList, + /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of + /// events that must be complete before this command can be executed. If + /// nullptr, the numEventsInWaitList must be 0, indicating that this + /// command does not wait on any event to complete. + const ur_event_handle_t *phEventWaitList, + /// [out][optional] return an event object that identifies this particular + /// command instance. + ur_event_handle_t *phEvent) { + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferFill"); + + if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { + char *Handle = nullptr; + std::vector Events; + ur_event_handle_t Event{}; + ur_device_handle_t Device = GetDevice(hQueue); + UR_CALL(MemBuffer->getHandle(Device, Handle)); + UR_CALL(getContext()->urDdiTable.Enqueue.pfnUSMFill( + hQueue, Handle + offset, patternSize, pPattern, size, + numEventsInWaitList, phEventWaitList, &Event)); + Events.push_back(Event); + + if (phEvent) { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnEventsWait( + hQueue, Events.size(), Events.data(), phEvent)); + } + } else { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnMemBufferFill( + hQueue, hBuffer, pPattern, patternSize, offset, size, + numEventsInWaitList, phEventWaitList, phEvent)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urEnqueueMemBufferMap +ur_result_t urEnqueueMemBufferMap( + /// [in] handle of the queue object + ur_queue_handle_t hQueue, + ur_mem_handle_t + /// [in][bounds(offset, size)] handle of the buffer object + hBuffer, + /// [in] indicates blocking (true), non-blocking (false) + bool blockingMap, + /// [in] flags for read, write, readwrite mapping + ur_map_flags_t mapFlags, + /// [in] offset in bytes of the buffer region being mapped + size_t offset, + /// [in] size in bytes of the buffer region being mapped + size_t size, + /// [in] size of the event wait list + uint32_t numEventsInWaitList, + /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of + /// events that must be complete before this command can be executed. If + /// nullptr, the numEventsInWaitList must be 0, indicating that this + /// command does not wait on any event to complete. + const ur_event_handle_t *phEventWaitList, + /// [out][optional] return an event object that identifies this + /// particular command instance. + ur_event_handle_t *phEvent, + /// [out] return mapped pointer. TODO: move it before numEventsInWaitList? + void **ppRetMap) { + URLOG_CTX(DEBUG, "==== urEnqueueMemBufferMap"); + + if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { + // Translate the host access mode info. + MemBuffer::AccessMode AccessMode = MemBuffer::UNKNOWN; + if (mapFlags & UR_MAP_FLAG_WRITE_INVALIDATE_REGION) { + AccessMode = MemBuffer::WRITE_ONLY; + } else { + if (mapFlags & UR_MAP_FLAG_READ) { + AccessMode = MemBuffer::READ_ONLY; + if (mapFlags & UR_MAP_FLAG_WRITE) { + AccessMode = MemBuffer::READ_WRITE; + } + } else if (mapFlags & UR_MAP_FLAG_WRITE) { + AccessMode = MemBuffer::WRITE_ONLY; + } + } + + UR_ASSERT(AccessMode != MemBuffer::UNKNOWN, + UR_RESULT_ERROR_INVALID_ARGUMENT); + + ur_device_handle_t Device = GetDevice(hQueue); + // If the buffer used host pointer, then we just reuse it. If not, we + // need to manually allocate a new host USM. + if (MemBuffer->HostPtr) { + *ppRetMap = MemBuffer->HostPtr + offset; + } else { + ur_context_handle_t Context = GetContext(hQueue); + ur_usm_desc_t USMDesc{}; + USMDesc.align = MemBuffer->getAlignment(); + ur_usm_pool_handle_t Pool{}; + UR_CALL(getContext()->urDdiTable.USM.pfnHostAlloc(Context, &USMDesc, Pool, + size, ppRetMap)); + } + + // Actually, if the access mode is write only, we don't need to do this + // copy. However, in that way, we cannot generate a event to user. So, + // we'll aways do copy here. + char *SrcHandle = nullptr; + UR_CALL(MemBuffer->getHandle(Device, SrcHandle)); + UR_CALL(getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( + hQueue, blockingMap, *ppRetMap, SrcHandle + offset, size, + numEventsInWaitList, phEventWaitList, phEvent)); + + { + std::scoped_lock Guard(MemBuffer->Mutex); + UR_ASSERT(MemBuffer->Mappings.find(*ppRetMap) == + MemBuffer->Mappings.end(), + UR_RESULT_ERROR_INVALID_VALUE); + MemBuffer->Mappings[*ppRetMap] = {offset, size}; + } + } else { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnMemBufferMap( + hQueue, hBuffer, blockingMap, mapFlags, offset, size, + numEventsInWaitList, phEventWaitList, phEvent, ppRetMap)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urEnqueueMemUnmap +ur_result_t urEnqueueMemUnmap( + /// [in] handle of the queue object + ur_queue_handle_t hQueue, + /// [in] handle of the memory (buffer or image) object + ur_mem_handle_t hMem, + /// [in] mapped host address + void *pMappedPtr, + /// [in] size of the event wait list + uint32_t numEventsInWaitList, + /// [in][optional][range(0, numEventsInWaitList)] pointer to a list of + /// events that must be complete before this command can be executed. If + /// nullptr, the numEventsInWaitList must be 0, indicating that this + /// command does not wait on any event to complete. + const ur_event_handle_t *phEventWaitList, + /// [out][optional] return an event object that identifies this particular + /// command instance. + ur_event_handle_t *phEvent) { + URLOG_CTX(DEBUG, "==== urEnqueueMemUnmap"); + + if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { + MemBuffer::Mapping Mapping{}; + { + std::scoped_lock Guard(MemBuffer->Mutex); + auto It = MemBuffer->Mappings.find(pMappedPtr); + UR_ASSERT(It != MemBuffer->Mappings.end(), UR_RESULT_ERROR_INVALID_VALUE); + Mapping = It->second; + MemBuffer->Mappings.erase(It); + } + + // Write back mapping memory data to device and release mapping memory + // if we allocated a host USM. But for now, UR doesn't support event + // call back, we can only do blocking copy here. + char *DstHandle = nullptr; + ur_context_handle_t Context = GetContext(hQueue); + ur_device_handle_t Device = GetDevice(hQueue); + UR_CALL(MemBuffer->getHandle(Device, DstHandle)); + UR_CALL(getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( + hQueue, true, DstHandle + Mapping.Offset, pMappedPtr, Mapping.Size, + numEventsInWaitList, phEventWaitList, phEvent)); + + if (!MemBuffer->HostPtr) { + UR_CALL(getContext()->urDdiTable.USM.pfnFree(Context, pMappedPtr)); + } + } else { + UR_CALL(getContext()->urDdiTable.Enqueue.pfnMemUnmap( + hQueue, hMem, pMappedPtr, numEventsInWaitList, phEventWaitList, + phEvent)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urKernelCreate +ur_result_t UR_APICALL urKernelCreate( + /// [in] handle of the program instance + ur_program_handle_t hProgram, + /// [in] pointer to null-terminated string. + const char *pKernelName, + /// [out][alloc] pointer to handle of kernel object created. + ur_kernel_handle_t *phKernel) { + URLOG_CTX(DEBUG, "==== urKernelCreate"); + + UR_CALL(getContext()->urDdiTable.Kernel.pfnCreate(hProgram, pKernelName, + phKernel)); + UR_CALL(getTsanInterceptor()->insertKernel(*phKernel)); + + return UR_RESULT_SUCCESS; +} + +ur_result_t UR_APICALL urKernelCreateWithNativeHandle( + /// [in][nocheck] the native handle of the kernel. + ur_native_handle_t hNativeKernel, + /// [in] handle of the context object + ur_context_handle_t hContext, + /// [in][optional] handle of the program associated with the kernel + ur_program_handle_t hProgram, + /// [in][optional] pointer to native kernel properties struct + const ur_kernel_native_properties_t *pProperties, + /// [out][alloc] pointer to the handle of the kernel object created. + ur_kernel_handle_t *phKernel) { + URLOG_CTX(DEBUG, "==== urKernelCreate"); + + UR_CALL(getContext()->urDdiTable.Kernel.pfnCreateWithNativeHandle( + hNativeKernel, hContext, hProgram, pProperties, phKernel)); + + UR_CALL(getTsanInterceptor()->insertKernel(*phKernel)); + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urKernelRetain +ur_result_t urKernelRetain( + /// [in] handle for the Kernel to retain + ur_kernel_handle_t hKernel) { + URLOG_CTX(DEBUG, "==== urKernelRetain"); + + UR_CALL(getContext()->urDdiTable.Kernel.pfnRetain(hKernel)); + + auto &KernelInfo = getTsanInterceptor()->getKernelInfo(hKernel); + KernelInfo.RefCount++; + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urKernelRelease +ur_result_t urKernelRelease( + /// [in] handle for the Kernel to release + ur_kernel_handle_t hKernel) { + auto pfnRelease = getContext()->urDdiTable.Kernel.pfnRelease; + + URLOG_CTX(DEBUG, "==== urKernelRelease"); + + auto &KernelInfo = getTsanInterceptor()->getKernelInfo(hKernel); + if (--KernelInfo.RefCount == 0) { + UR_CALL(getTsanInterceptor()->eraseKernel(hKernel)); + } + UR_CALL(pfnRelease(hKernel)); + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urKernelSetArgValue +ur_result_t urKernelSetArgValue( + /// [in] handle of the kernel object + ur_kernel_handle_t hKernel, + /// [in] argument index in range [0, num args - 1] + uint32_t argIndex, + /// [in] size of argument type + size_t argSize, + /// [in][optional] pointer to value properties. + const ur_kernel_arg_value_properties_t *pProperties, + /// [in] argument value represented as matching arg type. + const void *pArgValue) { + URLOG_CTX(DEBUG, "==== urKernelSetArgValue"); + + std::shared_ptr MemBuffer; + if (argSize == sizeof(ur_mem_handle_t) && + (MemBuffer = getTsanInterceptor()->getMemBuffer( + *ur_cast(pArgValue)))) { + auto &KernelInfo = getTsanInterceptor()->getKernelInfo(hKernel); + std::scoped_lock Guard(KernelInfo.Mutex); + KernelInfo.BufferArgs[argIndex] = std::move(MemBuffer); + } else { + UR_CALL(getContext()->urDdiTable.Kernel.pfnSetArgValue( + hKernel, argIndex, argSize, pProperties, pArgValue)); + } + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urKernelSetArgMemObj +ur_result_t urKernelSetArgMemObj( + /// [in] handle of the kernel object + ur_kernel_handle_t hKernel, + /// [in] argument index in range [0, num args - 1] + uint32_t argIndex, + /// [in][optional] pointer to Memory object properties. + const ur_kernel_arg_mem_obj_properties_t *pProperties, + /// [in][optional] handle of Memory object. + ur_mem_handle_t hArgValue) { + URLOG_CTX(DEBUG, "==== urKernelSetArgMemObj"); + + if (std::shared_ptr MemBuffer = + getTsanInterceptor()->getMemBuffer(hArgValue)) { + auto &KernelInfo = getTsanInterceptor()->getKernelInfo(hKernel); + std::scoped_lock Guard(KernelInfo.Mutex); + KernelInfo.BufferArgs[argIndex] = std::move(MemBuffer); + } else { + UR_CALL(getContext()->urDdiTable.Kernel.pfnSetArgMemObj( + hKernel, argIndex, pProperties, hArgValue)); + } + + return UR_RESULT_SUCCESS; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMDeviceAlloc __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( @@ -344,32 +1176,20 @@ ur_result_t urCheckVersion(ur_api_version_t version) { /// @returns /// - ::UR_RESULT_SUCCESS /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::UR_RESULT_ERROR_UNSUPPORTED_VERSION __urdlllocal ur_result_t UR_APICALL urGetContextProcAddrTable( - /// [in] API version requested - ur_api_version_t version, /// [in,out] pointer to table of DDI function pointers ur_context_dditable_t *pDdiTable) { if (nullptr == pDdiTable) { return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - if (UR_MAJOR_VERSION(ur_sanitizer_layer::getContext()->version) != - UR_MAJOR_VERSION(version) || - UR_MINOR_VERSION(ur_sanitizer_layer::getContext()->version) > - UR_MINOR_VERSION(version)) { - return UR_RESULT_ERROR_UNSUPPORTED_VERSION; - } - - ur_result_t result = UR_RESULT_SUCCESS; - pDdiTable->pfnCreate = ur_sanitizer_layer::tsan::urContextCreate; pDdiTable->pfnCreateWithNativeHandle = ur_sanitizer_layer::tsan::urContextCreateWithNativeHandle; pDdiTable->pfnRetain = ur_sanitizer_layer::tsan::urContextRetain; pDdiTable->pfnRelease = ur_sanitizer_layer::tsan::urContextRelease; - return result; + return UR_RESULT_SUCCESS; } /////////////////////////////////////////////////////////////////////////////// @@ -382,12 +1202,17 @@ __urdlllocal ur_result_t UR_APICALL urGetContextProcAddrTable( ur_result_t urGetProgramProcAddrTable( /// [in,out] pointer to table of DDI function pointers ur_program_dditable_t *pDdiTable) { + if (nullptr == pDdiTable) { + return UR_RESULT_ERROR_INVALID_NULL_POINTER; + } + pDdiTable->pfnBuild = ur_sanitizer_layer::tsan::urProgramBuild; pDdiTable->pfnLink = ur_sanitizer_layer::tsan::urProgramLink; return UR_RESULT_SUCCESS; } +/////////////////////////////////////////////////////////////////////////////// /// @brief Exported function for filling application's ProgramExp table /// with current process' addresses /// @@ -397,45 +1222,84 @@ ur_result_t urGetProgramProcAddrTable( ur_result_t urGetProgramExpProcAddrTable( /// [in,out] pointer to table of DDI function pointers ur_program_exp_dditable_t *pDdiTable) { - ur_result_t result = UR_RESULT_SUCCESS; + if (nullptr == pDdiTable) { + return UR_RESULT_ERROR_INVALID_NULL_POINTER; + } pDdiTable->pfnBuildExp = ur_sanitizer_layer::tsan::urProgramBuildExp; pDdiTable->pfnLinkExp = ur_sanitizer_layer::tsan::urProgramLinkExp; - return result; + return UR_RESULT_SUCCESS; } /////////////////////////////////////////////////////////////////////////////// -/// @brief Exported function for filling application's USM table +/// @brief Exported function for filling application's Kernel table /// with current process' addresses /// /// @returns /// - ::UR_RESULT_SUCCESS /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::UR_RESULT_ERROR_UNSUPPORTED_VERSION -__urdlllocal ur_result_t UR_APICALL urGetUSMProcAddrTable( - /// [in] API version requested - ur_api_version_t version, +ur_result_t urGetKernelProcAddrTable( /// [in,out] pointer to table of DDI function pointers - ur_usm_dditable_t *pDdiTable) { + ur_kernel_dditable_t *pDdiTable) { if (nullptr == pDdiTable) { return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - if (UR_MAJOR_VERSION(ur_sanitizer_layer::getContext()->version) != - UR_MAJOR_VERSION(version) || - UR_MINOR_VERSION(ur_sanitizer_layer::getContext()->version) > - UR_MINOR_VERSION(version)) { - return UR_RESULT_ERROR_UNSUPPORTED_VERSION; + pDdiTable->pfnCreate = ur_sanitizer_layer::tsan::urKernelCreate; + pDdiTable->pfnRetain = ur_sanitizer_layer::tsan::urKernelRetain; + pDdiTable->pfnRelease = ur_sanitizer_layer::tsan::urKernelRelease; + pDdiTable->pfnSetArgValue = ur_sanitizer_layer::tsan::urKernelSetArgValue; + pDdiTable->pfnSetArgMemObj = ur_sanitizer_layer::tsan::urKernelSetArgMemObj; + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's Mem table +/// with current process' addresses +/// +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER +ur_result_t urGetMemProcAddrTable( + /// [in,out] pointer to table of DDI function pointers + ur_mem_dditable_t *pDdiTable) { + if (nullptr == pDdiTable) { + return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - ur_result_t result = UR_RESULT_SUCCESS; + pDdiTable->pfnBufferCreate = ur_sanitizer_layer::tsan::urMemBufferCreate; + pDdiTable->pfnRetain = ur_sanitizer_layer::tsan::urMemRetain; + pDdiTable->pfnRelease = ur_sanitizer_layer::tsan::urMemRelease; + pDdiTable->pfnBufferPartition = + ur_sanitizer_layer::tsan::urMemBufferPartition; + pDdiTable->pfnGetNativeHandle = + ur_sanitizer_layer::tsan::urMemGetNativeHandle; + pDdiTable->pfnGetInfo = ur_sanitizer_layer::tsan::urMemGetInfo; + + return UR_RESULT_SUCCESS; +} + +/////////////////////////////////////////////////////////////////////////////// +/// @brief Exported function for filling application's USM table +/// with current process' addresses +/// +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER +__urdlllocal ur_result_t UR_APICALL urGetUSMProcAddrTable( + /// [in,out] pointer to table of DDI function pointers + ur_usm_dditable_t *pDdiTable) { + if (nullptr == pDdiTable) { + return UR_RESULT_ERROR_INVALID_NULL_POINTER; + } pDdiTable->pfnDeviceAlloc = ur_sanitizer_layer::tsan::urUSMDeviceAlloc; pDdiTable->pfnHostAlloc = ur_sanitizer_layer::tsan::urUSMHostAlloc; pDdiTable->pfnSharedAlloc = ur_sanitizer_layer::tsan::urUSMSharedAlloc; - return result; + return UR_RESULT_SUCCESS; } /////////////////////////////////////////////////////////////////////////////// @@ -445,28 +1309,32 @@ __urdlllocal ur_result_t UR_APICALL urGetUSMProcAddrTable( /// @returns /// - ::UR_RESULT_SUCCESS /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER -/// - ::UR_RESULT_ERROR_UNSUPPORTED_VERSION __urdlllocal ur_result_t UR_APICALL urGetEnqueueProcAddrTable( - /// [in] API version requested - ur_api_version_t version, /// [in,out] pointer to table of DDI function pointers ur_enqueue_dditable_t *pDdiTable) { if (nullptr == pDdiTable) { return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - if (UR_MAJOR_VERSION(ur_sanitizer_layer::getContext()->version) != - UR_MAJOR_VERSION(version) || - UR_MINOR_VERSION(ur_sanitizer_layer::getContext()->version) > - UR_MINOR_VERSION(version)) { - return UR_RESULT_ERROR_UNSUPPORTED_VERSION; - } - - ur_result_t result = UR_RESULT_SUCCESS; - + pDdiTable->pfnMemBufferRead = + ur_sanitizer_layer::tsan::urEnqueueMemBufferRead; + pDdiTable->pfnMemBufferWrite = + ur_sanitizer_layer::tsan::urEnqueueMemBufferWrite; + pDdiTable->pfnMemBufferReadRect = + ur_sanitizer_layer::tsan::urEnqueueMemBufferReadRect; + pDdiTable->pfnMemBufferWriteRect = + ur_sanitizer_layer::tsan::urEnqueueMemBufferWriteRect; + pDdiTable->pfnMemBufferCopy = + ur_sanitizer_layer::tsan::urEnqueueMemBufferCopy; + pDdiTable->pfnMemBufferCopyRect = + ur_sanitizer_layer::tsan::urEnqueueMemBufferCopyRect; + pDdiTable->pfnMemBufferFill = + ur_sanitizer_layer::tsan::urEnqueueMemBufferFill; + pDdiTable->pfnMemBufferMap = ur_sanitizer_layer::tsan::urEnqueueMemBufferMap; + pDdiTable->pfnMemUnmap = ur_sanitizer_layer::tsan::urEnqueueMemUnmap; pDdiTable->pfnKernelLaunch = ur_sanitizer_layer::tsan::urEnqueueKernelLaunch; - return result; + return UR_RESULT_SUCCESS; } } // namespace tsan @@ -481,8 +1349,8 @@ ur_result_t initTsanDDITable(ur_dditable_t *dditable) { } if (UR_RESULT_SUCCESS == result) { - result = ur_sanitizer_layer::tsan::urGetContextProcAddrTable( - UR_API_VERSION_CURRENT, &dditable->Context); + result = + ur_sanitizer_layer::tsan::urGetContextProcAddrTable(&dditable->Context); } if (UR_RESULT_SUCCESS == result) { @@ -496,13 +1364,21 @@ ur_result_t initTsanDDITable(ur_dditable_t *dditable) { } if (UR_RESULT_SUCCESS == result) { - result = ur_sanitizer_layer::tsan::urGetUSMProcAddrTable( - UR_API_VERSION_CURRENT, &dditable->USM); + result = + ur_sanitizer_layer::tsan::urGetKernelProcAddrTable(&dditable->Kernel); } if (UR_RESULT_SUCCESS == result) { - result = ur_sanitizer_layer::tsan::urGetEnqueueProcAddrTable( - UR_API_VERSION_CURRENT, &dditable->Enqueue); + result = ur_sanitizer_layer::tsan::urGetMemProcAddrTable(&dditable->Mem); + } + + if (UR_RESULT_SUCCESS == result) { + result = ur_sanitizer_layer::tsan::urGetUSMProcAddrTable(&dditable->USM); + } + + if (UR_RESULT_SUCCESS == result) { + result = + ur_sanitizer_layer::tsan::urGetEnqueueProcAddrTable(&dditable->Enqueue); } if (result != UR_RESULT_SUCCESS) { diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp index fdd5e345be46..58f3d30a0653 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp @@ -75,7 +75,7 @@ void ContextInfo::insertAllocInfo(ur_device_handle_t Device, TsanAllocInfo AI) { } else { for (auto Device : DeviceList) { std::scoped_lock Guard(AllocInfosMapMutex); - AllocInfosMap[Device].emplace_back(std::move(AI)); + AllocInfosMap[Device].emplace_back(AI); } } } @@ -182,6 +182,24 @@ ur_result_t TsanInterceptor::eraseContext(ur_context_handle_t Context) { return UR_RESULT_SUCCESS; } +ur_result_t TsanInterceptor::insertKernel(ur_kernel_handle_t Kernel) { + std::scoped_lock Guard(m_KernelMapMutex); + if (m_KernelMap.find(Kernel) != m_KernelMap.end()) { + return UR_RESULT_SUCCESS; + } + + m_KernelMap.emplace(Kernel, Kernel); + + return UR_RESULT_SUCCESS; +} + +ur_result_t TsanInterceptor::eraseKernel(ur_kernel_handle_t Kernel) { + std::scoped_lock Guard(m_KernelMapMutex); + assert(m_KernelMap.find(Kernel) != m_KernelMap.end()); + m_KernelMap.erase(Kernel); + return UR_RESULT_SUCCESS; +} + ur_result_t TsanInterceptor::insertDevice(ur_device_handle_t Device, std::shared_ptr &DI) { std::scoped_lock Guard(m_DeviceMapMutex); @@ -199,6 +217,32 @@ ur_result_t TsanInterceptor::insertDevice(ur_device_handle_t Device, return UR_RESULT_SUCCESS; } +ur_result_t +TsanInterceptor::insertMemBuffer(std::shared_ptr MemBuffer) { + std::scoped_lock Guard(m_MemBufferMapMutex); + assert(m_MemBufferMap.find(ur_cast(MemBuffer.get())) == + m_MemBufferMap.end()); + m_MemBufferMap.emplace(reinterpret_cast(MemBuffer.get()), + MemBuffer); + return UR_RESULT_SUCCESS; +} + +ur_result_t TsanInterceptor::eraseMemBuffer(ur_mem_handle_t MemHandle) { + std::scoped_lock Guard(m_MemBufferMapMutex); + assert(m_MemBufferMap.find(MemHandle) != m_MemBufferMap.end()); + m_MemBufferMap.erase(MemHandle); + return UR_RESULT_SUCCESS; +} + +std::shared_ptr +TsanInterceptor::getMemBuffer(ur_mem_handle_t MemHandle) { + std::shared_lock Guard(m_MemBufferMapMutex); + if (m_MemBufferMap.find(MemHandle) != m_MemBufferMap.end()) { + return m_MemBufferMap[MemHandle]; + } + return nullptr; +} + ur_result_t TsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ur_queue_handle_t Queue, LaunchInfo &LaunchInfo) { @@ -240,6 +284,24 @@ ur_result_t TsanInterceptor::prepareLaunch(std::shared_ptr &, ur_queue_handle_t Queue, ur_kernel_handle_t Kernel, LaunchInfo &LaunchInfo) { + // Set membuffer arguments + auto &KernelInfo = getKernelInfo(Kernel); + { + std::shared_lock Guard(KernelInfo.Mutex); + for (const auto &[ArgIndex, MemBuffer] : KernelInfo.BufferArgs) { + char *ArgPointer = nullptr; + UR_CALL(MemBuffer->getHandle(DI->Handle, ArgPointer)); + ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( + Kernel, ArgIndex, nullptr, ArgPointer); + if (URes != UR_RESULT_SUCCESS) { + URLOG_CTX(ERR, + "Failed to set buffer {} as the {} arg to kernel {}: {}", + ur_cast(MemBuffer.get()), ArgIndex, Kernel, + URes); + } + } + } + // Prepare launch info data LaunchInfo.Data.Host.GlobalShadowOffset = DI->Shadow->ShadowBegin; LaunchInfo.Data.Host.GlobalShadowOffsetEnd = DI->Shadow->ShadowEnd; diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.hpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.hpp index f7d79c60a209..c98df6fb5955 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.hpp @@ -15,6 +15,7 @@ #include "sanitizer_common/sanitizer_allocator.hpp" #include "sanitizer_common/sanitizer_common.hpp" +#include "tsan_buffer.hpp" #include "tsan_libdevice.hpp" #include "tsan_shadow.hpp" #include "ur_sanitizer_layer.hpp" @@ -75,6 +76,33 @@ struct DeviceGlobalInfo { uptr Addr; }; +struct KernelInfo { + ur_kernel_handle_t Handle = nullptr; + std::atomic RefCount = 1; + + // lock this mutex if following fields are accessed + ur_shared_mutex Mutex; + std::unordered_map> BufferArgs; + + KernelInfo() = default; + + explicit KernelInfo(ur_kernel_handle_t Kernel) : Handle(Kernel) { + [[maybe_unused]] auto Result = + getContext()->urDdiTable.Kernel.pfnRetain(Kernel); + assert(Result == UR_RESULT_SUCCESS); + } + + ~KernelInfo() { + [[maybe_unused]] auto Result = + getContext()->urDdiTable.Kernel.pfnRelease(Handle); + assert(Result == UR_RESULT_SUCCESS); + } + + KernelInfo(const KernelInfo &) = delete; + + KernelInfo &operator=(const KernelInfo &) = delete; +}; + struct TsanRuntimeDataWrapper { TsanRuntimeData Host{}; @@ -145,6 +173,16 @@ class TsanInterceptor { ur_result_t insertDevice(ur_device_handle_t Device, std::shared_ptr &DI); + ur_result_t insertKernel(ur_kernel_handle_t Kernel); + + ur_result_t eraseKernel(ur_kernel_handle_t Kernel); + + ur_result_t insertMemBuffer(std::shared_ptr MemBuffer); + + ur_result_t eraseMemBuffer(ur_mem_handle_t MemHandle); + + std::shared_ptr getMemBuffer(ur_mem_handle_t MemHandle); + ur_result_t preLaunchKernel(ur_kernel_handle_t Kernel, ur_queue_handle_t Queue, LaunchInfo &LaunchInfo); @@ -163,6 +201,12 @@ class TsanInterceptor { return m_DeviceMap[Device]; } + KernelInfo &getKernelInfo(ur_kernel_handle_t Kernel) { + std::shared_lock Guard(m_KernelMapMutex); + assert(m_KernelMap.find(Kernel) != m_KernelMap.end()); + return m_KernelMap[Kernel]; + } + private: ur_result_t updateShadowMemory(std::shared_ptr &CI, std::shared_ptr &DI, @@ -183,6 +227,13 @@ class TsanInterceptor { std::unordered_map> m_DeviceMap; ur_shared_mutex m_DeviceMapMutex; + + std::unordered_map m_KernelMap; + ur_shared_mutex m_KernelMapMutex; + + std::unordered_map> + m_MemBufferMap; + ur_shared_mutex m_MemBufferMapMutex; }; } // namespace tsan diff --git a/unified-runtime/source/loader/layers/sanitizer/ur_sanitizer_layer.cpp b/unified-runtime/source/loader/layers/sanitizer/ur_sanitizer_layer.cpp index ae8cee61a1c2..9c57308c99d1 100644 --- a/unified-runtime/source/loader/layers/sanitizer/ur_sanitizer_layer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/ur_sanitizer_layer.cpp @@ -16,7 +16,13 @@ #include "msan/msan_ddi.hpp" namespace ur_sanitizer_layer { -context_t *getContext() { return context_t::get_direct(); } +context_t *getContext() { + try { + return context_t::get_direct(); + } catch (...) { + die("Failed to get sanitizer context."); + } +} /////////////////////////////////////////////////////////////////////////////// context_t::context_t() diff --git a/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp b/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp index ac941397353a..6a9536f18164 100644 --- a/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp +++ b/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp @@ -6350,50 +6350,6 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Intercept function for urUSMPoolSetThresholdExp -__urdlllocal ur_result_t UR_APICALL urUSMPoolSetThresholdExp( - /// [in] handle of the context object - ur_context_handle_t hContext, - /// [in] handle of the device object - ur_device_handle_t hDevice, - /// [in] handle to USM memory pool for the threshold to be set - ur_usm_pool_handle_t hPool, - /// [in] release threshold to be set - size_t newThreshold) { - auto pfnPoolSetThresholdExp = - getContext()->urDdiTable.USMExp.pfnPoolSetThresholdExp; - - if (nullptr == pfnPoolSetThresholdExp) - return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; - - ur_usm_pool_set_threshold_exp_params_t params = {&hContext, &hDevice, &hPool, - &newThreshold}; - uint64_t instance = - getContext()->notify_begin(UR_FUNCTION_USM_POOL_SET_THRESHOLD_EXP, - "urUSMPoolSetThresholdExp", ¶ms); - - auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolSetThresholdExp\n"); - - ur_result_t result = - pfnPoolSetThresholdExp(hContext, hDevice, hPool, newThreshold); - - getContext()->notify_end(UR_FUNCTION_USM_POOL_SET_THRESHOLD_EXP, - "urUSMPoolSetThresholdExp", ¶ms, &result, - instance); - - if (logger.getLevel() <= logger::Level::INFO) { - std::ostringstream args_str; - ur::extras::printFunctionParams( - args_str, UR_FUNCTION_USM_POOL_SET_THRESHOLD_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolSetThresholdExp({}) -> {};\n", - args_str.str(), result); - } - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMPoolGetDefaultDevicePoolExp __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( @@ -6477,6 +6433,46 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urUSMPoolSetInfoExp +__urdlllocal ur_result_t UR_APICALL urUSMPoolSetInfoExp( + /// [in] handle to USM memory pool for the property to be set + ur_usm_pool_handle_t hPool, + /// [in] setting property name + ur_usm_pool_info_t propName, + /// [in] pointer to value to assign + void *pPropValue, + /// [in] size of value to assign + size_t propSize) { + auto pfnPoolSetInfoExp = getContext()->urDdiTable.USMExp.pfnPoolSetInfoExp; + + if (nullptr == pfnPoolSetInfoExp) + return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; + + ur_usm_pool_set_info_exp_params_t params = {&hPool, &propName, &pPropValue, + &propSize}; + uint64_t instance = getContext()->notify_begin( + UR_FUNCTION_USM_POOL_SET_INFO_EXP, "urUSMPoolSetInfoExp", ¶ms); + + auto &logger = getContext()->logger; + URLOG_(logger, INFO, " ---> urUSMPoolSetInfoExp\n"); + + ur_result_t result = pfnPoolSetInfoExp(hPool, propName, pPropValue, propSize); + + getContext()->notify_end(UR_FUNCTION_USM_POOL_SET_INFO_EXP, + "urUSMPoolSetInfoExp", ¶ms, &result, instance); + + if (logger.getLevel() <= logger::Level::INFO) { + std::ostringstream args_str; + ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_SET_INFO_EXP, + ¶ms); + URLOG_(logger, INFO, " <--- urUSMPoolSetInfoExp({}) -> {};\n", + args_str.str(), result); + } + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMPoolSetDevicePoolExp __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( @@ -10919,10 +10915,6 @@ __urdlllocal ur_result_t UR_APICALL urGetUSMExpProcAddrTable( dditable.pfnPoolDestroyExp = pDdiTable->pfnPoolDestroyExp; pDdiTable->pfnPoolDestroyExp = ur_tracing_layer::urUSMPoolDestroyExp; - dditable.pfnPoolSetThresholdExp = pDdiTable->pfnPoolSetThresholdExp; - pDdiTable->pfnPoolSetThresholdExp = - ur_tracing_layer::urUSMPoolSetThresholdExp; - dditable.pfnPoolGetDefaultDevicePoolExp = pDdiTable->pfnPoolGetDefaultDevicePoolExp; pDdiTable->pfnPoolGetDefaultDevicePoolExp = @@ -10931,6 +10923,9 @@ __urdlllocal ur_result_t UR_APICALL urGetUSMExpProcAddrTable( dditable.pfnPoolGetInfoExp = pDdiTable->pfnPoolGetInfoExp; pDdiTable->pfnPoolGetInfoExp = ur_tracing_layer::urUSMPoolGetInfoExp; + dditable.pfnPoolSetInfoExp = pDdiTable->pfnPoolSetInfoExp; + pDdiTable->pfnPoolSetInfoExp = ur_tracing_layer::urUSMPoolSetInfoExp; + dditable.pfnPoolSetDevicePoolExp = pDdiTable->pfnPoolSetDevicePoolExp; pDdiTable->pfnPoolSetDevicePoolExp = ur_tracing_layer::urUSMPoolSetDevicePoolExp; diff --git a/unified-runtime/source/loader/layers/validation/ur_valddi.cpp b/unified-runtime/source/loader/layers/validation/ur_valddi.cpp index 5354e36077a9..b7a8752ee9f0 100644 --- a/unified-runtime/source/loader/layers/validation/ur_valddi.cpp +++ b/unified-runtime/source/loader/layers/validation/ur_valddi.cpp @@ -6928,56 +6928,6 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Intercept function for urUSMPoolSetThresholdExp -__urdlllocal ur_result_t UR_APICALL urUSMPoolSetThresholdExp( - /// [in] handle of the context object - ur_context_handle_t hContext, - /// [in] handle of the device object - ur_device_handle_t hDevice, - /// [in] handle to USM memory pool for the threshold to be set - ur_usm_pool_handle_t hPool, - /// [in] release threshold to be set - size_t newThreshold) { - auto pfnPoolSetThresholdExp = - getContext()->urDdiTable.USMExp.pfnPoolSetThresholdExp; - - if (nullptr == pfnPoolSetThresholdExp) { - return UR_RESULT_ERROR_UNINITIALIZED; - } - - if (getContext()->enableParameterValidation) { - if (NULL == hContext) - return UR_RESULT_ERROR_INVALID_NULL_HANDLE; - - if (NULL == hDevice) - return UR_RESULT_ERROR_INVALID_NULL_HANDLE; - - if (NULL == hPool) - return UR_RESULT_ERROR_INVALID_NULL_HANDLE; - } - - if (getContext()->enableLifetimeValidation && - !getContext()->refCountContext->isReferenceValid(hContext)) { - URLOG_CTX_INVALID_REFERENCE(hContext); - } - - if (getContext()->enableLifetimeValidation && - !getContext()->refCountContext->isReferenceValid(hDevice)) { - URLOG_CTX_INVALID_REFERENCE(hDevice); - } - - if (getContext()->enableLifetimeValidation && - !getContext()->refCountContext->isReferenceValid(hPool)) { - URLOG_CTX_INVALID_REFERENCE(hPool); - } - - ur_result_t result = - pfnPoolSetThresholdExp(hContext, hDevice, hPool, newThreshold); - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMPoolGetDefaultDevicePoolExp __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( @@ -7059,6 +7009,47 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urUSMPoolSetInfoExp +__urdlllocal ur_result_t UR_APICALL urUSMPoolSetInfoExp( + /// [in] handle to USM memory pool for the property to be set + ur_usm_pool_handle_t hPool, + /// [in] setting property name + ur_usm_pool_info_t propName, + /// [in] pointer to value to assign + void *pPropValue, + /// [in] size of value to assign + size_t propSize) { + auto pfnPoolSetInfoExp = getContext()->urDdiTable.USMExp.pfnPoolSetInfoExp; + + if (nullptr == pfnPoolSetInfoExp) { + return UR_RESULT_ERROR_UNINITIALIZED; + } + + if (getContext()->enableParameterValidation) { + if (NULL == pPropValue) + return UR_RESULT_ERROR_INVALID_NULL_POINTER; + + if (pPropValue == NULL) + return UR_RESULT_ERROR_INVALID_NULL_POINTER; + + if (NULL == hPool) + return UR_RESULT_ERROR_INVALID_NULL_HANDLE; + + if (UR_USM_POOL_INFO_USED_HIGH_EXP < propName) + return UR_RESULT_ERROR_INVALID_ENUMERATION; + } + + if (getContext()->enableLifetimeValidation && + !getContext()->refCountContext->isReferenceValid(hPool)) { + URLOG_CTX_INVALID_REFERENCE(hPool); + } + + ur_result_t result = pfnPoolSetInfoExp(hPool, propName, pPropValue, propSize); + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMPoolSetDevicePoolExp __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( @@ -11579,10 +11570,6 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetUSMExpProcAddrTable( dditable.pfnPoolDestroyExp = pDdiTable->pfnPoolDestroyExp; pDdiTable->pfnPoolDestroyExp = ur_validation_layer::urUSMPoolDestroyExp; - dditable.pfnPoolSetThresholdExp = pDdiTable->pfnPoolSetThresholdExp; - pDdiTable->pfnPoolSetThresholdExp = - ur_validation_layer::urUSMPoolSetThresholdExp; - dditable.pfnPoolGetDefaultDevicePoolExp = pDdiTable->pfnPoolGetDefaultDevicePoolExp; pDdiTable->pfnPoolGetDefaultDevicePoolExp = @@ -11591,6 +11578,9 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetUSMExpProcAddrTable( dditable.pfnPoolGetInfoExp = pDdiTable->pfnPoolGetInfoExp; pDdiTable->pfnPoolGetInfoExp = ur_validation_layer::urUSMPoolGetInfoExp; + dditable.pfnPoolSetInfoExp = pDdiTable->pfnPoolSetInfoExp; + pDdiTable->pfnPoolSetInfoExp = ur_validation_layer::urUSMPoolSetInfoExp; + dditable.pfnPoolSetDevicePoolExp = pDdiTable->pfnPoolSetDevicePoolExp; pDdiTable->pfnPoolSetDevicePoolExp = ur_validation_layer::urUSMPoolSetDevicePoolExp; diff --git a/unified-runtime/source/loader/loader.def.in b/unified-runtime/source/loader/loader.def.in index f9e66a8f9899..2c1d2203ad31 100644 --- a/unified-runtime/source/loader/loader.def.in +++ b/unified-runtime/source/loader/loader.def.in @@ -509,7 +509,7 @@ EXPORTS urPrintUsmPoolReleaseParams urPrintUsmPoolRetainParams urPrintUsmPoolSetDevicePoolExpParams - urPrintUsmPoolSetThresholdExpParams + urPrintUsmPoolSetInfoExpParams urPrintUsmPoolTrimToExpParams urPrintUsmReleaseExpParams urPrintUsmSharedAllocParams @@ -571,7 +571,7 @@ EXPORTS urUSMPoolRelease urUSMPoolRetain urUSMPoolSetDevicePoolExp - urUSMPoolSetThresholdExp + urUSMPoolSetInfoExp urUSMPoolTrimToExp urUSMReleaseExp urUSMSharedAlloc diff --git a/unified-runtime/source/loader/loader.map.in b/unified-runtime/source/loader/loader.map.in index 459fcc2bdba7..687f97b28350 100644 --- a/unified-runtime/source/loader/loader.map.in +++ b/unified-runtime/source/loader/loader.map.in @@ -509,7 +509,7 @@ urPrintUsmPoolReleaseParams; urPrintUsmPoolRetainParams; urPrintUsmPoolSetDevicePoolExpParams; - urPrintUsmPoolSetThresholdExpParams; + urPrintUsmPoolSetInfoExpParams; urPrintUsmPoolTrimToExpParams; urPrintUsmReleaseExpParams; urPrintUsmSharedAllocParams; @@ -571,7 +571,7 @@ urUSMPoolRelease; urUSMPoolRetain; urUSMPoolSetDevicePoolExp; - urUSMPoolSetThresholdExp; + urUSMPoolSetInfoExp; urUSMPoolTrimToExp; urUSMReleaseExp; urUSMSharedAlloc; diff --git a/unified-runtime/source/loader/ur_adapter_registry.hpp b/unified-runtime/source/loader/ur_adapter_registry.hpp index d29742652ed0..0613b88fd111 100644 --- a/unified-runtime/source/loader/ur_adapter_registry.hpp +++ b/unified-runtime/source/loader/ur_adapter_registry.hpp @@ -280,9 +280,9 @@ class AdapterRegistry { [](unsigned char c) { return std::tolower(c); }); if (PositiveFilter) { - positiveFilters.push_back({backend, termPair.second}); + positiveFilters.push_back({std::move(backend), termPair.second}); } else { - negativeFilters.push_back({backend, termPair.second}); + negativeFilters.push_back({std::move(backend), termPair.second}); } } @@ -297,7 +297,8 @@ class AdapterRegistry { for (const auto &device : manifest.device_types) { ur_device_tuple single_device = {manifest.backend, device}; - auto matchesFilter = [single_device](const FilterTerm &f) -> bool { + const auto matchesFilter = + [single_device](const FilterTerm &f) -> bool { return f.matches(single_device); }; diff --git a/unified-runtime/source/loader/ur_ldrddi.cpp b/unified-runtime/source/loader/ur_ldrddi.cpp index 090839c1a80f..842e93969f3e 100644 --- a/unified-runtime/source/loader/ur_ldrddi.cpp +++ b/unified-runtime/source/loader/ur_ldrddi.cpp @@ -6512,42 +6512,6 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Intercept function for urUSMPoolSetThresholdExp -__urdlllocal ur_result_t UR_APICALL urUSMPoolSetThresholdExp( - /// [in] handle of the context object - ur_context_handle_t hContext, - /// [in] handle of the device object - ur_device_handle_t hDevice, - /// [in] handle to USM memory pool for the threshold to be set - ur_usm_pool_handle_t hPool, - /// [in] release threshold to be set - size_t newThreshold) { - ur_result_t result = UR_RESULT_SUCCESS; - - [[maybe_unused]] auto context = getContext(); - - // extract platform's function pointer table - auto dditable = reinterpret_cast(hContext)->dditable; - auto pfnPoolSetThresholdExp = dditable->ur.USMExp.pfnPoolSetThresholdExp; - if (nullptr == pfnPoolSetThresholdExp) - return UR_RESULT_ERROR_UNINITIALIZED; - - // convert loader handle to platform handle - hContext = reinterpret_cast(hContext)->handle; - - // convert loader handle to platform handle - hDevice = reinterpret_cast(hDevice)->handle; - - // convert loader handle to platform handle - hPool = reinterpret_cast(hPool)->handle; - - // forward to device-platform - result = pfnPoolSetThresholdExp(hContext, hDevice, hPool, newThreshold); - - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMPoolGetDefaultDevicePoolExp __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( @@ -6621,6 +6585,36 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Intercept function for urUSMPoolSetInfoExp +__urdlllocal ur_result_t UR_APICALL urUSMPoolSetInfoExp( + /// [in] handle to USM memory pool for the property to be set + ur_usm_pool_handle_t hPool, + /// [in] setting property name + ur_usm_pool_info_t propName, + /// [in] pointer to value to assign + void *pPropValue, + /// [in] size of value to assign + size_t propSize) { + ur_result_t result = UR_RESULT_SUCCESS; + + [[maybe_unused]] auto context = getContext(); + + // extract platform's function pointer table + auto dditable = reinterpret_cast(hPool)->dditable; + auto pfnPoolSetInfoExp = dditable->ur.USMExp.pfnPoolSetInfoExp; + if (nullptr == pfnPoolSetInfoExp) + return UR_RESULT_ERROR_UNINITIALIZED; + + // convert loader handle to platform handle + hPool = reinterpret_cast(hPool)->handle; + + // forward to device-platform + result = pfnPoolSetInfoExp(hPool, propName, pPropValue, propSize); + + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMPoolSetDevicePoolExp __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( @@ -11099,10 +11093,10 @@ UR_DLLEXPORT ur_result_t UR_APICALL urGetUSMExpProcAddrTable( // return pointers to loader's DDIs pDdiTable->pfnPoolCreateExp = ur_loader::urUSMPoolCreateExp; pDdiTable->pfnPoolDestroyExp = ur_loader::urUSMPoolDestroyExp; - pDdiTable->pfnPoolSetThresholdExp = ur_loader::urUSMPoolSetThresholdExp; pDdiTable->pfnPoolGetDefaultDevicePoolExp = ur_loader::urUSMPoolGetDefaultDevicePoolExp; pDdiTable->pfnPoolGetInfoExp = ur_loader::urUSMPoolGetInfoExp; + pDdiTable->pfnPoolSetInfoExp = ur_loader::urUSMPoolSetInfoExp; pDdiTable->pfnPoolSetDevicePoolExp = ur_loader::urUSMPoolSetDevicePoolExp; pDdiTable->pfnPoolGetDevicePoolExp = ur_loader::urUSMPoolGetDevicePoolExp; pDdiTable->pfnPoolTrimToExp = ur_loader::urUSMPoolTrimToExp; diff --git a/unified-runtime/source/loader/ur_libapi.cpp b/unified-runtime/source/loader/ur_libapi.cpp index 9bc71cb04d17..8019681b288d 100644 --- a/unified-runtime/source/loader/ur_libapi.cpp +++ b/unified-runtime/source/loader/ur_libapi.cpp @@ -6978,44 +6978,6 @@ ur_result_t UR_APICALL urUSMPoolDestroyExp( return exceptionToResult(std::current_exception()); } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Set a new release threshold for a USM memory pool. -/// -/// @details -/// - Set a new release threshold for a USM memory pool. -/// -/// @returns -/// - ::UR_RESULT_SUCCESS -/// - ::UR_RESULT_ERROR_UNINITIALIZED -/// - ::UR_RESULT_ERROR_DEVICE_LOST -/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC -/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `NULL == hContext` -/// + `NULL == hDevice` -/// + `NULL == hPool` -/// - ::UR_RESULT_ERROR_INVALID_VALUE -/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE -/// + If any device associated with `hContext` reports `false` for -/// ::UR_DEVICE_INFO_USM_POOL_SUPPORT -ur_result_t UR_APICALL urUSMPoolSetThresholdExp( - /// [in] handle of the context object - ur_context_handle_t hContext, - /// [in] handle of the device object - ur_device_handle_t hDevice, - /// [in] handle to USM memory pool for the threshold to be set - ur_usm_pool_handle_t hPool, - /// [in] release threshold to be set - size_t newThreshold) try { - auto pfnPoolSetThresholdExp = - ur_lib::getContext()->urDdiTable.USMExp.pfnPoolSetThresholdExp; - if (nullptr == pfnPoolSetThresholdExp) - return UR_RESULT_ERROR_UNINITIALIZED; - - return pfnPoolSetThresholdExp(hContext, hDevice, hPool, newThreshold); -} catch (...) { - return exceptionToResult(std::current_exception()); -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Get the default pool for a device. /// @@ -7072,7 +7034,6 @@ ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `pPropValue == NULL && pPropSizeRet == NULL` -/// - ::UR_RESULT_ERROR_INVALID_DEVICE /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY ur_result_t UR_APICALL urUSMPoolGetInfoExp( @@ -7094,6 +7055,51 @@ ur_result_t UR_APICALL urUSMPoolGetInfoExp( return exceptionToResult(std::current_exception()); } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Set a property for a USM memory pool. +/// +/// @details +/// - Set a property for a USM memory pool. +/// +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_UNINITIALIZED +/// - ::UR_RESULT_ERROR_DEVICE_LOST +/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC +/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `NULL == hPool` +/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION +/// + `::UR_USM_POOL_INFO_USED_HIGH_EXP < propName` +/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER +/// + `NULL == pPropValue` +/// + `pPropValue == NULL` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + If `propName` is not supported by the adapter. +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If any device associated with `hContext` reports `false` for +/// ::UR_DEVICE_INFO_USM_POOL_SUPPORT +/// - ::UR_RESULT_ERROR_INVALID_DEVICE +/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES +/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY +ur_result_t UR_APICALL urUSMPoolSetInfoExp( + /// [in] handle to USM memory pool for the property to be set + ur_usm_pool_handle_t hPool, + /// [in] setting property name + ur_usm_pool_info_t propName, + /// [in] pointer to value to assign + void *pPropValue, + /// [in] size of value to assign + size_t propSize) try { + auto pfnPoolSetInfoExp = + ur_lib::getContext()->urDdiTable.USMExp.pfnPoolSetInfoExp; + if (nullptr == pfnPoolSetInfoExp) + return UR_RESULT_ERROR_UNINITIALIZED; + + return pfnPoolSetInfoExp(hPool, propName, pPropValue, propSize); +} catch (...) { + return exceptionToResult(std::current_exception()); +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Set the current pool for a device. /// diff --git a/unified-runtime/source/loader/ur_print.cpp b/unified-runtime/source/loader/ur_print.cpp index 15967bb5fe30..50af3986b2f3 100644 --- a/unified-runtime/source/loader/ur_print.cpp +++ b/unified-runtime/source/loader/ur_print.cpp @@ -2671,14 +2671,6 @@ ur_result_t urPrintUsmPoolDestroyExpParams( return str_copy(&ss, buffer, buff_size, out_size); } -ur_result_t urPrintUsmPoolSetThresholdExpParams( - const struct ur_usm_pool_set_threshold_exp_params_t *params, char *buffer, - const size_t buff_size, size_t *out_size) { - std::stringstream ss; - ss << params; - return str_copy(&ss, buffer, buff_size, out_size); -} - ur_result_t urPrintUsmPoolGetDefaultDevicePoolExpParams( const struct ur_usm_pool_get_default_device_pool_exp_params_t *params, char *buffer, const size_t buff_size, size_t *out_size) { @@ -2695,6 +2687,14 @@ ur_result_t urPrintUsmPoolGetInfoExpParams( return str_copy(&ss, buffer, buff_size, out_size); } +ur_result_t urPrintUsmPoolSetInfoExpParams( + const struct ur_usm_pool_set_info_exp_params_t *params, char *buffer, + const size_t buff_size, size_t *out_size) { + std::stringstream ss; + ss << params; + return str_copy(&ss, buffer, buff_size, out_size); +} + ur_result_t urPrintUsmPoolSetDevicePoolExpParams( const struct ur_usm_pool_set_device_pool_exp_params_t *params, char *buffer, const size_t buff_size, size_t *out_size) { diff --git a/unified-runtime/source/ur_api.cpp b/unified-runtime/source/ur_api.cpp index 10440f0f377c..2bc2da22f256 100644 --- a/unified-runtime/source/ur_api.cpp +++ b/unified-runtime/source/ur_api.cpp @@ -6123,38 +6123,6 @@ ur_result_t UR_APICALL urUSMPoolDestroyExp( return result; } -/////////////////////////////////////////////////////////////////////////////// -/// @brief Set a new release threshold for a USM memory pool. -/// -/// @details -/// - Set a new release threshold for a USM memory pool. -/// -/// @returns -/// - ::UR_RESULT_SUCCESS -/// - ::UR_RESULT_ERROR_UNINITIALIZED -/// - ::UR_RESULT_ERROR_DEVICE_LOST -/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC -/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE -/// + `NULL == hContext` -/// + `NULL == hDevice` -/// + `NULL == hPool` -/// - ::UR_RESULT_ERROR_INVALID_VALUE -/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE -/// + If any device associated with `hContext` reports `false` for -/// ::UR_DEVICE_INFO_USM_POOL_SUPPORT -ur_result_t UR_APICALL urUSMPoolSetThresholdExp( - /// [in] handle of the context object - ur_context_handle_t hContext, - /// [in] handle of the device object - ur_device_handle_t hDevice, - /// [in] handle to USM memory pool for the threshold to be set - ur_usm_pool_handle_t hPool, - /// [in] release threshold to be set - size_t newThreshold) { - ur_result_t result = UR_RESULT_SUCCESS; - return result; -} - /////////////////////////////////////////////////////////////////////////////// /// @brief Get the default pool for a device. /// @@ -6205,7 +6173,6 @@ ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( /// + If `propName` is not supported by the adapter. /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER /// + `pPropValue == NULL && pPropSizeRet == NULL` -/// - ::UR_RESULT_ERROR_INVALID_DEVICE /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY ur_result_t UR_APICALL urUSMPoolGetInfoExp( @@ -6221,6 +6188,45 @@ ur_result_t UR_APICALL urUSMPoolGetInfoExp( return result; } +/////////////////////////////////////////////////////////////////////////////// +/// @brief Set a property for a USM memory pool. +/// +/// @details +/// - Set a property for a USM memory pool. +/// +/// @returns +/// - ::UR_RESULT_SUCCESS +/// - ::UR_RESULT_ERROR_UNINITIALIZED +/// - ::UR_RESULT_ERROR_DEVICE_LOST +/// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC +/// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE +/// + `NULL == hPool` +/// - ::UR_RESULT_ERROR_INVALID_ENUMERATION +/// + `::UR_USM_POOL_INFO_USED_HIGH_EXP < propName` +/// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER +/// + `NULL == pPropValue` +/// + `pPropValue == NULL` +/// - ::UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION +/// + If `propName` is not supported by the adapter. +/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE +/// + If any device associated with `hContext` reports `false` for +/// ::UR_DEVICE_INFO_USM_POOL_SUPPORT +/// - ::UR_RESULT_ERROR_INVALID_DEVICE +/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES +/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY +ur_result_t UR_APICALL urUSMPoolSetInfoExp( + /// [in] handle to USM memory pool for the property to be set + ur_usm_pool_handle_t hPool, + /// [in] setting property name + ur_usm_pool_info_t propName, + /// [in] pointer to value to assign + void *pPropValue, + /// [in] size of value to assign + size_t propSize) { + ur_result_t result = UR_RESULT_SUCCESS; + return result; +} + /////////////////////////////////////////////////////////////////////////////// /// @brief Set the current pool for a device. /// diff --git a/unified-runtime/test/adapters/cuda/CMakeLists.txt b/unified-runtime/test/adapters/cuda/CMakeLists.txt index 3f2f0c270c73..82d4227a6aff 100644 --- a/unified-runtime/test/adapters/cuda/CMakeLists.txt +++ b/unified-runtime/test/adapters/cuda/CMakeLists.txt @@ -29,4 +29,6 @@ target_include_directories(test-adapter-cuda PRIVATE ${PROJECT_SOURCE_DIR}/source/adapters/cuda ) -target_link_libraries(test-adapter-cuda PRIVATE cudadrv ${PROJECT_NAME}::umf) +find_package(CUDAToolkit 10.1 REQUIRED) + +target_link_libraries(test-adapter-cuda PRIVATE cudadrv CUDA::nvml ${PROJECT_NAME}::umf) diff --git a/unified-runtime/test/conformance/device/urDeviceGetInfo.cpp b/unified-runtime/test/conformance/device/urDeviceGetInfo.cpp index ef650c2e90e8..6ddfc973088d 100644 --- a/unified-runtime/test/conformance/device/urDeviceGetInfo.cpp +++ b/unified-runtime/test/conformance/device/urDeviceGetInfo.cpp @@ -2562,6 +2562,10 @@ TEST_P(urDeviceGetInfoTest, SuccessUseNativeAssert) { } TEST_P(urDeviceGetInfoTest, SuccessThrottleReasons) { + // TODO: enable when driver/library version mismatch is fixed in CI. + // See https://github.com/intel/llvm/issues/17614 + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + size_t property_size = 0; const ur_device_info_t property_name = UR_DEVICE_INFO_CURRENT_CLOCK_THROTTLE_REASONS; @@ -2579,6 +2583,10 @@ TEST_P(urDeviceGetInfoTest, SuccessThrottleReasons) { } TEST_P(urDeviceGetInfoTest, SuccessFanSpeed) { + // TODO: enable when driver/library version mismatch is fixed in CI. + // See https://github.com/intel/llvm/issues/17614 + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + size_t property_size = 0; const ur_device_info_t property_name = UR_DEVICE_INFO_FAN_SPEED; @@ -2596,6 +2604,10 @@ TEST_P(urDeviceGetInfoTest, SuccessFanSpeed) { } TEST_P(urDeviceGetInfoTest, SuccessMaxPowerLimit) { + // TODO: enable when driver/library version mismatch is fixed in CI. + // See https://github.com/intel/llvm/issues/17614 + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + size_t property_size = 0; const ur_device_info_t property_name = UR_DEVICE_INFO_MAX_POWER_LIMIT; @@ -2613,6 +2625,10 @@ TEST_P(urDeviceGetInfoTest, SuccessMaxPowerLimit) { } TEST_P(urDeviceGetInfoTest, SuccessMinPowerLimit) { + // TODO: enable when driver/library version mismatch is fixed in CI. + // See https://github.com/intel/llvm/issues/17614 + UUR_KNOWN_FAILURE_ON(uur::CUDA{}); + size_t property_size = 0; const ur_device_info_t property_name = UR_DEVICE_INFO_MIN_POWER_LIMIT; diff --git a/unified-runtime/third_party/benchmark_requirements.txt b/unified-runtime/third_party/benchmark_requirements.txt deleted file mode 100644 index 0df355c4bea6..000000000000 --- a/unified-runtime/third_party/benchmark_requirements.txt +++ /dev/null @@ -1,44 +0,0 @@ -six==1.16.0 -matplotlib==3.9.2 -mpld3==0.5.10 -alabaster==0.7.12 -Babel==2.14.0 -bandit==1.6.2 -beautifulsoup4==4.11.1 -breathe==4.33.1 -bs4==0.0.1 -certifi==2024.07.04 -chardet==3.0.4 -clang-format==15.0.7 -colorama==0.4.1 -docutils==0.15.2 -exhale==0.3.0 -idna==3.7 -imagesize==1.1.0 -Jinja2==3.1.4 -lxml==4.9.3 -Mako==1.3.0 -MarkupSafe==2.1.5 -packaging==24.1 -Pygments==2.17.2 -pyparsing==2.4.5 -pytest>=7.0 -pytz==2019.3 -PyYAML==6.0.1 -requests==2.32.2 -rst2pdf==0.102 -snowballstemmer==2.0.0 -soupsieve==1.9.5 -Sphinx==4.5.0 -sphinx-book-theme==0.3.3 -sphinxcontrib-applehelp==1.0.2 -sphinxcontrib-devhelp==1.0.2 -sphinxcontrib-htmlhelp==2.0.0 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==1.0.3 -sphinxcontrib-serializinghtml==1.1.5 -sphinxcontrib-websupport==1.2.4 -sphinx-rtd-theme==1.0.0 -urllib3==2.2.2 -dataclasses-json==0.6.7 -PyYAML==6.0.1 diff --git a/unified-runtime/third_party/requirements.txt b/unified-runtime/third_party/requirements.txt index 86292c932b6d..f4ce72724508 100644 --- a/unified-runtime/third_party/requirements.txt +++ b/unified-runtime/third_party/requirements.txt @@ -12,7 +12,7 @@ docutils==0.15.2 exhale==0.3.0 idna==3.7 imagesize==1.1.0 -Jinja2==3.1.4 +Jinja2==3.1.6 lxml==4.9.3 Mako==1.3.0 MarkupSafe==2.1.5 From a312a82157c4e888d01640a02b4076d6e3a8e0f0 Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Tue, 1 Apr 2025 15:11:26 +0000 Subject: [PATCH 03/16] Temporary asserts for verification of changes --- .../source/adapters/native_cpu/common.hpp | 6 +++--- unified-runtime/source/common/logger/ur_sinks.hpp | 12 +++++++----- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/unified-runtime/source/adapters/native_cpu/common.hpp b/unified-runtime/source/adapters/native_cpu/common.hpp index a44969fdd983..a40cf6d3ae12 100644 --- a/unified-runtime/source/adapters/native_cpu/common.hpp +++ b/unified-runtime/source/adapters/native_cpu/common.hpp @@ -21,20 +21,20 @@ extern thread_local char ErrorMessage[MaxMessageSize]; #define DIE_NO_IMPLEMENTATION \ do { \ - URLOG(ERR, "Not Implemented : {} - File : {} / Line : {}", __FUNCTION__) \ + URLOG(ERR, "Not Implemented : {}", __FUNCTION__) \ \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; \ } while (false) #define CONTINUE_NO_IMPLEMENTATION \ do { \ - URLOG(WARN, "Not Implemented : {} - File : {} / Line : {}", __FUNCTION__) \ + URLOG(WARN, "Not Implemented : {}", __FUNCTION__) \ return UR_RESULT_SUCCESS; \ } while (false) #define CASE_UR_UNSUPPORTED(not_supported) \ case not_supported: \ - URLOG(ERR, "Unsupported UR case : {} in {}:{}({})", #not_supported, \ + URLOG(ERR, "Unsupported UR case : {} in {}", #not_supported, \ __FUNCTION__) \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/common/logger/ur_sinks.hpp b/unified-runtime/source/common/logger/ur_sinks.hpp index 75dbab23a33e..de0f29b50600 100644 --- a/unified-runtime/source/common/logger/ur_sinks.hpp +++ b/unified-runtime/source/common/logger/ur_sinks.hpp @@ -100,16 +100,18 @@ class Sink { if (*(++fmt) == '{') { buffer << *fmt++; } else { - std::cerr << error_prefix - << "No arguments provided and braces not escaped!" - << std::endl; + // std::cerr << error_prefix + // << "No arguments provided and braces not escaped!" + // << std::endl; + assert(false & "No arguments provided and braces not escaped!"); } } else if (*fmt == '}') { if (*(++fmt) == '}') { buffer << *fmt++; } else { - std::cerr << error_prefix << "Closing curly brace not escaped!" - << std::endl; + // std::cerr << error_prefix << "Closing curly brace not escaped!" + // << std::endl; + assert(false & "Closing curly brace not escaped!"); } } } From baf1fcd72ce417f47817ec2f70d8868b230ad738 Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Thu, 3 Apr 2025 11:18:48 +0200 Subject: [PATCH 04/16] verification asserts removed --- .../source/common/logger/ur_sinks.hpp | 34 +++++++------------ 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/unified-runtime/source/common/logger/ur_sinks.hpp b/unified-runtime/source/common/logger/ur_sinks.hpp index 52285e2a6a26..3f2fa4ccfcd2 100644 --- a/unified-runtime/source/common/logger/ur_sinks.hpp +++ b/unified-runtime/source/common/logger/ur_sinks.hpp @@ -15,7 +15,6 @@ #include "ur_filesystem_resolved.hpp" #include "ur_level.hpp" #include "ur_print.hpp" -#include namespace logger { @@ -91,7 +90,8 @@ class Sink { std::mutex output_mutex; const char *error_prefix = "Log message syntax error: "; - void format(std::ostringstream &buffer, const char *filename, const char *lineno, const char *fmt) { + void format(std::ostringstream &buffer, const char *filename, + const char *lineno, const char *fmt) { while (*fmt != '\0') { while (*fmt != '{' && *fmt != '}' && *fmt != '\0') { buffer << *fmt++; @@ -101,28 +101,24 @@ class Sink { if (*(++fmt) == '{') { buffer << *fmt++; } else { - std::cerr << error_prefix - << "No arguments provided and braces not escaped!" - << filename << ":" << lineno - << std::endl; - assert(false && "No arguments provided and braces not escaped!"); + std::cerr << error_prefix + << "No arguments provided and braces not escaped!" + << filename << ":" << lineno << std::endl; } } else if (*fmt == '}') { if (*(++fmt) == '}') { buffer << *fmt++; } else { - std::cerr << error_prefix << "Closing curly brace not escaped!" - << filename << ":" << lineno - << std::endl; - assert(false); + std::cerr << error_prefix << "Closing curly brace not escaped!" + << filename << ":" << lineno << std::endl; } } } } template - void format(std::ostringstream &buffer, const char *filename, const char *lineno, const char *fmt, Arg &&arg, - Args &&...args) { + void format(std::ostringstream &buffer, const char *filename, + const char *lineno, const char *fmt, Arg &&arg, Args &&...args) { bool arg_printed = false; while (!arg_printed) { while (*fmt != '{' && *fmt != '}' && *fmt != '\0') { @@ -134,9 +130,7 @@ class Sink { buffer << *fmt++; } else if (*fmt != '}') { std::cerr << error_prefix << "Only empty braces are allowed!" - << filename << ":" << lineno - << std::endl; - assert(false); + << filename << ":" << lineno << std::endl; } else { buffer << arg; arg_printed = true; @@ -146,18 +140,14 @@ class Sink { buffer << *fmt++; } else { std::cerr << error_prefix << "Closing curly brace not escaped!" - << filename << ":" << lineno - << std::endl; - assert(false); + << filename << ":" << lineno << std::endl; } } if (*fmt == '\0') { - std::cerr << error_prefix - << filename << ":" << lineno + std::cerr << error_prefix << filename << ":" << lineno << "Too many arguments! first excessive:" << arg << std::endl; // ignore all left arguments and finalize message - assert(false); format(buffer, filename, lineno, fmt); return; } From 4eb3bf601c50b24cc14af6d1200a05580d053ee1 Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Fri, 11 Apr 2025 15:48:08 +0000 Subject: [PATCH 05/16] change macros names and reduce their number --- .../scripts/templates/trcddi.cpp.mako | 4 +- .../source/adapters/cuda/common.cpp | 6 +- .../source/adapters/cuda/device.cpp | 2 +- .../source/adapters/cuda/image.cpp | 2 +- unified-runtime/source/adapters/cuda/usm.cpp | 2 +- .../source/adapters/hip/common.cpp | 6 +- unified-runtime/source/adapters/hip/image.cpp | 2 +- .../source/adapters/level_zero/adapter.cpp | 24 +- .../adapters/level_zero/async_alloc.cpp | 2 +- .../adapters/level_zero/command_buffer.cpp | 10 +- .../source/adapters/level_zero/common.cpp | 6 +- .../source/adapters/level_zero/common.hpp | 2 +- .../source/adapters/level_zero/context.cpp | 14 +- .../source/adapters/level_zero/device.cpp | 32 +- .../source/adapters/level_zero/event.cpp | 20 +- .../level_zero/helpers/image_helpers.cpp | 38 +- .../level_zero/helpers/kernel_helpers.cpp | 14 +- .../source/adapters/level_zero/image.cpp | 36 +- .../source/adapters/level_zero/kernel.cpp | 24 +- .../source/adapters/level_zero/memory.cpp | 28 +- .../source/adapters/level_zero/platform.cpp | 2 +- .../source/adapters/level_zero/program.cpp | 6 +- .../source/adapters/level_zero/queue.cpp | 32 +- .../source/adapters/level_zero/sampler.cpp | 10 +- .../source/adapters/level_zero/usm.cpp | 20 +- .../source/adapters/level_zero/v2/api.cpp | 60 +- .../adapters/level_zero/v2/command_buffer.cpp | 2 +- .../level_zero/v2/command_list_cache.cpp | 8 +- .../source/adapters/level_zero/v2/event.cpp | 6 +- .../level_zero/v2/event_provider_normal.cpp | 2 +- .../source/adapters/level_zero/v2/kernel.cpp | 6 +- .../source/adapters/level_zero/v2/memory.cpp | 8 +- .../v2/queue_immediate_in_order.cpp | 4 +- .../source/adapters/level_zero/v2/usm.cpp | 8 +- .../adapters/level_zero/virtual_mem.cpp | 4 +- .../source/adapters/native_cpu/common.hpp | 6 +- .../source/adapters/native_cpu/device.cpp | 2 +- .../source/adapters/native_cpu/platform.cpp | 2 +- .../source/adapters/opencl/context.cpp | 2 +- .../source/common/latency_tracker.hpp | 8 +- .../source/common/linux/ur_lib_loader.cpp | 14 +- .../source/common/logger/ur_level.hpp | 8 +- .../source/common/logger/ur_logger.hpp | 27 +- .../common/logger/ur_logger_details.hpp | 12 +- .../source/common/logger/ur_sinks.hpp | 2 +- unified-runtime/source/common/umf_helpers.hpp | 2 +- .../source/common/ur_pool_manager.hpp | 4 +- unified-runtime/source/common/ur_util.cpp | 6 +- .../source/common/windows/ur_lib_loader.cpp | 8 +- .../layers/sanitizer/asan/asan_allocator.cpp | 2 +- .../layers/sanitizer/asan/asan_buffer.cpp | 12 +- .../loader/layers/sanitizer/asan/asan_ddi.cpp | 92 +- .../sanitizer/asan/asan_interceptor.cpp | 50 +- .../sanitizer/asan/asan_interceptor.hpp | 2 +- .../layers/sanitizer/asan/asan_report.cpp | 60 +- .../layers/sanitizer/asan/asan_shadow.cpp | 22 +- .../layers/sanitizer/asan/asan_statistics.cpp | 14 +- .../layers/sanitizer/msan/msan_allocator.cpp | 2 +- .../layers/sanitizer/msan/msan_buffer.cpp | 12 +- .../loader/layers/sanitizer/msan/msan_ddi.cpp | 94 +- .../sanitizer/msan/msan_interceptor.cpp | 44 +- .../layers/sanitizer/msan/msan_report.cpp | 8 +- .../layers/sanitizer/msan/msan_shadow.cpp | 18 +- .../linux/sanitizer_utils.cpp | 4 +- .../sanitizer_options_impl.hpp | 8 +- .../sanitizer_common/sanitizer_stacktrace.cpp | 10 +- .../sanitizer_common/sanitizer_utils.cpp | 16 +- .../layers/sanitizer/tsan/tsan_buffer.cpp | 12 +- .../loader/layers/sanitizer/tsan/tsan_ddi.cpp | 78 +- .../sanitizer/tsan/tsan_interceptor.cpp | 16 +- .../layers/sanitizer/tsan/tsan_report.cpp | 6 +- .../layers/sanitizer/tsan/tsan_shadow.cpp | 18 +- .../loader/layers/sanitizer/ur_sanddi.cpp | 2 +- .../loader/layers/tracing/ur_trcddi.cpp | 808 +++++++++--------- .../layers/validation/ur_leak_check.hpp | 14 +- .../layers/validation/ur_validation_layer.cpp | 2 +- .../source/loader/ur_adapter_registry.hpp | 32 +- unified-runtime/source/loader/ur_lib.cpp | 46 +- unified-runtime/source/ur/ur.hpp | 14 +- .../test/loader/platforms/platforms.cpp | 20 +- unified-runtime/test/unit/logger/env_var.cpp | 8 +- unified-runtime/test/unit/logger/logger.cpp | 46 +- unified-runtime/tools/urtrace/collector.cpp | 40 +- 83 files changed, 1098 insertions(+), 1089 deletions(-) diff --git a/unified-runtime/scripts/templates/trcddi.cpp.mako b/unified-runtime/scripts/templates/trcddi.cpp.mako index eb9777740c57..f3543c46f481 100644 --- a/unified-runtime/scripts/templates/trcddi.cpp.mako +++ b/unified-runtime/scripts/templates/trcddi.cpp.mako @@ -48,7 +48,7 @@ namespace ur_tracing_layer uint64_t instance = getContext()->notify_begin(${th.make_func_etor(n, tags, obj)}, "${th.make_func_name(n, tags, obj)}", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> ${th.make_func_name(n, tags, obj)}\n"); + UR_LOG_LOGGER(logger, INFO, " ---> ${th.make_func_name(n, tags, obj)}\n"); ${x}_result_t result = ${th.make_pfn_name(n, tags, obj)}( ${", ".join(th.make_param_lines(n, tags, obj, format=["name"]))} ); @@ -57,7 +57,7 @@ namespace ur_tracing_layer if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, ${th.make_func_etor(n, tags, obj)}, ¶ms); - URLOG_(logger, INFO, " <--- ${th.make_func_name(n, tags, obj)}({}) -> {};\n", args_str.str(), result); + UR_LOG_LOGGER(logger, INFO, " <--- ${th.make_func_name(n, tags, obj)}({}) -> {};\n", args_str.str(), result); } return result; diff --git a/unified-runtime/source/adapters/cuda/common.cpp b/unified-runtime/source/adapters/cuda/common.cpp index 67619462844e..5641f9d74845 100644 --- a/unified-runtime/source/adapters/cuda/common.cpp +++ b/unified-runtime/source/adapters/cuda/common.cpp @@ -71,7 +71,7 @@ void checkErrorUR(CUresult Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - URLOG(ERR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr || std::getenv("UR_CUDA_ABORT") != nullptr) { @@ -95,7 +95,7 @@ void checkErrorUR(nvmlReturn_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - URLOG(ERR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr || std::getenv("UR_CUDA_ABORT") != nullptr) { @@ -115,7 +115,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - URLOG(ERR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr) { std::abort(); diff --git a/unified-runtime/source/adapters/cuda/device.cpp b/unified-runtime/source/adapters/cuda/device.cpp index 20308a00e84a..7f44e43452a3 100644 --- a/unified-runtime/source/adapters/cuda/device.cpp +++ b/unified-runtime/source/adapters/cuda/device.cpp @@ -287,7 +287,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice, } else if (std::getenv("SYCL_UR_CUDA_ENABLE_IMAGE_SUPPORT") != nullptr) { Enabled = true; } else { - URLOG_ALWAYS( + UR_LOG(ALWAYS, "Images are not fully supported by the CUDA BE, their support is " "disabled by default. Their partial support can be activated by " "setting SYCL_UR_CUDA_ENABLE_IMAGE_SUPPORT environment variable at " diff --git a/unified-runtime/source/adapters/cuda/image.cpp b/unified-runtime/source/adapters/cuda/image.cpp index 925a8ff752aa..67e2cb8d2093 100644 --- a/unified-runtime/source/adapters/cuda/image.cpp +++ b/unified-runtime/source/adapters/cuda/image.cpp @@ -806,7 +806,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - URLOG(ERR, + UR_LOG(ERR, "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/cuda/usm.cpp b/unified-runtime/source/adapters/cuda/usm.cpp index 1744b81c7576..8921445877c3 100644 --- a/unified-runtime/source/adapters/cuda/usm.cpp +++ b/unified-runtime/source/adapters/cuda/usm.cpp @@ -444,7 +444,7 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, // Otherwise, do nothing. // Set maximum size is effectively ignored. if (Limits->maxPoolableSize > 0) - URLOG(WARN, "The memory pool maximum size feature requires CUDA " + UR_LOG(WARN, "The memory pool maximum size feature requires CUDA " "12.2 or later.\n"); #endif maxSize = Limits->maxPoolableSize; diff --git a/unified-runtime/source/adapters/hip/common.cpp b/unified-runtime/source/adapters/hip/common.cpp index cdd6886715ee..535693116cdf 100644 --- a/unified-runtime/source/adapters/hip/common.cpp +++ b/unified-runtime/source/adapters/hip/common.cpp @@ -86,7 +86,7 @@ void checkErrorUR(amd_comgr_status_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - URLOG(ERR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -113,7 +113,7 @@ void checkErrorUR(hipError_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - URLOG(ERR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -133,7 +133,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR HIP ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - URLOG(ERR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { diff --git a/unified-runtime/source/adapters/hip/image.cpp b/unified-runtime/source/adapters/hip/image.cpp index 9cac458e09b4..bf1dc9744c7c 100644 --- a/unified-runtime/source/adapters/hip/image.cpp +++ b/unified-runtime/source/adapters/hip/image.cpp @@ -825,7 +825,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - URLOG(ERR, + UR_LOG(ERR, "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/adapter.cpp b/unified-runtime/source/adapters/level_zero/adapter.cpp index 87e7b81ccba4..af4895c76656 100644 --- a/unified-runtime/source/adapters/level_zero/adapter.cpp +++ b/unified-runtime/source/adapters/level_zero/adapter.cpp @@ -163,7 +163,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, ZE2UR_CALL(zeDriverGet, (&ZeDriverGetCount, ZeDriverGetHandles.data())); } if (ZeDriverGetCount == 0 && GlobalAdapter->ZeInitDriversCount == 0) { - URLOG(ERR, "\nNo Valid L0 Drivers found.\n"); + UR_LOG(ERR, "\nNo Valid L0 Drivers found.\n"); return UR_RESULT_SUCCESS; } @@ -188,7 +188,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, // newer drivers. if (ZeDriverGetProperties.driverVersion != ZeInitDriverProperties.driverVersion) { - URLOG(DEBUG, + UR_LOG(DEBUG, "\nzeDriverHandle {} added to the zeInitDrivers list " "of possible handles.\n", ZeDriverGetHandles[Y]); @@ -202,7 +202,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, ZeDrivers.assign(ZeDriverGetHandles.begin(), ZeDriverGetHandles.end()); } ZeDriverCount = ZeDrivers.size(); - URLOG(DEBUG, "\n{} L0 Drivers found.\n", ZeDriverCount); + UR_LOG(DEBUG, "\n{} L0 Drivers found.\n", ZeDriverCount); for (uint32_t I = 0; I < ZeDriverCount; ++I) { // Keep track of the first platform init for this Driver bool DriverPlatformInit = false; @@ -360,7 +360,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() } if (getenv("SYCL_ENABLE_PCI") != nullptr) { - URLOG(WARN, + UR_LOG(WARN, "WARNING: SYCL_ENABLE_PCI is deprecated and no longer needed.\n"); } @@ -382,13 +382,13 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (UrL0InitAllDrivers) { L0InitFlags |= ZE_INIT_FLAG_VPU_ONLY; } - URLOG(DEBUG, "\nzeInit with flags value of {}\n", + UR_LOG(DEBUG, "\nzeInit with flags value of {}\n", static_cast(L0InitFlags)); GlobalAdapter->ZeInitResult = ZE_CALL_NOCHECK(zeInit, (L0InitFlags)); if (GlobalAdapter->ZeInitResult != ZE_RESULT_SUCCESS) { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitResult, ErrorString); - URLOG(ERR, "\nzeInit failed with {}\n", ErrorString); + UR_LOG(ERR, "\nzeInit failed with {}\n", ErrorString); } bool useInitDrivers = false; @@ -404,7 +404,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (strncmp(versions[i].component_name, "loader", strlen("loader")) == 0) { loader_version = versions[i].component_lib_version; - URLOG(DEBUG, "\nLevel Zero Loader Version: {}.{}.{}\n", + UR_LOG(DEBUG, "\nLevel Zero Loader Version: {}.{}.{}\n", loader_version.major, loader_version.minor, loader_version.patch); break; @@ -429,7 +429,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() GlobalAdapter->processHandle, "zeInitDrivers"); #endif if (GlobalAdapter->initDriversFunctionPtr) { - URLOG(DEBUG, "\nzeInitDrivers with flags value of {}\n", + UR_LOG(DEBUG, "\nzeInitDrivers with flags value of {}\n", static_cast(GlobalAdapter->InitDriversDesc.flags)); GlobalAdapter->ZeInitDriversResult = ZE_CALL_NOCHECK(GlobalAdapter->initDriversFunctionPtr, @@ -440,7 +440,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() } else { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitDriversResult, ErrorString); - URLOG(ERR, "\nzeInitDrivers failed with {}\n", ErrorString); + UR_LOG(ERR, "\nzeInitDrivers failed with {}\n", ErrorString); } } } @@ -458,12 +458,12 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() // Absorb the ZE_RESULT_ERROR_UNINITIALIZED and just return 0 Platforms. if (*GlobalAdapter->ZeResult == ZE_RESULT_ERROR_UNINITIALIZED) { - URLOG(ERR, "Level Zero Uninitialized\n"); + UR_LOG(ERR, "Level Zero Uninitialized\n"); result = std::move(platforms); return; } if (*GlobalAdapter->ZeResult != ZE_RESULT_SUCCESS) { - URLOG(ERR, "Level Zero initialization failure\n"); + UR_LOG(ERR, "Level Zero initialization failure\n"); result = ze2urResult(*GlobalAdapter->ZeResult); return; @@ -510,7 +510,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() GlobalAdapter->getSysManDriversFunctionPtr && GlobalAdapter->sysManInitFunctionPtr) { ze_init_flags_t L0ZesInitFlags = 0; - URLOG(DEBUG, "\nzesInit with flags value of {}\n", + UR_LOG(DEBUG, "\nzesInit with flags value of {}\n", static_cast(L0ZesInitFlags)); GlobalAdapter->ZesResult = ZE_CALL_NOCHECK( GlobalAdapter->sysManInitFunctionPtr, (L0ZesInitFlags)); diff --git a/unified-runtime/source/adapters/level_zero/async_alloc.cpp b/unified-runtime/source/adapters/level_zero/async_alloc.cpp index 178680bcd5e8..e8b29edccd42 100644 --- a/unified-runtime/source/adapters/level_zero/async_alloc.cpp +++ b/unified-runtime/source/adapters/level_zero/async_alloc.cpp @@ -92,7 +92,7 @@ static ur_result_t enqueueUSMAllocHelper( CommandType = UR_COMMAND_ENQUEUE_USM_SHARED_ALLOC_EXP; break; default: - URLOG(ERR, "enqueueUSMAllocHelper: unsupported USM type"); + UR_LOG(ERR, "enqueueUSMAllocHelper: unsupported USM type"); throw UR_RESULT_ERROR_UNKNOWN; } UR_CALL(createEventAndAssociateQueue(Queue, Event, CommandType, CommandList, diff --git a/unified-runtime/source/adapters/level_zero/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/command_buffer.cpp index 72ec6f25a355..4518b7d4d67f 100644 --- a/unified-runtime/source/adapters/level_zero/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/command_buffer.cpp @@ -19,7 +19,7 @@ */ // Print the name of a variable and its value in the L0 debug log -#define DEBUG_LOG(VAR) URLOG(DEBUG, #VAR " {}", VAR); +#define DEBUG_LOG(VAR) UR_LOG(DEBUG, #VAR " {}", VAR); namespace { @@ -44,7 +44,7 @@ bool checkImmediateAppendSupport(ur_context_handle_t Context, const bool EnableAppendPath = std::atoi(UrRet) == 1; if (EnableAppendPath && !Device->ImmCommandListUsed) { - URLOG(ERR, + UR_LOG(ERR, "{} is set but immediate command-lists are currently " "disabled. Immediate command-lists are " "required to use the immediate append path.", @@ -52,7 +52,7 @@ bool checkImmediateAppendSupport(ur_context_handle_t Context, std::abort(); } if (EnableAppendPath && !DriverSupportsImmediateAppend) { - URLOG(ERR, + UR_LOG(ERR, "{} is set but the current driver does not support the " "zeCommandListImmediateAppendCommandListsExp entrypoint.", AppendEnvVarName); @@ -1842,7 +1842,7 @@ ur_result_t validateCommandDesc( auto SupportedFeatures = CommandBuffer->Device->ZeDeviceMutableCmdListsProperties ->mutableCommandFlags; - URLOG(DEBUG, "Mutable features supported by device {}", SupportedFeatures); + UR_LOG(DEBUG, "Mutable features supported by device {}", SupportedFeatures); auto Command = static_cast(CommandDesc.hCommand); UR_ASSERT(CommandBuffer == Command->CommandBuffer, @@ -1871,7 +1871,7 @@ ur_result_t validateCommandDesc( if (NewGlobalWorkOffset) { if (!CommandBuffer->Context->getPlatform() ->ZeDriverGlobalOffsetExtensionFound) { - URLOG(ERR, "No global offset extension found on this driver"); + UR_LOG(ERR, "No global offset extension found on this driver"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/common.cpp b/unified-runtime/source/adapters/level_zero/common.cpp index 4de8c4087460..0bdab3325d1e 100644 --- a/unified-runtime/source/adapters/level_zero/common.cpp +++ b/unified-runtime/source/adapters/level_zero/common.cpp @@ -76,7 +76,7 @@ bool setEnvVar(const char *name, const char *value) { int Res = setenv(name, value, 1); #endif if (Res != 0) { - URLOG(DEBUG, "UR L0 Adapter was unable to set the environment variable: {}", + UR_LOG(DEBUG, "UR L0 Adapter was unable to set the environment variable: {}", name); return false; } @@ -138,7 +138,7 @@ void zeParseError(ze_result_t ZeError, const char *&ErrorString) { ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *ZeName, const char *ZeArgs, bool TraceError) { - URLOG(DEBUG, "ZE ---> {}{}", ZeName, ZeArgs); + UR_LOG(DEBUG, "ZE ---> {}{}", ZeName, ZeArgs); if (ZeResult == ZE_RESULT_SUCCESS) { if (UrL0LeaksDebug) { @@ -150,7 +150,7 @@ ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *ZeName, if (TraceError) { const char *ErrorString = "Unknown"; zeParseError(ZeResult, ErrorString); - URLOG(ERR, "Error ({}) in {}", ErrorString, ZeName); + UR_LOG(ERR, "Error ({}) in {}", ErrorString, ZeName); } return ZeResult; } diff --git a/unified-runtime/source/adapters/level_zero/common.hpp b/unified-runtime/source/adapters/level_zero/common.hpp index 3975965db686..e539379cc8f7 100644 --- a/unified-runtime/source/adapters/level_zero/common.hpp +++ b/unified-runtime/source/adapters/level_zero/common.hpp @@ -45,7 +45,7 @@ struct _ur_platform_handle_t; } } catch (...) { } - URLOG(DEBUG, + UR_LOG(DEBUG, "ZE ---> checkL0LoaderTeardown: Loader is in teardown or is unstable"); return false; } diff --git a/unified-runtime/source/adapters/level_zero/context.cpp b/unified-runtime/source/adapters/level_zero/context.cpp index c6e278e50c0b..733697536e02 100644 --- a/unified-runtime/source/adapters/level_zero/context.cpp +++ b/unified-runtime/source/adapters/level_zero/context.cpp @@ -171,7 +171,7 @@ ur_result_t urContextSetExtendedDeleter( std::ignore = Context; std::ignore = Deleter; std::ignore = UserData; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -209,7 +209,7 @@ ur_result_t ur_context_handle_t_::initialize() { if (Device->Platform->allowDriverInOrderLists( true /*Only Allow Driver In Order List if requested*/) && Device->useDriverCounterBasedEvents()) { - URLOG( + UR_LOG( DEBUG, "L0 Synchronous Immediate Command List needed with In Order property."); ZeCommandQueueDesc.flags |= ZE_COMMAND_QUEUE_FLAG_IN_ORDER; @@ -462,7 +462,7 @@ ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool( ZeEventPoolDesc.flags |= ZE_EVENT_POOL_FLAG_HOST_VISIBLE; if (ProfilingEnabled) ZeEventPoolDesc.flags |= ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP; - URLOG(DEBUG, "ze_event_pool_desc_t flags set to: {}", + UR_LOG(DEBUG, "ze_event_pool_desc_t flags set to: {}", ZeEventPoolDesc.flags); if (CounterBasedEventEnabled) { if (UsingImmCmdList) { @@ -471,7 +471,7 @@ ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool( counterBasedExt.flags = ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_NON_IMMEDIATE; } - URLOG(DEBUG, "ze_event_pool_desc_t counter based flags set to: {}", + UR_LOG(DEBUG, "ze_event_pool_desc_t counter based flags set to: {}", counterBasedExt.flags); if (InterruptBasedEventEnabled) { counterBasedExt.pNext = &eventSyncMode; @@ -512,7 +512,7 @@ ur_event_handle_t ur_context_handle_t_::getEventFromContextCache( getEventCache(HostVisible, WithProfiling, Device, CounterBasedEventEnabled, InterruptBasedEventEnabled); if (Cache->empty()) { - URLOG(INFO, + UR_LOG(INFO, "Cache empty (Host Visible: {}, Profiling: {}, Counter: {}, " "Interrupt: {}, Device: {})", HostVisible, WithProfiling, CounterBasedEventEnabled, @@ -527,7 +527,7 @@ ur_event_handle_t ur_context_handle_t_::getEventFromContextCache( // We have to reset event before using it. Event->reset(); - URLOG(INFO, + UR_LOG(INFO, "Using {} event (Host Visible: {}, Profiling: {}, Counter: {}, " "Interrupt: {}, Device: {}) from cache {}", Event, Event->HostVisibleEvent, Event->isProfilingEnabled(), @@ -548,7 +548,7 @@ void ur_context_handle_t_::addEventToContextCache(ur_event_handle_t Event) { auto Cache = getEventCache( Event->isHostVisible(), Event->isProfilingEnabled(), Device, Event->CounterBasedEventsEnabled, Event->InterruptBasedEventsEnabled); - URLOG(INFO, + UR_LOG(INFO, "Inserting {} event (Host Visible: {}, Profiling: {}, Counter: {}, " "Device: {}) into cache {}", Event, Event->HostVisibleEvent, Event->isProfilingEnabled(), diff --git a/unified-runtime/source/adapters/level_zero/device.cpp b/unified-runtime/source/adapters/level_zero/device.cpp index 675f17ca77f9..1fb886f39179 100644 --- a/unified-runtime/source/adapters/level_zero/device.cpp +++ b/unified-runtime/source/adapters/level_zero/device.cpp @@ -52,7 +52,7 @@ getRangeOfAllowedCopyEngines(const ur_device_handle_t &Device) { int UpperCopyEngineIndex = std::stoi(CopyEngineRange.substr(pos + 1)); if ((LowerCopyEngineIndex > UpperCopyEngineIndex) || (LowerCopyEngineIndex < -1) || (UpperCopyEngineIndex < -1)) { - URLOG(ERR, "UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " + UR_LOG(ERR, "UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " "default set."); LowerCopyEngineIndex = 0; UpperCopyEngineIndex = INT_MAX; @@ -141,7 +141,7 @@ ur_result_t urDeviceGet( break; default: Matched = false; - URLOG(WARN, "Unknown device type"); + UR_LOG(WARN, "Unknown device type"); break; } @@ -194,7 +194,7 @@ static std::tuple getZesDeviceData(ur_device_handle_t Device) { bool SysManEnv = getenv_tobool("ZES_ENABLE_SYSMAN", false); if ((Device->Platform->ZedeviceToZesDeviceMap.size() == 0) && !SysManEnv) { - URLOG(ERR, "SysMan support is unavailable on this system. Please " + UR_LOG(ERR, "SysMan support is unavailable on this system. Please " "check your level zero driver installation."); return {nullptr, {}, UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION}; } @@ -250,7 +250,7 @@ ur_result_t urDeviceGetInfo( case ZE_DEVICE_TYPE_FPGA: return ReturnValue(UR_DEVICE_TYPE_FPGA); default: - URLOG(ERR, "This device type is not supported"); + UR_LOG(ERR, "This device type is not supported"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1107,8 +1107,8 @@ ur_result_t urDeviceGetInfo( case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP: - URLOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); - URLOG(ERR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + UR_LOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP: { // L0 does not support mipmaps. @@ -1119,8 +1119,8 @@ ur_result_t urDeviceGetInfo( return ReturnValue(false); } case UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP: - URLOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); - URLOG(ERR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + UR_LOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP: { // L0 does not support creation of images from individual mipmap levels. @@ -1336,8 +1336,8 @@ ur_result_t urDeviceGetInfo( } } default: - URLOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); - URLOG(ERR, "ParamNameParamName={}(0x{})", ParamName, + UR_LOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERR, "ParamNameParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; } @@ -1650,7 +1650,7 @@ ur_device_handle_t_::useImmediateCommandLists() { } } - URLOG(INFO, "NOTE: L0 Immediate CommandList Setting: {}", + UR_LOG(INFO, "NOTE: L0 Immediate CommandList Setting: {}", ImmediateCommandlistsSetting); switch (ImmediateCommandlistsSetting) { @@ -1792,7 +1792,7 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal, if (numQueueGroups == 0) { return UR_RESULT_ERROR_UNKNOWN; } - URLOG_L(ERR, logger::LegacyMessage("NOTE: Number of queue groups = {}"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("NOTE: Number of queue groups = {}"), "Number of queue groups = {}", numQueueGroups); std::vector> @@ -1847,23 +1847,23 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal, } } if (QueueGroup[queue_group_info_t::MainCopy].ZeOrdinal < 0) - URLOG_L(INFO, + UR_LOG_LEGACY(INFO, logger::LegacyMessage( "NOTE: main blitter/copy engine is not available"), "main blitter/copy engine is not available") else - URLOG_L(INFO, + UR_LOG_LEGACY(INFO, logger::LegacyMessage( "NOTE: main blitter/copy engine is available"), "main blitter/copy engine is available") if (QueueGroup[queue_group_info_t::LinkCopy].ZeOrdinal < 0) - URLOG_L(INFO, + UR_LOG_LEGACY(INFO, logger::LegacyMessage( "NOTE: link blitter/copy engines are not available"), "link blitter/copy engines are not available") else - URLOG_L(INFO, + UR_LOG_LEGACY(INFO, logger::LegacyMessage( "NOTE: link blitter/copy engines are available"), "link blitter/copy engines are available") diff --git a/unified-runtime/source/adapters/level_zero/event.cpp b/unified-runtime/source/adapters/level_zero/event.cpp index f63cce10abbb..708a8de98834 100644 --- a/unified-runtime/source/adapters/level_zero/event.cpp +++ b/unified-runtime/source/adapters/level_zero/event.cpp @@ -29,7 +29,7 @@ void printZeEventList(const _ur_ze_event_list_t &UrZeEventList) { for (uint32_t I = 0; I < UrZeEventList.Length; I++) { ss << " " << ur_cast(UrZeEventList.ZeEventList[I]); } - URLOG(DEBUG, ss.str().c_str()); + UR_LOG(DEBUG, ss.str().c_str()); } } @@ -507,7 +507,7 @@ ur_result_t urEventGetInfo( return ReturnValue(Event->RefCount.load()); } default: - URLOG(ERR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", PropName, logger::toHex(PropName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -593,11 +593,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - URLOG(ERR, "urEventGetProfilingInfo: " + UR_LOG(ERR, "urEventGetProfilingInfo: " "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - URLOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -660,11 +660,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - URLOG(ERR, "urEventGetProfilingInfo: " + UR_LOG(ERR, "urEventGetProfilingInfo: " "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - URLOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } else { @@ -707,11 +707,11 @@ ur_result_t urEventGetProfilingInfo( // return ReturnValue(uint64_t{0}); case UR_PROFILING_INFO_COMMAND_COMPLETE: - URLOG(ERR, "urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " + UR_LOG(ERR, "urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " "not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - URLOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -826,7 +826,7 @@ urEventWait(uint32_t NumEvents, die("The host-visible proxy event missing"); ze_event_handle_t ZeEvent = HostVisibleEvent->ZeEvent; - URLOG(DEBUG, "ZeEvent = {}", ur_cast(ZeEvent)); + UR_LOG(DEBUG, "ZeEvent = {}", ur_cast(ZeEvent)); // If this event was an inner batched event, then sync with // the Queue instead of waiting on the event. if (HostVisibleEvent->IsInnerBatchedEvent && Event->ZeBatchedQueue) { @@ -1001,7 +1001,7 @@ ur_result_t urEventSetCallback( std::ignore = ExecStatus; std::ignore = Notify; std::ignore = UserData; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp index 9c7ae0fd3434..c360d4c2124a 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp @@ -35,7 +35,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormatTypeSize = 32; break; default: - URLOG(ERR, "ze2urImageFormat: unsupported image format layout: layout = {}", + UR_LOG(ERR, "ze2urImageFormat: unsupported image format layout: layout = {}", ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -53,7 +53,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_A; break; default: - URLOG(ERR, "ze2urImageFormat: unexpected image format channel x: x = {}", + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel x: x = {}", ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -62,7 +62,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, case ZE_IMAGE_FORMAT_LAYOUT_16_16: case ZE_IMAGE_FORMAT_LAYOUT_32_32: if (ZeImageFormat.x != ZE_IMAGE_FORMAT_SWIZZLE_R) { - URLOG(ERR, "ze2urImageFormat: unexpected image format channel x: x = {}", + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel x: x = {}", ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -77,7 +77,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RX; break; default: - URLOG(ERR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel y: y = {}\n", ZeImageFormat.y); return UR_RESULT_ERROR_INVALID_VALUE; @@ -96,13 +96,13 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGX; break; default: - URLOG(ERR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel z: z = {}\n", ZeImageFormat.z); return UR_RESULT_ERROR_INVALID_VALUE; } } else { - URLOG(ERR, "ze2urImageFormat: unexpected image format channel"); + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -120,7 +120,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGBA; break; default: - URLOG(ERR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel w: w = {}", ZeImageFormat.w); return UR_RESULT_ERROR_INVALID_VALUE; @@ -136,12 +136,12 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormat.w == ZE_IMAGE_FORMAT_SWIZZLE_A) { ChannelOrder = UR_IMAGE_CHANNEL_ORDER_BGRA; } else { - URLOG(ERR, "ze2urImageFormat: unexpected image format channel"); + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - URLOG(ERR, "ze2urImageFormat: unsupported image format layout: layout = {}", + UR_LOG(ERR, "ze2urImageFormat: unsupported image format layout: layout = {}", ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -160,7 +160,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32; break; default: - URLOG(ERR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -178,7 +178,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SIGNED_INT32; break; default: - URLOG(ERR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -193,7 +193,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNORM_INT16; break; default: - URLOG(ERR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -208,7 +208,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SNORM_INT16; break; default: - URLOG(ERR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -223,14 +223,14 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_FLOAT; break; default: - URLOG(ERR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - URLOG(ERR, "ze2urImageFormat: unsupported image format type: type = {}", + UR_LOG(ERR, "ze2urImageFormat: unsupported image format type: type = {}", ZeImageFormat.type); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -277,13 +277,13 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - URLOG(ERR, "ur2zeImageDesc: unexpected data type Size\n"); + UR_LOG(ERR, "ur2zeImageDesc: unexpected data type Size\n"); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; } break; } default: - URLOG(ERR, "format layout = {}", ImageFormat->channelOrder); + UR_LOG(ERR, "format layout = {}", ImageFormat->channelOrder); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; break; } @@ -312,7 +312,7 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - URLOG(ERR, "ur2zeImageDesc: unsupported image type"); + UR_LOG(ERR, "ur2zeImageDesc: unsupported image type"); return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR; } @@ -509,7 +509,7 @@ getImageFormatTypeAndSize(const ur_image_format_t *ImageFormat) { break; } default: - URLOG(ERR, "ur2zeImageDesc: unsupported image data type: data type = {}", + UR_LOG(ERR, "ur2zeImageDesc: unsupported image data type: data type = {}", ImageFormat->channelType); ZeImageFormatType = ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32; ZeImageFormatTypeSize = 0; diff --git a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp index af04d492149e..c97573736bce 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp @@ -52,13 +52,13 @@ ur_result_t getSuggestedLocalWorkSize(ur_device_handle_t hDevice, --GroupSize[I]; } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - URLOG(ERR, "getSuggestedLocalWorkSize: can't find a WG size " + UR_LOG(ERR, "getSuggestedLocalWorkSize: can't find a WG size " "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } WG[I] = GroupSize[I]; } - URLOG(DEBUG, + UR_LOG(DEBUG, "getSuggestedLocalWorkSize: using computed WG size = {{{}, {}, {}}}", WG[0], WG[1], WG[2]); } @@ -70,7 +70,7 @@ ur_result_t setKernelGlobalOffset(ur_context_handle_t Context, ze_kernel_handle_t Kernel, uint32_t WorkDim, const size_t *GlobalWorkOffset) { if (!Context->getPlatform()->ZeDriverGlobalOffsetExtensionFound) { - URLOG(DEBUG, "No global offset extension found on this driver"); + UR_LOG(DEBUG, "No global offset extension found on this driver"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -130,26 +130,26 @@ ur_result_t calculateKernelWorkDimensions( break; default: - URLOG(ERR, "calculateKernelWorkDimensions: unsupported work_dim"); + UR_LOG(ERR, "calculateKernelWorkDimensions: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - URLOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + UR_LOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " "is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - URLOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + UR_LOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " "is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[2] != size_t(ZeThreadGroupDimensions.groupCountZ) * WG[2]) { - URLOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + UR_LOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " "is not a multiple of the group size in the 3rd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } diff --git a/unified-runtime/source/adapters/level_zero/image.cpp b/unified-runtime/source/adapters/level_zero/image.cpp index 121cbc3b03d8..0b276fcc3552 100644 --- a/unified-runtime/source/adapters/level_zero/image.cpp +++ b/unified-runtime/source/adapters/level_zero/image.cpp @@ -56,7 +56,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32; break; default: - URLOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -75,7 +75,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32; break; default: - URLOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -95,7 +95,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - URLOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -113,13 +113,13 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32; break; default: - URLOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; } default: - URLOG(ERR, "format channel order = {}", ImageFormat->channelOrder); + UR_LOG(ERR, "format channel order = {}", ImageFormat->channelOrder); die("ur2zeImageDescBindless: unsupported image channel order\n"); break; } @@ -148,7 +148,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - URLOG(ERR, "ur2zeImageDescBindless: unsupported image type"); + UR_LOG(ERR, "ur2zeImageDescBindless: unsupported image type"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -237,7 +237,7 @@ ur_result_t bindlessImagesCreateImpl(ur_context_handle_t hContext, DriverHandle, "zeImageGetDeviceOffsetExp", (void **)&zeImageGetDeviceOffsetExpFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - URLOG(ERR, + UR_LOG(ERR, "zeDriverGetExtensionFunctionAddress zeImageGetDeviceOffsetExpv " "failed, err = {}", Result); @@ -281,7 +281,7 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, DriverHandle, "zeMemGetPitchFor2dImage", (void **)&zeMemGetPitchFor2dImageFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - URLOG(ERR, + UR_LOG(ERR, "zeDriverGetExtensionFunctionAddress zeMemGetPitchFor2dImage " "failed, err = {}", Result); @@ -554,7 +554,7 @@ ur_result_t urBindlessImagesImageCopyExp( &DstRegion, &SrcRegion, ZeEvent, WaitList.Length, WaitList.ZeEventList)); } else { - URLOG(ERR, "urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); + UR_LOG(ERR, "urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -622,7 +622,7 @@ ur_result_t urBindlessImagesMipmapGetLevelExp( std::ignore = hImageMem; std::ignore = mipmapLevel; std::ignore = phImageMem; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -806,7 +806,7 @@ ur_result_t urBindlessImagesImportExternalSemaphoreExp( auto UrPlatform = hContext->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] "), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] "), " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -939,7 +939,7 @@ ur_result_t urBindlessImagesReleaseExternalSemaphoreExp( std::ignore = hDevice; auto UrPlatform = hContext->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] "), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] "), " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -962,9 +962,9 @@ ur_result_t urBindlessImagesWaitExternalSemaphoreExp( const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { auto UrPlatform = hQueue->Context->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - logger::get_logger().log(logger::LegacyMessage("[UR][L0] "), - logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), - " {} function not supported!", __FUNCTION__); + UR_LOG_LEGACY(ERR, + logger::LegacyMessage("[UR][L0] {} function not supported!"), + "{} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1047,9 +1047,9 @@ ur_result_t urBindlessImagesSignalExternalSemaphoreExp( const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { auto UrPlatform = hQueue->Context->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - logger::get_logger().log(logger::LegacyMessage("[UR][L0] "), - logger::Level::ERR, SHORT_FILE, UR_STR(__LINE__), - " {} function not supported!", __FUNCTION__); + UR_LOG_LEGACY(ERR, + logger::LegacyMessage("[UR][L0] {} function not supported!"), + "{} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/kernel.cpp b/unified-runtime/source/adapters/level_zero/kernel.cpp index 1537b0f6247d..0364e4d54596 100644 --- a/unified-runtime/source/adapters/level_zero/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/kernel.cpp @@ -189,7 +189,7 @@ ur_result_t urEnqueueKernelLaunch( (*Event)->WaitList.Length, (*Event)->WaitList.ZeEventList)); } - URLOG(DEBUG, "calling zeCommandListAppendLaunchKernel() with ZeEvent {}", + UR_LOG(DEBUG, "calling zeCommandListAppendLaunchKernel() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList((*Event)->WaitList); @@ -316,14 +316,14 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - URLOG(ERR, + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: can't find a WG size " "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } WG[I] = GroupSize[I]; } - URLOG(DEBUG, + UR_LOG(DEBUG, "urEnqueueCooperativeKernelLaunchExp: using computed WG " "size = {{{}, {}, {}}}", WG[0], WG[1], WG[2]); @@ -355,28 +355,28 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( break; default: - URLOG(ERR, "urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - URLOG(ERR, + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - URLOG(ERR, + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[2] != size_t(ZeThreadGroupDimensions.groupCountZ) * WG[2]) { - URLOG(DEBUG, + UR_LOG(DEBUG, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 3rd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; @@ -449,7 +449,7 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( (*Event)->WaitList.Length, (*Event)->WaitList.ZeEventList)); } - URLOG(DEBUG, + UR_LOG(DEBUG, "calling zeCommandListAppendLaunchCooperativeKernel() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList((*Event)->WaitList); @@ -790,7 +790,7 @@ ur_result_t urKernelGetInfo( return UR_RESULT_ERROR_UNKNOWN; } default: - URLOG(ERR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -878,7 +878,7 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - URLOG(ERR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -1023,7 +1023,7 @@ ur_result_t urKernelSetExecInfo( return UR_RESULT_ERROR_INVALID_VALUE; ZE2UR_CALL(zeKernelSetCacheConfig, (ZeKernel, ZeCacheConfig);); } else { - URLOG(ERR, "urKernelSetExecInfo: unsupported ParamName"); + UR_LOG(ERR, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1175,7 +1175,7 @@ ur_result_t urKernelSetSpecializationConstants( std::ignore = Kernel; std::ignore = Count; std::ignore = SpecConstants; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/memory.cpp b/unified-runtime/source/adapters/level_zero/memory.cpp index 3fe1107e6f28..35a7086fb217 100644 --- a/unified-runtime/source/adapters/level_zero/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/memory.cpp @@ -117,7 +117,7 @@ ur_result_t enqueueMemCopyHelper(ur_command_t CommandType, const auto &ZeCommandList = CommandList->first; const auto &WaitList = (*Event)->WaitList; - URLOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -169,7 +169,7 @@ ur_result_t enqueueMemCopyRectHelper( const auto &ZeCommandList = CommandList->first; const auto &WaitList = (*Event)->WaitList; - URLOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -182,7 +182,7 @@ ur_result_t enqueueMemCopyRectHelper( ZeParams.srcPitch, ZeParams.srcSlicePitch, ZeEvent, WaitList.Length, WaitList.ZeEventList)); - URLOG(DEBUG, "calling zeCommandListAppendMemoryCopyRegion()"); + UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopyRegion()"); UR_CALL(Queue->executeCommandList(CommandList, Blocking, OkToBatch)); @@ -257,7 +257,7 @@ static ur_result_t enqueueMemFillHelper(ur_command_t CommandType, (ZeCommandList, Ptr, Pattern, PatternSize, Size, ZeEvent, WaitList.Length, WaitList.ZeEventList)); - URLOG(DEBUG, "calling zeCommandListAppendMemoryFill() with ZeEvent {}", + UR_LOG(DEBUG, "calling zeCommandListAppendMemoryFill() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -278,7 +278,7 @@ static ur_result_t enqueueMemFillHelper(ur_command_t CommandType, WaitList.Length, WaitList.ZeEventList)); } - URLOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -462,7 +462,7 @@ static ur_result_t enqueueMemImageCommandHelper( ur_cast(ZeHandleSrc), &ZeDstRegion, &ZeSrcRegion, ZeEvent, 0, nullptr)); } else { - URLOG(ERR, "enqueueMemImageUpdate: unsupported image command type"); + UR_LOG(ERR, "enqueueMemImageUpdate: unsupported image command type"); return UR_RESULT_ERROR_INVALID_OPERATION; } @@ -1039,7 +1039,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - URLOG(ERR, "urEnqueueMemBufferMap: duplicate mapping detected"); + UR_LOG(ERR, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -1100,7 +1100,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - URLOG(ERR, "urEnqueueMemBufferMap: duplicate mapping detected"); + UR_LOG(ERR, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -1154,7 +1154,7 @@ ur_result_t urEnqueueMemUnmap( std::scoped_lock Guard(Buffer->Mutex); auto It = Buffer->Mappings.find(MappedPtr); if (It == Buffer->Mappings.end()) { - URLOG(ERR, "urEnqueueMemUnmap: unknown memory mapping"); + UR_LOG(ERR, "urEnqueueMemUnmap: unknown memory mapping"); return UR_RESULT_ERROR_INVALID_VALUE; } MapInfo = It->second; @@ -1437,7 +1437,7 @@ ur_result_t urEnqueueUSMFill2D( std::ignore = NumEventsInWaitList; std::ignore = EventWaitList; std::ignore = OutEvent; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1886,7 +1886,7 @@ ur_result_t urMemImageGetInfo( std::ignore = PropSize; std::ignore = ImgInfo; std::ignore = PropSizeRet; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1940,7 +1940,7 @@ ur_result_t urEnqueueReadHostPipe(ur_queue_handle_t hQueue, std::ignore = numEventsInWaitList; std::ignore = phEventWaitList; std::ignore = phEvent; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1961,7 +1961,7 @@ ur_result_t urEnqueueWriteHostPipe(ur_queue_handle_t hQueue, std::ignore = numEventsInWaitList; std::ignore = phEventWaitList; std::ignore = phEvent; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -2226,7 +2226,7 @@ ur_result_t _ur_buffer::getBufferZeHandle(char *&ZeHandle, } } - URLOG(DEBUG, "getZeHandle(pi_device{{{}}}) = {}", (void *)Device, + UR_LOG(DEBUG, "getZeHandle(pi_device{{{}}}) = {}", (void *)Device, (void *)Allocation.ZeHandle); return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/adapters/level_zero/platform.cpp b/unified-runtime/source/adapters/level_zero/platform.cpp index 59c7f5ad73f3..3d3eca1445de 100644 --- a/unified-runtime/source/adapters/level_zero/platform.cpp +++ b/unified-runtime/source/adapters/level_zero/platform.cpp @@ -102,7 +102,7 @@ ur_result_t urPlatformGetInfo( case UR_PLATFORM_INFO_ADAPTER: return ReturnValue(GlobalAdapter); default: - URLOG(DEBUG, "urPlatformGetInfo: unrecognized ParamName"); + UR_LOG(DEBUG, "urPlatformGetInfo: unrecognized ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/program.cpp b/unified-runtime/source/adapters/level_zero/program.cpp index 3e6a1de9059b..0a4fe70b8d96 100644 --- a/unified-runtime/source/adapters/level_zero/program.cpp +++ b/unified-runtime/source/adapters/level_zero/program.cpp @@ -440,7 +440,7 @@ ur_result_t urProgramLinkExp( ZeModuleDesc.pInputModule = ZeExtModuleDesc.pInputModules[0]; ZeModuleDesc.pConstants = ZeExtModuleDesc.pConstants[0]; } else { - URLOG(ERR, + UR_LOG(ERR, "urProgramLink: level_zero driver does not have static linking " "support."); return UR_RESULT_ERROR_INVALID_VALUE; @@ -895,7 +895,7 @@ ur_result_t urProgramGetBuildInfo( // program. return ReturnValue(""); } else { - URLOG(ERR, "urProgramGetBuildInfo: unsupported ParamName"); + UR_LOG(ERR, "urProgramGetBuildInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -914,7 +914,7 @@ ur_result_t urProgramSetSpecializationConstant( std::ignore = SpecId; std::ignore = SpecSize; std::ignore = SpecValue; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/queue.cpp b/unified-runtime/source/adapters/level_zero/queue.cpp index 6e3941e2bfa9..16dc41993c80 100644 --- a/unified-runtime/source/adapters/level_zero/queue.cpp +++ b/unified-runtime/source/adapters/level_zero/queue.cpp @@ -455,7 +455,7 @@ ur_result_t urQueueGetInfo( return ReturnValue(true); } default: - URLOG( + UR_LOG( ERR, "Unsupported ParamName in urQueueGetInfo: ParamName=ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); @@ -935,7 +935,7 @@ ur_result_t urEnqueueKernelLaunchCustomExp( std::ignore = phEventWaitList; std::ignore = phEvent; - URLOG(ERR, "[UR][L0] {} function not implemented!", + UR_LOG(ERR, "[UR][L0] {} function not implemented!", "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1016,9 +1016,9 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { Val = std::stoi(BatchConfig.substr(Pos)); } catch (...) { if (IsCopy) - URLOG(ERR, "UR_L0_COPY_BATCH_SIZE: failed to parse value") + UR_LOG(ERR, "UR_L0_COPY_BATCH_SIZE: failed to parse value") else - URLOG(ERR, "UR_L0_BATCH_SIZE: failed to parse value") + UR_LOG(ERR, "UR_L0_BATCH_SIZE: failed to parse value") break; } switch (Ord) { @@ -1041,19 +1041,19 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { die("Unexpected batch config"); } if (IsCopy) - URLOG(ERR, "UR_L0_COPY_BATCH_SIZE: dynamic batch param #{}: {}", + UR_LOG(ERR, "UR_L0_COPY_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, (int)Val) else - URLOG(ERR, "UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, + UR_LOG(ERR, "UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, (int)Val) }; } else { // Negative batch sizes are silently ignored. if (IsCopy) - URLOG(WARN, "UR_L0_COPY_BATCH_SIZE: ignored negative value") + UR_LOG(WARN, "UR_L0_COPY_BATCH_SIZE: ignored negative value") else - URLOG(WARN, "UR_L0_BATCH_SIZE: ignored negative value") + UR_LOG(WARN, "UR_L0_BATCH_SIZE: ignored negative value") } } return Config; @@ -1233,7 +1233,7 @@ void ur_queue_handle_t_::adjustBatchSizeForFullBatch(bool IsCopy) { ZeCommandListBatchConfig.NumTimesClosedFullThreshold) { if (QueueBatchSize < ZeCommandListBatchConfig.DynamicSizeMax) { QueueBatchSize += ZeCommandListBatchConfig.DynamicSizeStep; - URLOG(DEBUG, "Raising QueueBatchSize to {}", QueueBatchSize); + UR_LOG(DEBUG, "Raising QueueBatchSize to {}", QueueBatchSize); } CommandBatch.NumTimesClosedEarly = 0; CommandBatch.NumTimesClosedFull = 0; @@ -1260,7 +1260,7 @@ void ur_queue_handle_t_::adjustBatchSizeForPartialBatch(bool IsCopy) { QueueBatchSize = CommandBatch.OpenCommandList->second.size() - 1; if (QueueBatchSize < 1) QueueBatchSize = 1; - URLOG(DEBUG, "Lowering QueueBatchSize to {}", QueueBatchSize); + UR_LOG(DEBUG, "Lowering QueueBatchSize to {}", QueueBatchSize); CommandBatch.NumTimesClosedEarly = 0; CommandBatch.NumTimesClosedFull = 0; } @@ -1628,12 +1628,12 @@ ur_result_t urQueueReleaseInternal(ur_queue_handle_t Queue) { Queue->clearEndTimeRecordings(); - URLOG(DEBUG, + UR_LOG(DEBUG, "urQueueRelease(compute) NumTimesClosedFull {}, " "NumTimesClosedEarly {}", Queue->ComputeCommandBatch.NumTimesClosedFull, Queue->ComputeCommandBatch.NumTimesClosedEarly); - URLOG(DEBUG, + UR_LOG(DEBUG, "urQueueRelease(copy) NumTimesClosedFull {}, NumTimesClosedEarly {}", Queue->CopyCommandBatch.NumTimesClosedFull, Queue->CopyCommandBatch.NumTimesClosedEarly); @@ -2253,7 +2253,7 @@ ur_queue_handle_t_::ur_queue_group_t::getZeQueue(uint32_t *QueueGroupOrdinal) { ZeCommandQueueDesc.flags = ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY; } - URLOG(DEBUG, + UR_LOG(DEBUG, "[getZeQueue]: create queue ordinal = {}, index = {} " "(round robin in [{}, {}]) priority = {}", ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, LowerIndex, @@ -2317,7 +2317,7 @@ ur_result_t ur_queue_handle_t_::createCommandList( IsInOrderList = true; } - URLOG( + UR_LOG( DEBUG, "create command list ordinal: {}, type: regular, device: {}, inOrder: {}", QueueGroupOrdinal, Device->ZeDevice, IsInOrderList); @@ -2486,12 +2486,12 @@ ur_command_list_ptr_t &ur_queue_handle_t_::ur_queue_group_t::getImmCmdList() { // If cache didn't contain a command list, create one. if (!ZeCommandList) { - URLOG(DEBUG, + UR_LOG(DEBUG, "[getZeQueue]: create queue ordinal = {}, index = {} " "(round robin in [{}, {}]) priority = {}", ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, LowerIndex, UpperIndex, Priority); - URLOG(DEBUG, + UR_LOG(DEBUG, "create command list ordinal: {}, type: immediate, device: " "{}, inOrder: {}", ZeCommandQueueDesc.ordinal, Queue->Device->ZeDevice, isInOrderList); diff --git a/unified-runtime/source/adapters/level_zero/sampler.cpp b/unified-runtime/source/adapters/level_zero/sampler.cpp index 4a04d275919d..45ff516b9910 100644 --- a/unified-runtime/source/adapters/level_zero/sampler.cpp +++ b/unified-runtime/source/adapters/level_zero/sampler.cpp @@ -83,7 +83,7 @@ ur_result_t urSamplerCreate( ZeSamplerDesc.addressMode = ZE_SAMPLER_ADDRESS_MODE_MIRROR; break; default: - URLOG(ERR, "urSamplerCreate: unsupported " + UR_LOG(ERR, "urSamplerCreate: unsupported " "UR_SAMPLER_PROPERTIES_ADDRESSING_MODEE value"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -93,7 +93,7 @@ ur_result_t urSamplerCreate( else if (Props->filterMode == UR_SAMPLER_FILTER_MODE_LINEAR) ZeSamplerDesc.filterMode = ZE_SAMPLER_FILTER_MODE_LINEAR; else { - URLOG(ERR, "urSamplerCreate: unsupported UR_SAMPLER_FILTER_MODE value"); + UR_LOG(ERR, "urSamplerCreate: unsupported UR_SAMPLER_FILTER_MODE value"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -158,7 +158,7 @@ ur_result_t urSamplerGetInfo( std::ignore = PropValueSize; std::ignore = PropValue; std::ignore = PropSizeRet; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -170,7 +170,7 @@ ur_result_t urSamplerGetNativeHandle( ur_native_handle_t *NativeSampler) { std::ignore = Sampler; std::ignore = NativeSampler; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -188,7 +188,7 @@ ur_result_t urSamplerCreateWithNativeHandle( std::ignore = Context; std::ignore = Properties; std::ignore = Sampler; - URLOG_L(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/usm.cpp b/unified-runtime/source/adapters/level_zero/usm.cpp index 832e470212d3..788009729830 100644 --- a/unified-runtime/source/adapters/level_zero/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/usm.cpp @@ -450,7 +450,7 @@ ur_result_t urUSMGetMemAllocInfo( MemAllocaType = UR_USM_TYPE_SHARED; break; default: - URLOG(ERR, "urUSMGetMemAllocInfo: unexpected usm memory type"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(MemAllocaType); @@ -490,7 +490,7 @@ ur_result_t urUSMGetMemAllocInfo( return UR_RESULT_ERROR_INVALID_VALUE; } default: - URLOG(ERR, "urUSMGetMemAllocInfo: unsupported ParamName"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -855,7 +855,7 @@ umf_result_t L0MemoryProvider::open_ipc_handle(void *IpcData, void **Ptr) { memcpy(&fdRemote, &zeIpcData->zeHandle, sizeof(fdRemote)); fdLocal = ur_duplicate_fd(zeIpcData->pid, fdRemote); if (fdLocal == -1) { - URLOG(ERR, "duplicating file descriptor from IPC handle failed"); + UR_LOG(ERR, "duplicating file descriptor from IPC handle failed"); return UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC; } @@ -963,12 +963,12 @@ MakeProvider(ProviderParams *Params = nullptr) { } break; default: - URLOG(ERR, "urUSMPoolCreate: invalid USM type found"); + UR_LOG(ERR, "urUSMPoolCreate: invalid USM type found"); Ret = UMF_RESULT_ERROR_INVALID_ARGUMENT; } if (Ret != UMF_RESULT_SUCCESS) { - URLOG(ERR, "urUSMPoolCreate: failed to create UMF provider"); + UR_LOG(ERR, "urUSMPoolCreate: failed to create UMF provider"); throw UsmAllocationException(umf::umf2urResult(Ret)); } @@ -1009,13 +1009,13 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - URLOG(ERR, "urUSMPoolCreate: failed to store USM pool tag"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - URLOG(ERR, "urUSMPoolCreate: failed to store UMF pool"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1069,12 +1069,12 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - URLOG(ERR, "urUSMPoolCreate: failed to store USM pool tag"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - URLOG(ERR, "urUSMPoolCreate: failed to store UMF pool"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1191,7 +1191,7 @@ ur_result_t ur_usm_pool_handle_t_::allocate(ur_context_handle_t Context, } if (*RetMem == nullptr) { auto umfRet = umfPoolGetLastAllocationError(umfPool); - URLOG(ERR, + UR_LOG(ERR, "enqueueUSMAllocHelper: allocation from the UMF pool {} failed", umfPool); return umf::umf2urResult(umfRet); diff --git a/unified-runtime/source/adapters/level_zero/v2/api.cpp b/unified-runtime/source/adapters/level_zero/v2/api.cpp index bb35f5238b6c..d58c14b6945a 100644 --- a/unified-runtime/source/adapters/level_zero/v2/api.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/api.cpp @@ -23,21 +23,21 @@ ur_result_t urContextSetExtendedDeleter(ur_context_handle_t hContext, ur_context_extended_deleter_t pfnDeleter, void *pUserData) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urKernelSetSpecializationConstants( ur_kernel_handle_t hKernel, uint32_t count, const ur_specialization_constant_info_t *pSpecConstants) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urEventSetCallback(ur_event_handle_t hEvent, ur_execution_info_t execStatus, ur_event_callback_t pfnNotify, void *pUserData) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -47,21 +47,21 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, ur_usm_pool_handle_t pool, size_t widthInBytes, size_t height, size_t elementSizeBytes, void **ppMem, size_t *pResultPitch) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -69,7 +69,7 @@ ur_result_t urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_mem_native_handle_t *phImageMem) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -77,7 +77,7 @@ ur_result_t urBindlessImagesImageFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -86,7 +86,7 @@ ur_result_t urBindlessImagesUnsampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_native_handle_t *phImage) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -95,14 +95,14 @@ ur_result_t urBindlessImagesSampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_sampler_handle_t hSampler, ur_exp_image_native_handle_t *phImage) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesImageGetInfoExp( ur_context_handle_t hContext, ur_exp_image_mem_native_handle_t hImageMem, ur_image_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -110,7 +110,7 @@ ur_result_t urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem, uint32_t mipmapLevel, ur_exp_image_mem_native_handle_t *phImageMem) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -118,7 +118,7 @@ ur_result_t urBindlessImagesMipmapFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hMem) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -127,7 +127,7 @@ ur_result_t urBindlessImagesImportExternalMemoryExp( ur_exp_external_mem_type_t memHandleType, ur_exp_external_mem_desc_t *pExternalMemDesc, ur_exp_external_mem_handle_t *phExternalMem) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -136,21 +136,21 @@ ur_result_t urBindlessImagesMapExternalArrayExp( const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_external_mem_handle_t hExternalMem, ur_exp_image_mem_native_handle_t *phImageMem) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesMapExternalLinearMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, uint64_t offset, uint64_t size, ur_exp_external_mem_handle_t hExternalMem, void **ppRetMem) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_mem_handle_t hExternalMem) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -159,14 +159,14 @@ ur_result_t urBindlessImagesImportExternalSemaphoreExp( ur_exp_external_semaphore_type_t semHandleType, ur_exp_external_semaphore_desc_t *pExternalSemaphoreDesc, ur_exp_external_semaphore_handle_t *phExternalSemaphore) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalSemaphoreExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_semaphore_handle_t hExternalSemaphore) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -174,21 +174,21 @@ ur_result_t urCommandBufferUpdateKernelLaunchExp( ur_exp_command_buffer_handle_t hCommandBuffer, uint32_t numKernelUpdates, const ur_exp_command_buffer_update_kernel_launch_desc_t *pUpdateKernelLaunch) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateSignalEventExp( ur_exp_command_buffer_command_handle_t hCommand, ur_event_handle_t *phEvent) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateWaitEventsExp( ur_exp_command_buffer_command_handle_t hCommand, uint32_t NumEventsInWaitList, const ur_event_handle_t *phEventWaitList) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -196,28 +196,28 @@ ur_result_t UR_APICALL urUSMPoolCreateExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_desc_t *PoolDesc, ur_usm_pool_handle_t *pPool) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolSetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t propSize) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -225,21 +225,21 @@ ur_result_t UR_APICALL urUSMPoolGetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -247,7 +247,7 @@ ur_result_t UR_APICALL urUSMPoolTrimToExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool, size_t minBytesToKeep) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp index 0ce72b46ec2b..5968fc475d05 100644 --- a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp @@ -20,7 +20,7 @@ namespace { // given context. void checkImmediateAppendSupport(ur_context_handle_t context) { if (!context->getPlatform()->ZeCommandListImmediateAppendExt.Supported) { - URLOG(ERR, "Adapter v2 is used but the current driver does not support " + UR_LOG(ERR, "Adapter v2 is used but the current driver does not support " "the zeCommandListImmediateAppendCommandListsExp entrypoint."); throw UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp b/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp index 99ecbb60548a..87512554e9ec 100644 --- a/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp @@ -62,12 +62,12 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { std::visit([](auto &&arg) { return arg.CopyOffloadEnabled; }, desc); if (ForceDisableCopyOffload && requestedCopyOffload) { - URLOG(INFO, "Copy offload is disabled by the environment variable."); + UR_LOG(INFO, "Copy offload is disabled by the environment variable."); requestedCopyOffload = false; } if (!ZeCopyOffloadExtensionSupported && requestedCopyOffload) { - URLOG(INFO, + UR_LOG(INFO, "Copy offload is requested but is not supported by the driver."); requestedCopyOffload = false; } @@ -89,7 +89,7 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { } QueueDesc.pNext = &offloadDesc; - URLOG(DEBUG, + UR_LOG(DEBUG, "create command list ordinal: {}, type: immediate, " "device: {}, inOrder: {}", ImmCmdDesc->Ordinal, ImmCmdDesc->ZeDevice, ImmCmdDesc->IsInOrder); @@ -106,7 +106,7 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { CmdListDesc.commandQueueGroupOrdinal = RegCmdDesc.Ordinal; CmdListDesc.pNext = &offloadDesc; - URLOG(DEBUG, + UR_LOG(DEBUG, "create command list ordinal: {}, type: immediate, " "device: {}, inOrder: {}", RegCmdDesc.Ordinal, RegCmdDesc.ZeDevice, RegCmdDesc.IsInOrder); diff --git a/unified-runtime/source/adapters/level_zero/v2/event.cpp b/unified-runtime/source/adapters/level_zero/v2/event.cpp index 3864c7af844d..d0f67b4b7f01 100644 --- a/unified-runtime/source/adapters/level_zero/v2/event.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/event.cpp @@ -271,7 +271,7 @@ ur_result_t urEventGetInfo(ur_event_handle_t hEvent, ur_event_info_t propName, return returnValue(hEvent->getCommandType()); } default: - URLOG(ERR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", propName, logger::toHex(propName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -317,7 +317,7 @@ ur_result_t urEventGetProfilingInfo( return returnValue(hEvent->getEventEndTimestamp()); } default: - URLOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -367,7 +367,7 @@ ur_result_t urEventGetProfilingInfo( // return returnValue(uint64_t{0}); default: - URLOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp b/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp index 842584b1c5c4..6239f3f5f741 100644 --- a/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp @@ -50,7 +50,7 @@ provider_pool::provider_pool(ur_context_handle_t context, queue_type queue, devices.push_back(d->ZeDevice); } - URLOG(DEBUG, "ze_event_pool_desc_t flags set to: {}", desc.flags); + UR_LOG(DEBUG, "ze_event_pool_desc_t flags set to: {}", desc.flags); ZE2UR_CALL_THROWS(zeEventPoolCreate, (context->getZeHandle(), &desc, devices.size(), diff --git a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp index 77ad67d81a1d..083c00db144b 100644 --- a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp @@ -264,7 +264,7 @@ ur_result_t ur_kernel_handle_t_::setExecInfo(ur_kernel_exec_info_t propName, ZE2UR_CALL(zeKernelSetCacheConfig, (kernel->hKernel.get(), zeCacheConfig);); } else { - URLOG(ERR, "urKernelSetExecInfo: unsupported ParamName"); + UR_LOG(ERR, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -560,7 +560,7 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - URLOG(ERR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -644,7 +644,7 @@ ur_result_t urKernelGetInfo(ur_kernel_handle_t hKernel, return ReturnValue(static_cast(attributes.data())); } default: - URLOG(ERR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/memory.cpp b/unified-runtime/source/adapters/level_zero/v2/memory.cpp index 29d67b189d1f..12123177f55e 100644 --- a/unified-runtime/source/adapters/level_zero/v2/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/memory.cpp @@ -95,7 +95,7 @@ ur_integrated_buffer_handle_t::ur_integrated_buffer_handle_t( this->ptr = usm_unique_ptr_t(rawPtr, [hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - URLOG(ERR, "Failed to free host memory: {}", ret); + UR_LOG(ERR, "Failed to free host memory: {}", ret); } }); @@ -182,7 +182,7 @@ void *ur_discrete_buffer_handle_t::allocateOnDevice(ur_device_handle_t hDevice, usm_unique_ptr_t(ptr, [hContext = this->hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - URLOG(ERR, "Failed to free device memory: {}", ret); + UR_LOG(ERR, "Failed to free device memory: {}", ret); } }); @@ -311,7 +311,7 @@ void *ur_discrete_buffer_handle_t::mapHostPtr( if (ownsAlloc) { auto ret = hContext->getDefaultUSMPool()->free(p); if (ret != UR_RESULT_SUCCESS) { - URLOG(ERR, "Failed to mapped memory: {}", ret); + UR_LOG(ERR, "Failed to mapped memory: {}", ret); } } }); @@ -742,7 +742,7 @@ ur_result_t urMemImageCreateWithNativeHandle( ur_result_t urMemImageGetInfo(ur_mem_handle_t hMemory, ur_image_info_t propName, size_t propSize, void *pPropValue, size_t *pPropSizeRet) { - URLOG(ERR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); std::ignore = hMemory; std::ignore = propName; diff --git a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp index 946eb2ece9c6..bbfa9ba292da 100644 --- a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp @@ -129,7 +129,7 @@ ur_queue_immediate_in_order_t::queueGetInfo(ur_queue_info_t propName, } } default: - URLOG(ERR, + UR_LOG(ERR, "Unsupported ParamName in urQueueGetInfo: " "ParamName=ParamName={}(0x{})", propName, logger::toHex(propName)); @@ -191,7 +191,7 @@ ur_queue_immediate_in_order_t::~ur_queue_immediate_in_order_t() { try { UR_CALL_THROWS(queueFinish()); } catch (...) { - URLOG(ERR, "Failed to finish queue on destruction"); + UR_LOG(ERR, "Failed to finish queue on destruction"); } } diff --git a/unified-runtime/source/adapters/level_zero/v2/usm.cpp b/unified-runtime/source/adapters/level_zero/v2/usm.cpp index 4a7ddc7aa7af..484f6ecbe5f3 100644 --- a/unified-runtime/source/adapters/level_zero/v2/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/usm.cpp @@ -163,7 +163,7 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t hContext, } } else { // If pooling is disabled, do nothing. - URLOG(INFO, "USM pooling is disabled. Skiping pool limits adjustment."); + UR_LOG(INFO, "USM pooling is disabled. Skiping pool limits adjustment."); } auto devicesAndSubDevices = @@ -236,7 +236,7 @@ ur_result_t ur_usm_pool_handle_t_::free(void *ptr) { if (umfPool) { return umf::umf2urResult(umfPoolFree(umfPool, ptr)); } else { - URLOG(ERR, "Failed to find pool for pointer: {}", ptr); + UR_LOG(ERR, "Failed to find pool for pointer: {}", ptr); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -440,7 +440,7 @@ ur_result_t urUSMGetMemAllocInfo( memAllocType = UR_USM_TYPE_SHARED; break; default: - URLOG(ERR, "urUSMGetMemAllocInfo: unexpected usm memory type"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(memAllocType); @@ -469,7 +469,7 @@ ur_result_t urUSMGetMemAllocInfo( // TODO return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; default: - URLOG(ERR, "urUSMGetMemAllocInfo: unsupported ParamName"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp index e04b09d580b0..9f588345067d 100644 --- a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp +++ b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp @@ -38,7 +38,7 @@ ur_result_t urVirtualMemGranularityGetInfo( return ReturnValue(PageSize); } default: - URLOG(ERR, "Unsupported propName in urQueueGetInfo: propName={}({})", + UR_LOG(ERR, "Unsupported propName in urQueueGetInfo: propName={}({})", propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -120,7 +120,7 @@ ur_result_t urVirtualMemGetInfo(ur_context_handle_t hContext, return ReturnValue(RetFlags); } default: - URLOG(ERR, "Unsupported propName in urQueueGetInfo: propName={}({})", + UR_LOG(ERR, "Unsupported propName in urQueueGetInfo: propName={}({})", propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/native_cpu/common.hpp b/unified-runtime/source/adapters/native_cpu/common.hpp index 1056d21c56a5..77b60233c09c 100644 --- a/unified-runtime/source/adapters/native_cpu/common.hpp +++ b/unified-runtime/source/adapters/native_cpu/common.hpp @@ -21,19 +21,19 @@ extern thread_local char ErrorMessage[MaxMessageSize]; #define DIE_NO_IMPLEMENTATION \ do { \ - URLOG(ERR, "Not Implemented : {}", __FUNCTION__) \ + UR_LOG(ERR, "Not Implemented : {}", __FUNCTION__) \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; \ } while (false) #define CONTINUE_NO_IMPLEMENTATION \ do { \ - URLOG(WARN, "Not Implemented : {}", __FUNCTION__) \ + UR_LOG(WARN, "Not Implemented : {}", __FUNCTION__) \ return UR_RESULT_SUCCESS; \ } while (false) #define CASE_UR_UNSUPPORTED(not_supported) \ case not_supported: \ - URLOG(ERR, "Unsupported UR case : {} in {}", #not_supported, __FUNCTION__) \ + UR_LOG(ERR, "Unsupported UR case : {} in {}", #not_supported, __FUNCTION__) \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; // Todo: replace this with a common helper once it is available diff --git a/unified-runtime/source/adapters/native_cpu/device.cpp b/unified-runtime/source/adapters/native_cpu/device.cpp index fe02707bb038..ba114c0e31a6 100644 --- a/unified-runtime/source/adapters/native_cpu/device.cpp +++ b/unified-runtime/source/adapters/native_cpu/device.cpp @@ -99,7 +99,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGet(ur_platform_handle_t hPlatform, if (NumEntries == 0) { /// Runtime queries number of devices if (phDevices != nullptr) { - URLOG(ERR, "Invalid Arguments for urDevicesGet"); + UR_LOG(ERR, "Invalid Arguments for urDevicesGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/adapters/native_cpu/platform.cpp b/unified-runtime/source/adapters/native_cpu/platform.cpp index 53fd793b477a..48bfc80198ca 100644 --- a/unified-runtime/source/adapters/native_cpu/platform.cpp +++ b/unified-runtime/source/adapters/native_cpu/platform.cpp @@ -29,7 +29,7 @@ urPlatformGet(ur_adapter_handle_t *, uint32_t, uint32_t NumEntries, if (NumEntries == 0) { if (phPlatforms != nullptr) { - URLOG(ERR, "Invalid argument combination for urPlatformsGet"); + UR_LOG(ERR, "Invalid argument combination for urPlatformsGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/adapters/opencl/context.cpp b/unified-runtime/source/adapters/opencl/context.cpp index 613cfc9ce731..4d68a453cefd 100644 --- a/unified-runtime/source/adapters/opencl/context.cpp +++ b/unified-runtime/source/adapters/opencl/context.cpp @@ -168,7 +168,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextSetExtendedDeleter( ur_context_handle_t hContext, ur_context_extended_deleter_t pfnDeleter, void *pUserData) { if (!ur::cl::getAdapter()->clSetContextDestructorCallback) { - URLOG_(ur::cl::getAdapter()->log, WARN, + UR_LOG_LOGGER(ur::cl::getAdapter()->log, WARN, "clSetContextDestructorCallback not found, consider upgrading the " "OpenCL-ICD-Loader to the latest version."); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/common/latency_tracker.hpp b/unified-runtime/source/common/latency_tracker.hpp index fd36a553d35b..1662d9ecdb2d 100644 --- a/unified-runtime/source/common/latency_tracker.hpp +++ b/unified-runtime/source/common/latency_tracker.hpp @@ -31,7 +31,7 @@ static inline bool trackLatency = []() { auto it = map->find("level"); return it != map->end() && - logger::str_to_level(it->second.front()) != logger::Level::QUIET; + logger::str_to_level(it->second.front()) != logger::Level::ALWAYS; } catch (...) { return false; } @@ -64,7 +64,7 @@ static inline latencyValues getValues(const struct hdr_histogram *histogram) { auto ret = hdr_value_at_percentiles(histogram, percentiles, values.percentileValues, numPercentiles); if (ret != 0) { - URLOG(ERR, "Failed to get percentiles from latency histogram"); + UR_LOG(ERR, "Failed to get percentiles from latency histogram"); } return values; @@ -137,7 +137,7 @@ class latency_histogram { auto ret = hdr_init(lowestDiscernibleValue, highestTrackableValue, significantFigures, &cHistogram); if (ret != 0) { - URLOG(ERR, "Failed to initialize latency histogram"); + UR_LOG(ERR, "Failed to initialize latency histogram"); } histogram = std::unique_ptr( cHistogram, &hdr_close); @@ -153,7 +153,7 @@ class latency_histogram { } if (hdr_min(histogram.get()) == std::numeric_limits::max()) { - URLOG(INFO, "[{}] latency: no data", name); + UR_LOG(INFO, "[{}] latency: no data", name); return; } diff --git a/unified-runtime/source/common/linux/ur_lib_loader.cpp b/unified-runtime/source/common/linux/ur_lib_loader.cpp index 1a1ac071f352..a6f4cf042335 100644 --- a/unified-runtime/source/common/linux/ur_lib_loader.cpp +++ b/unified-runtime/source/common/linux/ur_lib_loader.cpp @@ -25,10 +25,10 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { int res = dlclose(handle); if (res) { - URLOG(ERR, "Failed to unload the library with the handle at address {}", + UR_LOG(ERR, "Failed to unload the library with the handle at address {}", handle); } else { - URLOG(INFO, "unloaded adapter 0x{}", handle); + UR_LOG(INFO, "unloaded adapter 0x{}", handle); } } } @@ -40,7 +40,7 @@ LibLoader::loadAdapterLibrary(const char *name) { bool deepbind = getenv_tobool(DEEP_BIND_ENV); if (deepbind) { #if defined(SANITIZER_ANY) - URLOG(WARN + UR_LOG(WARN "Enabling RTLD_DEEPBIND while running under a sanitizer is likely " "to cause issues. Consider disabling {} environment variable.", DEEP_BIND_ENV); @@ -58,21 +58,21 @@ LibLoader::loadAdapterLibrary(const char *name) { (strstr(err, name) == NULL || strstr(err, "required by") != NULL)) { // If the adapter cannot be loaded due to missing dependencies or any // other related error, it is considered as an error. - URLOG(ERR, "failed to load adapter '{}' with error: {}", name, err); + UR_LOG(ERR, "failed to load adapter '{}' with error: {}", name, err); } else { // Simply having the adapter library missing isn't an error. - URLOG(INFO, "failed to load adapter '{}' with error: {}", name, + UR_LOG(INFO, "failed to load adapter '{}' with error: {}", name, err ? err : "unknown error"); } } else { #if defined(ADD_FULL_PATH_LOG) struct link_map *dlinfo_map; if (dlinfo(handle, RTLD_DI_LINKMAP, &dlinfo_map) == 0) { - URLOG(INFO, "loaded adapter 0x{} ({}) from {}", handle, name, + UR_LOG(INFO, "loaded adapter 0x{} ({}) from {}", handle, name, dlinfo_map->l_name); } else #endif - URLOG(INFO, "loaded adapter 0x{} ({})", handle, name); + UR_LOG(INFO, "loaded adapter 0x{} ({})", handle, name); } return std::unique_ptr(handle); } diff --git a/unified-runtime/source/common/logger/ur_level.hpp b/unified-runtime/source/common/logger/ur_level.hpp index b8225a7de80d..4ec11d9b7370 100644 --- a/unified-runtime/source/common/logger/ur_level.hpp +++ b/unified-runtime/source/common/logger/ur_level.hpp @@ -11,7 +11,7 @@ namespace logger { -enum class Level { DEBUG, INFO, WARN, ERR, QUIET }; +enum class Level { DEBUG, INFO, WARN, ERR, ALWAYS }; inline constexpr auto level_to_str(Level level) { switch (level) { @@ -23,8 +23,8 @@ inline constexpr auto level_to_str(Level level) { return "WARNING"; case Level::ERR: return "ERROR"; - case Level::QUIET: - return "QUIET"; + case Level::ALWAYS: + return "ALWAYS"; default: return ""; } @@ -40,7 +40,7 @@ inline auto str_to_level(std::string name) { {"info", Level::INFO}, {"warning", Level::WARN}, {"error", Level::ERR}, - {"quiet", Level::QUIET}}; + {"always", Level::ALWAYS}}; for (auto const &item : lvl_names) { if (item.name.compare(name) == 0) { diff --git a/unified-runtime/source/common/logger/ur_logger.hpp b/unified-runtime/source/common/logger/ur_logger.hpp index e26ce57cad43..990f72ee0fcb 100644 --- a/unified-runtime/source/common/logger/ur_logger.hpp +++ b/unified-runtime/source/common/logger/ur_logger.hpp @@ -16,10 +16,10 @@ namespace logger { Logger create_logger(std::string logger_name, bool skip_prefix = false, bool skip_linebreak = false, - Level default_log_level = Level::QUIET); + Level default_log_level = Level::ALWAYS); inline Logger &get_logger(std::string name = "common", - Level default_log_level = Level::QUIET) { + Level default_log_level = Level::ALWAYS) { static Logger logger = create_logger(std::move(name), /*skip_prefix*/ false, /*slip_linebreak*/ false, default_log_level); @@ -28,11 +28,13 @@ inline Logger &get_logger(std::string name = "common", inline void init(const std::string &name) { get_logger(name.c_str()); } -#define URLOG(...) URLOG_(logger::get_logger(), __VA_ARGS__) +#define UR_LOG(...) URLOG_(logger::get_logger(), __VA_ARGS__) +#define UR_LOG_LOGGER(...) URLOG_(__VA_ARGS__) +#define UR_LOG_LEGACY(...) URLOG_LEGACY_(logger::get_logger(), __VA_ARGS__) + #define URLOG_ALWAYS(...) URLOG_ALWAYS_(logger::get_logger(), __VA_ARGS__) -#define URLOG_CTX(...) URLOG_(getContext()->logger, __VA_ARGS__) -#define URLOG_CTX_ALWAYS(...) URLOG_(getContext()->logger, QUIET, __VA_ARGS__) -#define URLOG_L(...) URLOG_LEGACY_(logger::get_logger(), __VA_ARGS__) +// #define URLOG_CTX(...) URLOG_(getContext()->logger, __VA_ARGS__) +// #define URLOG_CTX_ALWAYS(...) URLOG_(getContext()->logger, ALWAYS, __VA_ARGS__) inline void setLevel(Level level) { get_logger().setLevel(level); } @@ -44,9 +46,16 @@ template inline std::string toHex(T t) { return s.str(); } -inline bool str_to_bool(const std::string str) { - return str == "true" || str == "TRUE" || str == "yes" || str == "YES" || - str == "y" || str == "Y" || str == "on" || str == "ON" || str == "1"; +inline bool str_to_bool(const std::string &str) { + if (!str.empty()) { + std::string lower_value = str; + std::transform(lower_value.begin(), lower_value.end(), lower_value.begin(), + [](unsigned char c) { return std::tolower(c); }); + const std::initializer_list true_str = {"y", "yes", "t", "true", "1"}; + return std::find(true_str.begin(), true_str.end(), lower_value) != true_str.end(); + } + + return false; } /// @brief Create an instance of the logger with parameters obtained from the diff --git a/unified-runtime/source/common/logger/ur_logger_details.hpp b/unified-runtime/source/common/logger/ur_logger_details.hpp index e9ae7f53312c..a622dcc3ff5c 100644 --- a/unified-runtime/source/common/logger/ur_logger_details.hpp +++ b/unified-runtime/source/common/logger/ur_logger_details.hpp @@ -20,7 +20,7 @@ struct LegacyMessage { class Logger { public: Logger(std::unique_ptr sink) - : level(Level::QUIET), sink(std::move(sink)) {} + : level(Level::ALWAYS), sink(std::move(sink)) {} Logger(Level level, std::unique_ptr sink) : level(level), sink(std::move(sink)) {} @@ -80,23 +80,23 @@ class Logger { #define SHORT_FILE __FILE__ #endif -#define UR_STRIMPL(x) #x -#define UR_STR(x) UR_STRIMPL(x) +#define UR_STRIMPL_(x) #x +#define UR_STR_(x) UR_STRIMPL_(x) #define URLOG_(logger_instance, level, ...) \ { \ (logger_instance) \ - .log(logger::Level::level, SHORT_FILE, UR_STR(__LINE__), __VA_ARGS__); \ + .log(logger::Level::level, SHORT_FILE, UR_STR_(__LINE__), __VA_ARGS__); \ } #define URLOG_ALWAYS_(logger_instance, ...) \ - URLOG_(logger_instance, QUIET, __VA_ARGS__) + URLOG_(logger_instance, ALWAYS, __VA_ARGS__) #define URLOG_LEGACY_(logger_instance, level, legacy_message, ...) \ { \ (logger_instance) \ .log(legacy_message, logger::Level::level, SHORT_FILE, \ - UR_STR(__LINE__), __VA_ARGS__); \ + UR_STR_(__LINE__), __VA_ARGS__); \ } #endif /* UR_LOGGER_DETAILS_HPP */ diff --git a/unified-runtime/source/common/logger/ur_sinks.hpp b/unified-runtime/source/common/logger/ur_sinks.hpp index 3f2fa4ccfcd2..086e8a871114 100644 --- a/unified-runtime/source/common/logger/ur_sinks.hpp +++ b/unified-runtime/source/common/logger/ur_sinks.hpp @@ -28,7 +28,7 @@ class Sink { void log(Level level, const char *filename, const char *lineno, const char *fmt, Args &&...args) { std::ostringstream buffer; - if (!skip_prefix && level != Level::QUIET) { + if (!skip_prefix && level != Level::ALWAYS) { buffer << "<" << logger_name << ">" << "[" << level_to_str(level) << "]: "; } diff --git a/unified-runtime/source/common/umf_helpers.hpp b/unified-runtime/source/common/umf_helpers.hpp index 1c9436b6992f..1a9d2e56a5ba 100644 --- a/unified-runtime/source/common/umf_helpers.hpp +++ b/unified-runtime/source/common/umf_helpers.hpp @@ -296,7 +296,7 @@ inline ur_result_t umf2urResult(umf_result_t umfResult) { umfMemoryProviderGetLastNativeError(hProvider, &Msg, &Err); if (Msg) { - URLOG(ERR, "UMF failed with: {}", Msg); + UR_LOG(ERR, "UMF failed with: {}", Msg); } return getProviderNativeError(umfMemoryProviderGetName(hProvider), Err); diff --git a/unified-runtime/source/common/ur_pool_manager.hpp b/unified-runtime/source/common/ur_pool_manager.hpp index 8ea260ad514a..90751f478891 100644 --- a/unified-runtime/source/common/ur_pool_manager.hpp +++ b/unified-runtime/source/common/ur_pool_manager.hpp @@ -176,7 +176,7 @@ template struct pool_manager { ur_result_t addPool(const D &desc, unique_pool_handle_t &&hPool) { if (!descToPoolMap.try_emplace(desc, std::move(hPool)).second) { - URLOG(ERR, "Pool for pool descriptor: {}, already exists", desc); + UR_LOG(ERR, "Pool for pool descriptor: {}, already exists", desc); return UR_RESULT_ERROR_INVALID_ARGUMENT; } @@ -186,7 +186,7 @@ template struct pool_manager { std::optional getPool(const D &desc) { auto it = descToPoolMap.find(desc); if (it == descToPoolMap.end()) { - URLOG(ERR, "Pool descriptor doesn't match any existing pool: {}", desc); + UR_LOG(ERR, "Pool descriptor doesn't match any existing pool: {}", desc); return std::nullopt; } diff --git a/unified-runtime/source/common/ur_util.cpp b/unified-runtime/source/common/ur_util.cpp index d44df684e0e4..6978a3958264 100644 --- a/unified-runtime/source/common/ur_util.cpp +++ b/unified-runtime/source/common/ur_util.cpp @@ -45,14 +45,14 @@ int ur_duplicate_fd(int pid, int fd_in) { errno = 0; int pid_fd = syscall(__NR_pidfd_open, pid, 0); if (pid_fd == -1) { - URLOG(ERR, "__NR_pidfd_open"); + UR_LOG(ERR, "__NR_pidfd_open"); return -1; } int fd_dup = syscall(__NR_pidfd_getfd, pid_fd, fd_in, 0); close(pid_fd); if (fd_dup == -1) { - URLOG(ERR, "__NR_pidfd_getfd"); + UR_LOG(ERR, "__NR_pidfd_getfd"); return -1; } @@ -63,7 +63,7 @@ int ur_duplicate_fd(int pid, int fd_in) { (void)pid; // unused (void)fd_in; // unused errno = ENOTSUP; // unsupported - URLOG(ERR, "__NR_pidfd_open or __NR_pidfd_getfd not available"); + UR_LOG(ERR, "__NR_pidfd_open or __NR_pidfd_getfd not available"); return -1; #endif /* defined(__NR_pidfd_open) && defined(__NR_pidfd_getfd) */ } diff --git a/unified-runtime/source/common/windows/ur_lib_loader.cpp b/unified-runtime/source/common/windows/ur_lib_loader.cpp index f6906b39a496..1821469ddecc 100644 --- a/unified-runtime/source/common/windows/ur_lib_loader.cpp +++ b/unified-runtime/source/common/windows/ur_lib_loader.cpp @@ -17,10 +17,10 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { BOOL res = FreeLibrary(handle); if (!res) { - URLOG(ERR, "Failed to unload the library with the handle at address 0x{}", + UR_LOG(ERR, "Failed to unload the library with the handle at address 0x{}", handle); } else { - URLOG(INFO, "unloaded adapter 0x{}", handle); + UR_LOG(INFO, "unloaded adapter 0x{}", handle); } } } @@ -28,10 +28,10 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { std::unique_ptr LibLoader::loadAdapterLibrary(const char *name) { if (HMODULE handle = LoadLibraryExA(name, nullptr, 0)) { - URLOG(INFO, "loaded adapter 0x{}: {}", handle, name); + UR_LOG(INFO, "loaded adapter 0x{}: {}", handle, name); return std::unique_ptr{handle}; } else { - URLOG(DEBUG, "loading adapter failed with error {}: {}", GetLastError(), + UR_LOG(DEBUG, "loading adapter failed with error {}: {}", GetLastError(), name); } return nullptr; diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp index 25e66a191db8..fddc0e0fbbdf 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp @@ -18,7 +18,7 @@ namespace ur_sanitizer_layer { namespace asan { void AllocInfo::print() { - URLOG_CTX(INFO, + UR_LOG_LOGGER(getContext()->logger, INFO, "AllocInfo(Alloc=[{}-{}), User=[{}-{}), AllocSize={}, Type={})", (void *)AllocBegin, (void *)(AllocBegin + AllocSize), (void *)UserBegin, (void *)(UserEnd), AllocSize, ToString(Type)); diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp index 9a42886f7507..38a7ad1343dc 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp @@ -97,7 +97,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::MEM_BUFFER, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to allocate {} bytes memory for buffer {}", Size, + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -107,7 +107,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX( + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to copy {} bytes data from host pointer {} to buffer {}", Size, HostPtr, this); @@ -135,7 +135,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Context, nullptr, &USMDesc, Pool, Size, AllocType::HOST_USM, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX( + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to allocate {} bytes host USM for buffer {} migration", Size, this); return URes; @@ -149,7 +149,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to migrate memory buffer data"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } } @@ -160,7 +160,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to migrate memory buffer data"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } } @@ -175,7 +175,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getAsanInterceptor()->releaseMemory(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to free buffer handle {}", Ptr); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to free buffer handle {}", Ptr); return URes; } } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp index aec317bf36f5..971ada1e1978 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp @@ -40,17 +40,17 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getAsanInterceptor()->insertDevice(hDevice, DI)); DI->Type = GetDeviceType(Context, hDevice); if (DI->Type == DeviceType::UNKNOWN) { - URLOG_CTX(ERR, "Unsupport device"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } if (DI->Type != DeviceType) { - URLOG_CTX(ERR, "Different device type in the same context"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Different device type in the same context"); return UR_RESULT_ERROR_INVALID_DEVICE; } - URLOG_CTX(INFO, "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", + UR_LOG_LOGGER(getContext()->logger, INFO, "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", (void *)DI->Handle, ToString(DI->Type), DI->IsSupportSharedSystemUSM); - URLOG_CTX(INFO, "Add {} into context {}", (void *)DI->Handle, + UR_LOG_LOGGER(getContext()->logger, INFO, "Add {} into context {}", (void *)DI->Handle, (void *)Context); DI->Shadow = ShadowMemory; CI->DeviceList.emplace_back(hDevice); @@ -111,7 +111,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urUSMHostAlloc"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urUSMHostAlloc"); return getAsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -138,7 +138,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urUSMDeviceAlloc"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urUSMDeviceAlloc"); return getAsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -165,7 +165,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urUSMSharedAlloc"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urUSMSharedAlloc"); return getAsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -184,7 +184,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urUSMFree"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urUSMFree"); return getAsanInterceptor()->releaseMemory(hContext, pMem); } @@ -209,7 +209,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urProgramCreateWithIL"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramCreateWithIL"); UR_CALL( pfnProgramCreateWithIL(hContext, pIL, length, pProperties, phProgram)); @@ -245,7 +245,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urProgramCreateWithBinary"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramCreateWithBinary"); UR_CALL(pfnProgramCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, pProperties, phProgram)); @@ -272,7 +272,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urProgramCreateWithNativeHandle"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramCreateWithNativeHandle"); UR_CALL(pfnProgramCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram)); @@ -293,7 +293,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urProgramRetain"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramRetain"); UR_CALL(pfnRetain(hProgram)); @@ -320,7 +320,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urProgramBuild"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramBuild"); auto UrRes = pfnProgramBuild(hContext, hProgram, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -351,7 +351,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urProgramBuildExp"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramBuildExp"); auto UrRes = pfnBuildExp(hProgram, numDevices, phDevices, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -383,7 +383,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urProgramLink"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramLink"); auto UrRes = pfnProgramLink(hContext, count, phPrograms, pOptions, phProgram); if (UrRes != UR_RESULT_SUCCESS) { @@ -421,7 +421,7 @@ ur_result_t UR_APICALL urProgramLinkExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urProgramLinkExp"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramLinkExp"); auto UrRes = pfnProgramLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram); @@ -447,7 +447,7 @@ ur_result_t UR_APICALL urProgramRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urProgramRelease"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramRelease"); UR_CALL(pfnProgramRelease(hProgram)); @@ -505,7 +505,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urEnqueueKernelLaunch"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueKernelLaunch"); LaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue), pGlobalWorkSize, pLocalWorkSize, pGlobalWorkOffset, workDim); @@ -548,7 +548,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urContextCreate"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextCreate"); ur_result_t result = pfnCreate(numDevices, phDevices, pProperties, phContext); @@ -580,7 +580,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urContextCreateWithNativeHandle"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextCreateWithNativeHandle"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -603,7 +603,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urContextRetain"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextRetain"); UR_CALL(pfnRetain(hContext)); @@ -625,7 +625,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urContextRelease"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextRelease"); UR_CALL(pfnRelease(hContext)); @@ -661,7 +661,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - URLOG_CTX(DEBUG, "==== urMemBufferCreate"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemBufferCreate"); void *Host = nullptr; if (pProperties) { @@ -715,7 +715,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urMemGetInfo"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemGetInfo"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMemory)) { UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); @@ -748,7 +748,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urMemRetain"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemRetain"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { MemBuffer->RefCount++; @@ -770,7 +770,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urMemRelease"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemRelease"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { if (--MemBuffer->RefCount != 0) { @@ -805,7 +805,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urMemBufferPartition"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemBufferPartition"); if (auto ParentBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { @@ -836,7 +836,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urMemGetNativeHandle"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemGetNativeHandle"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { char *Handle = nullptr; @@ -880,7 +880,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferRead"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferRead"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -928,7 +928,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWrite"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWrite"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -990,7 +990,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferReadRect"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferReadRect"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *SrcHandle = nullptr; @@ -1055,7 +1055,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWriteRect"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWriteRect"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *DstHandle = nullptr; @@ -1107,7 +1107,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopy"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopy"); auto SrcBuffer = getAsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getAsanInterceptor()->getMemBuffer(hBufferDst); @@ -1175,7 +1175,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopyRect"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopyRect"); auto SrcBuffer = getAsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getAsanInterceptor()->getMemBuffer(hBufferDst); @@ -1237,7 +1237,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferFill"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferFill"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *Handle = nullptr; @@ -1289,7 +1289,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferMap"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferMap"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { @@ -1376,7 +1376,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urEnqueueMemUnmap"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemUnmap"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { MemBuffer::Mapping Mapping{}; @@ -1421,7 +1421,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urKernelRetain"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelRetain"); UR_CALL(pfnRetain(hKernel)); @@ -1442,7 +1442,7 @@ __urdlllocal ur_result_t urKernelRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urKernelRelease"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelRelease"); auto &KernelInfo = getAsanInterceptor()->getOrCreateKernelInfo(hKernel); if (--KernelInfo.RefCount == 0) { @@ -1472,7 +1472,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urKernelSetArgValue"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelSetArgValue"); std::shared_ptr MemBuffer; if (argSize == sizeof(ur_mem_handle_t) && @@ -1505,7 +1505,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urKernelSetArgMemObj"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelSetArgMemObj"); std::shared_ptr MemBuffer; if ((MemBuffer = getAsanInterceptor()->getMemBuffer(hArgValue))) { @@ -1536,7 +1536,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urKernelSetArgLocal (argIndex={}, argSize={})", + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelSetArgLocal (argIndex={}, argSize={})", argIndex, argSize); { @@ -1572,7 +1572,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - URLOG_CTX(DEBUG, "==== urKernelSetArgPointer (argIndex={}, pArgValue={})", + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelSetArgPointer (argIndex={}, pArgValue={})", argIndex, pArgValue); std::shared_ptr KI; @@ -1956,7 +1956,7 @@ template struct NotSupportedApi; template struct NotSupportedApi { R static ReportError(A...) { - URLOG_CTX(ERR, MsgType::value); + UR_LOG_LOGGER(getContext()->logger, ERR, MsgType::value); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } }; @@ -2084,7 +2084,7 @@ __urdlllocal ur_result_t UR_APICALL urGetVirtualMemProcAddrTable( ur_result_t initAsanDDITable(ur_dditable_t *dditable) { ur_result_t result = UR_RESULT_SUCCESS; - URLOG_CTX_ALWAYS("==== DeviceSanitizer: ASAN"); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "==== DeviceSanitizer: ASAN"); if (UR_RESULT_SUCCESS == result) { result = ur_sanitizer_layer::asan::urGetGlobalProcAddrTable( @@ -2147,7 +2147,7 @@ ur_result_t initAsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Initialize ASAN DDI table failed: {}", result); + UR_LOG_LOGGER(getContext()->logger, ERR, "Initialize ASAN DDI table failed: {}", result); } return result; diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp index f2ef77389a36..54962db8cc13 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp @@ -117,7 +117,7 @@ ur_result_t AsanInterceptor::allocateMemory(ur_context_handle_t Context, UR_CALL(getContext()->urDdiTable.USM.pfnDeviceAlloc( Context, Device, Properties, Pool, NeededSize, &Allocated)); } else { - URLOG_CTX(ERR, "Unsupport memory type"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Unsupport memory type"); return UR_RESULT_ERROR_INVALID_ARGUMENT; } @@ -225,7 +225,7 @@ ur_result_t AsanInterceptor::releaseMemory(ur_context_handle_t Context, // If quarantine is disabled, USM is freed immediately if (!m_Quarantine) { - URLOG_CTX(DEBUG, "Free: {}", (void *)AllocInfo->AllocBegin); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "Free: {}", (void *)AllocInfo->AllocBegin); ContextInfo->Stats.UpdateUSMRealFreed(AllocInfo->AllocSize, AllocInfo->getRedzoneSize()); @@ -243,7 +243,7 @@ ur_result_t AsanInterceptor::releaseMemory(ur_context_handle_t Context, std::scoped_lock Guard(m_AllocationMapMutex); for (auto &It : ReleaseList) { auto ToFreeAllocInfo = It->second; - URLOG_CTX(INFO, "Quarantine Free: {}", + UR_LOG_LOGGER(getContext()->logger, INFO, "Quarantine Free: {}", (void *)ToFreeAllocInfo->AllocBegin); ContextInfo->Stats.UpdateUSMRealFreed(ToFreeAllocInfo->AllocSize, @@ -271,7 +271,7 @@ ur_result_t AsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(Context, Device); if (!InternalQueue) { - URLOG_CTX(ERR, "Failed to create internal queue"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -327,7 +327,7 @@ AsanInterceptor::getOrCreateShadowMemory(ur_device_handle_t Device, auto Res = getContext()->urDdiTable.Context.pfnCreate(1, &Device, nullptr, &InternalContext); if (Res != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to create shadow context"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to create shadow context"); return nullptr; } std::shared_ptr CI; @@ -440,13 +440,13 @@ AsanInterceptor::updateShadowMemory(std::shared_ptr &ContextInfo, ur_result_t AsanInterceptor::registerProgram(ur_program_handle_t Program) { ur_result_t Result = UR_RESULT_SUCCESS; - URLOG_CTX(INFO, "registerSpirKernels"); + UR_LOG_LOGGER(getContext()->logger, INFO, "registerSpirKernels"); Result = registerSpirKernels(Program); if (Result != UR_RESULT_SUCCESS) { return Result; } - URLOG_CTX(INFO, "registerDeviceGlobals"); + UR_LOG_LOGGER(getContext()->logger, INFO, "registerDeviceGlobals"); Result = registerDeviceGlobals(Program); if (Result != UR_RESULT_SUCCESS) { return Result; @@ -496,7 +496,7 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, &SKInfo[0], MetadataPtr, sizeof(SpirKernelInfo) * NumOfSpirKernel, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Can't read the value of <{}>: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Can't read the value of <{}>: {}", kSPIR_AsanSpirKernelMetadata, Result); return Result; } @@ -512,19 +512,19 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, KernelNameV.data(), (void *)SKI.KernelName, sizeof(char) * SKI.Size, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Can't read kernel name: {}", Result); + UR_LOG_LOGGER(getContext()->logger, ERR, "Can't read kernel name: {}", Result); return Result; } std::string KernelName = std::string(KernelNameV.begin(), KernelNameV.end()); - URLOG_CTX(INFO, "SpirKernel(name='{}', isInstrumented={})", KernelName, + UR_LOG_LOGGER(getContext()->logger, INFO, "SpirKernel(name='{}', isInstrumented={})", KernelName, true); PI->InstrumentedKernels.insert(std::move(KernelName)); } - URLOG_CTX(INFO, "Number of sanitized kernel: {}", + UR_LOG_LOGGER(getContext()->logger, INFO, "Number of sanitized kernel: {}", PI->InstrumentedKernels.size()); } @@ -549,7 +549,7 @@ AsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Device, Program, kSPIR_AsanDeviceGlobalMetadata, &MetadataSize, &MetadataPtr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(INFO, "No device globals"); + UR_LOG_LOGGER(getContext()->logger, INFO, "No device globals"); continue; } @@ -561,7 +561,7 @@ AsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Device Global[{}] Read Failed: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Device Global[{}] Read Failed: {}", kSPIR_AsanDeviceGlobalMetadata, Result); return Result; } @@ -728,7 +728,7 @@ ur_result_t AsanInterceptor::prepareLaunch( auto PrivateMemoryUsage = GetKernelPrivateMemorySize(Kernel, DeviceInfo->Handle); - URLOG_CTX(INFO, + UR_LOG_LOGGER(getContext()->logger, INFO, "KernelInfo {} (Name={}, ArgNums={}, IsInstrumented={}, " "LocalMemory={}, PrivateMemory={})", (void *)Kernel, GetKernelName(Kernel), ArgNums, @@ -759,7 +759,7 @@ ur_result_t AsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to set buffer {} as the {} arg to kernel {}: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); } @@ -779,7 +779,7 @@ ur_result_t AsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgNums - 1, nullptr, LaunchInfo.Data.getDevicePtr()); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to set launch info: {}", URes); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to set launch info: {}", URes); return URes; } } @@ -819,14 +819,14 @@ ur_result_t AsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocLocalShadow( Queue, NumWG, LaunchInfo.Data.Host.LocalShadowOffset, LaunchInfo.Data.Host.LocalShadowOffsetEnd) != UR_RESULT_SUCCESS) { - URLOG_CTX(WARN, + UR_LOG_LOGGER(getContext()->logger, WARN, "Failed to allocate shadow memory for local memory, " "maybe the number of workgroup ({}) is too large", NumWG); - URLOG_CTX(WARN, "Skip checking local memory of kernel <{}>", + UR_LOG_LOGGER(getContext()->logger, WARN, "Skip checking local memory of kernel <{}>", GetKernelName(Kernel)); } else { - URLOG_CTX(INFO, "ShadowMemory(Local, WorkGroup{}, {} - {})", NumWG, + UR_LOG_LOGGER(getContext()->logger, INFO, "ShadowMemory(Local, WorkGroup{}, {} - {})", NumWG, (void *)LaunchInfo.Data.Host.LocalShadowOffset, (void *)LaunchInfo.Data.Host.LocalShadowOffsetEnd); } @@ -837,14 +837,14 @@ ur_result_t AsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocPrivateShadow( Queue, NumWG, LaunchInfo.Data.Host.PrivateShadowOffset, LaunchInfo.Data.Host.PrivateShadowOffsetEnd) != UR_RESULT_SUCCESS) { - URLOG_CTX(WARN, + UR_LOG_LOGGER(getContext()->logger, WARN, "Failed to allocate shadow memory for private memory, " "maybe the number of workgroup ({}) is too large", NumWG); - URLOG_CTX(WARN, "Skip checking private memory of kernel <{}>", + UR_LOG_LOGGER(getContext()->logger, WARN, "Skip checking private memory of kernel <{}>", GetKernelName(Kernel)); } else { - URLOG_CTX(INFO, "ShadowMemory(Private, WorkGroup{}, {} - {})", NumWG, + UR_LOG_LOGGER(getContext()->logger, INFO, "ShadowMemory(Private, WorkGroup{}, {} - {})", NumWG, (void *)LaunchInfo.Data.Host.PrivateShadowOffset, (void *)LaunchInfo.Data.Host.PrivateShadowOffsetEnd); } @@ -855,7 +855,7 @@ ur_result_t AsanInterceptor::prepareLaunch( std::vector LocalArgsInfo; for (auto [ArgIndex, ArgInfo] : KernelInfo.LocalArgs) { LocalArgsInfo.push_back(ArgInfo); - URLOG_CTX(DEBUG, "local_args (argIndex={}, size={}, sizeWithRZ={})", + UR_LOG_LOGGER(getContext()->logger, DEBUG, "local_args (argIndex={}, size={}, sizeWithRZ={})", ArgIndex, ArgInfo.Size, ArgInfo.SizeWithRedZone); } UR_CALL(LaunchInfo.Data.importLocalArgsInfo(Queue, LocalArgsInfo)); @@ -864,7 +864,7 @@ ur_result_t AsanInterceptor::prepareLaunch( // sync asan runtime data to device side UR_CALL(LaunchInfo.Data.syncToDevice(Queue)); - URLOG_CTX( + UR_LOG_LOGGER(getContext()->logger, INFO, "LaunchInfo {} (device={}, debug={}, numLocalArgs={}, localArgs={})", (void *)LaunchInfo.Data.getDevicePtr(), @@ -943,7 +943,7 @@ ur_usm_pool_handle_t ContextInfo::getUSMPool() { getContext()->urDdiTable.USM.pfnPoolCreate(Handle, &Desc, &USMPool); if (URes != UR_RESULT_SUCCESS && URes != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) { - URLOG_CTX(WARN, + UR_LOG_LOGGER(getContext()->logger, WARN, "Failed to create USM pool, the memory overhead " "may increase: {}", URes); diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp index a09a9ad03a2f..edd503d9591b 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp @@ -185,7 +185,7 @@ struct AsanRuntimeDataWrapper { Context, Device, nullptr, nullptr, sizeof(AsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to alloc device usm for asan runtime data: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to alloc device usm for asan runtime data: {}", Result); } } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_report.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_report.cpp index 54de7ac53c62..7826a2dfb922 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_report.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_report.cpp @@ -26,13 +26,13 @@ namespace asan { namespace { void PrintAllocateInfo(uptr Addr, const AllocInfo *AI) { - URLOG_CTX_ALWAYS("{} is located inside of {} region [{}, {})", (void *)Addr, + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "{} is located inside of {} region [{}, {})", (void *)Addr, ToString(AI->Type), (void *)AI->UserBegin, (void *)AI->UserEnd); - URLOG_CTX_ALWAYS("allocated here:"); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "allocated here:"); AI->AllocStack.print(); if (AI->IsReleased) { - URLOG_CTX_ALWAYS("freed here:"); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "freed here:"); AI->ReleaseStack.print(); } } @@ -41,12 +41,12 @@ void PrintAllocateInfo(uptr Addr, const AllocInfo *AI) { void ReportBadFree(uptr Addr, const StackTrace &stack, const std::shared_ptr &AI) { - URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: bad-free on address {}", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "\n====ERROR: DeviceSanitizer: bad-free on address {}", (void *)Addr); stack.print(); if (!AI) { - URLOG_CTX_ALWAYS("{} may be allocated on Host Memory", (void *)Addr); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "{} may be allocated on Host Memory", (void *)Addr); } else { assert(!AI->IsReleased && "Chunk must be not released"); PrintAllocateInfo(Addr, AI.get()); @@ -55,7 +55,7 @@ void ReportBadFree(uptr Addr, const StackTrace &stack, void ReportBadContext(uptr Addr, const StackTrace &stack, const std::shared_ptr &AI) { - URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: bad-context on address {}", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "\n====ERROR: DeviceSanitizer: bad-context on address {}", (void *)Addr); stack.print(); @@ -64,29 +64,29 @@ void ReportBadContext(uptr Addr, const StackTrace &stack, void ReportDoubleFree(uptr Addr, const StackTrace &Stack, const std::shared_ptr &AI) { - URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: double-free on address {}", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "\n====ERROR: DeviceSanitizer: double-free on address {}", (void *)Addr); Stack.print(); - URLOG_CTX_ALWAYS("{} is located inside of {} region [{}, {})", (void *)Addr, + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "{} is located inside of {} region [{}, {})", (void *)Addr, ToString(AI->Type), (void *)AI->UserBegin, (void *)AI->UserEnd); - URLOG_CTX_ALWAYS("freed here:"); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "freed here:"); AI->ReleaseStack.print(); - URLOG_CTX_ALWAYS("previously allocated here:"); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "previously allocated here:"); AI->AllocStack.print(); } void ReportMemoryLeak(const std::shared_ptr &AI) { - URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: detected memory leaks of {}", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "\n====ERROR: DeviceSanitizer: detected memory leaks of {}", ToString(AI->Type)); - URLOG_CTX_ALWAYS("Direct leak of {} byte(s) at {} allocated from:", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "Direct leak of {} byte(s) at {} allocated from:", AI->UserEnd - AI->UserBegin, (void *)AI->UserBegin); AI->AllocStack.print(); } void ReportFatalError(const AsanErrorReport &Report) { - URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: {}", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "\n====ERROR: DeviceSanitizer: {}", ToString(Report.ErrorTy)); } @@ -99,15 +99,15 @@ void ReportGenericError(const AsanErrorReport &Report, // Try to demangle the kernel name KernelName = DemangleName(KernelName); - URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: {} on {} ({})", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "\n====ERROR: DeviceSanitizer: {} on {} ({})", ToString(Report.ErrorTy), ToString(Report.MemoryTy), (void *)Report.Address); - URLOG_CTX_ALWAYS( + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "{} of size {} at kernel <{}> LID({}, {}, {}) GID({}, {}, {})", Report.IsWrite ? "WRITE" : "READ", Report.AccessSize, KernelName.c_str(), Report.LID0, Report.LID1, Report.LID2, Report.GID0, Report.GID1, Report.GID2); - URLOG_CTX_ALWAYS(" #0 {} {}:{}", Func, File, Report.Line); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, " #0 {} {}:{}", Func, File, Report.Line); } void ReportUseAfterFree(const AsanErrorReport &Report, @@ -120,27 +120,27 @@ void ReportUseAfterFree(const AsanErrorReport &Report, // Try to demangle the kernel name KernelName = DemangleName(KernelName); - URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: {} on address {}", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "\n====ERROR: DeviceSanitizer: {} on address {}", ToString(Report.ErrorTy), (void *)Report.Address); - URLOG_CTX_ALWAYS( + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "{} of size {} at kernel <{}> LID({}, {}, {}) GID({}, {}, {})", Report.IsWrite ? "WRITE" : "READ", Report.AccessSize, KernelName.c_str(), Report.LID0, Report.LID1, Report.LID2, Report.GID0, Report.GID1, Report.GID2); - URLOG_CTX_ALWAYS(" #0 {} {}:{}", Func, File, Report.Line); - URLOG_CTX_ALWAYS(""); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, " #0 {} {}:{}", Func, File, Report.Line); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, ""); if (getContext()->Options.MaxQuarantineSizeMB > 0) { auto AllocInfoItOp = getAsanInterceptor()->findAllocInfoByAddress(Report.Address); if (!AllocInfoItOp) { - URLOG_CTX_ALWAYS("Failed to find which chunck {} is allocated", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "Failed to find which chunck {} is allocated", (void *)Report.Address); } else { auto &AllocInfo = (*AllocInfoItOp)->second; if (AllocInfo->Context != Context) { - URLOG_CTX_ALWAYS("Failed to find which chunck {} is allocated", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "Failed to find which chunck {} is allocated", (void *)Report.Address); } assert(AllocInfo->IsReleased && @@ -149,7 +149,7 @@ void ReportUseAfterFree(const AsanErrorReport &Report, PrintAllocateInfo(Report.Address, AllocInfo.get()); } } else { - URLOG_CTX_ALWAYS( + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "Please enable quarantine to get more information like memory " "chunck's kind and where the chunck was allocated and released."); } @@ -158,7 +158,7 @@ void ReportUseAfterFree(const AsanErrorReport &Report, void ReportInvalidKernelArgument(ur_kernel_handle_t Kernel, uint32_t ArgIndex, uptr Addr, const ValidateUSMResult &VR, StackTrace Stack) { - URLOG_CTX_ALWAYS("\n====ERROR: DeviceSanitizer: " + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "\n====ERROR: DeviceSanitizer: " "invalid-argument on kernel <{}>", DemangleName(GetKernelName(Kernel))); Stack.print(); @@ -166,29 +166,29 @@ void ReportInvalidKernelArgument(ur_kernel_handle_t Kernel, uint32_t ArgIndex, ArgIndex = ArgIndex + 1; switch (VR.Type) { case ValidateUSMResult::MAYBE_HOST_POINTER: - URLOG_CTX_ALWAYS("The {}th argument {} is not a USM pointer", ArgIndex, + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "The {}th argument {} is not a USM pointer", ArgIndex, (void *)Addr); break; case ValidateUSMResult::RELEASED_POINTER: - URLOG_CTX_ALWAYS("The {}th argument {} is a released USM pointer", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "The {}th argument {} is a released USM pointer", ArgIndex + 1, (void *)Addr); PrintAllocateInfo(Addr, AI.get()); break; case ValidateUSMResult::BAD_CONTEXT: - URLOG_CTX_ALWAYS("The {}th argument {} is allocated in other context", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "The {}th argument {} is allocated in other context", ArgIndex + 1, (void *)Addr); PrintAllocateInfo(Addr, AI.get()); break; case ValidateUSMResult::BAD_DEVICE: - URLOG_CTX_ALWAYS("The {}th argument {} is allocated in other device", + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "The {}th argument {} is allocated in other device", ArgIndex + 1, (void *)Addr); PrintAllocateInfo(Addr, AI.get()); break; case ValidateUSMResult::OUT_OF_BOUNDS: - URLOG_CTX_ALWAYS( + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "The {}th argument {} is located outside of its region [{}, {})", ArgIndex + 1, (void *)Addr, (void *)AI->UserBegin, (void *)AI->UserEnd); - URLOG_CTX_ALWAYS("allocated here:"); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "allocated here:"); AI->AllocStack.print(); break; default: diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp index b156bb7025c0..68beac4b8d09 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp @@ -30,7 +30,7 @@ std::shared_ptr CreateShadowMemory(ur_context_handle_t Context, } else if (Type == DeviceType::GPU_DG2) { return std::make_shared(Context, Device); } else { - URLOG_CTX(ERR, "Unsupport device type"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Unsupport device type"); return nullptr; } } @@ -51,7 +51,7 @@ ur_result_t ShadowMemoryCPU::Setup() { auto URes = EnqueuePoisonShadow({}, 0, NullptrRedzoneSize, kNullPointerRedzoneMagic); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "EnqueuePoisonShadow(NullPointerRZ): {}", URes); + UR_LOG_LOGGER(getContext()->logger, ERR, "EnqueuePoisonShadow(NullPointerRZ): {}", URes); return URes; } return URes; @@ -85,7 +85,7 @@ ur_result_t ShadowMemoryCPU::EnqueuePoisonShadow(ur_queue_handle_t, uptr Ptr, uptr ShadowBegin = MemToShadow(Ptr); uptr ShadowEnd = MemToShadow(Ptr + Size - 1); assert(ShadowBegin <= ShadowEnd); - URLOG_CTX(DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={})", + UR_LOG_LOGGER(getContext()->logger, DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={})", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value); memset((void *)ShadowBegin, Value, ShadowEnd - ShadowBegin + 1); @@ -108,7 +108,7 @@ ur_result_t ShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Shadow memory reserved failed with size {}: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; } @@ -124,7 +124,7 @@ ur_result_t ShadowMemoryGPU::Setup() { Result = EnqueuePoisonShadow(Queue, 0, NullptrRedzoneSize, kNullPointerRedzoneMagic); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "EnqueuePoisonShadow(NullPointerRZ): {}", Result); + UR_LOG_LOGGER(getContext()->logger, ERR, "EnqueuePoisonShadow(NullPointerRZ): {}", Result); return Result; } return Result; @@ -194,7 +194,7 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, &Desc, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "urPhysicalMemCreate(): {}", URes); + UR_LOG_LOGGER(getContext()->logger, ERR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -202,18 +202,18 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, + UR_LOG_LOGGER(getContext()->logger, ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } - URLOG_CTX(DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); // Initialize to zero URes = EnqueueUSMBlockingSet(Queue, (void *)MappedPtr, 0, PageSize); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "EnqueueUSMBlockingSet(): {}", URes); + UR_LOG_LOGGER(getContext()->logger, ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } @@ -224,11 +224,11 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, auto URes = EnqueueUSMBlockingSet(Queue, (void *)ShadowBegin, Value, ShadowEnd - ShadowBegin + 1); - URLOG_CTX(DEBUG, "EnqueuePoisonShadow (addr={}, count={}, value={}): {}", + UR_LOG_LOGGER(getContext()->logger, DEBUG, "EnqueuePoisonShadow (addr={}, count={}, value={}): {}", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value, URes); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "EnqueueUSMBlockingSet(): {}", URes); + UR_LOG_LOGGER(getContext()->logger, ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp index 29b81e90894b..2789fdc1c525 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp @@ -46,14 +46,14 @@ struct AsanStats { }; void AsanStats::Print(ur_context_handle_t Context) { - URLOG_CTX_ALWAYS("Stats: Context {}", (void *)Context); - URLOG_CTX_ALWAYS("Stats: peak memory overhead: {}%", Overhead * 100); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "Stats: Context {}", (void *)Context); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "Stats: peak memory overhead: {}%", Overhead * 100); } void AsanStats::UpdateUSMMalloced(uptr MallocedSize, uptr RedzoneSize) { UsmMalloced += MallocedSize; UsmMallocedRedzones += RedzoneSize; - URLOG_CTX(DEBUG, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "Stats: UpdateUSMMalloced(UsmMalloced={}, UsmMallocedRedzones={})", UsmMalloced, UsmMallocedRedzones); UpdateOverhead(); @@ -61,7 +61,7 @@ void AsanStats::UpdateUSMMalloced(uptr MallocedSize, uptr RedzoneSize) { void AsanStats::UpdateUSMFreed(uptr FreedSize) { UsmFreed += FreedSize; - URLOG_CTX(DEBUG, "Stats: UpdateUSMFreed(UsmFreed={})", UsmFreed); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "Stats: UpdateUSMFreed(UsmFreed={})", UsmFreed); } void AsanStats::UpdateUSMRealFreed(uptr FreedSize, uptr RedzoneSize) { @@ -70,7 +70,7 @@ void AsanStats::UpdateUSMRealFreed(uptr FreedSize, uptr RedzoneSize) { if (getContext()->Options.MaxQuarantineSizeMB) { UsmFreed -= FreedSize; } - URLOG_CTX(DEBUG, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "Stats: UpdateUSMRealFreed(UsmMalloced={}, UsmMallocedRedzones={})", UsmMalloced, UsmMallocedRedzones); UpdateOverhead(); @@ -78,14 +78,14 @@ void AsanStats::UpdateUSMRealFreed(uptr FreedSize, uptr RedzoneSize) { void AsanStats::UpdateShadowMalloced(uptr ShadowSize) { ShadowMalloced += ShadowSize; - URLOG_CTX(DEBUG, "Stats: UpdateShadowMalloced(ShadowMalloced={})", + UR_LOG_LOGGER(getContext()->logger, DEBUG, "Stats: UpdateShadowMalloced(ShadowMalloced={})", ShadowMalloced); UpdateOverhead(); } void AsanStats::UpdateShadowFreed(uptr ShadowSize) { ShadowMalloced -= ShadowSize; - URLOG_CTX(DEBUG, "Stats: UpdateShadowFreed(ShadowMalloced={})", + UR_LOG_LOGGER(getContext()->logger, DEBUG, "Stats: UpdateShadowFreed(ShadowMalloced={})", ShadowMalloced); UpdateOverhead(); } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp index 1976eac9ef0e..93b999a057da 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp @@ -18,7 +18,7 @@ namespace ur_sanitizer_layer { namespace msan { void MsanAllocInfo::print() { - URLOG_CTX(INFO, "AllocInfo(Alloc=[{}-{}), AllocSize={})", (void *)AllocBegin, + UR_LOG_LOGGER(getContext()->logger, INFO, "AllocInfo(Alloc=[{}-{}), AllocSize={})", (void *)AllocBegin, (void *)(AllocBegin + AllocSize), AllocSize); } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp index 6cdf5349edd0..0d9a54086bf7 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp @@ -137,7 +137,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::DEVICE_USM, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to allocate {} bytes memory for buffer {}", Size, + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -147,7 +147,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX( + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to copy {} bytes data from host pointer {} to buffer {}", Size, HostPtr, this); @@ -180,7 +180,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.USM.pfnHostAlloc( Context, &USMDesc, Pool, Size, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to allocate {} bytes host " "USM for buffer {} migration", Size, this); @@ -195,7 +195,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to migrate memory buffer data"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } } @@ -206,7 +206,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to migrate memory buffer data"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } } @@ -221,7 +221,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getContext()->urDdiTable.USM.pfnFree(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to free buffer handle {}", Ptr); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to free buffer handle {}", Ptr); return URes; } } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp index f825ec1f98e5..26315273c275 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp @@ -33,13 +33,13 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getMsanInterceptor()->insertDevice(hDevice, DI)); DI->Type = GetDeviceType(Context, hDevice); if (DI->Type == DeviceType::UNKNOWN) { - URLOG_CTX(ERR, "Unsupport device"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } - URLOG_CTX(INFO, "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", + UR_LOG_LOGGER(getContext()->logger, INFO, "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", (void *)DI->Handle, ToString(DI->Type), DI->IsSupportSharedSystemUSM); - URLOG_CTX(INFO, "Add {} into context {}", (void *)DI->Handle, + UR_LOG_LOGGER(getContext()->logger, INFO, "Add {} into context {}", (void *)DI->Handle, (void *)Context); if (!DI->Shadow) { UR_CALL(DI->allocShadowMemory(Context)); @@ -98,7 +98,7 @@ ur_result_t urUSMDeviceAlloc( size_t size, /// [out] pointer to USM device memory object void **ppMem) { - URLOG_CTX(DEBUG, "==== urUSMDeviceAlloc"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urUSMDeviceAlloc"); return getMsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -116,7 +116,7 @@ ur_result_t UR_APICALL urUSMHostAlloc( size, ///< [in] size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM host memory object ) { - URLOG_CTX(DEBUG, "==== urUSMHostAlloc"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urUSMHostAlloc"); return getMsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -135,7 +135,7 @@ ur_result_t UR_APICALL urUSMSharedAlloc( size, ///< [in] size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM shared memory object ) { - URLOG_CTX(DEBUG, "==== urUSMSharedAlloc"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urUSMSharedAlloc"); return getMsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -148,7 +148,7 @@ ur_result_t UR_APICALL urUSMFree( ur_context_handle_t hContext, /// [in] pointer to USM memory object void *pMem) { - URLOG_CTX(DEBUG, "==== urUSMFree"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urUSMFree"); return getMsanInterceptor()->releaseMemory(hContext, pMem); } @@ -169,7 +169,7 @@ ur_result_t urProgramCreateWithIL( auto pfnProgramCreateWithIL = getContext()->urDdiTable.Program.pfnCreateWithIL; - URLOG_CTX(DEBUG, "==== urProgramCreateWithIL"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramCreateWithIL"); UR_CALL( pfnProgramCreateWithIL(hContext, pIL, length, pProperties, phProgram)); @@ -201,7 +201,7 @@ ur_result_t urProgramCreateWithBinary( auto pfnProgramCreateWithBinary = getContext()->urDdiTable.Program.pfnCreateWithBinary; - URLOG_CTX(DEBUG, "==== urProgramCreateWithBinary"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramCreateWithBinary"); UR_CALL(pfnProgramCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, pProperties, phProgram)); @@ -224,7 +224,7 @@ ur_result_t urProgramCreateWithNativeHandle( auto pfnProgramCreateWithNativeHandle = getContext()->urDdiTable.Program.pfnCreateWithNativeHandle; - URLOG_CTX(DEBUG, "==== urProgramCreateWithNativeHandle"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramCreateWithNativeHandle"); UR_CALL(pfnProgramCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram)); @@ -241,7 +241,7 @@ urProgramRetain(ur_program_handle_t hProgram) { auto pfnRetain = getContext()->urDdiTable.Program.pfnRetain; - URLOG_CTX(DEBUG, "==== urProgramRetain"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramRetain"); UR_CALL(pfnRetain(hProgram)); @@ -263,7 +263,7 @@ ur_result_t urProgramBuild( const char *pOptions) { auto pfnProgramBuild = getContext()->urDdiTable.Program.pfnBuild; - URLOG_CTX(DEBUG, "==== urProgramBuild"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramBuild"); auto UrRes = pfnProgramBuild(hContext, hProgram, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -290,7 +290,7 @@ ur_result_t urProgramBuildExp( const char *pOptions) { auto pfnBuildExp = getContext()->urDdiTable.ProgramExp.pfnBuildExp; - URLOG_CTX(DEBUG, "==== urProgramBuildExp"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramBuildExp"); auto UrRes = pfnBuildExp(hProgram, numDevices, phDevices, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -318,7 +318,7 @@ ur_result_t urProgramLink( ur_program_handle_t *phProgram) { auto pfnProgramLink = getContext()->urDdiTable.Program.pfnLink; - URLOG_CTX(DEBUG, "==== urProgramLink"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramLink"); auto UrRes = pfnProgramLink(hContext, count, phPrograms, pOptions, phProgram); if (UrRes != UR_RESULT_SUCCESS) { @@ -352,7 +352,7 @@ ur_result_t urProgramLinkExp( ur_program_handle_t *phProgram) { auto pfnProgramLinkExp = getContext()->urDdiTable.ProgramExp.pfnLinkExp; - URLOG_CTX(DEBUG, "==== urProgramLinkExp"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramLinkExp"); auto UrRes = pfnProgramLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram); @@ -374,7 +374,7 @@ ur_result_t urProgramRelease( ur_program_handle_t hProgram) { auto pfnProgramRelease = getContext()->urDdiTable.Program.pfnRelease; - URLOG_CTX(DEBUG, "==== urProgramRelease"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramRelease"); UR_CALL(pfnProgramRelease(hProgram)); @@ -422,7 +422,7 @@ ur_result_t urEnqueueKernelLaunch( ur_event_handle_t *phEvent) { auto pfnKernelLaunch = getContext()->urDdiTable.Enqueue.pfnKernelLaunch; - URLOG_CTX(DEBUG, "==== urEnqueueKernelLaunch"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueKernelLaunch"); USMLaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue), pGlobalWorkSize, pLocalWorkSize, pGlobalWorkOffset, @@ -462,7 +462,7 @@ ur_result_t urContextCreate( ur_context_handle_t *phContext) { auto pfnCreate = getContext()->urDdiTable.Context.pfnCreate; - URLOG_CTX(DEBUG, "==== urContextCreate"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextCreate"); ur_result_t result = pfnCreate(numDevices, phDevices, pProperties, phContext); @@ -490,7 +490,7 @@ ur_result_t urContextCreateWithNativeHandle( auto pfnCreateWithNativeHandle = getContext()->urDdiTable.Context.pfnCreateWithNativeHandle; - URLOG_CTX(DEBUG, "==== urContextCreateWithNativeHandle"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextCreateWithNativeHandle"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -510,7 +510,7 @@ ur_result_t urContextRetain( ur_context_handle_t hContext) { auto pfnRetain = getContext()->urDdiTable.Context.pfnRetain; - URLOG_CTX(DEBUG, "==== urContextRetain"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextRetain"); UR_CALL(pfnRetain(hContext)); @@ -528,7 +528,7 @@ ur_result_t urContextRelease( ur_context_handle_t hContext) { auto pfnRelease = getContext()->urDdiTable.Context.pfnRelease; - URLOG_CTX(DEBUG, "==== urContextRelease"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextRelease"); UR_CALL(pfnRelease(hContext)); @@ -558,7 +558,7 @@ ur_result_t urMemBufferCreate( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - URLOG_CTX(DEBUG, "==== urMemBufferCreate"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemBufferCreate"); void *Host = nullptr; if (pProperties) { @@ -614,7 +614,7 @@ ur_result_t urMemGetInfo( size_t *pPropSizeRet) { auto pfnGetInfo = getContext()->urDdiTable.Mem.pfnGetInfo; - URLOG_CTX(DEBUG, "==== urMemGetInfo"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemGetInfo"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMemory)) { UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); @@ -643,7 +643,7 @@ ur_result_t urMemRetain( ur_mem_handle_t hMem) { auto pfnRetain = getContext()->urDdiTable.Mem.pfnRetain; - URLOG_CTX(DEBUG, "==== urMemRetain"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemRetain"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { MemBuffer->RefCount++; @@ -661,7 +661,7 @@ ur_result_t urMemRelease( ur_mem_handle_t hMem) { auto pfnRelease = getContext()->urDdiTable.Mem.pfnRelease; - URLOG_CTX(DEBUG, "==== urMemRelease"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemRelease"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { if (--MemBuffer->RefCount != 0) { @@ -692,7 +692,7 @@ ur_result_t urMemBufferPartition( ur_mem_handle_t *phMem) { auto pfnBufferPartition = getContext()->urDdiTable.Mem.pfnBufferPartition; - URLOG_CTX(DEBUG, "==== urMemBufferPartition"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemBufferPartition"); if (auto ParentBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { @@ -719,7 +719,7 @@ ur_result_t urMemGetNativeHandle( ur_native_handle_t *phNativeMem) { auto pfnGetNativeHandle = getContext()->urDdiTable.Mem.pfnGetNativeHandle; - URLOG_CTX(DEBUG, "==== urMemGetNativeHandle"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemGetNativeHandle"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { char *Handle = nullptr; @@ -759,7 +759,7 @@ ur_result_t urEnqueueMemBufferRead( ur_event_handle_t *phEvent) { auto pfnMemBufferRead = getContext()->urDdiTable.Enqueue.pfnMemBufferRead; - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferRead"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferRead"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -803,7 +803,7 @@ ur_result_t urEnqueueMemBufferWrite( ur_event_handle_t *phEvent) { auto pfnMemBufferWrite = getContext()->urDdiTable.Enqueue.pfnMemBufferWrite; - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWrite"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWrite"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -880,7 +880,7 @@ ur_result_t urEnqueueMemBufferReadRect( auto pfnMemBufferReadRect = getContext()->urDdiTable.Enqueue.pfnMemBufferReadRect; - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferReadRect"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferReadRect"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *SrcHandle = nullptr; @@ -941,7 +941,7 @@ ur_result_t urEnqueueMemBufferWriteRect( auto pfnMemBufferWriteRect = getContext()->urDdiTable.Enqueue.pfnMemBufferWriteRect; - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWriteRect"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWriteRect"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *DstHandle = nullptr; @@ -989,7 +989,7 @@ ur_result_t urEnqueueMemBufferCopy( ur_event_handle_t *phEvent) { auto pfnMemBufferCopy = getContext()->urDdiTable.Enqueue.pfnMemBufferCopy; - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopy"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopy"); auto SrcBuffer = getMsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getMsanInterceptor()->getMemBuffer(hBufferDst); @@ -1074,7 +1074,7 @@ ur_result_t urEnqueueMemBufferCopyRect( auto pfnMemBufferCopyRect = getContext()->urDdiTable.Enqueue.pfnMemBufferCopyRect; - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopyRect"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopyRect"); auto SrcBuffer = getMsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getMsanInterceptor()->getMemBuffer(hBufferDst); @@ -1131,7 +1131,7 @@ ur_result_t urEnqueueMemBufferFill( ur_event_handle_t *phEvent) { auto pfnMemBufferFill = getContext()->urDdiTable.Enqueue.pfnMemBufferFill; - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferFill"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferFill"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *Handle = nullptr; @@ -1198,7 +1198,7 @@ ur_result_t urEnqueueMemBufferMap( void **ppRetMap) { auto pfnMemBufferMap = getContext()->urDdiTable.Enqueue.pfnMemBufferMap; - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferMap"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferMap"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { @@ -1280,7 +1280,7 @@ ur_result_t urEnqueueMemUnmap( ur_event_handle_t *phEvent) { auto pfnMemUnmap = getContext()->urDdiTable.Enqueue.pfnMemUnmap; - URLOG_CTX(DEBUG, "==== urEnqueueMemUnmap"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemUnmap"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { MemBuffer::Mapping Mapping{}; @@ -1321,7 +1321,7 @@ ur_result_t urKernelRetain( ur_kernel_handle_t hKernel) { auto pfnRetain = getContext()->urDdiTable.Kernel.pfnRetain; - URLOG_CTX(DEBUG, "==== urKernelRetain"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelRetain"); UR_CALL(pfnRetain(hKernel)); @@ -1338,7 +1338,7 @@ ur_result_t urKernelRelease( ur_kernel_handle_t hKernel) { auto pfnRelease = getContext()->urDdiTable.Kernel.pfnRelease; - URLOG_CTX(DEBUG, "==== urKernelRelease"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelRelease"); auto &KernelInfo = getMsanInterceptor()->getOrCreateKernelInfo(hKernel); if (--KernelInfo.RefCount == 0) { @@ -1364,7 +1364,7 @@ ur_result_t urKernelSetArgValue( const void *pArgValue) { auto pfnSetArgValue = getContext()->urDdiTable.Kernel.pfnSetArgValue; - URLOG_CTX(DEBUG, "==== urKernelSetArgValue"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelSetArgValue"); std::shared_ptr MemBuffer; if (argSize == sizeof(ur_mem_handle_t) && @@ -1393,7 +1393,7 @@ ur_result_t urKernelSetArgMemObj( ur_mem_handle_t hArgValue) { auto pfnSetArgMemObj = getContext()->urDdiTable.Kernel.pfnSetArgMemObj; - URLOG_CTX(DEBUG, "==== urKernelSetArgMemObj"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelSetArgMemObj"); std::shared_ptr MemBuffer; std::shared_ptr KernelInfo; @@ -1421,7 +1421,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( const ur_kernel_arg_local_properties_t *pProperties) { auto pfnSetArgLocal = getContext()->urDdiTable.Kernel.pfnSetArgLocal; - URLOG_CTX(DEBUG, "==== urKernelSetArgLocal (argIndex={}, argSize={})", + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelSetArgLocal (argIndex={}, argSize={})", argIndex, argSize); { @@ -1459,7 +1459,7 @@ ur_result_t UR_APICALL urEnqueueUSMFill( /// must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMFill = getContext()->urDdiTable.Enqueue.pfnUSMFill; - URLOG_CTX(DEBUG, "==== urEnqueueUSMFill"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueUSMFill"); std::vector Events; ur_event_handle_t Event{}; @@ -1515,7 +1515,7 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy( /// must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMMemcpy = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy; - URLOG_CTX(DEBUG, "==== urEnqueueUSMMemcpy"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueUSMMemcpy"); std::vector Events; ur_event_handle_t Event{}; @@ -1592,7 +1592,7 @@ ur_result_t UR_APICALL urEnqueueUSMFill2D( /// phEvent must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMFill2D = getContext()->urDdiTable.Enqueue.pfnUSMFill2D; - URLOG_CTX(DEBUG, "==== urEnqueueUSMFill2D"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueUSMFill2D"); std::vector Events; ur_event_handle_t Event{}; @@ -1656,7 +1656,7 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( /// phEvent must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMMemcpy2D = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy2D; - URLOG_CTX(DEBUG, "==== urEnqueueUSMMemcpy2D"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueUSMMemcpy2D"); std::vector Events; ur_event_handle_t Event{}; @@ -1896,7 +1896,7 @@ ur_result_t urCheckVersion(ur_api_version_t version) { ur_result_t initMsanDDITable(ur_dditable_t *dditable) { ur_result_t result = UR_RESULT_SUCCESS; - URLOG_CTX_ALWAYS("==== DeviceSanitizer: MSAN"); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "==== DeviceSanitizer: MSAN"); if (UR_RESULT_SUCCESS == result) { result = ur_sanitizer_layer::msan::urCheckVersion(UR_API_VERSION_CURRENT); @@ -1946,7 +1946,7 @@ ur_result_t initMsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Initialize MSAN DDI table failed: {}", result); + UR_LOG_LOGGER(getContext()->logger, ERR, "Initialize MSAN DDI table failed: {}", result); } return result; diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp index 9da7a0394ede..fe8e65d92e8d 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp @@ -123,7 +123,7 @@ ur_result_t MsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(Context, Device); if (!InternalQueue) { - URLOG_CTX(ERR, "Failed to create internal queue"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -157,13 +157,13 @@ ur_result_t MsanInterceptor::postLaunchKernel(ur_kernel_handle_t Kernel, ur_result_t MsanInterceptor::registerProgram(ur_program_handle_t Program) { ur_result_t Result = UR_RESULT_SUCCESS; - URLOG_CTX(INFO, "registerSpirKernels"); + UR_LOG_LOGGER(getContext()->logger, INFO, "registerSpirKernels"); Result = registerSpirKernels(Program); if (Result != UR_RESULT_SUCCESS) { return Result; } - URLOG_CTX(INFO, "registerDeviceGlobals"); + UR_LOG_LOGGER(getContext()->logger, INFO, "registerDeviceGlobals"); Result = registerDeviceGlobals(Program); if (Result != UR_RESULT_SUCCESS) { return Result; @@ -202,7 +202,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, &SKInfo[0], MetadataPtr, sizeof(SpirKernelInfo) * NumOfSpirKernel, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Can't read the value of <{}>: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Can't read the value of <{}>: {}", kSPIR_MsanSpirKernelMetadata, Result); return Result; } @@ -217,14 +217,14 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, KernelNameV.data(), (void *)SKI.KernelName, sizeof(char) * SKI.Size, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Can't read kernel name: {}", Result); + UR_LOG_LOGGER(getContext()->logger, ERR, "Can't read kernel name: {}", Result); return Result; } std::string KernelName = std::string(KernelNameV.begin(), KernelNameV.end()); - URLOG_CTX(INFO, + UR_LOG_LOGGER(getContext()->logger, INFO, "SpirKernel(name='{}', isInstrumented={}, " "checkLocals={}, checkPrivates={})", KernelName, true, (bool)SKI.CheckLocals, @@ -233,7 +233,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { PI->KernelMetadataMap[KernelName] = ProgramInfo::KernelMetada{ (bool)SKI.CheckLocals, (bool)SKI.CheckPrivates}; } - URLOG_CTX(INFO, "Number of sanitized kernel: {}", + UR_LOG_LOGGER(getContext()->logger, INFO, "Number of sanitized kernel: {}", PI->KernelMetadataMap.size()); } @@ -258,7 +258,7 @@ MsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Device, Program, kSPIR_MsanDeviceGlobalMetadata, &MetadataSize, &MetadataPtr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(INFO, "No device globals"); + UR_LOG_LOGGER(getContext()->logger, INFO, "No device globals"); continue; } @@ -270,7 +270,7 @@ MsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Device Global[{}] Read Failed: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Device Global[{}] Read Failed: {}", kSPIR_MsanDeviceGlobalMetadata, Result); return Result; } @@ -437,7 +437,7 @@ ur_result_t MsanInterceptor::prepareLaunch( auto Result = getContext()->urDdiTable.Enqueue.pfnDeviceGlobalVariableWrite( Queue, Program, Name, false, Size, 0, Value, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to write device global \"{}\": {}", Name, Result); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to write device global \"{}\": {}", Name, Result); return Result; } return UR_RESULT_SUCCESS; @@ -445,7 +445,7 @@ ur_result_t MsanInterceptor::prepareLaunch( // Set membuffer arguments auto &KernelInfo = getOrCreateKernelInfo(Kernel); - URLOG_CTX(INFO, + UR_LOG_LOGGER(getContext()->logger, INFO, "KernelInfo {} (Name=<{}>, IsInstrumented={}, " "IsCheckLocals={}, IsCheckPrivates={})", (void *)Kernel, GetKernelName(Kernel), KernelInfo.IsInstrumented, @@ -459,7 +459,7 @@ ur_result_t MsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to set buffer {} as the {} arg to kernel {}: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); } @@ -509,14 +509,14 @@ ur_result_t MsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocLocalShadow( Queue, NumWG, LaunchInfo.Data->LocalShadowOffset, LaunchInfo.Data->LocalShadowOffsetEnd) != UR_RESULT_SUCCESS) { - URLOG_CTX(WARN, + UR_LOG_LOGGER(getContext()->logger, WARN, "Failed to allocate shadow memory for local memory, " "maybe the number of workgroup ({}) is too large", NumWG); - URLOG_CTX(WARN, "Skip checking local memory of kernel <{}> ", + UR_LOG_LOGGER(getContext()->logger, WARN, "Skip checking local memory of kernel <{}> ", GetKernelName(Kernel)); } else { - URLOG_CTX(DEBUG, "ShadowMemory(Local, WorkGroup={}, {} - {})", NumWG, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "ShadowMemory(Local, WorkGroup={}, {} - {})", NumWG, (void *)LaunchInfo.Data->LocalShadowOffset, (void *)LaunchInfo.Data->LocalShadowOffsetEnd); } @@ -527,14 +527,14 @@ ur_result_t MsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocPrivateShadow( Queue, NumWG, LaunchInfo.Data->PrivateShadowOffset, LaunchInfo.Data->PrivateShadowOffsetEnd) != UR_RESULT_SUCCESS) { - URLOG_CTX(WARN, + UR_LOG_LOGGER(getContext()->logger, WARN, "Failed to allocate shadow memory for private memory, " "maybe the number of workgroup ({}) is too large", NumWG); - URLOG_CTX(WARN, "Skip checking private memory of kernel <{}>", + UR_LOG_LOGGER(getContext()->logger, WARN, "Skip checking private memory of kernel <{}>", GetKernelName(Kernel)); } else { - URLOG_CTX(DEBUG, "ShadowMemory(Private, WorkGroup={}, {} - {})", NumWG, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "ShadowMemory(Private, WorkGroup={}, {} - {})", NumWG, (void *)LaunchInfo.Data->PrivateShadowOffset, (void *)LaunchInfo.Data->PrivateShadowOffsetEnd); } @@ -543,14 +543,14 @@ ur_result_t MsanInterceptor::prepareLaunch( std::vector LocalArgsInfo; for (auto [ArgIndex, ArgInfo] : KernelInfo.LocalArgs) { LocalArgsInfo.push_back(ArgInfo); - URLOG_CTX(DEBUG, "LocalArgs (argIndex={}, size={})", ArgIndex, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "LocalArgs (argIndex={}, size={})", ArgIndex, ArgInfo.Size); } UR_CALL(LaunchInfo.importLocalArgsInfo(Queue, LocalArgsInfo)); } } - URLOG_CTX( + UR_LOG_LOGGER(getContext()->logger, INFO, "LaunchInfo {} (GlobalShadow={}, LocalShadow={}, PrivateShadow={}, " "CleanShadow={}, LocalArgs={}, NumLocalArgs={}, Device={}, Debug={})", @@ -564,7 +564,7 @@ ur_result_t MsanInterceptor::prepareLaunch( ur_result_t URes = EnqueueWriteGlobal("__MsanLaunchInfo", &LaunchInfo.Data, sizeof(uptr)); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(INFO, + UR_LOG_LOGGER(getContext()->logger, INFO, "EnqueueWriteGlobal(__MsanLaunchInfo) " "failed, maybe empty kernel: {}", URes); @@ -609,7 +609,7 @@ ur_result_t DeviceInfo::allocShadowMemory(ur_context_handle_t Context) { Shadow = GetMsanShadowMemory(Context, Handle, Type); assert(Shadow && "Failed to get shadow memory"); UR_CALL(Shadow->Setup()); - URLOG_CTX(INFO, "ShadowMemory(Global): {} - {}", (void *)Shadow->ShadowBegin, + UR_LOG_LOGGER(getContext()->logger, INFO, "ShadowMemory(Global): {} - {}", (void *)Shadow->ShadowBegin, (void *)Shadow->ShadowEnd); return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_report.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_report.cpp index 254f61ede161..abb15e76c31f 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_report.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_report.cpp @@ -31,20 +31,20 @@ void ReportUsesUninitializedValue(const MsanErrorReport &Report, KernelName = DemangleName(KernelName); if (Report.Origin) { - URLOG_CTX_ALWAYS( + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "====WARNING: DeviceSanitizer: use-of-uninitialized-value (shadow: {})", (void *)Report.Origin); } else { - URLOG_CTX_ALWAYS( + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "====WARNING: DeviceSanitizer: use-of-uninitialized-value"); } - URLOG_CTX_ALWAYS("use of size {} at kernel <{}> LID({}, {}, {}) GID({}, " + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "use of size {} at kernel <{}> LID({}, {}, {}) GID({}, " "{}, {})", Report.AccessSize, KernelName.c_str(), Report.LID0, Report.LID1, Report.LID2, Report.GID0, Report.GID1, Report.GID2); - URLOG_CTX_ALWAYS(" #0 {} {}:{}", Func, File, Report.Line); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, " #0 {} {}:{}", Func, File, Report.Line); } } // namespace msan diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp index 1beda4ecf489..d43907951249 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp @@ -45,7 +45,7 @@ GetMsanShadowMemory(ur_context_handle_t Context, ur_device_handle_t Device, std::make_shared(Context, Device); return ShadowDG2; } else { - URLOG_CTX(ERR, "Unsupport device type"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Unsupport device type"); return nullptr; } } @@ -118,7 +118,7 @@ ur_result_t MsanShadowMemoryCPU::EnqueuePoisonShadow( const uptr ShadowBegin = MemToShadow(Ptr); const uptr ShadowEnd = MemToShadow(Ptr + Size - 1); assert(ShadowBegin <= ShadowEnd); - URLOG_CTX(DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={})", + UR_LOG_LOGGER(getContext()->logger, DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={})", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value); memset((void *)ShadowBegin, Value, ShadowEnd - ShadowBegin + 1); @@ -146,7 +146,7 @@ ur_result_t MsanShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Shadow memory reserved failed with size {}: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; } @@ -191,7 +191,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, nullptr, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "urPhysicalMemCreate(): {}", URes); + UR_LOG_LOGGER(getContext()->logger, ERR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -199,12 +199,12 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, + UR_LOG_LOGGER(getContext()->logger, ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } - URLOG_CTX(DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); // Initialize to zero @@ -212,7 +212,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( EventWaitList.size(), EventWaitList.data(), OutEvent); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "EnqueueUSMSet(): {}", URes); + UR_LOG_LOGGER(getContext()->logger, ERR, "EnqueueUSMSet(): {}", URes); return URes; } @@ -256,7 +256,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueuePoisonShadow( ShadowEnd - ShadowBegin + 1, Events.size(), Events.data(), OutEvent); - URLOG_CTX(DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={}): {}", + UR_LOG_LOGGER(getContext()->logger, DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={}): {}", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value, Result); @@ -283,7 +283,7 @@ MsanShadowMemoryGPU::ReleaseShadow(std::shared_ptr AI) { Context, (void *)MappedPtr, PageSize)); UR_CALL(getContext()->urDdiTable.PhysicalMem.pfnRelease( VirtualMemMaps[MappedPtr].first)); - URLOG_CTX(DEBUG, "urVirtualMemUnmap: {} ~ {}", (void *)MappedPtr, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "urVirtualMemUnmap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); } } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp index 6013b7ae4f70..152721c2bc1f 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp @@ -67,12 +67,12 @@ bool DontCoredumpRange(uptr Addr, uptr Size) { void *GetMemFunctionPointer(const char *FuncName) { void *handle = dlopen(LIBC_SO, RTLD_LAZY | RTLD_NOLOAD); if (!handle) { - URLOG_CTX(ERR, "Failed to dlopen {}", LIBC_SO); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to dlopen {}", LIBC_SO); return nullptr; } auto ptr = dlsym(handle, FuncName); if (!ptr) { - URLOG_CTX(ERR, "Failed to get '{}' from {}", FuncName, LIBC_SO); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to get '{}' from {}", FuncName, LIBC_SO); } return ptr; } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp index 74b219ee31b4..e95ef73efb67 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp @@ -72,7 +72,7 @@ struct OptionParser { SS << " \"" << S << "\""; } SS << "."; - URLOG_(Logger, ERR, SS.str().c_str()); + UR_LOG_LOGGER(Logger, ERR, SS.str().c_str()); die("Sanitizer failed to parse options.\n"); } } @@ -93,13 +93,13 @@ struct OptionParser { uint64_t Value = std::stoul(ValueStr.c_str()); if (Value < Min) { - URLOG_(Logger, WARN, + UR_LOG_LOGGER(Logger, WARN, "The valid range of \"{}\" is [{}, {}]. " "Setting to the minimum value {}.", Name, Min, Max, Min); Result = Min; } else if (Value > Max) { - URLOG_(Logger, WARN, + UR_LOG_LOGGER(Logger, WARN, "The valid range of \"{}\" is [{}, {}]. " "Setting to the maximum value {}.", Name, Min, Max, Max); @@ -108,7 +108,7 @@ struct OptionParser { Result = Value; } } catch (...) { - URLOG_(Logger, ERR, + UR_LOG_LOGGER(Logger, ERR, "The valid range of \"{}\" is [{}, {}]. Failed " "to parse the value \"{}\".", Name, Min, Max, ValueStr); diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_stacktrace.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_stacktrace.cpp index cd2bf0b7b626..5317d85b5a49 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_stacktrace.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_stacktrace.cpp @@ -82,7 +82,7 @@ SourceInfo ParseSymbolizerOutput(const std::string &Output) { void StackTrace::print() const { if (!stack.size()) { - URLOG_CTX_ALWAYS(" failed to acquire backtrace"); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, " failed to acquire backtrace"); } unsigned index = 0; @@ -113,19 +113,19 @@ void StackTrace::print() const { std::string Result((char *)ResultVector.data()); SourceInfo SrcInfo = ParseSymbolizerOutput(Result); if (SrcInfo.file != "??") { - URLOG_CTX_ALWAYS(" #{} in {} {}:{}:{}", index, SrcInfo.function, + UR_LOG_LOGGER(getContext()->logger, ALWAYS, " #{} in {} {}:{}:{}", index, SrcInfo.function, SrcInfo.file, SrcInfo.line, SrcInfo.column); } else { - URLOG_CTX_ALWAYS(" #{} in {} ({}+{})", index, SrcInfo.function, + UR_LOG_LOGGER(getContext()->logger, ALWAYS, " #{} in {} ({}+{})", index, SrcInfo.function, ModuleName, (void *)Offset); } } } else { - URLOG_CTX_ALWAYS(" #{} {}", index, BI); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, " #{} {}", index, BI); } ++index; } - URLOG_CTX_ALWAYS(""); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, ""); free(BacktraceSymbols); } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp index 6fcbdcc2718d..7e4e89a326e3 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp @@ -22,16 +22,16 @@ ManagedQueue::ManagedQueue(ur_context_handle_t Context, [[maybe_unused]] auto Result = getContext()->urDdiTable.Queue.pfnCreate( Context, Device, nullptr, &Handle); assert(Result == UR_RESULT_SUCCESS && "Failed to create ManagedQueue"); - URLOG_CTX(DEBUG, ">>> ManagedQueue {}", (void *)Handle); + UR_LOG_LOGGER(getContext()->logger, DEBUG, ">>> ManagedQueue {}", (void *)Handle); } ManagedQueue::~ManagedQueue() { - URLOG_CTX(DEBUG, "<<< ~ManagedQueue {}", (void *)Handle); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "<<< ~ManagedQueue {}", (void *)Handle); [[maybe_unused]] ur_result_t Result; Result = getContext()->urDdiTable.Queue.pfnFinish(Handle); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to finish ManagedQueue: {}", Result); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to finish ManagedQueue: {}", Result); } assert(Result == UR_RESULT_SUCCESS && "Failed to finish ManagedQueue"); Result = getContext()->urDdiTable.Queue.pfnRelease(Handle); @@ -149,7 +149,7 @@ DeviceType GetDeviceType(ur_context_handle_t Context, [[maybe_unused]] ur_result_t Result = getContext()->urDdiTable.USM.pfnDeviceAlloc(Context, Device, nullptr, nullptr, 4, (void **)&Ptr); - URLOG_CTX(DEBUG, "GetDeviceType: {}", (void *)Ptr); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "GetDeviceType: {}", (void *)Ptr); assert(Result == UR_RESULT_SUCCESS && "getDeviceType() failed at allocating device USM"); // FIXME: There's no API querying the address bits of device, so we guess it @@ -258,7 +258,7 @@ ur_result_t EnqueueUSMBlockingSet(ur_queue_handle_t Queue, void *Ptr, void PrintUrBuildLog(ur_program_handle_t hProgram, ur_device_handle_t *phDevices, size_t numDevices) { - URLOG_CTX(ERR, "Printing build log for program {}", (void *)hProgram); + UR_LOG_LOGGER(getContext()->logger, ERR, "Printing build log for program {}", (void *)hProgram); for (size_t i = 0; i < numDevices; i++) { std::vector LogBuf; size_t LogSize = 0; @@ -267,7 +267,7 @@ void PrintUrBuildLog(ur_program_handle_t hProgram, auto UrRes = getContext()->urDdiTable.Program.pfnGetBuildInfo( hProgram, hDevice, UR_PROGRAM_BUILD_INFO_LOG, 0, nullptr, &LogSize); if (UrRes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "For device {}: failed to get build log size.", + UR_LOG_LOGGER(getContext()->logger, ERR, "For device {}: failed to get build log size.", (void *)hDevice); continue; } @@ -277,12 +277,12 @@ void PrintUrBuildLog(ur_program_handle_t hProgram, hProgram, hDevice, UR_PROGRAM_BUILD_INFO_LOG, LogSize, LogBuf.data(), nullptr); if (UrRes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "For device {}: failed to get build log.", + UR_LOG_LOGGER(getContext()->logger, ERR, "For device {}: failed to get build log.", (void *)hDevice); continue; } - URLOG_CTX(ERR, "For device {}:\n{}", (void *)hDevice, LogBuf.data()); + UR_LOG_LOGGER(getContext()->logger, ERR, "For device {}:\n{}", (void *)hDevice, LogBuf.data()); } } diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp index 5dd390d2f0b4..69fd24fcf779 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp @@ -105,7 +105,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::DEVICE_USM, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to allocate {} bytes memory for buffer {}", Size, + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -115,7 +115,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to copy {} bytes data from host " "pointer {} to buffer {}", Size, HostPtr, this); @@ -142,7 +142,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.USM.pfnHostAlloc( Context, &USMDesc, Pool, Size, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to allocate {} bytes host " "USM for buffer {} migration", Size, this); @@ -157,7 +157,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to migrate memory buffer data"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } } @@ -168,7 +168,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to migrate memory buffer data"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } } @@ -183,7 +183,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getContext()->urDdiTable.USM.pfnFree(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to free buffer handle {}", Ptr); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to free buffer handle {}", Ptr); return URes; } } diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp index 58ae40fc55d6..885773bc3ff3 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp @@ -31,7 +31,7 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getTsanInterceptor()->insertDevice(phDevices[i], DI)); DI->Type = GetDeviceType(Context, DI->Handle); if (DI->Type == DeviceType::UNKNOWN) { - URLOG_CTX(ERR, "Unsupport device"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } if (!DI->Shadow) @@ -54,7 +54,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( const ur_context_properties_t *pProperties, /// [out] pointer to handle of context object created ur_context_handle_t *phContext) { - URLOG_CTX(DEBUG, "==== urContextCreate"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextCreate"); UR_CALL(getContext()->urDdiTable.Context.pfnCreate(numDevices, phDevices, pProperties, phContext)); @@ -78,7 +78,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( const ur_context_native_properties_t *pProperties, /// [out] pointer to the handle of the context object created. ur_context_handle_t *phContext) { - URLOG_CTX(DEBUG, "==== urContextCreateWithNativeHandle"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextCreateWithNativeHandle"); UR_CALL(getContext()->urDdiTable.Context.pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext)); @@ -94,13 +94,13 @@ ur_result_t urContextRetain( /// [in] handle of the context to get a reference of. ur_context_handle_t hContext) { - URLOG_CTX(DEBUG, "==== urContextRetain"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextRetain"); UR_CALL(getContext()->urDdiTable.Context.pfnRetain(hContext)); auto ContextInfo = getTsanInterceptor()->getContextInfo(hContext); if (!ContextInfo) { - URLOG_CTX(ERR, "Invalid context"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Invalid context"); return UR_RESULT_ERROR_INVALID_CONTEXT; } ContextInfo->RefCount++; @@ -113,13 +113,13 @@ ur_result_t urContextRetain( ur_result_t urContextRelease( /// [in] handle of the context to release. ur_context_handle_t hContext) { - URLOG_CTX(DEBUG, "==== urContextRelease"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urContextRelease"); UR_CALL(getContext()->urDdiTable.Context.pfnRelease(hContext)); auto ContextInfo = getTsanInterceptor()->getContextInfo(hContext); if (!ContextInfo) { - URLOG_CTX(ERR, "Invalid context"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Invalid context"); return UR_RESULT_ERROR_INVALID_CONTEXT; } @@ -138,7 +138,7 @@ ur_result_t urProgramBuild( ur_program_handle_t hProgram, /// [in] string of build options const char *pOptions) { - URLOG_CTX(DEBUG, "==== urProgramBuild"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramBuild"); UR_CALL( getContext()->urDdiTable.Program.pfnBuild(hContext, hProgram, pOptions)); @@ -161,7 +161,7 @@ ur_result_t urProgramLink( const char *pOptions, /// [out] pointer to handle of program object created. ur_program_handle_t *phProgram) { - URLOG_CTX(DEBUG, "==== urProgramLink"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramLink"); UR_CALL(getContext()->urDdiTable.Program.pfnLink(hContext, count, phPrograms, pOptions, phProgram)); @@ -182,7 +182,7 @@ ur_result_t urProgramBuildExp( ur_device_handle_t *phDevices, /// [in][optional] pointer to build options null-terminated string. const char *pOptions) { - URLOG_CTX(DEBUG, "==== urProgramBuildExp"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramBuildExp"); UR_CALL(getContext()->urDdiTable.ProgramExp.pfnBuildExp(hProgram, numDevices, phDevices, pOptions)); @@ -207,7 +207,7 @@ ur_result_t urProgramLinkExp( const char *pOptions, /// [out] pointer to handle of program object created. ur_program_handle_t *phProgram) { - URLOG_CTX(DEBUG, "==== urProgramLinkExp"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urProgramLinkExp"); UR_CALL(getContext()->urDdiTable.ProgramExp.pfnLinkExp( hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram)); @@ -234,7 +234,7 @@ ur_result_t urMemBufferCreate( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - URLOG_CTX(DEBUG, "==== urMemBufferCreate"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemBufferCreate"); void *Host = nullptr; if (pProperties) { @@ -270,7 +270,7 @@ ur_result_t urMemBufferCreate( ur_result_t urMemRetain( /// [in] handle of the memory object to get access ur_mem_handle_t hMem) { - URLOG_CTX(DEBUG, "==== urMemRetain"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemRetain"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { MemBuffer->RefCount++; @@ -286,7 +286,7 @@ ur_result_t urMemRetain( ur_result_t urMemRelease( /// [in] handle of the memory object to release ur_mem_handle_t hMem) { - URLOG_CTX(DEBUG, "==== urMemRelease"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemRelease"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { if (--MemBuffer->RefCount != 0) { @@ -315,7 +315,7 @@ ur_result_t urMemBufferPartition( const ur_buffer_region_t *pRegion, /// [out] pointer to the handle of sub buffer created ur_mem_handle_t *phMem) { - URLOG_CTX(DEBUG, "==== urMemBufferPartition"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemBufferPartition"); if (auto ParentBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { @@ -340,7 +340,7 @@ ur_result_t urMemGetNativeHandle( ur_mem_handle_t hMem, ur_device_handle_t hDevice, /// [out] a pointer to the native handle of the mem. ur_native_handle_t *phNativeMem) { - URLOG_CTX(DEBUG, "==== urMemGetNativeHandle"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemGetNativeHandle"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { char *Handle = nullptr; @@ -371,7 +371,7 @@ ur_result_t urMemGetInfo( /// [out][optional] pointer to the actual size in bytes of the queried /// propName. size_t *pPropSizeRet) { - URLOG_CTX(DEBUG, "==== urMemGetInfo"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urMemGetInfo"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMemory)) { UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); @@ -419,7 +419,7 @@ ur_result_t urEnqueueMemBufferRead( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferRead"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferRead"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -462,7 +462,7 @@ ur_result_t urEnqueueMemBufferWrite( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWrite"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWrite"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -525,7 +525,7 @@ ur_result_t urEnqueueMemBufferReadRect( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferReadRect"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferReadRect"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { char *SrcHandle = nullptr; @@ -583,7 +583,7 @@ ur_result_t urEnqueueMemBufferWriteRect( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferWriteRect"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWriteRect"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { char *DstHandle = nullptr; @@ -629,7 +629,7 @@ ur_result_t urEnqueueMemBufferCopy( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopy"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopy"); auto SrcBuffer = getTsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getTsanInterceptor()->getMemBuffer(hBufferDst); @@ -700,7 +700,7 @@ ur_result_t urEnqueueMemBufferCopyRect( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferCopyRect"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopyRect"); auto SrcBuffer = getTsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getTsanInterceptor()->getMemBuffer(hBufferDst); @@ -755,7 +755,7 @@ ur_result_t urEnqueueMemBufferFill( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferFill"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferFill"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { char *Handle = nullptr; @@ -809,7 +809,7 @@ ur_result_t urEnqueueMemBufferMap( ur_event_handle_t *phEvent, /// [out] return mapped pointer. TODO: move it before numEventsInWaitList? void **ppRetMap) { - URLOG_CTX(DEBUG, "==== urEnqueueMemBufferMap"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemBufferMap"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { // Translate the host access mode info. @@ -888,7 +888,7 @@ ur_result_t urEnqueueMemUnmap( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - URLOG_CTX(DEBUG, "==== urEnqueueMemUnmap"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueMemUnmap"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { MemBuffer::Mapping Mapping{}; @@ -932,7 +932,7 @@ ur_result_t UR_APICALL urKernelCreate( const char *pKernelName, /// [out][alloc] pointer to handle of kernel object created. ur_kernel_handle_t *phKernel) { - URLOG_CTX(DEBUG, "==== urKernelCreate"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelCreate"); UR_CALL(getContext()->urDdiTable.Kernel.pfnCreate(hProgram, pKernelName, phKernel)); @@ -952,7 +952,7 @@ ur_result_t UR_APICALL urKernelCreateWithNativeHandle( const ur_kernel_native_properties_t *pProperties, /// [out][alloc] pointer to the handle of the kernel object created. ur_kernel_handle_t *phKernel) { - URLOG_CTX(DEBUG, "==== urKernelCreate"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelCreate"); UR_CALL(getContext()->urDdiTable.Kernel.pfnCreateWithNativeHandle( hNativeKernel, hContext, hProgram, pProperties, phKernel)); @@ -967,7 +967,7 @@ ur_result_t UR_APICALL urKernelCreateWithNativeHandle( ur_result_t urKernelRetain( /// [in] handle for the Kernel to retain ur_kernel_handle_t hKernel) { - URLOG_CTX(DEBUG, "==== urKernelRetain"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelRetain"); UR_CALL(getContext()->urDdiTable.Kernel.pfnRetain(hKernel)); @@ -984,7 +984,7 @@ ur_result_t urKernelRelease( ur_kernel_handle_t hKernel) { auto pfnRelease = getContext()->urDdiTable.Kernel.pfnRelease; - URLOG_CTX(DEBUG, "==== urKernelRelease"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelRelease"); auto &KernelInfo = getTsanInterceptor()->getKernelInfo(hKernel); if (--KernelInfo.RefCount == 0) { @@ -1008,7 +1008,7 @@ ur_result_t urKernelSetArgValue( const ur_kernel_arg_value_properties_t *pProperties, /// [in] argument value represented as matching arg type. const void *pArgValue) { - URLOG_CTX(DEBUG, "==== urKernelSetArgValue"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelSetArgValue"); std::shared_ptr MemBuffer; if (argSize == sizeof(ur_mem_handle_t) && @@ -1036,7 +1036,7 @@ ur_result_t urKernelSetArgMemObj( const ur_kernel_arg_mem_obj_properties_t *pProperties, /// [in][optional] handle of Memory object. ur_mem_handle_t hArgValue) { - URLOG_CTX(DEBUG, "==== urKernelSetArgMemObj"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urKernelSetArgMemObj"); if (std::shared_ptr MemBuffer = getTsanInterceptor()->getMemBuffer(hArgValue)) { @@ -1066,7 +1066,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( size_t size, /// [out] pointer to USM device memory object void **ppMem) { - URLOG_CTX(DEBUG, "==== urUSMDeviceAlloc"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urUSMDeviceAlloc"); return getTsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -1085,7 +1085,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( size_t size, /// [out] pointer to USM host memory object void **ppMem) { - URLOG_CTX(DEBUG, "==== urUSMHostAlloc"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urUSMHostAlloc"); return getTsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -1106,7 +1106,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( size_t size, /// [out] pointer to USM shared memory object void **ppMem) { - URLOG_CTX(DEBUG, "==== urUSMSharedAlloc"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urUSMSharedAlloc"); return getTsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -1144,7 +1144,7 @@ ur_result_t urEnqueueKernelLaunch( /// [out][optional] return an event object that identifies this /// particular kernel execution instance. ur_event_handle_t *phEvent) { - URLOG_CTX(DEBUG, "==== urEnqueueKernelLaunch"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueKernelLaunch"); LaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue)); @@ -1191,7 +1191,7 @@ ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( /// are not NULL, phEvent must not refer to an element of the /// phEventWaitList array. ur_event_handle_t *phEvent) { - URLOG_CTX(DEBUG, "==== urEnqueueCooperativeKernelLaunchExp"); + UR_LOG_LOGGER(getContext()->logger, DEBUG, "==== urEnqueueCooperativeKernelLaunchExp"); LaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue)); @@ -1408,7 +1408,7 @@ __urdlllocal ur_result_t UR_APICALL urGetEnqueueExpProcAddrTable( ur_result_t initTsanDDITable(ur_dditable_t *dditable) { ur_result_t result = UR_RESULT_SUCCESS; - URLOG_CTX_ALWAYS("==== DeviceSanitizer: TSAN"); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "==== DeviceSanitizer: TSAN"); if (UR_RESULT_SUCCESS == result) { result = ur_sanitizer_layer::tsan::urCheckVersion(UR_API_VERSION_CURRENT); @@ -1453,7 +1453,7 @@ ur_result_t initTsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Initialize TSAN DDI table failed: {}", result); + UR_LOG_LOGGER(getContext()->logger, ERR, "Initialize TSAN DDI table failed: {}", result); } return result; diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp index 755117aaf9b7..50351fdba29a 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp @@ -33,7 +33,7 @@ TsanRuntimeData *TsanRuntimeDataWrapper::getDevicePtr() { Context, Device, nullptr, nullptr, sizeof(TsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - URLOG(ERR, "Failed to alloc device usm for asan runtime data: {}", + UR_LOG(ERR, "Failed to alloc device usm for asan runtime data: {}", Result); } } @@ -63,7 +63,7 @@ ur_result_t DeviceInfo::allocShadowMemory() { Shadow = GetShadowMemory(ShadowContext, Handle, Type); assert(Shadow && "Failed to get shadow memory"); UR_CALL(Shadow->Setup()); - URLOG_CTX(INFO, "ShadowMemory(Global): {} - {}", (void *)Shadow->ShadowBegin, + UR_LOG_LOGGER(getContext()->logger, INFO, "ShadowMemory(Global): {} - {}", (void *)Shadow->ShadowBegin, (void *)Shadow->ShadowEnd); return UR_RESULT_SUCCESS; } @@ -110,7 +110,7 @@ ur_result_t TsanInterceptor::allocateMemory(ur_context_handle_t Context, } ur_result_t TsanInterceptor::registerProgram(ur_program_handle_t Program) { - URLOG_CTX(INFO, "registerDeviceGlobals"); + UR_LOG_LOGGER(getContext()->logger, INFO, "registerDeviceGlobals"); UR_CALL(registerDeviceGlobals(Program)); return UR_RESULT_SUCCESS; } @@ -131,7 +131,7 @@ TsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Device, Program, kSPIR_TsanDeviceGlobalMetadata, &MetadataSize, &MetadataPtr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(INFO, "No device globals"); + UR_LOG_LOGGER(getContext()->logger, INFO, "No device globals"); continue; } @@ -143,7 +143,7 @@ TsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Device Global[{}] Read Failed: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Device Global[{}] Read Failed: {}", kSPIR_TsanDeviceGlobalMetadata, Result); return Result; } @@ -252,7 +252,7 @@ ur_result_t TsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(CI->Handle, DI->Handle); if (!InternalQueue) { - URLOG_CTX(ERR, "Failed to create internal queue"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -295,7 +295,7 @@ ur_result_t TsanInterceptor::prepareLaunch(std::shared_ptr &, ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Failed to set buffer {} as the {} arg to kernel {}: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); } @@ -317,7 +317,7 @@ ur_result_t TsanInterceptor::prepareLaunch(std::shared_ptr &, Queue, GetProgram(Kernel), "__TsanLaunchInfo", true, sizeof(LaunchInfoPtr), 0, &LaunchInfoPtr, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(INFO, + UR_LOG_LOGGER(getContext()->logger, INFO, "EnqueueWriteGlobal(__TsanLaunchInfo) " "failed, maybe empty kernel: {}", URes); diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_report.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_report.cpp index cd7f76fd2c3c..fe944c430307 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_report.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_report.cpp @@ -26,14 +26,14 @@ void ReportDataRace(const TsanErrorReport &Report, ur_kernel_handle_t Kernel) { // Try to demangle the kernel name KernelName = DemangleName(KernelName); - URLOG_CTX_ALWAYS("====WARNING: DeviceSanitizer: data race"); - URLOG_CTX_ALWAYS( + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "====WARNING: DeviceSanitizer: data race"); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, "When {} of size {} at {} in kernel <{}> LID({}, {}, {}) GID({}, " "{}, {})", Report.Type & kAccessRead ? "read" : "write", Report.AccessSize, (void *)Report.Address, KernelName.c_str(), Report.LID0, Report.LID1, Report.LID2, Report.GID0, Report.GID1, Report.GID2); - URLOG_CTX_ALWAYS(" #0 {} {}:{}", Func, File, Report.Line); + UR_LOG_LOGGER(getContext()->logger, ALWAYS, " #0 {} {}:{}", Func, File, Report.Line); } } // namespace tsan diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp index fed6903924c4..c8bc0fa61c3b 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp @@ -29,7 +29,7 @@ std::shared_ptr GetShadowMemory(ur_context_handle_t Context, } else if (Type == DeviceType::GPU_PVC) { return std::make_shared(Context, Device); } else { - URLOG_CTX(ERR, "Unsupport device type"); + UR_LOG_LOGGER(getContext()->logger, ERR, "Unsupport device type"); return nullptr; } } @@ -71,7 +71,7 @@ ur_result_t ShadowMemoryCPU::CleanShadow(ur_queue_handle_t, uptr Ptr, Size = RoundUpTo(Size, kShadowCell); RawShadow *Begin = MemToShadow(Ptr); - URLOG_CTX(DEBUG, "CleanShadow(addr={}, count={})", (void *)Begin, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "CleanShadow(addr={}, count={})", (void *)Begin, Size / kShadowCell); memset((void *)Begin, 0, Size / kShadowCell * kShadowCnt * kShadowSize); } @@ -91,7 +91,7 @@ ur_result_t ShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "Shadow memory reserved failed with size {}: {}", + UR_LOG_LOGGER(getContext()->logger, ERR, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; } @@ -146,7 +146,7 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, &Desc, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "urPhysicalMemCreate(): {}", URes); + UR_LOG_LOGGER(getContext()->logger, ERR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -154,18 +154,18 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, + UR_LOG_LOGGER(getContext()->logger, ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } - URLOG_CTX(DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); // Initialize to zero URes = EnqueueUSMBlockingSet(Queue, (void *)MappedPtr, 0, PageSize); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "EnqueueUSMBlockingSet(): {}", URes); + UR_LOG_LOGGER(getContext()->logger, ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } @@ -177,11 +177,11 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, auto URes = EnqueueUSMBlockingSet( Queue, (void *)Begin, 0, Size / kShadowCell * kShadowCnt * kShadowSize); if (URes != UR_RESULT_SUCCESS) { - URLOG_CTX(ERR, "EnqueueUSMBlockingSet(): {}", URes); + UR_LOG_LOGGER(getContext()->logger, ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } - URLOG_CTX(DEBUG, "CleanShadow(addr={}, count={})", (void *)Begin, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "CleanShadow(addr={}, count={})", (void *)Begin, Size / kShadowCell); return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp b/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp index a31b5cf249f4..078479669114 100644 --- a/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp @@ -26,7 +26,7 @@ ur_result_t context_t::init(ur_dditable_t *dditable, bool tsanEnabled = enabledLayerNames.count("UR_LAYER_TSAN"); if ((asanEnabled + msanEnabled + tsanEnabled) >= 2) { - URLOG(WARN, + UR_LOG(WARN, "Enabling ASAN or MSAN or TSAN at the same time is not supported."); return UR_RESULT_SUCCESS; } else if (asanEnabled) { diff --git a/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp b/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp index 6a9536f18164..7a44215882c2 100644 --- a/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp +++ b/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp @@ -42,7 +42,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGet( "urAdapterGet", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urAdapterGet\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urAdapterGet\n"); ur_result_t result = pfnAdapterGet(NumEntries, phAdapters, pNumAdapters); @@ -52,7 +52,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGet( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_GET, ¶ms); - URLOG_(logger, INFO, " <--- urAdapterGet({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urAdapterGet({}) -> {};\n", args_str.str(), result); } @@ -74,7 +74,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRelease( "urAdapterRelease", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urAdapterRelease\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urAdapterRelease\n"); ur_result_t result = pfnAdapterRelease(hAdapter); @@ -85,7 +85,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_RELEASE, ¶ms); - URLOG_(logger, INFO, " <--- urAdapterRelease({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urAdapterRelease({}) -> {};\n", args_str.str(), result); } @@ -107,7 +107,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain( "urAdapterRetain", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urAdapterRetain\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urAdapterRetain\n"); ur_result_t result = pfnAdapterRetain(hAdapter); @@ -118,7 +118,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_RETAIN, ¶ms); - URLOG_(logger, INFO, " <--- urAdapterRetain({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urAdapterRetain({}) -> {};\n", args_str.str(), result); } @@ -147,7 +147,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetLastError( UR_FUNCTION_ADAPTER_GET_LAST_ERROR, "urAdapterGetLastError", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urAdapterGetLastError\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urAdapterGetLastError\n"); ur_result_t result = pfnAdapterGetLastError(hAdapter, ppMessage, pError); @@ -158,7 +158,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetLastError( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ADAPTER_GET_LAST_ERROR, ¶ms); - URLOG_(logger, INFO, " <--- urAdapterGetLastError({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urAdapterGetLastError({}) -> {};\n", args_str.str(), result); } @@ -194,7 +194,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetInfo( "urAdapterGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urAdapterGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urAdapterGetInfo\n"); ur_result_t result = pfnAdapterGetInfo(hAdapter, propName, propSize, pPropValue, pPropSizeRet); @@ -206,7 +206,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urAdapterGetInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urAdapterGetInfo({}) -> {};\n", args_str.str(), result); } @@ -242,7 +242,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGet( "urPlatformGet", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urPlatformGet\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urPlatformGet\n"); ur_result_t result = pfnGet(phAdapters, NumAdapters, NumEntries, phPlatforms, pNumPlatforms); @@ -254,7 +254,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGet( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PLATFORM_GET, ¶ms); - URLOG_(logger, INFO, " <--- urPlatformGet({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urPlatformGet({}) -> {};\n", args_str.str(), result); } @@ -290,7 +290,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetInfo( "urPlatformGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urPlatformGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urPlatformGetInfo\n"); ur_result_t result = pfnGetInfo(hPlatform, propName, propSize, pPropValue, pPropSizeRet); @@ -302,7 +302,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PLATFORM_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urPlatformGetInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urPlatformGetInfo({}) -> {};\n", args_str.str(), result); } @@ -326,7 +326,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetApiVersion( UR_FUNCTION_PLATFORM_GET_API_VERSION, "urPlatformGetApiVersion", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urPlatformGetApiVersion\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urPlatformGetApiVersion\n"); ur_result_t result = pfnGetApiVersion(hPlatform, pVersion); @@ -338,7 +338,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetApiVersion( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_API_VERSION, ¶ms); - URLOG_(logger, INFO, " <--- urPlatformGetApiVersion({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urPlatformGetApiVersion({}) -> {};\n", args_str.str(), result); } @@ -365,7 +365,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle( "urPlatformGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urPlatformGetNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urPlatformGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hPlatform, phNativePlatform); @@ -377,7 +377,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urPlatformGetNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urPlatformGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -408,7 +408,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( "urPlatformCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urPlatformCreateWithNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urPlatformCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativePlatform, hAdapter, pProperties, phPlatform); @@ -421,7 +421,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_CREATE_WITH_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urPlatformCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -452,7 +452,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption( "urPlatformGetBackendOption", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urPlatformGetBackendOption\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urPlatformGetBackendOption\n"); ur_result_t result = pfnGetBackendOption(hPlatform, pFrontendOption, ppPlatformOption); @@ -465,7 +465,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_BACKEND_OPTION, ¶ms); - URLOG_(logger, INFO, " <--- urPlatformGetBackendOption({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urPlatformGetBackendOption({}) -> {};\n", args_str.str(), result); } @@ -502,7 +502,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGet( "urDeviceGet", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urDeviceGet\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urDeviceGet\n"); ur_result_t result = pfnGet(hPlatform, DeviceType, NumEntries, phDevices, pNumDevices); @@ -513,7 +513,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGet( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_GET, ¶ms); - URLOG_(logger, INFO, " <--- urDeviceGet({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urDeviceGet({}) -> {};\n", args_str.str(), result); } @@ -550,7 +550,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( "urDeviceGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urDeviceGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urDeviceGetInfo\n"); ur_result_t result = pfnGetInfo(hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -562,7 +562,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urDeviceGetInfo({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urDeviceGetInfo({}) -> {};\n", args_str.str(), result); } @@ -584,7 +584,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain( "urDeviceRetain", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urDeviceRetain\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urDeviceRetain\n"); ur_result_t result = pfnRetain(hDevice); @@ -595,7 +595,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_RETAIN, ¶ms); - URLOG_(logger, INFO, " <--- urDeviceRetain({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urDeviceRetain({}) -> {};\n", args_str.str(), result); } @@ -617,7 +617,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRelease( "urDeviceRelease", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urDeviceRelease\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urDeviceRelease\n"); ur_result_t result = pfnRelease(hDevice); @@ -628,7 +628,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_RELEASE, ¶ms); - URLOG_(logger, INFO, " <--- urDeviceRelease({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urDeviceRelease({}) -> {};\n", args_str.str(), result); } @@ -662,7 +662,7 @@ __urdlllocal ur_result_t UR_APICALL urDevicePartition( "urDevicePartition", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urDevicePartition\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urDevicePartition\n"); ur_result_t result = pfnPartition(hDevice, pProperties, NumDevices, phSubDevices, pNumDevicesRet); @@ -674,7 +674,7 @@ __urdlllocal ur_result_t UR_APICALL urDevicePartition( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_PARTITION, ¶ms); - URLOG_(logger, INFO, " <--- urDevicePartition({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urDevicePartition({}) -> {};\n", args_str.str(), result); } @@ -707,7 +707,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceSelectBinary( UR_FUNCTION_DEVICE_SELECT_BINARY, "urDeviceSelectBinary", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urDeviceSelectBinary\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urDeviceSelectBinary\n"); ur_result_t result = pfnSelectBinary(hDevice, pBinaries, NumBinaries, pSelectedBinary); @@ -719,7 +719,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceSelectBinary( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_SELECT_BINARY, ¶ms); - URLOG_(logger, INFO, " <--- urDeviceSelectBinary({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urDeviceSelectBinary({}) -> {};\n", args_str.str(), result); } @@ -743,7 +743,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( UR_FUNCTION_DEVICE_GET_NATIVE_HANDLE, "urDeviceGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urDeviceGetNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urDeviceGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hDevice, phNativeDevice); @@ -755,7 +755,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_GET_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urDeviceGetNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urDeviceGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -786,7 +786,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( "urDeviceCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urDeviceCreateWithNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urDeviceCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeDevice, hAdapter, pProperties, phDevice); @@ -799,7 +799,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urDeviceCreateWithNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urDeviceCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -830,7 +830,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( "urDeviceGetGlobalTimestamps", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urDeviceGetGlobalTimestamps\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urDeviceGetGlobalTimestamps\n"); ur_result_t result = pfnGetGlobalTimestamps(hDevice, pDeviceTimestamp, pHostTimestamp); @@ -843,7 +843,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_GET_GLOBAL_TIMESTAMPS, ¶ms); - URLOG_(logger, INFO, " <--- urDeviceGetGlobalTimestamps({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urDeviceGetGlobalTimestamps({}) -> {};\n", args_str.str(), result); } @@ -872,7 +872,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( "urContextCreate", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urContextCreate\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urContextCreate\n"); ur_result_t result = pfnCreate(DeviceCount, phDevices, pProperties, phContext); @@ -884,7 +884,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_CREATE, ¶ms); - URLOG_(logger, INFO, " <--- urContextCreate({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urContextCreate({}) -> {};\n", args_str.str(), result); } @@ -906,7 +906,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( "urContextRetain", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urContextRetain\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urContextRetain\n"); ur_result_t result = pfnRetain(hContext); @@ -917,7 +917,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_RETAIN, ¶ms); - URLOG_(logger, INFO, " <--- urContextRetain({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urContextRetain({}) -> {};\n", args_str.str(), result); } @@ -939,7 +939,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( "urContextRelease", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urContextRelease\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urContextRelease\n"); ur_result_t result = pfnRelease(hContext); @@ -950,7 +950,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_RELEASE, ¶ms); - URLOG_(logger, INFO, " <--- urContextRelease({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urContextRelease({}) -> {};\n", args_str.str(), result); } @@ -987,7 +987,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo( "urContextGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urContextGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urContextGetInfo\n"); ur_result_t result = pfnGetInfo(hContext, propName, propSize, pPropValue, pPropSizeRet); @@ -999,7 +999,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urContextGetInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urContextGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1024,7 +1024,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetNativeHandle( "urContextGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urContextGetNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urContextGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hContext, phNativeContext); @@ -1036,7 +1036,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_GET_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urContextGetNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urContextGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1073,7 +1073,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( "urContextCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urContextCreateWithNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urContextCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -1086,7 +1086,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_CREATE_WITH_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urContextCreateWithNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urContextCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1115,7 +1115,7 @@ __urdlllocal ur_result_t UR_APICALL urContextSetExtendedDeleter( "urContextSetExtendedDeleter", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urContextSetExtendedDeleter\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urContextSetExtendedDeleter\n"); ur_result_t result = pfnSetExtendedDeleter(hContext, pfnDeleter, pUserData); @@ -1127,7 +1127,7 @@ __urdlllocal ur_result_t UR_APICALL urContextSetExtendedDeleter( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_SET_EXTENDED_DELETER, ¶ms); - URLOG_(logger, INFO, " <--- urContextSetExtendedDeleter({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urContextSetExtendedDeleter({}) -> {};\n", args_str.str(), result); } @@ -1160,7 +1160,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreate( "urMemImageCreate", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urMemImageCreate\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urMemImageCreate\n"); ur_result_t result = pfnImageCreate(hContext, flags, pImageFormat, pImageDesc, pHost, phMem); @@ -1172,7 +1172,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_IMAGE_CREATE, ¶ms); - URLOG_(logger, INFO, " <--- urMemImageCreate({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urMemImageCreate({}) -> {};\n", args_str.str(), result); } @@ -1203,7 +1203,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( "urMemBufferCreate", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urMemBufferCreate\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urMemBufferCreate\n"); ur_result_t result = pfnBufferCreate(hContext, flags, size, pProperties, phBuffer); @@ -1215,7 +1215,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_BUFFER_CREATE, ¶ms); - URLOG_(logger, INFO, " <--- urMemBufferCreate({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urMemBufferCreate({}) -> {};\n", args_str.str(), result); } @@ -1237,7 +1237,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( "urMemRetain", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urMemRetain\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urMemRetain\n"); ur_result_t result = pfnRetain(hMem); @@ -1247,7 +1247,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_RETAIN, ¶ms); - URLOG_(logger, INFO, " <--- urMemRetain({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urMemRetain({}) -> {};\n", args_str.str(), result); } @@ -1269,7 +1269,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( "urMemRelease", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urMemRelease\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urMemRelease\n"); ur_result_t result = pfnRelease(hMem); @@ -1279,7 +1279,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_RELEASE, ¶ms); - URLOG_(logger, INFO, " <--- urMemRelease({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urMemRelease({}) -> {};\n", args_str.str(), result); } @@ -1310,7 +1310,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( UR_FUNCTION_MEM_BUFFER_PARTITION, "urMemBufferPartition", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urMemBufferPartition\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urMemBufferPartition\n"); ur_result_t result = pfnBufferPartition(hBuffer, flags, bufferCreateType, pRegion, phMem); @@ -1322,7 +1322,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_BUFFER_PARTITION, ¶ms); - URLOG_(logger, INFO, " <--- urMemBufferPartition({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urMemBufferPartition({}) -> {};\n", args_str.str(), result); } @@ -1349,7 +1349,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( UR_FUNCTION_MEM_GET_NATIVE_HANDLE, "urMemGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urMemGetNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urMemGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hMem, hDevice, phNativeMem); @@ -1360,7 +1360,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_GET_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urMemGetNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urMemGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1391,7 +1391,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( "urMemBufferCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urMemBufferCreateWithNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urMemBufferCreateWithNativeHandle\n"); ur_result_t result = pfnBufferCreateWithNativeHandle(hNativeMem, hContext, pProperties, phMem); @@ -1404,7 +1404,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_MEM_BUFFER_CREATE_WITH_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urMemBufferCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1440,7 +1440,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( "urMemImageCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urMemImageCreateWithNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urMemImageCreateWithNativeHandle\n"); ur_result_t result = pfnImageCreateWithNativeHandle( hNativeMem, hContext, pImageFormat, pImageDesc, pProperties, phMem); @@ -1453,7 +1453,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_MEM_IMAGE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urMemImageCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1490,7 +1490,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( "urMemGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urMemGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urMemGetInfo\n"); ur_result_t result = pfnGetInfo(hMemory, propName, propSize, pPropValue, pPropSizeRet); @@ -1502,7 +1502,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urMemGetInfo({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urMemGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1538,7 +1538,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageGetInfo( "urMemImageGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urMemImageGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urMemImageGetInfo\n"); ur_result_t result = pfnImageGetInfo(hMemory, propName, propSize, pPropValue, pPropSizeRet); @@ -1550,7 +1550,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_IMAGE_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urMemImageGetInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urMemImageGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1576,7 +1576,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreate( "urSamplerCreate", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urSamplerCreate\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urSamplerCreate\n"); ur_result_t result = pfnCreate(hContext, pDesc, phSampler); @@ -1587,7 +1587,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_CREATE, ¶ms); - URLOG_(logger, INFO, " <--- urSamplerCreate({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urSamplerCreate({}) -> {};\n", args_str.str(), result); } @@ -1609,7 +1609,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain( "urSamplerRetain", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urSamplerRetain\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urSamplerRetain\n"); ur_result_t result = pfnRetain(hSampler); @@ -1620,7 +1620,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_RETAIN, ¶ms); - URLOG_(logger, INFO, " <--- urSamplerRetain({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urSamplerRetain({}) -> {};\n", args_str.str(), result); } @@ -1642,7 +1642,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRelease( "urSamplerRelease", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urSamplerRelease\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urSamplerRelease\n"); ur_result_t result = pfnRelease(hSampler); @@ -1653,7 +1653,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_RELEASE, ¶ms); - URLOG_(logger, INFO, " <--- urSamplerRelease({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urSamplerRelease({}) -> {};\n", args_str.str(), result); } @@ -1685,7 +1685,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo( "urSamplerGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urSamplerGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urSamplerGetInfo\n"); ur_result_t result = pfnGetInfo(hSampler, propName, propSize, pPropValue, pPropSizeRet); @@ -1697,7 +1697,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urSamplerGetInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urSamplerGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1722,7 +1722,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetNativeHandle( "urSamplerGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urSamplerGetNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urSamplerGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hSampler, phNativeSampler); @@ -1734,7 +1734,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_SAMPLER_GET_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urSamplerGetNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urSamplerGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1765,7 +1765,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( "urSamplerCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urSamplerCreateWithNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urSamplerCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeSampler, hContext, pProperties, phSampler); @@ -1778,7 +1778,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_SAMPLER_CREATE_WITH_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urSamplerCreateWithNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urSamplerCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1809,7 +1809,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( "urUSMHostAlloc", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMHostAlloc\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMHostAlloc\n"); ur_result_t result = pfnHostAlloc(hContext, pUSMDesc, pool, size, ppMem); @@ -1820,7 +1820,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_HOST_ALLOC, ¶ms); - URLOG_(logger, INFO, " <--- urUSMHostAlloc({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urUSMHostAlloc({}) -> {};\n", args_str.str(), result); } @@ -1853,7 +1853,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( "urUSMDeviceAlloc", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMDeviceAlloc\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMDeviceAlloc\n"); ur_result_t result = pfnDeviceAlloc(hContext, hDevice, pUSMDesc, pool, size, ppMem); @@ -1865,7 +1865,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_DEVICE_ALLOC, ¶ms); - URLOG_(logger, INFO, " <--- urUSMDeviceAlloc({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMDeviceAlloc({}) -> {};\n", args_str.str(), result); } @@ -1898,7 +1898,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( "urUSMSharedAlloc", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMSharedAlloc\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMSharedAlloc\n"); ur_result_t result = pfnSharedAlloc(hContext, hDevice, pUSMDesc, pool, size, ppMem); @@ -1910,7 +1910,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_SHARED_ALLOC, ¶ms); - URLOG_(logger, INFO, " <--- urUSMSharedAlloc({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMSharedAlloc({}) -> {};\n", args_str.str(), result); } @@ -1934,7 +1934,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( getContext()->notify_begin(UR_FUNCTION_USM_FREE, "urUSMFree", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMFree\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMFree\n"); ur_result_t result = pfnFree(hContext, pMem); @@ -1944,7 +1944,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_FREE, ¶ms); - URLOG_(logger, INFO, " <--- urUSMFree({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urUSMFree({}) -> {};\n", args_str.str(), result); } @@ -1978,7 +1978,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMGetMemAllocInfo( UR_FUNCTION_USM_GET_MEM_ALLOC_INFO, "urUSMGetMemAllocInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMGetMemAllocInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMGetMemAllocInfo\n"); ur_result_t result = pfnGetMemAllocInfo(hContext, pMem, propName, propSize, pPropValue, pPropSizeRet); @@ -1990,7 +1990,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMGetMemAllocInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_GET_MEM_ALLOC_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urUSMGetMemAllocInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMGetMemAllocInfo({}) -> {};\n", args_str.str(), result); } @@ -2017,7 +2017,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreate( "urUSMPoolCreate", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolCreate\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolCreate\n"); ur_result_t result = pfnPoolCreate(hContext, pPoolDesc, ppPool); @@ -2028,7 +2028,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_CREATE, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolCreate({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolCreate({}) -> {};\n", args_str.str(), result); } @@ -2050,7 +2050,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain( "urUSMPoolRetain", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolRetain\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolRetain\n"); ur_result_t result = pfnPoolRetain(pPool); @@ -2061,7 +2061,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_RETAIN, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolRetain({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolRetain({}) -> {};\n", args_str.str(), result); } @@ -2083,7 +2083,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRelease( "urUSMPoolRelease", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolRelease\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolRelease\n"); ur_result_t result = pfnPoolRelease(pPool); @@ -2094,7 +2094,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_RELEASE, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolRelease({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolRelease({}) -> {};\n", args_str.str(), result); } @@ -2126,7 +2126,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfo( "urUSMPoolGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolGetInfo\n"); ur_result_t result = pfnPoolGetInfo(hPool, propName, propSize, pPropValue, pPropSizeRet); @@ -2138,7 +2138,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolGetInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2179,7 +2179,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGranularityGetInfo( "urVirtualMemGranularityGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urVirtualMemGranularityGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urVirtualMemGranularityGetInfo\n"); ur_result_t result = pfnGranularityGetInfo( hContext, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -2192,7 +2192,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGranularityGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_VIRTUAL_MEM_GRANULARITY_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urVirtualMemGranularityGetInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urVirtualMemGranularityGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2224,7 +2224,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemReserve( UR_FUNCTION_VIRTUAL_MEM_RESERVE, "urVirtualMemReserve", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urVirtualMemReserve\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urVirtualMemReserve\n"); ur_result_t result = pfnReserve(hContext, pStart, size, ppStart); @@ -2235,7 +2235,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemReserve( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_RESERVE, ¶ms); - URLOG_(logger, INFO, " <--- urVirtualMemReserve({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urVirtualMemReserve({}) -> {};\n", args_str.str(), result); } @@ -2261,7 +2261,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemFree( "urVirtualMemFree", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urVirtualMemFree\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urVirtualMemFree\n"); ur_result_t result = pfnFree(hContext, pStart, size); @@ -2272,7 +2272,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemFree( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_FREE, ¶ms); - URLOG_(logger, INFO, " <--- urVirtualMemFree({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urVirtualMemFree({}) -> {};\n", args_str.str(), result); } @@ -2305,7 +2305,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemMap( "urVirtualMemMap", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urVirtualMemMap\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urVirtualMemMap\n"); ur_result_t result = pfnMap(hContext, pStart, size, hPhysicalMem, offset, flags); @@ -2317,7 +2317,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemMap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_MAP, ¶ms); - URLOG_(logger, INFO, " <--- urVirtualMemMap({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urVirtualMemMap({}) -> {};\n", args_str.str(), result); } @@ -2343,7 +2343,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemUnmap( "urVirtualMemUnmap", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urVirtualMemUnmap\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urVirtualMemUnmap\n"); ur_result_t result = pfnUnmap(hContext, pStart, size); @@ -2354,7 +2354,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemUnmap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_UNMAP, ¶ms); - URLOG_(logger, INFO, " <--- urVirtualMemUnmap({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urVirtualMemUnmap({}) -> {};\n", args_str.str(), result); } @@ -2383,7 +2383,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemSetAccess( UR_FUNCTION_VIRTUAL_MEM_SET_ACCESS, "urVirtualMemSetAccess", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urVirtualMemSetAccess\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urVirtualMemSetAccess\n"); ur_result_t result = pfnSetAccess(hContext, pStart, size, flags); @@ -2394,7 +2394,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemSetAccess( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_VIRTUAL_MEM_SET_ACCESS, ¶ms); - URLOG_(logger, INFO, " <--- urVirtualMemSetAccess({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urVirtualMemSetAccess({}) -> {};\n", args_str.str(), result); } @@ -2434,7 +2434,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGetInfo( UR_FUNCTION_VIRTUAL_MEM_GET_INFO, "urVirtualMemGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urVirtualMemGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urVirtualMemGetInfo\n"); ur_result_t result = pfnGetInfo(hContext, pStart, size, propName, propSize, pPropValue, pPropSizeRet); @@ -2446,7 +2446,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urVirtualMemGetInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urVirtualMemGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2478,7 +2478,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemCreate( UR_FUNCTION_PHYSICAL_MEM_CREATE, "urPhysicalMemCreate", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urPhysicalMemCreate\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urPhysicalMemCreate\n"); ur_result_t result = pfnCreate(hContext, hDevice, size, pProperties, phPhysicalMem); @@ -2490,7 +2490,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_CREATE, ¶ms); - URLOG_(logger, INFO, " <--- urPhysicalMemCreate({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urPhysicalMemCreate({}) -> {};\n", args_str.str(), result); } @@ -2512,7 +2512,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain( UR_FUNCTION_PHYSICAL_MEM_RETAIN, "urPhysicalMemRetain", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urPhysicalMemRetain\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urPhysicalMemRetain\n"); ur_result_t result = pfnRetain(hPhysicalMem); @@ -2523,7 +2523,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_RETAIN, ¶ms); - URLOG_(logger, INFO, " <--- urPhysicalMemRetain({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urPhysicalMemRetain({}) -> {};\n", args_str.str(), result); } @@ -2545,7 +2545,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( UR_FUNCTION_PHYSICAL_MEM_RELEASE, "urPhysicalMemRelease", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urPhysicalMemRelease\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urPhysicalMemRelease\n"); ur_result_t result = pfnRelease(hPhysicalMem); @@ -2556,7 +2556,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_RELEASE, ¶ms); - URLOG_(logger, INFO, " <--- urPhysicalMemRelease({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urPhysicalMemRelease({}) -> {};\n", args_str.str(), result); } @@ -2591,7 +2591,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( UR_FUNCTION_PHYSICAL_MEM_GET_INFO, "urPhysicalMemGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urPhysicalMemGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urPhysicalMemGetInfo\n"); ur_result_t result = pfnGetInfo(hPhysicalMem, propName, propSize, pPropValue, pPropSizeRet); @@ -2603,7 +2603,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urPhysicalMemGetInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urPhysicalMemGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2634,7 +2634,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( UR_FUNCTION_PROGRAM_CREATE_WITH_IL, "urProgramCreateWithIL", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramCreateWithIL\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramCreateWithIL\n"); ur_result_t result = pfnCreateWithIL(hContext, pIL, length, pProperties, phProgram); @@ -2646,7 +2646,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_IL, ¶ms); - URLOG_(logger, INFO, " <--- urProgramCreateWithIL({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramCreateWithIL({}) -> {};\n", args_str.str(), result); } @@ -2687,7 +2687,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( "urProgramCreateWithBinary", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramCreateWithBinary\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramCreateWithBinary\n"); ur_result_t result = pfnCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, @@ -2701,7 +2701,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_BINARY, ¶ms); - URLOG_(logger, INFO, " <--- urProgramCreateWithBinary({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramCreateWithBinary({}) -> {};\n", args_str.str(), result); } @@ -2727,7 +2727,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( "urProgramBuild", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramBuild\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramBuild\n"); ur_result_t result = pfnBuild(hContext, hProgram, pOptions); @@ -2738,7 +2738,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_BUILD, ¶ms); - URLOG_(logger, INFO, " <--- urProgramBuild({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urProgramBuild({}) -> {};\n", args_str.str(), result); } @@ -2764,7 +2764,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompile( "urProgramCompile", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramCompile\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramCompile\n"); ur_result_t result = pfnCompile(hContext, hProgram, pOptions); @@ -2775,7 +2775,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompile( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_COMPILE, ¶ms); - URLOG_(logger, INFO, " <--- urProgramCompile({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramCompile({}) -> {};\n", args_str.str(), result); } @@ -2809,7 +2809,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( "urProgramLink", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramLink\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramLink\n"); ur_result_t result = pfnLink(hContext, count, phPrograms, pOptions, phProgram); @@ -2821,7 +2821,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_LINK, ¶ms); - URLOG_(logger, INFO, " <--- urProgramLink({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urProgramLink({}) -> {};\n", args_str.str(), result); } @@ -2843,7 +2843,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( "urProgramRetain", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramRetain\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramRetain\n"); ur_result_t result = pfnRetain(hProgram); @@ -2854,7 +2854,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_RETAIN, ¶ms); - URLOG_(logger, INFO, " <--- urProgramRetain({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urProgramRetain({}) -> {};\n", args_str.str(), result); } @@ -2876,7 +2876,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRelease( "urProgramRelease", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramRelease\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramRelease\n"); ur_result_t result = pfnRelease(hProgram); @@ -2887,7 +2887,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_RELEASE, ¶ms); - URLOG_(logger, INFO, " <--- urProgramRelease({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramRelease({}) -> {};\n", args_str.str(), result); } @@ -2920,7 +2920,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetFunctionPointer( "urProgramGetFunctionPointer", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramGetFunctionPointer\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramGetFunctionPointer\n"); ur_result_t result = pfnGetFunctionPointer(hDevice, hProgram, pFunctionName, ppFunctionPointer); @@ -2933,7 +2933,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetFunctionPointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_FUNCTION_POINTER, ¶ms); - URLOG_(logger, INFO, " <--- urProgramGetFunctionPointer({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramGetFunctionPointer({}) -> {};\n", args_str.str(), result); } @@ -2969,7 +2969,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetGlobalVariablePointer( "urProgramGetGlobalVariablePointer", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramGetGlobalVariablePointer\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramGetGlobalVariablePointer\n"); ur_result_t result = pfnGetGlobalVariablePointer( hDevice, hProgram, pGlobalVariableName, pGlobalVariableSizeRet, @@ -2983,7 +2983,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetGlobalVariablePointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_GLOBAL_VARIABLE_POINTER, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urProgramGetGlobalVariablePointer({}) -> {};\n", args_str.str(), result); } @@ -3021,7 +3021,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetInfo( "urProgramGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramGetInfo\n"); ur_result_t result = pfnGetInfo(hProgram, propName, propSize, pPropValue, pPropSizeRet); @@ -3033,7 +3033,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urProgramGetInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramGetInfo({}) -> {};\n", args_str.str(), result); } @@ -3071,7 +3071,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetBuildInfo( UR_FUNCTION_PROGRAM_GET_BUILD_INFO, "urProgramGetBuildInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramGetBuildInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramGetBuildInfo\n"); ur_result_t result = pfnGetBuildInfo(hProgram, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3083,7 +3083,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetBuildInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_BUILD_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urProgramGetBuildInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramGetBuildInfo({}) -> {};\n", args_str.str(), result); } @@ -3113,7 +3113,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramSetSpecializationConstants( "urProgramSetSpecializationConstants", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramSetSpecializationConstants\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramSetSpecializationConstants\n"); ur_result_t result = pfnSetSpecializationConstants(hProgram, count, pSpecConstants); @@ -3126,7 +3126,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramSetSpecializationConstants( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_SET_SPECIALIZATION_CONSTANTS, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urProgramSetSpecializationConstants({}) -> {};\n", args_str.str(), result); } @@ -3152,7 +3152,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetNativeHandle( "urProgramGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramGetNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hProgram, phNativeProgram); @@ -3164,7 +3164,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urProgramGetNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3195,7 +3195,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( "urProgramCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramCreateWithNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram); @@ -3208,7 +3208,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urProgramCreateWithNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3234,7 +3234,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreate( "urKernelCreate", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelCreate\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelCreate\n"); ur_result_t result = pfnCreate(hProgram, pKernelName, phKernel); @@ -3245,7 +3245,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_CREATE, ¶ms); - URLOG_(logger, INFO, " <--- urKernelCreate({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urKernelCreate({}) -> {};\n", args_str.str(), result); } @@ -3278,7 +3278,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( UR_FUNCTION_KERNEL_SET_ARG_VALUE, "urKernelSetArgValue", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelSetArgValue\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelSetArgValue\n"); ur_result_t result = pfnSetArgValue(hKernel, argIndex, argSize, pProperties, pArgValue); @@ -3290,7 +3290,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_ARG_VALUE, ¶ms); - URLOG_(logger, INFO, " <--- urKernelSetArgValue({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urKernelSetArgValue({}) -> {};\n", args_str.str(), result); } @@ -3319,7 +3319,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( UR_FUNCTION_KERNEL_SET_ARG_LOCAL, "urKernelSetArgLocal", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelSetArgLocal\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelSetArgLocal\n"); ur_result_t result = pfnSetArgLocal(hKernel, argIndex, argSize, pProperties); @@ -3330,7 +3330,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_ARG_LOCAL, ¶ms); - URLOG_(logger, INFO, " <--- urKernelSetArgLocal({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urKernelSetArgLocal({}) -> {};\n", args_str.str(), result); } @@ -3367,7 +3367,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetInfo( "urKernelGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelGetInfo\n"); ur_result_t result = pfnGetInfo(hKernel, propName, propSize, pPropValue, pPropSizeRet); @@ -3379,7 +3379,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urKernelGetInfo({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urKernelGetInfo({}) -> {};\n", args_str.str(), result); } @@ -3414,7 +3414,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetGroupInfo( UR_FUNCTION_KERNEL_GET_GROUP_INFO, "urKernelGetGroupInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelGetGroupInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelGetGroupInfo\n"); ur_result_t result = pfnGetGroupInfo(hKernel, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3426,7 +3426,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetGroupInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_GET_GROUP_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urKernelGetGroupInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urKernelGetGroupInfo({}) -> {};\n", args_str.str(), result); } @@ -3462,7 +3462,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSubGroupInfo( "urKernelGetSubGroupInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelGetSubGroupInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelGetSubGroupInfo\n"); ur_result_t result = pfnGetSubGroupInfo(hKernel, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3475,7 +3475,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSubGroupInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_SUB_GROUP_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urKernelGetSubGroupInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urKernelGetSubGroupInfo({}) -> {};\n", args_str.str(), result); } @@ -3497,7 +3497,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( "urKernelRetain", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelRetain\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelRetain\n"); ur_result_t result = pfnRetain(hKernel); @@ -3508,7 +3508,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_RETAIN, ¶ms); - URLOG_(logger, INFO, " <--- urKernelRetain({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urKernelRetain({}) -> {};\n", args_str.str(), result); } @@ -3530,7 +3530,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRelease( "urKernelRelease", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelRelease\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelRelease\n"); ur_result_t result = pfnRelease(hKernel); @@ -3541,7 +3541,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_RELEASE, ¶ms); - URLOG_(logger, INFO, " <--- urKernelRelease({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urKernelRelease({}) -> {};\n", args_str.str(), result); } @@ -3571,7 +3571,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( UR_FUNCTION_KERNEL_SET_ARG_POINTER, "urKernelSetArgPointer", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelSetArgPointer\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelSetArgPointer\n"); ur_result_t result = pfnSetArgPointer(hKernel, argIndex, pProperties, pArgValue); @@ -3583,7 +3583,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_POINTER, ¶ms); - URLOG_(logger, INFO, " <--- urKernelSetArgPointer({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urKernelSetArgPointer({}) -> {};\n", args_str.str(), result); } @@ -3615,7 +3615,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetExecInfo( UR_FUNCTION_KERNEL_SET_EXEC_INFO, "urKernelSetExecInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelSetExecInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelSetExecInfo\n"); ur_result_t result = pfnSetExecInfo(hKernel, propName, propSize, pProperties, pPropValue); @@ -3627,7 +3627,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetExecInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_EXEC_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urKernelSetExecInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urKernelSetExecInfo({}) -> {};\n", args_str.str(), result); } @@ -3656,7 +3656,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( UR_FUNCTION_KERNEL_SET_ARG_SAMPLER, "urKernelSetArgSampler", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelSetArgSampler\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelSetArgSampler\n"); ur_result_t result = pfnSetArgSampler(hKernel, argIndex, pProperties, hArgValue); @@ -3668,7 +3668,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_SAMPLER, ¶ms); - URLOG_(logger, INFO, " <--- urKernelSetArgSampler({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urKernelSetArgSampler({}) -> {};\n", args_str.str(), result); } @@ -3697,7 +3697,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, "urKernelSetArgMemObj", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelSetArgMemObj\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelSetArgMemObj\n"); ur_result_t result = pfnSetArgMemObj(hKernel, argIndex, pProperties, hArgValue); @@ -3709,7 +3709,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, ¶ms); - URLOG_(logger, INFO, " <--- urKernelSetArgMemObj({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urKernelSetArgMemObj({}) -> {};\n", args_str.str(), result); } @@ -3738,7 +3738,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetSpecializationConstants( "urKernelSetSpecializationConstants", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelSetSpecializationConstants\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelSetSpecializationConstants\n"); ur_result_t result = pfnSetSpecializationConstants(hKernel, count, pSpecConstants); @@ -3751,7 +3751,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetSpecializationConstants( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_SPECIALIZATION_CONSTANTS, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urKernelSetSpecializationConstants({}) -> {};\n", args_str.str(), result); } @@ -3776,7 +3776,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetNativeHandle( UR_FUNCTION_KERNEL_GET_NATIVE_HANDLE, "urKernelGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelGetNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hKernel, phNativeKernel); @@ -3788,7 +3788,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urKernelGetNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urKernelGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3821,7 +3821,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreateWithNativeHandle( "urKernelCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelCreateWithNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle( hNativeKernel, hContext, hProgram, pProperties, phKernel); @@ -3834,7 +3834,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_CREATE_WITH_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urKernelCreateWithNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urKernelCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3875,7 +3875,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize( "urKernelGetSuggestedLocalWorkSize", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelGetSuggestedLocalWorkSize\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelGetSuggestedLocalWorkSize\n"); ur_result_t result = pfnGetSuggestedLocalWorkSize( hKernel, hQueue, numWorkDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -3889,7 +3889,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_SUGGESTED_LOCAL_WORK_SIZE, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urKernelGetSuggestedLocalWorkSize({}) -> {};\n", args_str.str(), result); } @@ -3922,7 +3922,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetInfo( "urQueueGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urQueueGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urQueueGetInfo\n"); ur_result_t result = pfnGetInfo(hQueue, propName, propSize, pPropValue, pPropSizeRet); @@ -3934,7 +3934,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urQueueGetInfo({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urQueueGetInfo({}) -> {};\n", args_str.str(), result); } @@ -3963,7 +3963,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreate( "urQueueCreate", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urQueueCreate\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urQueueCreate\n"); ur_result_t result = pfnCreate(hContext, hDevice, pProperties, phQueue); @@ -3974,7 +3974,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_CREATE, ¶ms); - URLOG_(logger, INFO, " <--- urQueueCreate({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urQueueCreate({}) -> {};\n", args_str.str(), result); } @@ -3996,7 +3996,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain( "urQueueRetain", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urQueueRetain\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urQueueRetain\n"); ur_result_t result = pfnRetain(hQueue); @@ -4007,7 +4007,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_RETAIN, ¶ms); - URLOG_(logger, INFO, " <--- urQueueRetain({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urQueueRetain({}) -> {};\n", args_str.str(), result); } @@ -4029,7 +4029,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRelease( "urQueueRelease", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urQueueRelease\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urQueueRelease\n"); ur_result_t result = pfnRelease(hQueue); @@ -4040,7 +4040,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_RELEASE, ¶ms); - URLOG_(logger, INFO, " <--- urQueueRelease({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urQueueRelease({}) -> {};\n", args_str.str(), result); } @@ -4067,7 +4067,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetNativeHandle( UR_FUNCTION_QUEUE_GET_NATIVE_HANDLE, "urQueueGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urQueueGetNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urQueueGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hQueue, pDesc, phNativeQueue); @@ -4079,7 +4079,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_QUEUE_GET_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urQueueGetNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urQueueGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4112,7 +4112,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreateWithNativeHandle( "urQueueCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urQueueCreateWithNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urQueueCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeQueue, hContext, hDevice, pProperties, phQueue); @@ -4125,7 +4125,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_QUEUE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urQueueCreateWithNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urQueueCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4147,7 +4147,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFinish( "urQueueFinish", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urQueueFinish\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urQueueFinish\n"); ur_result_t result = pfnFinish(hQueue); @@ -4158,7 +4158,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFinish( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_FINISH, ¶ms); - URLOG_(logger, INFO, " <--- urQueueFinish({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urQueueFinish({}) -> {};\n", args_str.str(), result); } @@ -4180,7 +4180,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFlush( "urQueueFlush", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urQueueFlush\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urQueueFlush\n"); ur_result_t result = pfnFlush(hQueue); @@ -4190,7 +4190,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFlush( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_FLUSH, ¶ms); - URLOG_(logger, INFO, " <--- urQueueFlush({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urQueueFlush({}) -> {};\n", args_str.str(), result); } @@ -4222,7 +4222,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetInfo( "urEventGetInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEventGetInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEventGetInfo\n"); ur_result_t result = pfnGetInfo(hEvent, propName, propSize, pPropValue, pPropSizeRet); @@ -4234,7 +4234,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_GET_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urEventGetInfo({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urEventGetInfo({}) -> {};\n", args_str.str(), result); } @@ -4267,7 +4267,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetProfilingInfo( UR_FUNCTION_EVENT_GET_PROFILING_INFO, "urEventGetProfilingInfo", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEventGetProfilingInfo\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEventGetProfilingInfo\n"); ur_result_t result = pfnGetProfilingInfo(hEvent, propName, propSize, pPropValue, pPropSizeRet); @@ -4280,7 +4280,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetProfilingInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_GET_PROFILING_INFO, ¶ms); - URLOG_(logger, INFO, " <--- urEventGetProfilingInfo({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEventGetProfilingInfo({}) -> {};\n", args_str.str(), result); } @@ -4305,7 +4305,7 @@ __urdlllocal ur_result_t UR_APICALL urEventWait( "urEventWait", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEventWait\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEventWait\n"); ur_result_t result = pfnWait(numEvents, phEventWaitList); @@ -4315,7 +4315,7 @@ __urdlllocal ur_result_t UR_APICALL urEventWait( if (logger.getLevel() <= logger::Level::INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_WAIT, ¶ms); - URLOG_(logger, INFO, " <--- urEventWait({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urEventWait({}) -> {};\n", args_str.str(), result); } @@ -4337,7 +4337,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain( "urEventRetain", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEventRetain\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEventRetain\n"); ur_result_t result = pfnRetain(hEvent); @@ -4348,7 +4348,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_RETAIN, ¶ms); - URLOG_(logger, INFO, " <--- urEventRetain({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urEventRetain({}) -> {};\n", args_str.str(), result); } @@ -4370,7 +4370,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRelease( "urEventRelease", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEventRelease\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEventRelease\n"); ur_result_t result = pfnRelease(hEvent); @@ -4381,7 +4381,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_RELEASE, ¶ms); - URLOG_(logger, INFO, " <--- urEventRelease({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urEventRelease({}) -> {};\n", args_str.str(), result); } @@ -4405,7 +4405,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetNativeHandle( UR_FUNCTION_EVENT_GET_NATIVE_HANDLE, "urEventGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEventGetNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEventGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hEvent, phNativeEvent); @@ -4417,7 +4417,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_GET_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urEventGetNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEventGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4448,7 +4448,7 @@ __urdlllocal ur_result_t UR_APICALL urEventCreateWithNativeHandle( "urEventCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEventCreateWithNativeHandle\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEventCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeEvent, hContext, pProperties, phEvent); @@ -4461,7 +4461,7 @@ __urdlllocal ur_result_t UR_APICALL urEventCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_CREATE_WITH_NATIVE_HANDLE, ¶ms); - URLOG_(logger, INFO, " <--- urEventCreateWithNativeHandle({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEventCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4490,7 +4490,7 @@ __urdlllocal ur_result_t UR_APICALL urEventSetCallback( "urEventSetCallback", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEventSetCallback\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEventSetCallback\n"); ur_result_t result = pfnSetCallback(hEvent, execStatus, pfnNotify, pUserData); @@ -4501,7 +4501,7 @@ __urdlllocal ur_result_t UR_APICALL urEventSetCallback( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_SET_CALLBACK, ¶ms); - URLOG_(logger, INFO, " <--- urEventSetCallback({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEventSetCallback({}) -> {};\n", args_str.str(), result); } @@ -4560,7 +4560,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH, "urEnqueueKernelLaunch", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueKernelLaunch\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueKernelLaunch\n"); ur_result_t result = pfnKernelLaunch( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -4573,7 +4573,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueKernelLaunch({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueKernelLaunch({}) -> {};\n", args_str.str(), result); } @@ -4608,7 +4608,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWait( UR_FUNCTION_ENQUEUE_EVENTS_WAIT, "urEnqueueEventsWait", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueEventsWait\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueEventsWait\n"); ur_result_t result = pfnEventsWait(hQueue, numEventsInWaitList, phEventWaitList, phEvent); @@ -4620,7 +4620,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWait( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueEventsWait({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueEventsWait({}) -> {};\n", args_str.str(), result); } @@ -4657,7 +4657,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( "urEnqueueEventsWaitWithBarrier", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueEventsWaitWithBarrier\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueEventsWaitWithBarrier\n"); ur_result_t result = pfnEventsWaitWithBarrier(hQueue, numEventsInWaitList, phEventWaitList, phEvent); @@ -4670,7 +4670,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueEventsWaitWithBarrier({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueEventsWaitWithBarrier({}) -> {};\n", args_str.str(), result); } @@ -4716,7 +4716,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ, "urEnqueueMemBufferRead", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemBufferRead\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemBufferRead\n"); ur_result_t result = pfnMemBufferRead(hQueue, hBuffer, blockingRead, offset, size, pDst, @@ -4730,7 +4730,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemBufferRead({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemBufferRead({}) -> {};\n", args_str.str(), result); } @@ -4776,7 +4776,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE, "urEnqueueMemBufferWrite", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemBufferWrite\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemBufferWrite\n"); ur_result_t result = pfnMemBufferWrite(hQueue, hBuffer, blockingWrite, offset, size, pSrc, @@ -4790,7 +4790,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemBufferWrite({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemBufferWrite({}) -> {};\n", args_str.str(), result); } @@ -4851,7 +4851,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( "urEnqueueMemBufferReadRect", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemBufferReadRect\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemBufferReadRect\n"); ur_result_t result = pfnMemBufferReadRect( hQueue, hBuffer, blockingRead, bufferOrigin, hostOrigin, region, @@ -4866,7 +4866,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ_RECT, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemBufferReadRect({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemBufferReadRect({}) -> {};\n", args_str.str(), result); } @@ -4928,7 +4928,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( "urEnqueueMemBufferWriteRect", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemBufferWriteRect\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemBufferWriteRect\n"); ur_result_t result = pfnMemBufferWriteRect( hQueue, hBuffer, blockingWrite, bufferOrigin, hostOrigin, region, @@ -4943,7 +4943,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE_RECT, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemBufferWriteRect({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemBufferWriteRect({}) -> {};\n", args_str.str(), result); } @@ -4988,7 +4988,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY, "urEnqueueMemBufferCopy", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemBufferCopy\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemBufferCopy\n"); ur_result_t result = pfnMemBufferCopy(hQueue, hBufferSrc, hBufferDst, srcOffset, dstOffset, @@ -5002,7 +5002,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemBufferCopy({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemBufferCopy({}) -> {};\n", args_str.str(), result); } @@ -5059,7 +5059,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( "urEnqueueMemBufferCopyRect", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemBufferCopyRect\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemBufferCopyRect\n"); ur_result_t result = pfnMemBufferCopyRect( hQueue, hBufferSrc, hBufferDst, srcOrigin, dstOrigin, region, srcRowPitch, @@ -5074,7 +5074,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY_RECT, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemBufferCopyRect({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemBufferCopyRect({}) -> {};\n", args_str.str(), result); } @@ -5125,7 +5125,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( UR_FUNCTION_ENQUEUE_MEM_BUFFER_FILL, "urEnqueueMemBufferFill", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemBufferFill\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemBufferFill\n"); ur_result_t result = pfnMemBufferFill(hQueue, hBuffer, pPattern, patternSize, offset, size, @@ -5139,7 +5139,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_FILL, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemBufferFill({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemBufferFill({}) -> {};\n", args_str.str(), result); } @@ -5191,7 +5191,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageRead( UR_FUNCTION_ENQUEUE_MEM_IMAGE_READ, "urEnqueueMemImageRead", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemImageRead\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemImageRead\n"); ur_result_t result = pfnMemImageRead( hQueue, hImage, blockingRead, origin, region, rowPitch, slicePitch, pDst, @@ -5204,7 +5204,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_READ, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemImageRead({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemImageRead({}) -> {};\n", args_str.str(), result); } @@ -5256,7 +5256,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageWrite( UR_FUNCTION_ENQUEUE_MEM_IMAGE_WRITE, "urEnqueueMemImageWrite", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemImageWrite\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemImageWrite\n"); ur_result_t result = pfnMemImageWrite( hQueue, hImage, blockingWrite, origin, region, rowPitch, slicePitch, pSrc, @@ -5270,7 +5270,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_WRITE, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemImageWrite({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemImageWrite({}) -> {};\n", args_str.str(), result); } @@ -5318,7 +5318,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageCopy( UR_FUNCTION_ENQUEUE_MEM_IMAGE_COPY, "urEnqueueMemImageCopy", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemImageCopy\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemImageCopy\n"); ur_result_t result = pfnMemImageCopy(hQueue, hImageSrc, hImageDst, srcOrigin, dstOrigin, @@ -5331,7 +5331,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageCopy( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_COPY, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemImageCopy({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemImageCopy({}) -> {};\n", args_str.str(), result); } @@ -5380,7 +5380,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( UR_FUNCTION_ENQUEUE_MEM_BUFFER_MAP, "urEnqueueMemBufferMap", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemBufferMap\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemBufferMap\n"); ur_result_t result = pfnMemBufferMap(hQueue, hBuffer, blockingMap, mapFlags, offset, size, @@ -5393,7 +5393,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_MAP, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemBufferMap({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemBufferMap({}) -> {};\n", args_str.str(), result); } @@ -5432,7 +5432,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( "urEnqueueMemUnmap", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueMemUnmap\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueMemUnmap\n"); ur_result_t result = pfnMemUnmap( hQueue, hMem, pMappedPtr, numEventsInWaitList, phEventWaitList, phEvent); @@ -5444,7 +5444,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_MEM_UNMAP, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueMemUnmap({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueMemUnmap({}) -> {};\n", args_str.str(), result); } @@ -5489,7 +5489,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill( "urEnqueueUSMFill", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueUSMFill\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueUSMFill\n"); ur_result_t result = pfnUSMFill(hQueue, pMem, patternSize, pPattern, size, numEventsInWaitList, @@ -5502,7 +5502,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FILL, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueUSMFill({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueUSMFill({}) -> {};\n", args_str.str(), result); } @@ -5545,7 +5545,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy( "urEnqueueUSMMemcpy", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueUSMMemcpy\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueUSMMemcpy\n"); ur_result_t result = pfnUSMMemcpy(hQueue, blocking, pDst, pSrc, size, numEventsInWaitList, @@ -5558,7 +5558,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_MEMCPY, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueUSMMemcpy({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueUSMMemcpy({}) -> {};\n", args_str.str(), result); } @@ -5599,7 +5599,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMPrefetch( UR_FUNCTION_ENQUEUE_USM_PREFETCH, "urEnqueueUSMPrefetch", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueUSMPrefetch\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueUSMPrefetch\n"); ur_result_t result = pfnUSMPrefetch( hQueue, pMem, size, flags, numEventsInWaitList, phEventWaitList, phEvent); @@ -5611,7 +5611,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMPrefetch( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_PREFETCH, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueUSMPrefetch({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueUSMPrefetch({}) -> {};\n", args_str.str(), result); } @@ -5643,7 +5643,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMAdvise( "urEnqueueUSMAdvise", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueUSMAdvise\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueUSMAdvise\n"); ur_result_t result = pfnUSMAdvise(hQueue, pMem, size, advice, phEvent); @@ -5654,7 +5654,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMAdvise( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_ADVISE, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueUSMAdvise({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueUSMAdvise({}) -> {};\n", args_str.str(), result); } @@ -5705,7 +5705,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill2D( UR_FUNCTION_ENQUEUE_USM_FILL_2D, "urEnqueueUSMFill2D", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueUSMFill2D\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueUSMFill2D\n"); ur_result_t result = pfnUSMFill2D(hQueue, pMem, pitch, patternSize, pPattern, width, height, @@ -5718,7 +5718,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill2D( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FILL_2D, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueUSMFill2D({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueUSMFill2D({}) -> {};\n", args_str.str(), result); } @@ -5771,7 +5771,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( UR_FUNCTION_ENQUEUE_USM_MEMCPY_2D, "urEnqueueUSMMemcpy2D", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueUSMMemcpy2D\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueUSMMemcpy2D\n"); ur_result_t result = pfnUSMMemcpy2D(hQueue, blocking, pDst, dstPitch, pSrc, srcPitch, width, @@ -5784,7 +5784,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_MEMCPY_2D, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueUSMMemcpy2D({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueUSMMemcpy2D({}) -> {};\n", args_str.str(), result); } @@ -5835,7 +5835,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( "urEnqueueDeviceGlobalVariableWrite", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueDeviceGlobalVariableWrite\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueDeviceGlobalVariableWrite\n"); ur_result_t result = pfnDeviceGlobalVariableWrite( hQueue, hProgram, name, blockingWrite, count, offset, pSrc, @@ -5849,7 +5849,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_DEVICE_GLOBAL_VARIABLE_WRITE, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueDeviceGlobalVariableWrite({}) -> {};\n", args_str.str(), result); } @@ -5901,7 +5901,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( "urEnqueueDeviceGlobalVariableRead", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueDeviceGlobalVariableRead\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueDeviceGlobalVariableRead\n"); ur_result_t result = pfnDeviceGlobalVariableRead( hQueue, hProgram, name, blockingRead, count, offset, pDst, @@ -5915,7 +5915,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_DEVICE_GLOBAL_VARIABLE_READ, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueDeviceGlobalVariableRead({}) -> {};\n", args_str.str(), result); } @@ -5967,7 +5967,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueReadHostPipe( UR_FUNCTION_ENQUEUE_READ_HOST_PIPE, "urEnqueueReadHostPipe", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueReadHostPipe\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueReadHostPipe\n"); ur_result_t result = pfnReadHostPipe(hQueue, hProgram, pipe_symbol, blocking, pDst, size, @@ -5980,7 +5980,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueReadHostPipe( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_READ_HOST_PIPE, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueReadHostPipe({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueReadHostPipe({}) -> {};\n", args_str.str(), result); } @@ -6032,7 +6032,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueWriteHostPipe( UR_FUNCTION_ENQUEUE_WRITE_HOST_PIPE, "urEnqueueWriteHostPipe", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueWriteHostPipe\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueWriteHostPipe\n"); ur_result_t result = pfnWriteHostPipe(hQueue, hProgram, pipe_symbol, blocking, pSrc, size, @@ -6046,7 +6046,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueWriteHostPipe( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_WRITE_HOST_PIPE, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueWriteHostPipe({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueWriteHostPipe({}) -> {};\n", args_str.str(), result); } @@ -6089,7 +6089,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMDeviceAllocExp( "urEnqueueUSMDeviceAllocExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueUSMDeviceAllocExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueUSMDeviceAllocExp\n"); ur_result_t result = pfnUSMDeviceAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6103,7 +6103,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMDeviceAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_DEVICE_ALLOC_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueUSMDeviceAllocExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueUSMDeviceAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6146,7 +6146,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMSharedAllocExp( "urEnqueueUSMSharedAllocExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueUSMSharedAllocExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueUSMSharedAllocExp\n"); ur_result_t result = pfnUSMSharedAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6160,7 +6160,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMSharedAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_SHARED_ALLOC_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueUSMSharedAllocExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueUSMSharedAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6203,7 +6203,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMHostAllocExp( "urEnqueueUSMHostAllocExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueUSMHostAllocExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueUSMHostAllocExp\n"); ur_result_t result = pfnUSMHostAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6217,7 +6217,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMHostAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_HOST_ALLOC_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueUSMHostAllocExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueUSMHostAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6253,7 +6253,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFreeExp( UR_FUNCTION_ENQUEUE_USM_FREE_EXP, "urEnqueueUSMFreeExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueUSMFreeExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueUSMFreeExp\n"); ur_result_t result = pfnUSMFreeExp(hQueue, pPool, pMem, numEventsInWaitList, phEventWaitList, phEvent); @@ -6265,7 +6265,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FREE_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueUSMFreeExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueUSMFreeExp({}) -> {};\n", args_str.str(), result); } @@ -6295,7 +6295,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreateExp( UR_FUNCTION_USM_POOL_CREATE_EXP, "urUSMPoolCreateExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolCreateExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolCreateExp\n"); ur_result_t result = pfnPoolCreateExp(hContext, hDevice, pPoolDesc, pPool); @@ -6306,7 +6306,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreateExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_CREATE_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolCreateExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolCreateExp({}) -> {};\n", args_str.str(), result); } @@ -6332,7 +6332,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( UR_FUNCTION_USM_POOL_DESTROY_EXP, "urUSMPoolDestroyExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolDestroyExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolDestroyExp\n"); ur_result_t result = pfnPoolDestroyExp(hContext, hDevice, hPool); @@ -6343,7 +6343,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_DESTROY_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolDestroyExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolDestroyExp({}) -> {};\n", args_str.str(), result); } @@ -6372,7 +6372,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( "urUSMPoolGetDefaultDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolGetDefaultDevicePoolExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolGetDefaultDevicePoolExp\n"); ur_result_t result = pfnPoolGetDefaultDevicePoolExp(hContext, hDevice, pPool); @@ -6384,7 +6384,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_GET_DEFAULT_DEVICE_POOL_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolGetDefaultDevicePoolExp({}) -> {};\n", args_str.str(), result); } @@ -6414,7 +6414,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( UR_FUNCTION_USM_POOL_GET_INFO_EXP, "urUSMPoolGetInfoExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolGetInfoExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolGetInfoExp\n"); ur_result_t result = pfnPoolGetInfoExp(hPool, propName, pPropValue, pPropSizeRet); @@ -6426,7 +6426,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_GET_INFO_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolGetInfoExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -6455,7 +6455,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetInfoExp( UR_FUNCTION_USM_POOL_SET_INFO_EXP, "urUSMPoolSetInfoExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolSetInfoExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolSetInfoExp\n"); ur_result_t result = pfnPoolSetInfoExp(hPool, propName, pPropValue, propSize); @@ -6466,7 +6466,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_SET_INFO_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolSetInfoExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolSetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -6495,7 +6495,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( "urUSMPoolSetDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolSetDevicePoolExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolSetDevicePoolExp\n"); ur_result_t result = pfnPoolSetDevicePoolExp(hContext, hDevice, hPool); @@ -6507,7 +6507,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_SET_DEVICE_POOL_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolSetDevicePoolExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolSetDevicePoolExp({}) -> {};\n", args_str.str(), result); } @@ -6536,7 +6536,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp( "urUSMPoolGetDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolGetDevicePoolExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolGetDevicePoolExp\n"); ur_result_t result = pfnPoolGetDevicePoolExp(hContext, hDevice, pPool); @@ -6548,7 +6548,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_GET_DEVICE_POOL_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolGetDevicePoolExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolGetDevicePoolExp({}) -> {};\n", args_str.str(), result); } @@ -6577,7 +6577,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolTrimToExp( UR_FUNCTION_USM_POOL_TRIM_TO_EXP, "urUSMPoolTrimToExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPoolTrimToExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPoolTrimToExp\n"); ur_result_t result = pfnPoolTrimToExp(hContext, hDevice, hPool, minBytesToKeep); @@ -6589,7 +6589,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolTrimToExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_TRIM_TO_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPoolTrimToExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPoolTrimToExp({}) -> {};\n", args_str.str(), result); } @@ -6629,7 +6629,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( UR_FUNCTION_USM_PITCHED_ALLOC_EXP, "urUSMPitchedAllocExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMPitchedAllocExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMPitchedAllocExp\n"); ur_result_t result = pfnPitchedAllocExp(hContext, hDevice, pUSMDesc, pool, widthInBytes, @@ -6642,7 +6642,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_PITCHED_ALLOC_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUSMPitchedAllocExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUSMPitchedAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6673,7 +6673,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp( "urBindlessImagesUnsampledImageHandleDestroyExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesUnsampledImageHandleDestroyExp\n"); ur_result_t result = @@ -6690,7 +6690,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp( args_str, UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_HANDLE_DESTROY_EXP, ¶ms); - URLOG_( + UR_LOG_LOGGER( logger, INFO, " <--- urBindlessImagesUnsampledImageHandleDestroyExp({}) -> {};\n", args_str.str(), result); @@ -6723,7 +6723,7 @@ urBindlessImagesSampledImageHandleDestroyExp( "urBindlessImagesSampledImageHandleDestroyExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesSampledImageHandleDestroyExp\n"); ur_result_t result = @@ -6739,7 +6739,7 @@ urBindlessImagesSampledImageHandleDestroyExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_HANDLE_DESTROY_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesSampledImageHandleDestroyExp({}) -> {};\n", args_str.str(), result); } @@ -6773,7 +6773,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( "urBindlessImagesImageAllocateExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesImageAllocateExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesImageAllocateExp\n"); ur_result_t result = pfnImageAllocateExp(hContext, hDevice, pImageFormat, pImageDesc, phImageMem); @@ -6786,7 +6786,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_ALLOCATE_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesImageAllocateExp({}) -> {};\n", args_str.str(), result); } @@ -6816,7 +6816,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( "urBindlessImagesImageFreeExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesImageFreeExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesImageFreeExp\n"); ur_result_t result = pfnImageFreeExp(hContext, hDevice, hImageMem); @@ -6828,7 +6828,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_FREE_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urBindlessImagesImageFreeExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesImageFreeExp({}) -> {};\n", args_str.str(), result); } @@ -6863,7 +6863,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( "urBindlessImagesUnsampledImageCreateExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesUnsampledImageCreateExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesUnsampledImageCreateExp\n"); ur_result_t result = pfnUnsampledImageCreateExp( hContext, hDevice, hImageMem, pImageFormat, pImageDesc, phImage); @@ -6877,7 +6877,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_CREATE_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesUnsampledImageCreateExp({}) -> {};\n", args_str.str(), result); } @@ -6916,7 +6916,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( "urBindlessImagesSampledImageCreateExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesSampledImageCreateExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesSampledImageCreateExp\n"); ur_result_t result = pfnSampledImageCreateExp(hContext, hDevice, hImageMem, pImageFormat, @@ -6931,7 +6931,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_CREATE_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesSampledImageCreateExp({}) -> {};\n", args_str.str(), result); } @@ -6996,7 +6996,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( "urBindlessImagesImageCopyExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesImageCopyExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesImageCopyExp\n"); ur_result_t result = pfnImageCopyExp( hQueue, pSrc, pDst, pSrcImageDesc, pDstImageDesc, pSrcImageFormat, @@ -7011,7 +7011,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_COPY_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urBindlessImagesImageCopyExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesImageCopyExp({}) -> {};\n", args_str.str(), result); } @@ -7044,7 +7044,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( "urBindlessImagesImageGetInfoExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesImageGetInfoExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesImageGetInfoExp\n"); ur_result_t result = pfnImageGetInfoExp(hContext, hImageMem, propName, pPropValue, pPropSizeRet); @@ -7057,7 +7057,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_GET_INFO_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urBindlessImagesImageGetInfoExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesImageGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -7090,7 +7090,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( "urBindlessImagesMipmapGetLevelExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesMipmapGetLevelExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesMipmapGetLevelExp\n"); ur_result_t result = pfnMipmapGetLevelExp(hContext, hDevice, hImageMem, mipmapLevel, phImageMem); @@ -7103,7 +7103,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_GET_LEVEL_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesMipmapGetLevelExp({}) -> {};\n", args_str.str(), result); } @@ -7133,7 +7133,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( "urBindlessImagesMipmapFreeExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesMipmapFreeExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesMipmapFreeExp\n"); ur_result_t result = pfnMipmapFreeExp(hContext, hDevice, hMem); @@ -7145,7 +7145,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_FREE_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urBindlessImagesMipmapFreeExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesMipmapFreeExp({}) -> {};\n", args_str.str(), result); } @@ -7181,7 +7181,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalMemoryExp( "urBindlessImagesImportExternalMemoryExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesImportExternalMemoryExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesImportExternalMemoryExp\n"); ur_result_t result = pfnImportExternalMemoryExp( hContext, hDevice, size, memHandleType, pExternalMemDesc, phExternalMem); @@ -7195,7 +7195,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_MEMORY_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesImportExternalMemoryExp({}) -> {};\n", args_str.str(), result); } @@ -7232,7 +7232,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( "urBindlessImagesMapExternalArrayExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesMapExternalArrayExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesMapExternalArrayExp\n"); ur_result_t result = pfnMapExternalArrayExp( hContext, hDevice, pImageFormat, pImageDesc, hExternalMem, phImageMem); @@ -7245,7 +7245,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_ARRAY_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesMapExternalArrayExp({}) -> {};\n", args_str.str(), result); } @@ -7281,7 +7281,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalLinearMemoryExp( "urBindlessImagesMapExternalLinearMemoryExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesMapExternalLinearMemoryExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesMapExternalLinearMemoryExp\n"); ur_result_t result = pfnMapExternalLinearMemoryExp( hContext, hDevice, offset, size, hExternalMem, ppRetMem); @@ -7295,7 +7295,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalLinearMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesMapExternalLinearMemoryExp({}) -> {};\n", args_str.str(), result); } @@ -7325,7 +7325,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalMemoryExp( "urBindlessImagesReleaseExternalMemoryExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesReleaseExternalMemoryExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesReleaseExternalMemoryExp\n"); ur_result_t result = pfnReleaseExternalMemoryExp(hContext, hDevice, hExternalMem); @@ -7339,7 +7339,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_RELEASE_EXTERNAL_MEMORY_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesReleaseExternalMemoryExp({}) -> {};\n", args_str.str(), result); } @@ -7374,7 +7374,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreExp( "urBindlessImagesImportExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesImportExternalSemaphoreExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesImportExternalSemaphoreExp\n"); ur_result_t result = pfnImportExternalSemaphoreExp( hContext, hDevice, semHandleType, pExternalSemaphoreDesc, @@ -7389,7 +7389,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_SEMAPHORE_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesImportExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7419,7 +7419,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalSemaphoreExp( "urBindlessImagesReleaseExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesReleaseExternalSemaphoreExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesReleaseExternalSemaphoreExp\n"); ur_result_t result = pfnReleaseExternalSemaphoreExp(hContext, hDevice, hExternalSemaphore); @@ -7434,7 +7434,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_RELEASE_EXTERNAL_SEMAPHORE_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesReleaseExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7483,7 +7483,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesWaitExternalSemaphoreExp( "urBindlessImagesWaitExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesWaitExternalSemaphoreExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesWaitExternalSemaphoreExp\n"); ur_result_t result = pfnWaitExternalSemaphoreExp( hQueue, hSemaphore, hasWaitValue, waitValue, numEventsInWaitList, @@ -7498,7 +7498,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesWaitExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_WAIT_EXTERNAL_SEMAPHORE_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesWaitExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7547,7 +7547,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSignalExternalSemaphoreExp( "urBindlessImagesSignalExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urBindlessImagesSignalExternalSemaphoreExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urBindlessImagesSignalExternalSemaphoreExp\n"); ur_result_t result = pfnSignalExternalSemaphoreExp( hQueue, hSemaphore, hasSignalValue, signalValue, numEventsInWaitList, @@ -7562,7 +7562,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSignalExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_SIGNAL_EXTERNAL_SEMAPHORE_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urBindlessImagesSignalExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7593,7 +7593,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferCreateExp( "urCommandBufferCreateExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferCreateExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferCreateExp\n"); ur_result_t result = pfnCreateExp(hContext, hDevice, pCommandBufferDesc, phCommandBuffer); @@ -7606,7 +7606,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferCreateExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_CREATE_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urCommandBufferCreateExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferCreateExp({}) -> {};\n", args_str.str(), result); } @@ -7629,7 +7629,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainExp( "urCommandBufferRetainExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferRetainExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferRetainExp\n"); ur_result_t result = pfnRetainExp(hCommandBuffer); @@ -7641,7 +7641,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_RETAIN_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urCommandBufferRetainExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferRetainExp({}) -> {};\n", args_str.str(), result); } @@ -7664,7 +7664,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferReleaseExp( "urCommandBufferReleaseExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferReleaseExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferReleaseExp\n"); ur_result_t result = pfnReleaseExp(hCommandBuffer); @@ -7676,7 +7676,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferReleaseExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_RELEASE_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urCommandBufferReleaseExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferReleaseExp({}) -> {};\n", args_str.str(), result); } @@ -7700,7 +7700,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferFinalizeExp( "urCommandBufferFinalizeExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferFinalizeExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferFinalizeExp\n"); ur_result_t result = pfnFinalizeExp(hCommandBuffer); @@ -7712,7 +7712,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferFinalizeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_FINALIZE_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urCommandBufferFinalizeExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferFinalizeExp({}) -> {};\n", args_str.str(), result); } @@ -7792,7 +7792,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( "urCommandBufferAppendKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendKernelLaunchExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendKernelLaunchExp\n"); ur_result_t result = pfnAppendKernelLaunchExp( hCommandBuffer, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -7808,7 +7808,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_KERNEL_LAUNCH_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendKernelLaunchExp({}) -> {};\n", args_str.str(), result); } @@ -7869,7 +7869,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp( "urCommandBufferAppendUSMMemcpyExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendUSMMemcpyExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendUSMMemcpyExp\n"); ur_result_t result = pfnAppendUSMMemcpyExp( hCommandBuffer, pDst, pSrc, size, numSyncPointsInWaitList, @@ -7884,7 +7884,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_MEMCPY_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendUSMMemcpyExp({}) -> {};\n", args_str.str(), result); } @@ -7948,7 +7948,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMFillExp( "urCommandBufferAppendUSMFillExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendUSMFillExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendUSMFillExp\n"); ur_result_t result = pfnAppendUSMFillExp( hCommandBuffer, pMemory, pPattern, patternSize, size, @@ -7963,7 +7963,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMFillExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_FILL_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urCommandBufferAppendUSMFillExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendUSMFillExp({}) -> {};\n", args_str.str(), result); } @@ -8029,7 +8029,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp( "urCommandBufferAppendMemBufferCopyExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferCopyExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendMemBufferCopyExp\n"); ur_result_t result = pfnAppendMemBufferCopyExp( hCommandBuffer, hSrcMem, hDstMem, srcOffset, dstOffset, size, @@ -8045,7 +8045,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_COPY_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendMemBufferCopyExp({}) -> {};\n", args_str.str(), result); } @@ -8109,7 +8109,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp( "urCommandBufferAppendMemBufferWriteExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferWriteExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendMemBufferWriteExp\n"); ur_result_t result = pfnAppendMemBufferWriteExp( hCommandBuffer, hBuffer, offset, size, pSrc, numSyncPointsInWaitList, @@ -8125,7 +8125,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_WRITE_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendMemBufferWriteExp({}) -> {};\n", args_str.str(), result); } @@ -8189,7 +8189,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp( "urCommandBufferAppendMemBufferReadExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferReadExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendMemBufferReadExp\n"); ur_result_t result = pfnAppendMemBufferReadExp( hCommandBuffer, hBuffer, offset, size, pDst, numSyncPointsInWaitList, @@ -8205,7 +8205,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_READ_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendMemBufferReadExp({}) -> {};\n", args_str.str(), result); } @@ -8284,7 +8284,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp( "urCommandBufferAppendMemBufferCopyRectExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferCopyRectExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendMemBufferCopyRectExp\n"); ur_result_t result = pfnAppendMemBufferCopyRectExp( hCommandBuffer, hSrcMem, hDstMem, srcOrigin, dstOrigin, region, @@ -8301,7 +8301,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_COPY_RECT_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendMemBufferCopyRectExp({}) -> {};\n", args_str.str(), result); } @@ -8383,7 +8383,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp( "urCommandBufferAppendMemBufferWriteRectExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferWriteRectExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendMemBufferWriteRectExp\n"); ur_result_t result = pfnAppendMemBufferWriteRectExp( hCommandBuffer, hBuffer, bufferOffset, hostOffset, region, bufferRowPitch, @@ -8400,7 +8400,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_WRITE_RECT_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendMemBufferWriteRectExp({}) -> {};\n", args_str.str(), result); } @@ -8481,7 +8481,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp( "urCommandBufferAppendMemBufferReadRectExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferReadRectExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendMemBufferReadRectExp\n"); ur_result_t result = pfnAppendMemBufferReadRectExp( hCommandBuffer, hBuffer, bufferOffset, hostOffset, region, bufferRowPitch, @@ -8498,7 +8498,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_READ_RECT_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendMemBufferReadRectExp({}) -> {};\n", args_str.str(), result); } @@ -8565,7 +8565,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp( "urCommandBufferAppendMemBufferFillExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendMemBufferFillExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendMemBufferFillExp\n"); ur_result_t result = pfnAppendMemBufferFillExp( hCommandBuffer, hBuffer, pPattern, patternSize, offset, size, @@ -8581,7 +8581,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_FILL_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendMemBufferFillExp({}) -> {};\n", args_str.str(), result); } @@ -8642,7 +8642,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMPrefetchExp( "urCommandBufferAppendUSMPrefetchExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendUSMPrefetchExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendUSMPrefetchExp\n"); ur_result_t result = pfnAppendUSMPrefetchExp( hCommandBuffer, pMemory, size, flags, numSyncPointsInWaitList, @@ -8657,7 +8657,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMPrefetchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_PREFETCH_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendUSMPrefetchExp({}) -> {};\n", args_str.str(), result); } @@ -8718,7 +8718,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp( "urCommandBufferAppendUSMAdviseExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendUSMAdviseExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendUSMAdviseExp\n"); ur_result_t result = pfnAppendUSMAdviseExp( hCommandBuffer, pMemory, size, advice, numSyncPointsInWaitList, @@ -8733,7 +8733,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_ADVISE_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendUSMAdviseExp({}) -> {};\n", args_str.str(), result); } @@ -8779,7 +8779,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendNativeCommandExp( "urCommandBufferAppendNativeCommandExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferAppendNativeCommandExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferAppendNativeCommandExp\n"); ur_result_t result = pfnAppendNativeCommandExp( hCommandBuffer, pfnNativeCommand, pData, hChildCommandBuffer, @@ -8794,7 +8794,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendNativeCommandExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_NATIVE_COMMAND_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferAppendNativeCommandExp({}) -> {};\n", args_str.str(), result); } @@ -8835,7 +8835,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCommandBufferExp( "urEnqueueCommandBufferExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueCommandBufferExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueCommandBufferExp\n"); ur_result_t result = pfnCommandBufferExp( hQueue, hCommandBuffer, numEventsInWaitList, phEventWaitList, phEvent); @@ -8848,7 +8848,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCommandBufferExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueCommandBufferExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueCommandBufferExp({}) -> {};\n", args_str.str(), result); } @@ -8879,7 +8879,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp( "urCommandBufferUpdateKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferUpdateKernelLaunchExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferUpdateKernelLaunchExp\n"); ur_result_t result = pfnUpdateKernelLaunchExp( hCommandBuffer, numKernelUpdates, pUpdateKernelLaunch); @@ -8892,7 +8892,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_KERNEL_LAUNCH_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferUpdateKernelLaunchExp({}) -> {};\n", args_str.str(), result); } @@ -8920,7 +8920,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateSignalEventExp( "urCommandBufferUpdateSignalEventExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferUpdateSignalEventExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferUpdateSignalEventExp\n"); ur_result_t result = pfnUpdateSignalEventExp(hCommand, phSignalEvent); @@ -8932,7 +8932,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateSignalEventExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferUpdateSignalEventExp({}) -> {};\n", args_str.str(), result); } @@ -8964,7 +8964,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateWaitEventsExp( "urCommandBufferUpdateWaitEventsExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferUpdateWaitEventsExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferUpdateWaitEventsExp\n"); ur_result_t result = pfnUpdateWaitEventsExp(hCommand, numEventsInWaitList, phEventWaitList); @@ -8977,7 +8977,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateWaitEventsExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_WAIT_EVENTS_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferUpdateWaitEventsExp({}) -> {};\n", args_str.str(), result); } @@ -9011,7 +9011,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetInfoExp( "urCommandBufferGetInfoExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferGetInfoExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferGetInfoExp\n"); ur_result_t result = pfnGetInfoExp(hCommandBuffer, propName, propSize, pPropValue, pPropSizeRet); @@ -9024,7 +9024,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_GET_INFO_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urCommandBufferGetInfoExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -9051,7 +9051,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetNativeHandleExp( "urCommandBufferGetNativeHandleExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urCommandBufferGetNativeHandleExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urCommandBufferGetNativeHandleExp\n"); ur_result_t result = pfnGetNativeHandleExp(hCommandBuffer, phNativeCommandBuffer); @@ -9064,7 +9064,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetNativeHandleExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_GET_NATIVE_HANDLE_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urCommandBufferGetNativeHandleExp({}) -> {};\n", args_str.str(), result); } @@ -9127,7 +9127,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( "urEnqueueCooperativeKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueCooperativeKernelLaunchExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueCooperativeKernelLaunchExp\n"); ur_result_t result = pfnCooperativeKernelLaunchExp( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -9141,7 +9141,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_COOPERATIVE_KERNEL_LAUNCH_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueCooperativeKernelLaunchExp({}) -> {};\n", args_str.str(), result); } @@ -9186,7 +9186,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp( "urKernelSuggestMaxCooperativeGroupCountExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urKernelSuggestMaxCooperativeGroupCountExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urKernelSuggestMaxCooperativeGroupCountExp\n"); ur_result_t result = pfnSuggestMaxCooperativeGroupCountExp( hKernel, hDevice, workDim, pLocalWorkSize, dynamicSharedMemorySize, @@ -9201,7 +9201,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SUGGEST_MAX_COOPERATIVE_GROUP_COUNT_EXP, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urKernelSuggestMaxCooperativeGroupCountExp({}) -> {};\n", args_str.str(), result); } @@ -9249,7 +9249,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp( "urEnqueueTimestampRecordingExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueTimestampRecordingExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueTimestampRecordingExp\n"); ur_result_t result = pfnTimestampRecordingExp( hQueue, blocking, numEventsInWaitList, phEventWaitList, phEvent); @@ -9262,7 +9262,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_TIMESTAMP_RECORDING_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueTimestampRecordingExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueTimestampRecordingExp({}) -> {};\n", args_str.str(), result); } @@ -9330,7 +9330,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp( "urEnqueueKernelLaunchCustomExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueKernelLaunchCustomExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueKernelLaunchCustomExp\n"); ur_result_t result = pfnKernelLaunchCustomExp( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -9345,7 +9345,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH_CUSTOM_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueKernelLaunchCustomExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueKernelLaunchCustomExp({}) -> {};\n", args_str.str(), result); } @@ -9374,7 +9374,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( "urProgramBuildExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramBuildExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramBuildExp\n"); ur_result_t result = pfnBuildExp(hProgram, numDevices, phDevices, pOptions); @@ -9385,7 +9385,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_BUILD_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urProgramBuildExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramBuildExp({}) -> {};\n", args_str.str(), result); } @@ -9414,7 +9414,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompileExp( UR_FUNCTION_PROGRAM_COMPILE_EXP, "urProgramCompileExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramCompileExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramCompileExp\n"); ur_result_t result = pfnCompileExp(hProgram, numDevices, phDevices, pOptions); @@ -9425,7 +9425,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompileExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_COMPILE_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urProgramCompileExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramCompileExp({}) -> {};\n", args_str.str(), result); } @@ -9464,7 +9464,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLinkExp( "urProgramLinkExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urProgramLinkExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urProgramLinkExp\n"); ur_result_t result = pfnLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram); @@ -9476,7 +9476,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLinkExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_LINK_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urProgramLinkExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urProgramLinkExp({}) -> {};\n", args_str.str(), result); } @@ -9502,7 +9502,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( "urUSMImportExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMImportExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMImportExp\n"); ur_result_t result = pfnImportExp(hContext, pMem, size); @@ -9513,7 +9513,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_IMPORT_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUSMImportExp({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urUSMImportExp({}) -> {};\n", args_str.str(), result); } @@ -9537,7 +9537,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( "urUSMReleaseExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUSMReleaseExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUSMReleaseExp\n"); ur_result_t result = pfnReleaseExp(hContext, pMem); @@ -9548,7 +9548,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_RELEASE_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUSMReleaseExp({}) -> {};\n", args_str.str(), + UR_LOG_LOGGER(logger, INFO, " <--- urUSMReleaseExp({}) -> {};\n", args_str.str(), result); } @@ -9575,7 +9575,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp( "urUsmP2PEnablePeerAccessExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUsmP2PEnablePeerAccessExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUsmP2PEnablePeerAccessExp\n"); ur_result_t result = pfnEnablePeerAccessExp(commandDevice, peerDevice); @@ -9587,7 +9587,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_ENABLE_PEER_ACCESS_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUsmP2PEnablePeerAccessExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUsmP2PEnablePeerAccessExp({}) -> {};\n", args_str.str(), result); } @@ -9614,7 +9614,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( "urUsmP2PDisablePeerAccessExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUsmP2PDisablePeerAccessExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUsmP2PDisablePeerAccessExp\n"); ur_result_t result = pfnDisablePeerAccessExp(commandDevice, peerDevice); @@ -9626,7 +9626,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_DISABLE_PEER_ACCESS_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUsmP2PDisablePeerAccessExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUsmP2PDisablePeerAccessExp({}) -> {};\n", args_str.str(), result); } @@ -9668,7 +9668,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( "urUsmP2PPeerAccessGetInfoExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urUsmP2PPeerAccessGetInfoExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urUsmP2PPeerAccessGetInfoExp\n"); ur_result_t result = pfnPeerAccessGetInfoExp( commandDevice, peerDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -9681,7 +9681,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_PEER_ACCESS_GET_INFO_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urUsmP2PPeerAccessGetInfoExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urUsmP2PPeerAccessGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -9720,7 +9720,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrierExt( "urEnqueueEventsWaitWithBarrierExt", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueEventsWaitWithBarrierExt\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueEventsWaitWithBarrierExt\n"); ur_result_t result = pfnEventsWaitWithBarrierExt( hQueue, pProperties, numEventsInWaitList, phEventWaitList, phEvent); @@ -9733,7 +9733,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrierExt( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT, ¶ms); - URLOG_(logger, INFO, + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueEventsWaitWithBarrierExt({}) -> {};\n", args_str.str(), result); } @@ -9793,7 +9793,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( "urEnqueueNativeCommandExp", ¶ms); auto &logger = getContext()->logger; - URLOG_(logger, INFO, " ---> urEnqueueNativeCommandExp\n"); + UR_LOG_LOGGER(logger, INFO, " ---> urEnqueueNativeCommandExp\n"); ur_result_t result = pfnNativeCommandExp( hQueue, pfnNativeEnqueue, data, numMemsInMemList, phMemList, pProperties, @@ -9807,7 +9807,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_NATIVE_COMMAND_EXP, ¶ms); - URLOG_(logger, INFO, " <--- urEnqueueNativeCommandExp({}) -> {};\n", + UR_LOG_LOGGER(logger, INFO, " <--- urEnqueueNativeCommandExp({}) -> {};\n", args_str.str(), result); } diff --git a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp index 17bbb92d7407..6f2f6f900a0b 100644 --- a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp +++ b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp @@ -68,13 +68,13 @@ struct RefCountContext { ptr, RefRuntimeInfo{1, std::type_index(typeid(handle)), getCurrentBacktrace()}); } else { - URLOG_CTX(ERR, "Handle {} already exists", ptr); + UR_LOG_LOGGER(getContext()->logger, ERR, "Handle {} already exists", ptr); return; } break; case REFCOUNT_INCREASE: if (it == counts.end()) { - URLOG_CTX(ERR, "Attempting to retain nonexistent handle {}", ptr); + UR_LOG_LOGGER(getContext()->logger, ERR, "Attempting to retain nonexistent handle {}", ptr); return; } else { it->second.refCount++; @@ -90,14 +90,14 @@ struct RefCountContext { } if (it->second.refCount < 0) { - URLOG(ERR, "Attempting to release nonexistent handle {}", ptr); + UR_LOG(ERR, "Attempting to release nonexistent handle {}", ptr); } else if (it->second.refCount == 0 && isAdapterHandle) { adapterCount--; } break; } - URLOG_CTX(DEBUG, "Reference count for handle {} changed to {}", ptr, + UR_LOG_LOGGER(getContext()->logger, DEBUG, "Reference count for handle {} changed to {}", ptr, it->second.refCount); if (it->second.refCount == 0) { @@ -106,7 +106,7 @@ struct RefCountContext { // No more active adapters, so any references still held are leaked if (adapterCount == 0) { - logInvalidReferences(SHORT_FILE, UR_STR(__LINE__)); + logInvalidReferences(SHORT_FILE, UR_STR_(__LINE__)); counts.clear(); } } @@ -167,9 +167,9 @@ struct RefCountContext { #define URLOG_CTX_INVALID_REFERENCE(ptr) \ getContext()->refCountContext->logInvalidReference(SHORT_FILE, \ - UR_STR(__LINE__), ptr); + UR_STR_(__LINE__), ptr); #define URLOG_CTX_INVALID_REFERENCES() \ getContext()->refCountContext->logInvalidReferences(SHORT_FILE, \ - UR_STR(__LINE__)); + UR_STR_(__LINE__)); #endif /* UR_LEAK_CHECK_H */ diff --git a/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp b/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp index c9e99ccb0858..ac239b35aacf 100644 --- a/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp +++ b/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp @@ -33,7 +33,7 @@ context_t::~context_t() {} result == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) \ return UR_RESULT_SUCCESS; \ if (result != UR_RESULT_SUCCESS) { \ - URLOG_CTX(ERR, "Unexpected non-success result code from {}", #result); \ + UR_LOG_LOGGER(getContext()->logger, ERR, "Unexpected non-success result code from {}", #result); \ assert(0); \ return result; \ } diff --git a/unified-runtime/source/loader/ur_adapter_registry.hpp b/unified-runtime/source/loader/ur_adapter_registry.hpp index 0613b88fd111..74a77db92b49 100644 --- a/unified-runtime/source/loader/ur_adapter_registry.hpp +++ b/unified-runtime/source/loader/ur_adapter_registry.hpp @@ -49,7 +49,7 @@ struct FilterTerm { auto backendIter = backendNameMap.find(backend); if (backendIter == backendNameMap.end()) { - URLOG(DEBUG, + UR_LOG(DEBUG, "ONEAPI_DEVICE_SELECTOR Pre-Filter with illegal backend '{}' ", backend); return false; @@ -74,7 +74,7 @@ struct FilterTerm { } auto deviceIter = deviceTypeMap.find(deviceString); if (deviceIter == deviceTypeMap.end()) { - URLOG(DEBUG, + UR_LOG(DEBUG, "ONEAPI_DEVICE_SELECTOR Pre-Filter with illegal device '{}' ", deviceString); continue; @@ -102,14 +102,14 @@ class AdapterRegistry { try { forceLoadedAdaptersOpt = getenv_to_vec("UR_ADAPTERS_FORCE_LOAD"); } catch (const std::invalid_argument &e) { - URLOG(ERR, e.what()); + UR_LOG(ERR, e.what()); } if (forceLoadedAdaptersOpt.has_value()) { for (const auto &s : forceLoadedAdaptersOpt.value()) { auto path = fs::path(s); if (path.filename().extension() == STATIC_LIBRARY_EXTENSION) { - URLOG(WARN, + UR_LOG(WARN, "UR_ADAPTERS_FORCE_LOAD contains a path to a static" "library {}, it will be skipped", s); @@ -120,14 +120,14 @@ class AdapterRegistry { try { exists = fs::exists(path); } catch (std::exception &e) { - URLOG(ERR, e.what()); + UR_LOG(ERR, e.what()); } if (exists) { forceLoaded = true; adaptersLoadPaths.emplace_back(std::vector{std::move(path)}); } else { - URLOG(WARN, + UR_LOG(WARN, "Detected nonexistent path {} in environment " "variable UR_ADAPTERS_FORCE_LOAD", s); @@ -205,7 +205,7 @@ class AdapterRegistry { try { pathStringsOpt = getenv_to_vec("UR_ADAPTERS_SEARCH_PATH"); } catch (const std::invalid_argument &e) { - URLOG(ERR, e.what()); + UR_LOG(ERR, e.what()); return std::nullopt; } @@ -216,7 +216,7 @@ class AdapterRegistry { if (fs::exists(path)) { paths.emplace_back(path); } else { - URLOG(WARN, + UR_LOG(WARN, "Detected nonexistent path {} in environmental " "variable UR_ADAPTERS_SEARCH_PATH", s); @@ -235,11 +235,11 @@ class AdapterRegistry { } catch (...) { // If the selector is malformed, then we ignore selector and return // success. - URLOG(ERR, "ERROR: missing backend, format of filter = " + UR_LOG(ERR, "ERROR: missing backend, format of filter = " "'[!]backend:filterStrings'"); return UR_RESULT_SUCCESS; } - URLOG(DEBUG, "getenv_to_map parsed env var and {} a map", + UR_LOG(DEBUG, "getenv_to_map parsed env var and {} a map", (odsEnvMap.has_value() ? "produced" : "failed to produce")); // if the ODS env var is not set at all, then pretend it was set to the @@ -258,21 +258,21 @@ class AdapterRegistry { if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case // malformed term: missing backend -- output ERROR, then continue - URLOG(ERR, "ERROR: missing backend, format of filter = " + UR_LOG(ERR, "ERROR: missing backend, format of filter = " "'[!]backend:filterStrings'"); continue; } - URLOG(DEBUG, "ONEAPI_DEVICE_SELECTOR Pre-Filter with backend '{}' ", + UR_LOG(DEBUG, "ONEAPI_DEVICE_SELECTOR Pre-Filter with backend '{}' ", backend); bool PositiveFilter = backend.front() != '!'; - URLOG(DEBUG, "term is a {} filter", + UR_LOG(DEBUG, "term is a {} filter", (PositiveFilter ? "positive" : "negative")); if (!PositiveFilter) { - URLOG(DEBUG, "DEBUG: backend was '{}'", backend); + UR_LOG(DEBUG, "DEBUG: backend was '{}'", backend); // Trim off the "!" from the backend backend.erase(backend.cbegin()); - URLOG(DEBUG, "DEBUG: backend now '{}'", backend); + UR_LOG(DEBUG, "DEBUG: backend now '{}'", backend); } // Make sure the backend is lower case @@ -341,7 +341,7 @@ class AdapterRegistry { std::string(adapterName).find("v2") != std::string::npos; if (v2Requested != v2Adapter) { - URLOG(INFO, "The adapter '{}' is skipped because {} {}.", adapterName, + UR_LOG(INFO, "The adapter '{}' is skipped because {} {}.", adapterName, "UR_LOADER_USE_LEVEL_ZERO_V2 or SYCL_UR_USE_LEVEL_ZERO_V2", v2Requested ? "is set" : "is not set"); continue; diff --git a/unified-runtime/source/loader/ur_lib.cpp b/unified-runtime/source/loader/ur_lib.cpp index b85dba31ee7c..0f4b4ecb5013 100644 --- a/unified-runtime/source/loader/ur_lib.cpp +++ b/unified-runtime/source/loader/ur_lib.cpp @@ -76,7 +76,7 @@ __urdlllocal ur_result_t context_t::Init( ur_result_t result; const char *logger_name = "loader"; logger::init(logger_name); - URLOG(DEBUG, "Logger {} initialized successfully!", logger_name); + UR_LOG(DEBUG, "Logger {} initialized successfully!", logger_name); result = ur_loader::getContext()->init(); @@ -215,7 +215,7 @@ ur_result_t urLoaderTearDown() { ur_result_t result = ret == 0 ? UR_RESULT_SUCCESS : UR_RESULT_ERROR_UNINITIALIZED; - URLOG(INFO, "---> urLoaderTearDown() -> {}", result); + UR_LOG(INFO, "---> urLoaderTearDown() -> {}", result); return result; } @@ -324,7 +324,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // `std::map` with `std::queue>` or // something similar.) auto maybeEnvVarMap = getenv_to_map("ONEAPI_DEVICE_SELECTOR", false); - URLOG(DEBUG, "getenv_to_map parsed env var and {} a map", + UR_LOG(DEBUG, "getenv_to_map parsed env var and {} a map", (maybeEnvVarMap.has_value() ? "produced" : "failed to produce")); // if the ODS env var is not set at all, then pretend it was set to the @@ -460,7 +460,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case // malformed term: missing backend -- output ERROR, then continue - URLOG(ERR, "ERROR: missing backend, format of filter = " + UR_LOG(ERR, "ERROR: missing backend, format of filter = " "'[!]backend:filterStrings'"); continue; } @@ -468,14 +468,14 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, AcceptFilter, DiscardFilter, } termType = (backend.front() != '!') ? AcceptFilter : DiscardFilter; - URLOG(DEBUG, "termType is {}", + UR_LOG(DEBUG, "termType is {}", (termType != AcceptFilter ? "DiscardFilter" : "AcceptFilter")); auto &deviceList = (termType != AcceptFilter) ? discardDeviceList : acceptDeviceList; if (termType != AcceptFilter) { - URLOG(DEBUG, "DEBUG: backend was '{}'", backend); + UR_LOG(DEBUG, "DEBUG: backend was '{}'", backend); backend.erase(backend.cbegin()); - URLOG(DEBUG, "DEBUG: backend now '{}'", backend); + UR_LOG(DEBUG, "DEBUG: backend now '{}'", backend); } // Note the hPlatform -> platformBackend -> platformBackendName conversion // above guarantees minimal sanity for the comparison with backend from the @@ -490,12 +490,12 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, })) { // irrelevant term for current request: different backend -- silently // ignore - URLOG(ERR, "unrecognised backend '{}'", backend); + UR_LOG(ERR, "unrecognised backend '{}'", backend); return UR_RESULT_ERROR_INVALID_VALUE; } if (termPair.second.size() == 0) { // malformed term: missing filterStrings -- output ERROR - URLOG(ERR, "missing filterStrings, format of filter = " + UR_LOG(ERR, "missing filterStrings, format of filter = " "'[!]backend:filterStrings'"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -504,7 +504,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, termPair.second.cend()) { // FIXME: never true because getenv_to_map rejects this case // malformed term: missing filterString -- output warning, then continue - URLOG(WARN, "WARNING: empty filterString, format of filterStrings " + UR_LOG(WARN, "WARNING: empty filterString, format of filterStrings " "= 'filterString[,filterString[,...]]'"); continue; } @@ -513,7 +513,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return std::count(s.cbegin(), s.cend(), '.') > 2; }) != termPair.second.cend()) { // malformed term: too many dots in filterString - URLOG(ERR, "too many dots in filterString, format of " + UR_LOG(ERR, "too many dots in filterString, format of " "filterString = 'root[.sub[.subsub]]'"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -535,7 +535,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return false; // no BAD things, so must be okay }) != termPair.second.cend()) { // malformed term: star dot no-star in filterString - URLOG(ERR, "invalid wildcard in filterString, '*.' => '*.*'"); + UR_LOG(ERR, "invalid wildcard in filterString, '*.' => '*.*'"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -594,8 +594,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, 0, 0, nullptr}); } - URLOG(DEBUG, "DEBUG: size of acceptDeviceList = {}", acceptDeviceList.size()); - URLOG(DEBUG, "DEBUG: size of discardDeviceList = {}", + UR_LOG(DEBUG, "DEBUG: size of acceptDeviceList = {}", acceptDeviceList.size()); + UR_LOG(DEBUG, "DEBUG: size of discardDeviceList = {}", discardDeviceList.size()); std::vector rootDevices; @@ -722,18 +722,18 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // is a subsubdevice filter, then it must be '*.*.*' matches = (filter.hwType == device.hwType) || (filter.hwType == DeviceHardwareType::UR_DEVICE_TYPE_ALL); - URLOG(DEBUG, "DEBUG: In ApplyFilter, if block case 1, matches = {}", + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 1, matches = {}", matches); } else if (filter.rootId != device.rootId) { // root part in filter is a number but does not match the number in the // root part of device matches = false; - URLOG(DEBUG, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 2, matches = ", matches); } else if (filter.level == DevicePartLevel::ROOT) { // this is a root device filter with a number that matches matches = true; - URLOG(DEBUG, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 3, matches = ", matches); } else if (filter.subId == DeviceIdTypeALL) { // sub type of star always matches (when root part matches, which we @@ -741,30 +741,30 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // 'matches.*' if this is a subsubdevice filter, then it must be // 'matches.*.*' matches = true; - URLOG(DEBUG, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 4, matches = ", matches); } else if (filter.subId != device.subId) { // sub part in filter is a number but does not match the number in the sub // part of device matches = false; - URLOG(DEBUG, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 5, matches = ", matches); } else if (filter.level == DevicePartLevel::SUB) { // this is a sub device number filter, numbers match in both parts matches = true; - URLOG(DEBUG, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 6, matches = ", matches); } else if (filter.subsubId == DeviceIdTypeALL) { // subsub type of star always matches (when other parts match, which we // already know here) this is a subsub device filter, it must be // 'matches.matches.*' matches = true; - URLOG(DEBUG, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 7, matches = ", matches); } else { // this is a subsub device filter, numbers in all three parts match matches = (filter.subsubId == device.subsubId); - URLOG(DEBUG, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 8, matches = ", matches); } return matches; @@ -829,7 +829,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, subSubDevices.end()); } if (numAlreadySelected == selectedDevices.size()) { - URLOG(WARN, + UR_LOG(WARN, "WARNING: an accept term was ignored because it " "does not select any additional devices" "selectedDevices.size() = {}", diff --git a/unified-runtime/source/ur/ur.hpp b/unified-runtime/source/ur/ur.hpp index 35b4ddeaf11a..b41f63b7257f 100644 --- a/unified-runtime/source/ur/ur.hpp +++ b/unified-runtime/source/ur/ur.hpp @@ -37,10 +37,10 @@ #define UR_CALL(Call) \ { \ if (PrintTrace) \ - URLOG_ALWAYS("UR ---> {}", #Call); \ + UR_LOG(ALWAYS, "UR ---> {}", #Call); \ ur_result_t Result = (Call); \ if (PrintTrace) \ - URLOG_ALWAYS("UR <--- {}({})", #Call, getUrResultString(Result)); \ + UR_LOG(ALWAYS, "UR <--- {}({})", #Call, getUrResultString(Result)); \ if (Result != UR_RESULT_SUCCESS) \ return Result; \ } @@ -49,10 +49,10 @@ #define UR_CALL_THROWS(Call) \ { \ if (PrintTrace) \ - URLOG_ALWAYS("UR ---> {}", #Call); \ + UR_LOG(ALWAYS, "UR ---> {}", #Call); \ ur_result_t Result = (Call); \ if (PrintTrace) \ - URLOG_ALWAYS("UR <--- {}({})", #Call, getUrResultString(Result)); \ + UR_LOG(ALWAYS, "UR <--- {}({})", #Call, getUrResultString(Result)); \ if (Result != UR_RESULT_SUCCESS) \ throw Result; \ } @@ -61,10 +61,10 @@ #define UR_CALL_NOCHECK(Call) \ { \ if (PrintTrace) \ - URLOG_ALWAYS("UR ---> {}", #Call); \ + UR_LOG(ALWAYS, "UR ---> {}", #Call); \ (void)(Call); \ if (PrintTrace) \ - URLOG_ALWAYS("UR <--- {}", #Call); \ + UR_LOG(ALWAYS, "UR <--- {}", #Call); \ } static auto getUrResultString = [](ur_result_t Result) { @@ -244,7 +244,7 @@ const ur_command_t UR_EXT_COMMAND_TYPE_USER = // Terminates the process with a catastrophic error message. [[noreturn]] inline void die(const char *Message) { - URLOG_ALWAYS("ur_die: {}", Message); + UR_LOG(ALWAYS, "ur_die: {}", Message); std::terminate(); } diff --git a/unified-runtime/test/loader/platforms/platforms.cpp b/unified-runtime/test/loader/platforms/platforms.cpp index c315c764bcd1..86adfd27ab4d 100644 --- a/unified-runtime/test/loader/platforms/platforms.cpp +++ b/unified-runtime/test/loader/platforms/platforms.cpp @@ -27,23 +27,23 @@ int main(int, char *[]) { // Initialize the platform status = urLoaderInit(0, nullptr); if (status != UR_RESULT_SUCCESS) { - URLOG_(out, ERR, "urLoaderInit failed with return code: {}", status); + UR_LOG_LOGGER(out, ERR, "urLoaderInit failed with return code: {}", status); return 1; } - URLOG_(out, INFO, "urLoaderInit succeeded."); + UR_LOG_LOGGER(out, INFO, "urLoaderInit succeeded."); uint32_t adapterCount = 0; std::vector adapters; status = urAdapterGet(0, nullptr, &adapterCount); if (status != UR_RESULT_SUCCESS) { - URLOG_(out, ERR, "urAdapterGet failed with return code: {}", status); + UR_LOG_LOGGER(out, ERR, "urAdapterGet failed with return code: {}", status); return 1; } adapters.resize(adapterCount); status = urAdapterGet(adapterCount, adapters.data(), nullptr); if (status != UR_RESULT_SUCCESS) { - URLOG_(out, ERR, "urAdapterGet failed with return code: {}", status); + UR_LOG_LOGGER(out, ERR, "urAdapterGet failed with return code: {}", status); return 1; } @@ -53,16 +53,16 @@ int main(int, char *[]) { status = urPlatformGet(adapters.data(), adapterCount, 1, nullptr, &platformCount); if (status != UR_RESULT_SUCCESS) { - URLOG_(out, ERR, "urPlatformGet failed with return code: {}", status); + UR_LOG_LOGGER(out, ERR, "urPlatformGet failed with return code: {}", status); goto out; } - URLOG_(out, INFO, "urPlatformGet found {} platforms", platformCount); + UR_LOG_LOGGER(out, INFO, "urPlatformGet found {} platforms", platformCount); platforms.resize(platformCount); status = urPlatformGet(adapters.data(), adapterCount, platformCount, platforms.data(), nullptr); if (status != UR_RESULT_SUCCESS) { - URLOG_(out, ERR, "urPlatformGet failed with return code: {}", status); + UR_LOG_LOGGER(out, ERR, "urPlatformGet failed with return code: {}", status); goto out; } @@ -70,7 +70,7 @@ int main(int, char *[]) { size_t name_len; status = urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, 0, nullptr, &name_len); if (status != UR_RESULT_SUCCESS) { - URLOG_(out, ERR, "urPlatformGetInfo failed with return code: {}", status); + UR_LOG_LOGGER(out, ERR, "urPlatformGetInfo failed with return code: {}", status); goto out; } @@ -80,11 +80,11 @@ int main(int, char *[]) { status = urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, name_len, name, nullptr); if (status != UR_RESULT_SUCCESS) { - URLOG_(out, ERR, "urPlatformGetInfo failed with return code: {}", status); + UR_LOG_LOGGER(out, ERR, "urPlatformGetInfo failed with return code: {}", status); free(name); goto out; } - URLOG_(out, INFO, "Found {} ", name); + UR_LOG_LOGGER(out, INFO, "Found {} ", name); free(name); } diff --git a/unified-runtime/test/unit/logger/env_var.cpp b/unified-runtime/test/unit/logger/env_var.cpp index 2171afe70fe4..e8f43e45889c 100644 --- a/unified-runtime/test/unit/logger/env_var.cpp +++ b/unified-runtime/test/unit/logger/env_var.cpp @@ -8,17 +8,17 @@ ////////////////////////////////////////////////////////////////////////////// TEST_F(LoggerFromEnvVar, DebugMessage) { - URLOG(DEBUG, "Test message: {}", "success"); + UR_LOG(DEBUG, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, InfoMessage) { - URLOG(INFO, "Test message: {}", "success"); + UR_LOG(INFO, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, WarningMessage) { - URLOG(WARN, "Test message: {}", "success"); + UR_LOG(WARN, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, ErrorMessage) { - URLOG(ERR, "Test message: {}", "success"); + UR_LOG(ERR, "Test message: {}", "success"); } diff --git a/unified-runtime/test/unit/logger/logger.cpp b/unified-runtime/test/unit/logger/logger.cpp index a32f69c24b92..51552fa0bc6d 100644 --- a/unified-runtime/test/unit/logger/logger.cpp +++ b/unified-runtime/test/unit/logger/logger.cpp @@ -13,41 +13,41 @@ ////////////////////////////////////////////////////////////////////////////// TEST_F(DefaultLoggerWithFileSink, DefaultLevelNoOutput) { - URLOG_(*logger, INFO, "This should not be printed: {}", 42); + UR_LOG_LOGGER(*logger, INFO, "This should not be printed: {}", 42); test_msg.clear(); } TEST_F(DefaultLoggerWithFileSink, MultipleLines) { - URLOG_(*logger, WARN, "Test message: {}", "success"); - URLOG_(*logger, DEBUG, "This should not be printed: {}", 42); - URLOG_(*logger, ERR, "Test message: {}", "success"); + UR_LOG_LOGGER(*logger, WARN, "Test message: {}", "success"); + UR_LOG_LOGGER(*logger, DEBUG, "This should not be printed: {}", 42); + UR_LOG_LOGGER(*logger, ERR, "Test message: {}", "success"); test_msg << test_msg_prefix << "[WARNING]: Test message: success\n" << test_msg_prefix << "[ERROR]: Test message: success\n"; } TEST_F(DefaultLoggerWithFileSink, ThreeParams) { - URLOG_(*logger, ERR, "{} {}: {}", "Test", 42, 3.8); + UR_LOG_LOGGER(*logger, ERR, "{} {}: {}", "Test", 42, 3.8); test_msg << test_msg_prefix << "[ERROR]: Test 42: 3.8\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces) { - URLOG_(*logger, ERR, "{{}} {}: {}", "Test", 42); + UR_LOG_LOGGER(*logger, ERR, "{{}} {}: {}", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: {} Test: 42\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces2) { - URLOG_(*logger, ERR, "200 {{ {}: {{{}}} 3.8", "Test", 42); + UR_LOG_LOGGER(*logger, ERR, "200 {{ {}: {{{}}} 3.8", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: 200 { Test: {42} 3.8\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces3) { - URLOG_(*logger, ERR, "{{ {}:}} {}}}", "Test", 42); + UR_LOG_LOGGER(*logger, ERR, "{{ {}:}} {}}}", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: { Test:} 42}\n"; } TEST_F(DefaultLoggerWithFileSink, NoBraces) { - URLOG_(*logger, ERR, " Test: 42"); + UR_LOG_LOGGER(*logger, ERR, " Test: 42"); test_msg << test_msg_prefix << "[ERROR]: Test: 42\n"; } @@ -55,7 +55,7 @@ TEST_F(DefaultLoggerWithFileSink, SetLevelDebug) { auto level = logger::Level::DEBUG; logger->setLevel(level); logger->setFlushLevel(level); - URLOG_(*logger, DEBUG, "Test message: {}", "success"); + UR_LOG_LOGGER(*logger, DEBUG, "Test message: {}", "success"); test_msg << test_msg_prefix << "[DEBUG]: Test message: success\n"; } @@ -64,8 +64,8 @@ TEST_F(DefaultLoggerWithFileSink, SetLevelInfo) { auto level = logger::Level::INFO; logger->setLevel(level); logger->setFlushLevel(level); - URLOG_(*logger, INFO, "Test message: {}", "success"); - URLOG_(*logger, DEBUG, "This should not be printed: {}", 42); + UR_LOG_LOGGER(*logger, INFO, "Test message: {}", "success"); + UR_LOG_LOGGER(*logger, DEBUG, "This should not be printed: {}", 42); test_msg << test_msg_prefix << "[INFO]: Test message: success\n"; } @@ -73,16 +73,16 @@ TEST_F(DefaultLoggerWithFileSink, SetLevelInfo) { TEST_F(DefaultLoggerWithFileSink, SetLevelWarning) { auto level = logger::Level::WARN; logger->setLevel(level); - URLOG_(*logger, WARN, "Test message: {}", "success"); - URLOG_(*logger, INFO, "This should not be printed: {}", 42); + UR_LOG_LOGGER(*logger, WARN, "Test message: {}", "success"); + UR_LOG_LOGGER(*logger, INFO, "This should not be printed: {}", 42); test_msg << test_msg_prefix << "[WARNING]: Test message: success\n"; } TEST_F(DefaultLoggerWithFileSink, SetLevelError) { logger->setLevel(logger::Level::ERR); - URLOG_(*logger, ERR, "Test message: {}", "success"); - URLOG_(*logger, WARN, "This should not be printed: {}", 42); + UR_LOG_LOGGER(*logger, ERR, "Test message: {}", "success"); + UR_LOG_LOGGER(*logger, WARN, "This should not be printed: {}", 42); test_msg << test_msg_prefix << "[ERROR]: Test message: success\n"; } @@ -93,7 +93,7 @@ TEST_F(UniquePtrLoggerWithFilesink, SetLogLevelAndFlushLevelDebugWithCtor) { logger = std::make_unique( level, std::make_unique(logger_name, file_path, level)); - URLOG_(*logger, DEBUG, "Test message: {}", "success"); + UR_LOG_LOGGER(*logger, DEBUG, "Test message: {}", "success"); test_msg << test_msg_prefix << "[DEBUG]: Test message: success\n"; } @@ -109,13 +109,13 @@ TEST_F(UniquePtrLoggerWithFilesink, NestedFilePath) { logger::Level::WARN, std::make_unique( logger_name, file_path, logger::Level::WARN)); - URLOG_(*logger, WARN, "Test message: {}", "success"); + UR_LOG_LOGGER(*logger, WARN, "Test message: {}", "success"); test_msg << test_msg_prefix << "[WARNING]: Test message: success\n"; } TEST_F(UniquePtrLoggerWithFilesinkFail, NullSink) { logger = std::make_unique(logger::Level::INFO, nullptr); - URLOG_(*logger, INFO, "This should not be printed: {}", 42); + UR_LOG_LOGGER(*logger, INFO, "This should not be printed: {}", 42); test_msg.clear(); } @@ -136,7 +136,7 @@ TEST_P(FileSinkLoggerMultipleThreads, Multithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - URLOG_(local_logger, WARN, "Test message: {}", "it's a success"); + UR_LOG_LOGGER(local_logger, WARN, "Test message: {}", "it's a success"); } }); } @@ -150,7 +150,7 @@ TEST_P(FileSinkLoggerMultipleThreads, Multithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - URLOG_(local_logger, ERR, "Flushed test message: {}", "it's a success"); + UR_LOG_LOGGER(local_logger, ERR, "Flushed test message: {}", "it's a success"); } }); } @@ -181,7 +181,7 @@ TEST_P(CommonLoggerWithMultipleThreads, StdoutMultithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - URLOG_(local_logger, WARN, "Test message: {}", "it's a success"); + UR_LOG_LOGGER(local_logger, WARN, "Test message: {}", "it's a success"); } }); } @@ -195,7 +195,7 @@ TEST_P(CommonLoggerWithMultipleThreads, StdoutMultithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - URLOG_(local_logger, ERR, "Flushed test message: {}", "it's a success"); + UR_LOG_LOGGER(local_logger, ERR, "Flushed test message: {}", "it's a success"); } }); } diff --git a/unified-runtime/tools/urtrace/collector.cpp b/unified-runtime/tools/urtrace/collector.cpp index 715ccf970e74..5379a9c8be98 100644 --- a/unified-runtime/tools/urtrace/collector.cpp +++ b/unified-runtime/tools/urtrace/collector.cpp @@ -86,7 +86,7 @@ std::string time_to_str(std::chrono::nanoseconds dur, enum time_unit unit) { ostr << d.count() << "s"; } break; default: { - URLOG_(out, ERR, "invalid time unit {}", unit); + UR_LOG_LOGGER(out, ERR, "invalid time unit {}", unit); break; } } @@ -123,7 +123,7 @@ static class cli_args { return std::nullopt; } if (arg_values.size() != 1) { - URLOG_(out, WARN, "{} requires a single argument, skipping...", name); + UR_LOG_LOGGER(out, WARN, "{} requires a single argument, skipping...", name); return std::nullopt; } return arg_values.at(0); @@ -161,15 +161,15 @@ static class cli_args { try { filter = filter_str; } catch (const std::regex_error &err) { - URLOG_(out, WARN, "invalid filter regex {} {}", *filter_str, + UR_LOG_LOGGER(out, WARN, "invalid filter regex {} {}", *filter_str, err.what()); } } else { - URLOG_(out, WARN, "unknown {} argument {}.", ARGS_ENV, arg_name); + UR_LOG_LOGGER(out, WARN, "unknown {} argument {}.", ARGS_ENV, arg_name); } } } - URLOG_(out, DEBUG, + UR_LOG_LOGGER(out, DEBUG, "collector args (.print_begin = {}, .profiling = {}, " ".time_unit = {}, .filter = {}, .output_format = {})", print_begin, profiling, time_unit_str[time_unit], @@ -204,7 +204,7 @@ class TraceWriter { class HumanReadable : public TraceWriter { void begin(uint64_t id, const char *fname, std::string args) override { if (cli_args.print_begin) { - URLOG_(out, INFO, "begin({}) - {}({});", id, fname, args); + UR_LOG_LOGGER(out, INFO, "begin({}) - {}({});", id, fname, args); } } void end(uint64_t id, const char *fname, std::string args, Timepoint tp, @@ -220,7 +220,7 @@ class HumanReadable : public TraceWriter { std::chrono::duration_cast(tp - start_tp); profile_str << " (" << time_to_str(dur, cli_args.time_unit) << ")"; } - URLOG_(out, INFO, "{}{}({}) -> {};{}", prefix_str.str(), fname, args, + UR_LOG_LOGGER(out, INFO, "{}{}({}) -> {};{}", prefix_str.str(), fname, args, *resultp, profile_str.str()); } }; @@ -236,16 +236,16 @@ class JsonWriter : public TraceWriter { // not much we can do here... } } - void prologue() override { URLOG_(out, INFO, "{{\n \"traceEvents\": ["); } + void prologue() override { UR_LOG_LOGGER(out, INFO, "{{\n \"traceEvents\": ["); } void epilogue() override { // Empty trace to avoid ending in a comma // To prevent that last comma from being printed in the first place // we could synchronize the entire 'end' function, while reversing the // logic and printing commas at the front. Not worth it probably. - URLOG_(out, INFO, + UR_LOG_LOGGER(out, INFO, "{{\"name\": \"\", \"cat\": \"\", \"ph\": \"\", \"pid\": \"\", " "\"tid\": \"\", \"ts\": \"\"}}"); - URLOG_(out, INFO, "]\n}}"); + UR_LOG_LOGGER(out, INFO, "]\n}}"); } void begin(uint64_t, const char *, std::string) override {} @@ -257,7 +257,7 @@ class JsonWriter : public TraceWriter { .count(); auto dur_us = std::chrono::duration_cast(dur).count(); - URLOG_(out, INFO, "{{\ + UR_LOG_LOGGER(out, INFO, "{{\ \"cat\": \"UR\", \ \"ph\": \"X\",\ \"pid\": {},\ @@ -322,7 +322,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, if (auto regex = cli_args.filter) { if (!std::regex_match(args->function_name, *regex)) { - URLOG_(out, DEBUG, "function {} does not match regex filter, skipping...", + UR_LOG_LOGGER(out, DEBUG, "function {} does not match regex filter, skipping...", args->function_name); return; } @@ -344,7 +344,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, } else if (trace_type == TRACE_FN_END) { auto ctx = pop_instance_data(instance); if (!ctx) { - URLOG_(out, ERR, + UR_LOG_LOGGER(out, ERR, "Received TRACE_FN_END without corresponding " "TRACE_FN_BEGIN, instance {}. Skipping...", instance); @@ -355,7 +355,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, writer()->end(instance, args->function_name, args_str.str(), time_for_end, *ctx->start, resultp); } else { - URLOG_(out, WARN, "unsupported trace type"); + UR_LOG_LOGGER(out, WARN, "unsupported trace type"); } } @@ -368,17 +368,17 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, unsigned int minor_version, const char *, const char *stream_name) { if (stream_name == nullptr) { - URLOG_(out, DEBUG, "Found stream with null name. Skipping..."); + UR_LOG_LOGGER(out, DEBUG, "Found stream with null name. Skipping..."); return; } if (std::string_view(stream_name) != UR_STREAM_NAME) { - URLOG_(out, DEBUG, "Found stream: {}. Expected: {}. Skipping...", + UR_LOG_LOGGER(out, DEBUG, "Found stream: {}. Expected: {}. Skipping...", stream_name, UR_STREAM_NAME); return; } if (UR_MAKE_VERSION(major_version, minor_version) != UR_API_VERSION_CURRENT) { - URLOG_( + UR_LOG_LOGGER( out, ERR, "Invalid stream version: {}.{}. Expected: {}.{}. Skipping...", major_version, minor_version, UR_MAJOR_VERSION(UR_API_VERSION_CURRENT), UR_MINOR_VERSION(UR_API_VERSION_CURRENT)); @@ -387,7 +387,7 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, uint8_t stream_id = xptiRegisterStream(stream_name); - URLOG_(out, DEBUG, "Registered stream {} ({}.{}).", stream_name, + UR_LOG_LOGGER(out, DEBUG, "Registered stream {} ({}.{}).", stream_name, major_version, minor_version); writer()->prologue(); @@ -400,11 +400,11 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, */ XPTI_CALLBACK_API void xptiTraceFinish(const char *stream_name) { if (stream_name == nullptr) { - URLOG_(out, DEBUG, "Found stream with null name. Skipping..."); + UR_LOG_LOGGER(out, DEBUG, "Found stream with null name. Skipping..."); return; } if (std::string_view(stream_name) != UR_STREAM_NAME) { - URLOG_(out, DEBUG, "Found stream: {}. Expected: {}. Skipping...", + UR_LOG_LOGGER(out, DEBUG, "Found stream: {}. Expected: {}. Skipping...", stream_name, UR_STREAM_NAME); return; } From e56dcf996427fc6044e9e9106fb1f6df155d5d63 Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Tue, 15 Apr 2025 10:40:19 +0000 Subject: [PATCH 06/16] merge with upstream and adapt macros --- .../scripts/templates/trcddi.cpp.mako | 4 +- .../source/adapters/cuda/common.cpp | 6 +- .../source/adapters/cuda/enqueue.cpp | 14 +- .../source/adapters/cuda/image.cpp | 2 +- unified-runtime/source/adapters/cuda/usm.cpp | 4 +- .../source/adapters/hip/common.cpp | 6 +- .../source/adapters/hip/enqueue.cpp | 22 +- unified-runtime/source/adapters/hip/image.cpp | 2 +- .../source/adapters/level_zero/adapter.cpp | 24 +- .../adapters/level_zero/async_alloc.cpp | 2 +- .../adapters/level_zero/command_buffer.cpp | 10 +- .../source/adapters/level_zero/common.cpp | 6 +- .../source/adapters/level_zero/common.hpp | 2 +- .../source/adapters/level_zero/context.cpp | 14 +- .../source/adapters/level_zero/device.cpp | 32 +- .../source/adapters/level_zero/event.cpp | 20 +- .../level_zero/helpers/image_helpers.cpp | 38 +- .../level_zero/helpers/kernel_helpers.cpp | 14 +- .../source/adapters/level_zero/image.cpp | 28 +- .../source/adapters/level_zero/kernel.cpp | 24 +- .../source/adapters/level_zero/memory.cpp | 28 +- .../source/adapters/level_zero/platform.cpp | 2 +- .../source/adapters/level_zero/program.cpp | 6 +- .../source/adapters/level_zero/queue.cpp | 32 +- .../source/adapters/level_zero/sampler.cpp | 10 +- .../source/adapters/level_zero/usm.cpp | 20 +- .../source/adapters/level_zero/v2/api.cpp | 60 +- .../adapters/level_zero/v2/command_buffer.cpp | 2 +- .../level_zero/v2/command_list_cache.cpp | 8 +- .../source/adapters/level_zero/v2/event.cpp | 6 +- .../level_zero/v2/event_provider_normal.cpp | 2 +- .../source/adapters/level_zero/v2/kernel.cpp | 6 +- .../source/adapters/level_zero/v2/memory.cpp | 8 +- .../v2/queue_immediate_in_order.cpp | 4 +- .../source/adapters/level_zero/v2/usm.cpp | 8 +- .../adapters/level_zero/virtual_mem.cpp | 4 +- .../source/adapters/native_cpu/common.hpp | 6 +- .../source/adapters/native_cpu/device.cpp | 2 +- .../source/adapters/native_cpu/platform.cpp | 2 +- .../source/adapters/opencl/context.cpp | 2 +- .../source/common/latency_tracker.hpp | 6 +- .../source/common/linux/ur_lib_loader.cpp | 12 +- .../source/common/logger/ur_logger.hpp | 2 +- .../common/logger/ur_logger_details.hpp | 22 +- unified-runtime/source/common/umf_helpers.hpp | 2 +- .../source/common/ur_pool_manager.hpp | 4 +- unified-runtime/source/common/ur_util.cpp | 6 +- .../source/common/windows/ur_lib_loader.cpp | 8 +- .../layers/sanitizer/asan/asan_allocator.cpp | 2 +- .../layers/sanitizer/asan/asan_buffer.cpp | 12 +- .../loader/layers/sanitizer/asan/asan_ddi.cpp | 90 +- .../sanitizer/asan/asan_interceptor.cpp | 48 +- .../sanitizer/asan/asan_interceptor.hpp | 2 +- .../layers/sanitizer/asan/asan_shadow.cpp | 20 +- .../layers/sanitizer/asan/asan_statistics.cpp | 10 +- .../layers/sanitizer/msan/msan_allocator.cpp | 2 +- .../layers/sanitizer/msan/msan_buffer.cpp | 12 +- .../loader/layers/sanitizer/msan/msan_ddi.cpp | 92 +- .../sanitizer/msan/msan_interceptor.cpp | 44 +- .../layers/sanitizer/msan/msan_shadow.cpp | 18 +- .../linux/sanitizer_utils.cpp | 4 +- .../sanitizer_common/sanitizer_options.cpp | 2 +- .../sanitizer_options_impl.hpp | 8 +- .../sanitizer_common/sanitizer_utils.cpp | 16 +- .../layers/sanitizer/tsan/tsan_buffer.cpp | 12 +- .../loader/layers/sanitizer/tsan/tsan_ddi.cpp | 76 +- .../sanitizer/tsan/tsan_interceptor.cpp | 16 +- .../layers/sanitizer/tsan/tsan_shadow.cpp | 18 +- .../loader/layers/sanitizer/ur_sanddi.cpp | 2 +- .../loader/layers/tracing/ur_trcddi.cpp | 821 +++++++++--------- .../layers/validation/ur_leak_check.hpp | 8 +- .../layers/validation/ur_validation_layer.cpp | 2 +- .../source/loader/ur_adapter_registry.hpp | 34 +- unified-runtime/source/loader/ur_lib.cpp | 50 +- .../test/loader/platforms/platforms.cpp | 20 +- unified-runtime/test/logger/env_var.cpp | 8 +- unified-runtime/test/unit/logger.cpp | 46 +- unified-runtime/tools/urtrace/collector.cpp | 41 +- 78 files changed, 1049 insertions(+), 1041 deletions(-) diff --git a/unified-runtime/scripts/templates/trcddi.cpp.mako b/unified-runtime/scripts/templates/trcddi.cpp.mako index 4c7ba67813da..c76c98042c3a 100644 --- a/unified-runtime/scripts/templates/trcddi.cpp.mako +++ b/unified-runtime/scripts/templates/trcddi.cpp.mako @@ -48,7 +48,7 @@ namespace ur_tracing_layer uint64_t instance = getContext()->notify_begin(${th.make_func_etor(n, tags, obj)}, "${th.make_func_name(n, tags, obj)}", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> ${th.make_func_name(n, tags, obj)}\n"); + UR_LOG_L(logger, Info, " ---> ${th.make_func_name(n, tags, obj)}\n"); ${x}_result_t result = ${th.make_pfn_name(n, tags, obj)}( ${", ".join(th.make_param_lines(n, tags, obj, format=["name"]))} ); @@ -57,7 +57,7 @@ namespace ur_tracing_layer if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, ${th.make_func_etor(n, tags, obj)}, ¶ms); - UR_LOG_L(logger, INFO, " <--- ${th.make_func_name(n, tags, obj)}({}) -> {};\n", args_str.str(), result); + UR_LOG_L(logger, Info, " <--- ${th.make_func_name(n, tags, obj)}({}) -> {};\n", args_str.str(), result); } return result; diff --git a/unified-runtime/source/adapters/cuda/common.cpp b/unified-runtime/source/adapters/cuda/common.cpp index 81d3aa3f0f28..3eaec9770c1f 100644 --- a/unified-runtime/source/adapters/cuda/common.cpp +++ b/unified-runtime/source/adapters/cuda/common.cpp @@ -71,7 +71,7 @@ void checkErrorUR(CUresult Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(Error, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr || std::getenv("UR_CUDA_ABORT") != nullptr) { @@ -95,7 +95,7 @@ void checkErrorUR(nvmlReturn_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(Error, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr || std::getenv("UR_CUDA_ABORT") != nullptr) { @@ -115,7 +115,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(Error, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr) { std::abort(); diff --git a/unified-runtime/source/adapters/cuda/enqueue.cpp b/unified-runtime/source/adapters/cuda/enqueue.cpp index 36dd73d410f8..bc16da279a8a 100644 --- a/unified-runtime/source/adapters/cuda/enqueue.cpp +++ b/unified-runtime/source/adapters/cuda/enqueue.cpp @@ -97,8 +97,8 @@ ur_result_t setCuMemAdvise(CUdeviceptr DevPtr, size_t Size, for (auto &UnmappedFlag : UnmappedMemAdviceFlags) { if (URAdviceFlags & UnmappedFlag) { - UR_LOG(WARN, "Memory advice ignored because the CUDA backend does not " - "support some of the specified flags."); + UR_LOG(Warning, "Memory advice ignored because the CUDA backend does not " + "support some of the specified flags."); return UR_RESULT_SUCCESS; } } @@ -1612,8 +1612,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch( // for managed memory. Therefore, ignore prefetch hint if concurrent managed // memory access is not available. if (!getAttribute(Device, CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS)) { - UR_LOG(WARN, "Prefetch hint ignored as device does not support " - "concurrent managed access."); + UR_LOG(Warning, "Prefetch hint ignored as device does not support " + "concurrent managed access."); return UR_RESULT_SUCCESS; } @@ -1621,7 +1621,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch( UR_CHECK_ERROR(cuPointerGetAttribute( &IsManaged, CU_POINTER_ATTRIBUTE_IS_MANAGED, (CUdeviceptr)pMem)); if (!IsManaged) { - UR_LOG(WARN, "Prefetch hint ignored as prefetch only works with USM."); + UR_LOG(Warning, "Prefetch hint ignored as prefetch only works with USM."); return UR_RESULT_SUCCESS; } @@ -1672,8 +1672,8 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size, (advice & UR_USM_ADVICE_FLAG_DEFAULT)) { ur_device_handle_t Device = hQueue->getDevice(); if (!getAttribute(Device, CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS)) { - UR_LOG(WARN, "Mem advise ignored as device does not support " - "concurrent managed access."); + UR_LOG(Warning, "Mem advise ignored as device does not support " + "concurrent managed access."); return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/adapters/cuda/image.cpp b/unified-runtime/source/adapters/cuda/image.cpp index 5e5a26cffc25..df4a5f30dd9a 100644 --- a/unified-runtime/source/adapters/cuda/image.cpp +++ b/unified-runtime/source/adapters/cuda/image.cpp @@ -806,7 +806,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - UR_LOG(ERROR, + UR_LOG(Error, "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/cuda/usm.cpp b/unified-runtime/source/adapters/cuda/usm.cpp index 79c4bcb34853..c12b3c37e0f1 100644 --- a/unified-runtime/source/adapters/cuda/usm.cpp +++ b/unified-runtime/source/adapters/cuda/usm.cpp @@ -444,8 +444,8 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, // Otherwise, do nothing. // Set maximum size is effectively ignored. if (Limits->maxPoolableSize > 0) - UR_LOG(WARN, "The memory pool maximum size feature requires CUDA " - "12.2 or later.\n"); + UR_LOG(Warning, "The memory pool maximum size feature requires CUDA " + "12.2 or later.\n"); #endif maxSize = Limits->maxPoolableSize; size_t chunkSize = 33554432; // 32MB diff --git a/unified-runtime/source/adapters/hip/common.cpp b/unified-runtime/source/adapters/hip/common.cpp index 7a5d81feddce..ac6662c553a7 100644 --- a/unified-runtime/source/adapters/hip/common.cpp +++ b/unified-runtime/source/adapters/hip/common.cpp @@ -86,7 +86,7 @@ void checkErrorUR(amd_comgr_status_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(Error, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -113,7 +113,7 @@ void checkErrorUR(hipError_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(Error, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -133,7 +133,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR HIP ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(Error, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { diff --git a/unified-runtime/source/adapters/hip/enqueue.cpp b/unified-runtime/source/adapters/hip/enqueue.cpp index a313f05aa76b..3cf6eeb288a8 100644 --- a/unified-runtime/source/adapters/hip/enqueue.cpp +++ b/unified-runtime/source/adapters/hip/enqueue.cpp @@ -1408,8 +1408,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch( // mem_advise. if (!Device->getManagedMemSupport()) { releaseEvent(); - UR_LOG(WARN, "mem_advise ignored as device does not support " - "managed memory access."); + UR_LOG(Warning, "mem_advise ignored as device does not support " + "managed memory access."); return UR_RESULT_SUCCESS; } @@ -1423,7 +1423,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch( // async prefetch requires USM pointer (or hip SVM) to work. if (!attribs.isManaged) { releaseEvent(); - UR_LOG(WARN, "Prefetch hint ignored as prefetch only works with USM."); + UR_LOG(Warning, "Prefetch hint ignored as prefetch only works with USM."); return UR_RESULT_SUCCESS; } @@ -1479,8 +1479,8 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size, // mem_advise. if (!Device->getManagedMemSupport()) { releaseEvent(); - UR_LOG(WARN, "mem_advise ignored as device does not support " - "managed memory access."); + UR_LOG(Warning, "mem_advise ignored as device does not support " + "managed memory access."); return UR_RESULT_SUCCESS; } @@ -1496,8 +1496,8 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size, UR_USM_ADVICE_FLAG_DEFAULT)) { if (!Device->getConcurrentManagedAccess()) { releaseEvent(); - UR_LOG(WARN, "mem_advise ignored as device does not support " - "concurrent memory access."); + UR_LOG(Warning, "mem_advise ignored as device does not support " + "concurrent memory access."); return UR_RESULT_SUCCESS; } @@ -1516,8 +1516,8 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size, if (auto ptrAttribs = getPointerAttributes(pMem); !ptrAttribs || !ptrAttribs->isManaged) { releaseEvent(); - UR_LOG(WARN, "mem_advise is ignored as the pointer argument is not " - "a shared USM pointer."); + UR_LOG(Warning, "mem_advise is ignored as the pointer argument is not " + "a shared USM pointer."); return UR_RESULT_SUCCESS; } @@ -1545,8 +1545,8 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size, // the runtime. if (Result == UR_RESULT_ERROR_INVALID_ENUMERATION) { releaseEvent(); - UR_LOG(WARN, "mem_advise is ignored as the advice argument is not " - "supported by this device."); + UR_LOG(Warning, "mem_advise is ignored as the advice argument is not " + "supported by this device."); return UR_RESULT_SUCCESS; } UR_CHECK_ERROR(Result); diff --git a/unified-runtime/source/adapters/hip/image.cpp b/unified-runtime/source/adapters/hip/image.cpp index f5fc8b302671..778a5edf09cf 100644 --- a/unified-runtime/source/adapters/hip/image.cpp +++ b/unified-runtime/source/adapters/hip/image.cpp @@ -825,7 +825,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - UR_LOG(ERROR, + UR_LOG(Error, "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/adapter.cpp b/unified-runtime/source/adapters/level_zero/adapter.cpp index 275abb0d6c7e..0d9c377b7bc9 100644 --- a/unified-runtime/source/adapters/level_zero/adapter.cpp +++ b/unified-runtime/source/adapters/level_zero/adapter.cpp @@ -163,7 +163,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, ZE2UR_CALL(zeDriverGet, (&ZeDriverGetCount, ZeDriverGetHandles.data())); } if (ZeDriverGetCount == 0 && GlobalAdapter->ZeInitDriversCount == 0) { - UR_LOG(ERROR, "\nNo Valid L0 Drivers found.\n"); + UR_LOG(Error, "\nNo Valid L0 Drivers found.\n"); return UR_RESULT_SUCCESS; } @@ -188,7 +188,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, // newer drivers. if (ZeDriverGetProperties.driverVersion != ZeInitDriverProperties.driverVersion) { - UR_LOG(DEBUG, + UR_LOG(Debug, "\nzeDriverHandle {} added to the zeInitDrivers list " "of possible handles.\n", ZeDriverGetHandles[Y]); @@ -202,7 +202,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, ZeDrivers.assign(ZeDriverGetHandles.begin(), ZeDriverGetHandles.end()); } ZeDriverCount = ZeDrivers.size(); - UR_LOG(DEBUG, "\n{} L0 Drivers found.\n", ZeDriverCount); + UR_LOG(Debug, "\n{} L0 Drivers found.\n", ZeDriverCount); for (uint32_t I = 0; I < ZeDriverCount; ++I) { // Keep track of the first platform init for this Driver bool DriverPlatformInit = false; @@ -361,7 +361,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (getenv("SYCL_ENABLE_PCI") != nullptr) { UR_LOG( - WARN, + Warning, "WARNING: SYCL_ENABLE_PCI is deprecated and no longer needed.\n"); } @@ -383,13 +383,13 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (UrL0InitAllDrivers) { L0InitFlags |= ZE_INIT_FLAG_VPU_ONLY; } - UR_LOG(DEBUG, "\nzeInit with flags value of {}\n", + UR_LOG(Debug, "\nzeInit with flags value of {}\n", static_cast(L0InitFlags)); GlobalAdapter->ZeInitResult = ZE_CALL_NOCHECK(zeInit, (L0InitFlags)); if (GlobalAdapter->ZeInitResult != ZE_RESULT_SUCCESS) { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitResult, ErrorString); - UR_LOG(ERROR, "\nzeInit failed with {}\n", ErrorString); + UR_LOG(Error, "\nzeInit failed with {}\n", ErrorString); } bool useInitDrivers = false; @@ -405,7 +405,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (strncmp(versions[i].component_name, "loader", strlen("loader")) == 0) { loader_version = versions[i].component_lib_version; - UR_LOG(DEBUG, "\nLevel Zero Loader Version: {}.{}.{}\n", + UR_LOG(Debug, "\nLevel Zero Loader Version: {}.{}.{}\n", loader_version.major, loader_version.minor, loader_version.patch); break; @@ -430,7 +430,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() GlobalAdapter->processHandle, "zeInitDrivers"); #endif if (GlobalAdapter->initDriversFunctionPtr) { - UR_LOG(DEBUG, "\nzeInitDrivers with flags value of {}\n", + UR_LOG(Debug, "\nzeInitDrivers with flags value of {}\n", static_cast(GlobalAdapter->InitDriversDesc.flags)); GlobalAdapter->ZeInitDriversResult = ZE_CALL_NOCHECK(GlobalAdapter->initDriversFunctionPtr, @@ -441,7 +441,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() } else { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitDriversResult, ErrorString); - UR_LOG(ERROR, "\nzeInitDrivers failed with {}\n", ErrorString); + UR_LOG(Error, "\nzeInitDrivers failed with {}\n", ErrorString); } } } @@ -459,12 +459,12 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() // Absorb the ZE_RESULT_ERROR_UNINITIALIZED and just return 0 Platforms. if (*GlobalAdapter->ZeResult == ZE_RESULT_ERROR_UNINITIALIZED) { - UR_LOG(ERROR, "Level Zero Uninitialized\n"); + UR_LOG(Error, "Level Zero Uninitialized\n"); result = std::move(platforms); return; } if (*GlobalAdapter->ZeResult != ZE_RESULT_SUCCESS) { - UR_LOG(ERROR, "Level Zero initialization failure\n"); + UR_LOG(Error, "Level Zero initialization failure\n"); result = ze2urResult(*GlobalAdapter->ZeResult); return; @@ -511,7 +511,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() GlobalAdapter->getSysManDriversFunctionPtr && GlobalAdapter->sysManInitFunctionPtr) { ze_init_flags_t L0ZesInitFlags = 0; - UR_LOG(DEBUG, "\nzesInit with flags value of {}\n", + UR_LOG(Debug, "\nzesInit with flags value of {}\n", static_cast(L0ZesInitFlags)); GlobalAdapter->ZesResult = ZE_CALL_NOCHECK( GlobalAdapter->sysManInitFunctionPtr, (L0ZesInitFlags)); diff --git a/unified-runtime/source/adapters/level_zero/async_alloc.cpp b/unified-runtime/source/adapters/level_zero/async_alloc.cpp index cd363c49504c..b02a74e9458a 100644 --- a/unified-runtime/source/adapters/level_zero/async_alloc.cpp +++ b/unified-runtime/source/adapters/level_zero/async_alloc.cpp @@ -92,7 +92,7 @@ static ur_result_t enqueueUSMAllocHelper( CommandType = UR_COMMAND_ENQUEUE_USM_SHARED_ALLOC_EXP; break; default: - UR_LOG(ERROR, "enqueueUSMAllocHelper: unsupported USM type"); + UR_LOG(Error, "enqueueUSMAllocHelper: unsupported USM type"); throw UR_RESULT_ERROR_UNKNOWN; } UR_CALL(createEventAndAssociateQueue(Queue, Event, CommandType, CommandList, diff --git a/unified-runtime/source/adapters/level_zero/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/command_buffer.cpp index 3fa051a8bd9b..c68a295929be 100644 --- a/unified-runtime/source/adapters/level_zero/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/command_buffer.cpp @@ -19,7 +19,7 @@ */ // Print the name of a variable and its value in the L0 debug log -#define DEBUG_LOG(VAR) UR_LOG(DEBUG, #VAR " {}", VAR); +#define DEBUG_LOG(VAR) UR_LOG(Debug, #VAR " {}", VAR); namespace { @@ -44,7 +44,7 @@ bool checkImmediateAppendSupport(ur_context_handle_t Context, const bool EnableAppendPath = std::atoi(UrRet) == 1; if (EnableAppendPath && !Device->ImmCommandListUsed) { - UR_LOG(ERROR, + UR_LOG(Error, "{} is set but immediate command-lists are currently " "disabled. Immediate command-lists are " "required to use the immediate append path.", @@ -52,7 +52,7 @@ bool checkImmediateAppendSupport(ur_context_handle_t Context, std::abort(); } if (EnableAppendPath && !DriverSupportsImmediateAppend) { - UR_LOG(ERROR, + UR_LOG(Error, "{} is set but the current driver does not support the " "zeCommandListImmediateAppendCommandListsExp entrypoint.", AppendEnvVarName); @@ -1842,7 +1842,7 @@ ur_result_t validateCommandDesc( auto SupportedFeatures = CommandBuffer->Device->ZeDeviceMutableCmdListsProperties ->mutableCommandFlags; - UR_LOG(DEBUG, "Mutable features supported by device {}", SupportedFeatures); + UR_LOG(Debug, "Mutable features supported by device {}", SupportedFeatures); auto Command = static_cast(CommandDesc.hCommand); UR_ASSERT(CommandBuffer == Command->CommandBuffer, @@ -1871,7 +1871,7 @@ ur_result_t validateCommandDesc( if (NewGlobalWorkOffset) { if (!CommandBuffer->Context->getPlatform() ->ZeDriverGlobalOffsetExtensionFound) { - UR_LOG(ERROR, "No global offset extension found on this driver"); + UR_LOG(Error, "No global offset extension found on this driver"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/common.cpp b/unified-runtime/source/adapters/level_zero/common.cpp index a0f150c142f1..7288dd10f66e 100644 --- a/unified-runtime/source/adapters/level_zero/common.cpp +++ b/unified-runtime/source/adapters/level_zero/common.cpp @@ -76,7 +76,7 @@ bool setEnvVar(const char *name, const char *value) { int Res = setenv(name, value, 1); #endif if (Res != 0) { - UR_LOG(DEBUG, + UR_LOG(Debug, "UR L0 Adapter was unable to set the environment variable: {}", name); return false; @@ -139,7 +139,7 @@ void zeParseError(ze_result_t ZeError, const char *&ErrorString) { ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *ZeName, const char *ZeArgs, bool TraceError) { - UR_LOG(DEBUG, "ZE ---> {}{}", ZeName, ZeArgs); + UR_LOG(Debug, "ZE ---> {}{}", ZeName, ZeArgs); if (ZeResult == ZE_RESULT_SUCCESS) { if (UrL0LeaksDebug) { @@ -151,7 +151,7 @@ ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *ZeName, if (TraceError) { const char *ErrorString = "Unknown"; zeParseError(ZeResult, ErrorString); - UR_LOG(ERROR, "Error ({}) in {}", ErrorString, ZeName); + UR_LOG(Error, "Error ({}) in {}", ErrorString, ZeName); } return ZeResult; } diff --git a/unified-runtime/source/adapters/level_zero/common.hpp b/unified-runtime/source/adapters/level_zero/common.hpp index b3ed8d09fe14..65e749e586f8 100644 --- a/unified-runtime/source/adapters/level_zero/common.hpp +++ b/unified-runtime/source/adapters/level_zero/common.hpp @@ -45,7 +45,7 @@ struct _ur_platform_handle_t; } } catch (...) { } - UR_LOG(DEBUG, + UR_LOG(Debug, "ZE ---> checkL0LoaderTeardown: Loader is in teardown or is unstable"); return false; } diff --git a/unified-runtime/source/adapters/level_zero/context.cpp b/unified-runtime/source/adapters/level_zero/context.cpp index c434566e3dc0..6b9350239a6b 100644 --- a/unified-runtime/source/adapters/level_zero/context.cpp +++ b/unified-runtime/source/adapters/level_zero/context.cpp @@ -171,7 +171,7 @@ ur_result_t urContextSetExtendedDeleter( std::ignore = Context; std::ignore = Deleter; std::ignore = UserData; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -211,7 +211,7 @@ ur_result_t ur_context_handle_t_::initialize() { true /*Only Allow Driver In Order List if requested*/) && Device->useDriverCounterBasedEvents()) { UR_LOG( - DEBUG, + Debug, "L0 Synchronous Immediate Command List needed with In Order property."); ZeCommandQueueDesc.flags |= ZE_COMMAND_QUEUE_FLAG_IN_ORDER; } @@ -463,7 +463,7 @@ ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool( ZeEventPoolDesc.flags |= ZE_EVENT_POOL_FLAG_HOST_VISIBLE; if (ProfilingEnabled) ZeEventPoolDesc.flags |= ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP; - UR_LOG(DEBUG, "ze_event_pool_desc_t flags set to: {}", + UR_LOG(Debug, "ze_event_pool_desc_t flags set to: {}", ZeEventPoolDesc.flags); if (CounterBasedEventEnabled) { if (UsingImmCmdList) { @@ -472,7 +472,7 @@ ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool( counterBasedExt.flags = ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_NON_IMMEDIATE; } - UR_LOG(DEBUG, "ze_event_pool_desc_t counter based flags set to: {}", + UR_LOG(Debug, "ze_event_pool_desc_t counter based flags set to: {}", counterBasedExt.flags); if (InterruptBasedEventEnabled) { counterBasedExt.pNext = &eventSyncMode; @@ -513,7 +513,7 @@ ur_event_handle_t ur_context_handle_t_::getEventFromContextCache( getEventCache(HostVisible, WithProfiling, Device, CounterBasedEventEnabled, InterruptBasedEventEnabled); if (Cache->empty()) { - UR_LOG(INFO, + UR_LOG(Info, "Cache empty (Host Visible: {}, Profiling: {}, Counter: {}, " "Interrupt: {}, Device: {})", HostVisible, WithProfiling, CounterBasedEventEnabled, @@ -528,7 +528,7 @@ ur_event_handle_t ur_context_handle_t_::getEventFromContextCache( // We have to reset event before using it. Event->reset(); - UR_LOG(INFO, + UR_LOG(Info, "Using {} event (Host Visible: {}, Profiling: {}, Counter: {}, " "Interrupt: {}, Device: {}) from cache {}", Event, Event->HostVisibleEvent, Event->isProfilingEnabled(), @@ -549,7 +549,7 @@ void ur_context_handle_t_::addEventToContextCache(ur_event_handle_t Event) { auto Cache = getEventCache( Event->isHostVisible(), Event->isProfilingEnabled(), Device, Event->CounterBasedEventsEnabled, Event->InterruptBasedEventsEnabled); - UR_LOG(INFO, + UR_LOG(Info, "Inserting {} event (Host Visible: {}, Profiling: {}, Counter: {}, " "Device: {}) into cache {}", Event, Event->HostVisibleEvent, Event->isProfilingEnabled(), diff --git a/unified-runtime/source/adapters/level_zero/device.cpp b/unified-runtime/source/adapters/level_zero/device.cpp index 0c822173e1ac..c92f7b8f4ada 100644 --- a/unified-runtime/source/adapters/level_zero/device.cpp +++ b/unified-runtime/source/adapters/level_zero/device.cpp @@ -52,7 +52,7 @@ getRangeOfAllowedCopyEngines(const ur_device_handle_t &Device) { int UpperCopyEngineIndex = std::stoi(CopyEngineRange.substr(pos + 1)); if ((LowerCopyEngineIndex > UpperCopyEngineIndex) || (LowerCopyEngineIndex < -1) || (UpperCopyEngineIndex < -1)) { - UR_LOG(ERROR, "UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " + UR_LOG(Error, "UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " "default set."); LowerCopyEngineIndex = 0; UpperCopyEngineIndex = INT_MAX; @@ -141,7 +141,7 @@ ur_result_t urDeviceGet( break; default: Matched = false; - UR_LOG(WARN, "Unknown device type"); + UR_LOG(Warning, "Unknown device type"); break; } @@ -194,7 +194,7 @@ static std::tuple getZesDeviceData(ur_device_handle_t Device) { bool SysManEnv = getenv_tobool("ZES_ENABLE_SYSMAN", false); if ((Device->Platform->ZedeviceToZesDeviceMap.size() == 0) && !SysManEnv) { - UR_LOG(ERROR, "SysMan support is unavailable on this system. Please " + UR_LOG(Error, "SysMan support is unavailable on this system. Please " "check your level zero driver installation."); return {nullptr, {}, UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION}; } @@ -250,7 +250,7 @@ ur_result_t urDeviceGetInfo( case ZE_DEVICE_TYPE_FPGA: return ReturnValue(UR_DEVICE_TYPE_FPGA); default: - UR_LOG(ERROR, "This device type is not supported"); + UR_LOG(Error, "This device type is not supported"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1107,8 +1107,8 @@ ur_result_t urDeviceGetInfo( case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP: - UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(ERROR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + UR_LOG(Error, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(Error, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP: { // L0 does not support mipmaps. @@ -1119,8 +1119,8 @@ ur_result_t urDeviceGetInfo( return ReturnValue(false); } case UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP: - UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(ERROR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + UR_LOG(Error, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(Error, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP: { // L0 does not support creation of images from individual mipmap levels. @@ -1338,8 +1338,8 @@ ur_result_t urDeviceGetInfo( } } default: - UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(ERROR, "ParamNameParamName={}(0x{})", ParamName, + UR_LOG(Error, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(Error, "ParamNameParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; } @@ -1652,7 +1652,7 @@ ur_device_handle_t_::useImmediateCommandLists() { } } - UR_LOG(INFO, "NOTE: L0 Immediate CommandList Setting: {}", + UR_LOG(Info, "NOTE: L0 Immediate CommandList Setting: {}", ImmediateCommandlistsSetting); switch (ImmediateCommandlistsSetting) { @@ -1794,7 +1794,7 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal, if (numQueueGroups == 0) { return UR_RESULT_ERROR_UNKNOWN; } - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("NOTE: Number of queue groups = {}"), "Number of queue groups = {}", numQueueGroups); @@ -1850,23 +1850,23 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal, } } if (QueueGroup[queue_group_info_t::MainCopy].ZeOrdinal < 0) - UR_LOG_LEGACY(INFO, + UR_LOG_LEGACY(Info, logger::LegacyMessage( "NOTE: main blitter/copy engine is not available"), "main blitter/copy engine is not available") else - UR_LOG_LEGACY(INFO, + UR_LOG_LEGACY(Info, logger::LegacyMessage( "NOTE: main blitter/copy engine is available"), "main blitter/copy engine is available") if (QueueGroup[queue_group_info_t::LinkCopy].ZeOrdinal < 0) - UR_LOG_LEGACY(INFO, + UR_LOG_LEGACY(Info, logger::LegacyMessage( "NOTE: link blitter/copy engines are not available"), "link blitter/copy engines are not available") else - UR_LOG_LEGACY(INFO, + UR_LOG_LEGACY(Info, logger::LegacyMessage( "NOTE: link blitter/copy engines are available"), "link blitter/copy engines are available") diff --git a/unified-runtime/source/adapters/level_zero/event.cpp b/unified-runtime/source/adapters/level_zero/event.cpp index 32cd0806b662..187c260a04c6 100644 --- a/unified-runtime/source/adapters/level_zero/event.cpp +++ b/unified-runtime/source/adapters/level_zero/event.cpp @@ -29,7 +29,7 @@ void printZeEventList(const _ur_ze_event_list_t &UrZeEventList) { for (uint32_t I = 0; I < UrZeEventList.Length; I++) { ss << " " << ur_cast(UrZeEventList.ZeEventList[I]); } - UR_LOG(DEBUG, ss.str().c_str()); + UR_LOG(Debug, ss.str().c_str()); } } @@ -507,7 +507,7 @@ ur_result_t urEventGetInfo( return ReturnValue(Event->RefCount.load()); } default: - UR_LOG(ERROR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + UR_LOG(Error, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", PropName, logger::toHex(PropName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -593,11 +593,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(ERROR, "urEventGetProfilingInfo: " + UR_LOG(Error, "urEventGetProfilingInfo: " "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(Error, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -660,11 +660,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(ERROR, "urEventGetProfilingInfo: " + UR_LOG(Error, "urEventGetProfilingInfo: " "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(Error, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } else { @@ -707,11 +707,11 @@ ur_result_t urEventGetProfilingInfo( // return ReturnValue(uint64_t{0}); case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(ERROR, "urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " + UR_LOG(Error, "urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " "not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(Error, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -826,7 +826,7 @@ urEventWait(uint32_t NumEvents, die("The host-visible proxy event missing"); ze_event_handle_t ZeEvent = HostVisibleEvent->ZeEvent; - UR_LOG(DEBUG, "ZeEvent = {}", ur_cast(ZeEvent)); + UR_LOG(Debug, "ZeEvent = {}", ur_cast(ZeEvent)); // If this event was an inner batched event, then sync with // the Queue instead of waiting on the event. if (HostVisibleEvent->IsInnerBatchedEvent && Event->ZeBatchedQueue) { @@ -1001,7 +1001,7 @@ ur_result_t urEventSetCallback( std::ignore = ExecStatus; std::ignore = Notify; std::ignore = UserData; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp index 160627953166..ae061d437acb 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp @@ -35,7 +35,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormatTypeSize = 32; break; default: - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unsupported image format layout: layout = {}", ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; @@ -54,7 +54,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_A; break; default: - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unexpected image format channel x: x = {}", ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; @@ -64,7 +64,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, case ZE_IMAGE_FORMAT_LAYOUT_16_16: case ZE_IMAGE_FORMAT_LAYOUT_32_32: if (ZeImageFormat.x != ZE_IMAGE_FORMAT_SWIZZLE_R) { - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unexpected image format channel x: x = {}", ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; @@ -80,7 +80,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RX; break; default: - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unexpected image format channel y: y = {}\n", ZeImageFormat.y); return UR_RESULT_ERROR_INVALID_VALUE; @@ -99,13 +99,13 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGX; break; default: - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unexpected image format channel z: z = {}\n", ZeImageFormat.z); return UR_RESULT_ERROR_INVALID_VALUE; } } else { - UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel"); + UR_LOG(Error, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -123,7 +123,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGBA; break; default: - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unexpected image format channel w: w = {}", ZeImageFormat.w); return UR_RESULT_ERROR_INVALID_VALUE; @@ -139,12 +139,12 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormat.w == ZE_IMAGE_FORMAT_SWIZZLE_A) { ChannelOrder = UR_IMAGE_CHANNEL_ORDER_BGRA; } else { - UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel"); + UR_LOG(Error, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unsupported image format layout: layout = {}", ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; @@ -164,7 +164,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32; break; default: - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -182,7 +182,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SIGNED_INT32; break; default: - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -197,7 +197,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNORM_INT16; break; default: - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -212,7 +212,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SNORM_INT16; break; default: - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -227,14 +227,14 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_FLOAT; break; default: - UR_LOG(ERROR, + UR_LOG(Error, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - UR_LOG(ERROR, "ze2urImageFormat: unsupported image format type: type = {}", + UR_LOG(Error, "ze2urImageFormat: unsupported image format type: type = {}", ZeImageFormat.type); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -281,13 +281,13 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDesc: unexpected data type Size\n"); + UR_LOG(Error, "ur2zeImageDesc: unexpected data type Size\n"); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; } break; } default: - UR_LOG(ERROR, "format layout = {}", ImageFormat->channelOrder); + UR_LOG(Error, "format layout = {}", ImageFormat->channelOrder); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; break; } @@ -316,7 +316,7 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - UR_LOG(ERROR, "ur2zeImageDesc: unsupported image type"); + UR_LOG(Error, "ur2zeImageDesc: unsupported image type"); return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR; } @@ -513,7 +513,7 @@ getImageFormatTypeAndSize(const ur_image_format_t *ImageFormat) { break; } default: - UR_LOG(ERROR, "ur2zeImageDesc: unsupported image data type: data type = {}", + UR_LOG(Error, "ur2zeImageDesc: unsupported image data type: data type = {}", ImageFormat->channelType); ZeImageFormatType = ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32; ZeImageFormatTypeSize = 0; diff --git a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp index e015d14477cd..dbb76e37adf5 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp @@ -52,13 +52,13 @@ ur_result_t getSuggestedLocalWorkSize(ur_device_handle_t hDevice, --GroupSize[I]; } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - UR_LOG(ERROR, "getSuggestedLocalWorkSize: can't find a WG size " + UR_LOG(Error, "getSuggestedLocalWorkSize: can't find a WG size " "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } WG[I] = GroupSize[I]; } - UR_LOG(DEBUG, + UR_LOG(Debug, "getSuggestedLocalWorkSize: using computed WG size = {{{}, {}, {}}}", WG[0], WG[1], WG[2]); } @@ -70,7 +70,7 @@ ur_result_t setKernelGlobalOffset(ur_context_handle_t Context, ze_kernel_handle_t Kernel, uint32_t WorkDim, const size_t *GlobalWorkOffset) { if (!Context->getPlatform()->ZeDriverGlobalOffsetExtensionFound) { - UR_LOG(DEBUG, "No global offset extension found on this driver"); + UR_LOG(Debug, "No global offset extension found on this driver"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -130,26 +130,26 @@ ur_result_t calculateKernelWorkDimensions( break; default: - UR_LOG(ERROR, "calculateKernelWorkDimensions: unsupported work_dim"); + UR_LOG(Error, "calculateKernelWorkDimensions: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " + UR_LOG(Error, "calculateKernelWorkDimensions: invalid work_dim. The range " "is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " + UR_LOG(Error, "calculateKernelWorkDimensions: invalid work_dim. The range " "is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[2] != size_t(ZeThreadGroupDimensions.groupCountZ) * WG[2]) { - UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " + UR_LOG(Error, "calculateKernelWorkDimensions: invalid work_dim. The range " "is not a multiple of the group size in the 3rd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } diff --git a/unified-runtime/source/adapters/level_zero/image.cpp b/unified-runtime/source/adapters/level_zero/image.cpp index 050697cb653b..165fca5f01f6 100644 --- a/unified-runtime/source/adapters/level_zero/image.cpp +++ b/unified-runtime/source/adapters/level_zero/image.cpp @@ -56,7 +56,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(Error, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -75,7 +75,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(Error, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -95,7 +95,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(Error, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -113,13 +113,13 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(Error, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; } default: - UR_LOG(ERROR, "format channel order = {}", ImageFormat->channelOrder); + UR_LOG(Error, "format channel order = {}", ImageFormat->channelOrder); die("ur2zeImageDescBindless: unsupported image channel order\n"); break; } @@ -148,7 +148,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unsupported image type"); + UR_LOG(Error, "ur2zeImageDescBindless: unsupported image type"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -237,7 +237,7 @@ ur_result_t bindlessImagesCreateImpl(ur_context_handle_t hContext, DriverHandle, "zeImageGetDeviceOffsetExp", (void **)&zeImageGetDeviceOffsetExpFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - UR_LOG(ERROR, + UR_LOG(Error, "zeDriverGetExtensionFunctionAddress zeImageGetDeviceOffsetExpv " "failed, err = {}", Result); @@ -281,7 +281,7 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, DriverHandle, "zeMemGetPitchFor2dImage", (void **)&zeMemGetPitchFor2dImageFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - UR_LOG(ERROR, + UR_LOG(Error, "zeDriverGetExtensionFunctionAddress zeMemGetPitchFor2dImage " "failed, err = {}", Result); @@ -554,7 +554,7 @@ ur_result_t urBindlessImagesImageCopyExp( &DstRegion, &SrcRegion, ZeEvent, WaitList.Length, WaitList.ZeEventList)); } else { - UR_LOG(ERROR, "urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); + UR_LOG(Error, "urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -622,7 +622,7 @@ ur_result_t urBindlessImagesMipmapGetLevelExp( std::ignore = hImageMem; std::ignore = mipmapLevel; std::ignore = phImageMem; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -807,7 +807,7 @@ ur_result_t urBindlessImagesImportExternalSemaphoreExp( auto UrPlatform = hContext->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] "), + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] "), " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -940,7 +940,7 @@ ur_result_t urBindlessImagesReleaseExternalSemaphoreExp( std::ignore = hDevice; auto UrPlatform = hContext->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] "), + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] "), " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -963,7 +963,7 @@ ur_result_t urBindlessImagesWaitExternalSemaphoreExp( const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { auto UrPlatform = hQueue->Context->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not supported!"), "{} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1048,7 +1048,7 @@ ur_result_t urBindlessImagesSignalExternalSemaphoreExp( const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { auto UrPlatform = hQueue->Context->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not supported!"), "{} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/kernel.cpp b/unified-runtime/source/adapters/level_zero/kernel.cpp index afbfb703250b..213226078ca4 100644 --- a/unified-runtime/source/adapters/level_zero/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/kernel.cpp @@ -189,7 +189,7 @@ ur_result_t urEnqueueKernelLaunch( (*Event)->WaitList.Length, (*Event)->WaitList.ZeEventList)); } - UR_LOG(DEBUG, "calling zeCommandListAppendLaunchKernel() with ZeEvent {}", + UR_LOG(Debug, "calling zeCommandListAppendLaunchKernel() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList((*Event)->WaitList); @@ -316,14 +316,14 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - UR_LOG(ERROR, + UR_LOG(Error, "urEnqueueCooperativeKernelLaunchExp: can't find a WG size " "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } WG[I] = GroupSize[I]; } - UR_LOG(DEBUG, + UR_LOG(Debug, "urEnqueueCooperativeKernelLaunchExp: using computed WG " "size = {{{}, {}, {}}}", WG[0], WG[1], WG[2]); @@ -355,28 +355,28 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( break; default: - UR_LOG(ERROR, "urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); + UR_LOG(Error, "urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - UR_LOG(ERROR, + UR_LOG(Error, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - UR_LOG(ERROR, + UR_LOG(Error, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[2] != size_t(ZeThreadGroupDimensions.groupCountZ) * WG[2]) { - UR_LOG(DEBUG, + UR_LOG(Debug, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 3rd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; @@ -449,7 +449,7 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( (*Event)->WaitList.Length, (*Event)->WaitList.ZeEventList)); } - UR_LOG(DEBUG, + UR_LOG(Debug, "calling zeCommandListAppendLaunchCooperativeKernel() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList((*Event)->WaitList); @@ -790,7 +790,7 @@ ur_result_t urKernelGetInfo( return UR_RESULT_ERROR_UNKNOWN; } default: - UR_LOG(ERROR, + UR_LOG(Error, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; @@ -879,7 +879,7 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - UR_LOG(ERROR, + UR_LOG(Error, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; @@ -1025,7 +1025,7 @@ ur_result_t urKernelSetExecInfo( return UR_RESULT_ERROR_INVALID_VALUE; ZE2UR_CALL(zeKernelSetCacheConfig, (ZeKernel, ZeCacheConfig);); } else { - UR_LOG(ERROR, "urKernelSetExecInfo: unsupported ParamName"); + UR_LOG(Error, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1177,7 +1177,7 @@ ur_result_t urKernelSetSpecializationConstants( std::ignore = Kernel; std::ignore = Count; std::ignore = SpecConstants; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/memory.cpp b/unified-runtime/source/adapters/level_zero/memory.cpp index 381212c16af7..8431be354528 100644 --- a/unified-runtime/source/adapters/level_zero/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/memory.cpp @@ -117,7 +117,7 @@ ur_result_t enqueueMemCopyHelper(ur_command_t CommandType, const auto &ZeCommandList = CommandList->first; const auto &WaitList = (*Event)->WaitList; - UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + UR_LOG(Debug, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -169,7 +169,7 @@ ur_result_t enqueueMemCopyRectHelper( const auto &ZeCommandList = CommandList->first; const auto &WaitList = (*Event)->WaitList; - UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + UR_LOG(Debug, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -182,7 +182,7 @@ ur_result_t enqueueMemCopyRectHelper( ZeParams.srcPitch, ZeParams.srcSlicePitch, ZeEvent, WaitList.Length, WaitList.ZeEventList)); - UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopyRegion()"); + UR_LOG(Debug, "calling zeCommandListAppendMemoryCopyRegion()"); UR_CALL(Queue->executeCommandList(CommandList, Blocking, OkToBatch)); @@ -257,7 +257,7 @@ static ur_result_t enqueueMemFillHelper(ur_command_t CommandType, (ZeCommandList, Ptr, Pattern, PatternSize, Size, ZeEvent, WaitList.Length, WaitList.ZeEventList)); - UR_LOG(DEBUG, "calling zeCommandListAppendMemoryFill() with ZeEvent {}", + UR_LOG(Debug, "calling zeCommandListAppendMemoryFill() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -278,7 +278,7 @@ static ur_result_t enqueueMemFillHelper(ur_command_t CommandType, WaitList.Length, WaitList.ZeEventList)); } - UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + UR_LOG(Debug, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -462,7 +462,7 @@ static ur_result_t enqueueMemImageCommandHelper( ur_cast(ZeHandleSrc), &ZeDstRegion, &ZeSrcRegion, ZeEvent, 0, nullptr)); } else { - UR_LOG(ERROR, "enqueueMemImageUpdate: unsupported image command type"); + UR_LOG(Error, "enqueueMemImageUpdate: unsupported image command type"); return UR_RESULT_ERROR_INVALID_OPERATION; } @@ -1039,7 +1039,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - UR_LOG(ERROR, "urEnqueueMemBufferMap: duplicate mapping detected"); + UR_LOG(Error, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -1100,7 +1100,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - UR_LOG(ERROR, "urEnqueueMemBufferMap: duplicate mapping detected"); + UR_LOG(Error, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -1154,7 +1154,7 @@ ur_result_t urEnqueueMemUnmap( std::scoped_lock Guard(Buffer->Mutex); auto It = Buffer->Mappings.find(MappedPtr); if (It == Buffer->Mappings.end()) { - UR_LOG(ERROR, "urEnqueueMemUnmap: unknown memory mapping"); + UR_LOG(Error, "urEnqueueMemUnmap: unknown memory mapping"); return UR_RESULT_ERROR_INVALID_VALUE; } MapInfo = It->second; @@ -1437,7 +1437,7 @@ ur_result_t urEnqueueUSMFill2D( std::ignore = NumEventsInWaitList; std::ignore = EventWaitList; std::ignore = OutEvent; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1887,7 +1887,7 @@ ur_result_t urMemImageGetInfo( std::ignore = PropSize; std::ignore = ImgInfo; std::ignore = PropSizeRet; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1942,7 +1942,7 @@ ur_result_t urEnqueueReadHostPipe(ur_queue_handle_t hQueue, std::ignore = numEventsInWaitList; std::ignore = phEventWaitList; std::ignore = phEvent; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1964,7 +1964,7 @@ ur_result_t urEnqueueWriteHostPipe(ur_queue_handle_t hQueue, std::ignore = numEventsInWaitList; std::ignore = phEventWaitList; std::ignore = phEvent; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -2230,7 +2230,7 @@ ur_result_t _ur_buffer::getBufferZeHandle(char *&ZeHandle, } } - UR_LOG(DEBUG, "getZeHandle(pi_device{{{}}}) = {}", (void *)Device, + UR_LOG(Debug, "getZeHandle(pi_device{{{}}}) = {}", (void *)Device, (void *)Allocation.ZeHandle); return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/adapters/level_zero/platform.cpp b/unified-runtime/source/adapters/level_zero/platform.cpp index a0bdeffb1f98..0a9c29e32c19 100644 --- a/unified-runtime/source/adapters/level_zero/platform.cpp +++ b/unified-runtime/source/adapters/level_zero/platform.cpp @@ -102,7 +102,7 @@ ur_result_t urPlatformGetInfo( case UR_PLATFORM_INFO_ADAPTER: return ReturnValue(GlobalAdapter); default: - UR_LOG(DEBUG, "urPlatformGetInfo: unrecognized ParamName"); + UR_LOG(Debug, "urPlatformGetInfo: unrecognized ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/program.cpp b/unified-runtime/source/adapters/level_zero/program.cpp index 58935586f76c..87a18cbe2f0c 100644 --- a/unified-runtime/source/adapters/level_zero/program.cpp +++ b/unified-runtime/source/adapters/level_zero/program.cpp @@ -440,7 +440,7 @@ ur_result_t urProgramLinkExp( ZeModuleDesc.pInputModule = ZeExtModuleDesc.pInputModules[0]; ZeModuleDesc.pConstants = ZeExtModuleDesc.pConstants[0]; } else { - UR_LOG(ERROR, + UR_LOG(Error, "urProgramLink: level_zero driver does not have static linking " "support."); return UR_RESULT_ERROR_INVALID_VALUE; @@ -895,7 +895,7 @@ ur_result_t urProgramGetBuildInfo( // program. return ReturnValue(""); } else { - UR_LOG(ERROR, "urProgramGetBuildInfo: unsupported ParamName"); + UR_LOG(Error, "urProgramGetBuildInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -914,7 +914,7 @@ ur_result_t urProgramSetSpecializationConstant( std::ignore = SpecId; std::ignore = SpecSize; std::ignore = SpecValue; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/queue.cpp b/unified-runtime/source/adapters/level_zero/queue.cpp index 2e31c2c5b498..0a8ea4fadd10 100644 --- a/unified-runtime/source/adapters/level_zero/queue.cpp +++ b/unified-runtime/source/adapters/level_zero/queue.cpp @@ -456,7 +456,7 @@ ur_result_t urQueueGetInfo( } default: UR_LOG( - ERROR, + Error, "Unsupported ParamName in urQueueGetInfo: ParamName=ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_ENUMERATION; @@ -935,7 +935,7 @@ ur_result_t urEnqueueKernelLaunchCustomExp( std::ignore = phEventWaitList; std::ignore = phEvent; - UR_LOG(ERROR, "[UR][L0] {} function not implemented!", + UR_LOG(Error, "[UR][L0] {} function not implemented!", "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1016,9 +1016,9 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { Val = std::stoi(BatchConfig.substr(Pos)); } catch (...) { if (IsCopy) - UR_LOG(ERROR, "UR_L0_COPY_BATCH_SIZE: failed to parse value") + UR_LOG(Error, "UR_L0_COPY_BATCH_SIZE: failed to parse value") else - UR_LOG(ERROR, "UR_L0_BATCH_SIZE: failed to parse value") + UR_LOG(Error, "UR_L0_BATCH_SIZE: failed to parse value") break; } switch (Ord) { @@ -1041,19 +1041,19 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { die("Unexpected batch config"); } if (IsCopy) - UR_LOG(ERROR, "UR_L0_COPY_BATCH_SIZE: dynamic batch param #{}: {}", + UR_LOG(Error, "UR_L0_COPY_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, (int)Val) else - UR_LOG(ERROR, "UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", + UR_LOG(Error, "UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, (int)Val) }; } else { // Negative batch sizes are silently ignored. if (IsCopy) - UR_LOG(WARN, "UR_L0_COPY_BATCH_SIZE: ignored negative value") + UR_LOG(Warning, "UR_L0_COPY_BATCH_SIZE: ignored negative value") else - UR_LOG(WARN, "UR_L0_BATCH_SIZE: ignored negative value") + UR_LOG(Warning, "UR_L0_BATCH_SIZE: ignored negative value") } } return Config; @@ -1233,7 +1233,7 @@ void ur_queue_handle_t_::adjustBatchSizeForFullBatch(bool IsCopy) { ZeCommandListBatchConfig.NumTimesClosedFullThreshold) { if (QueueBatchSize < ZeCommandListBatchConfig.DynamicSizeMax) { QueueBatchSize += ZeCommandListBatchConfig.DynamicSizeStep; - UR_LOG(DEBUG, "Raising QueueBatchSize to {}", QueueBatchSize); + UR_LOG(Debug, "Raising QueueBatchSize to {}", QueueBatchSize); } CommandBatch.NumTimesClosedEarly = 0; CommandBatch.NumTimesClosedFull = 0; @@ -1260,7 +1260,7 @@ void ur_queue_handle_t_::adjustBatchSizeForPartialBatch(bool IsCopy) { QueueBatchSize = CommandBatch.OpenCommandList->second.size() - 1; if (QueueBatchSize < 1) QueueBatchSize = 1; - UR_LOG(DEBUG, "Lowering QueueBatchSize to {}", QueueBatchSize); + UR_LOG(Debug, "Lowering QueueBatchSize to {}", QueueBatchSize); CommandBatch.NumTimesClosedEarly = 0; CommandBatch.NumTimesClosedFull = 0; } @@ -1628,12 +1628,12 @@ ur_result_t urQueueReleaseInternal(ur_queue_handle_t Queue) { Queue->clearEndTimeRecordings(); - UR_LOG(DEBUG, + UR_LOG(Debug, "urQueueRelease(compute) NumTimesClosedFull {}, " "NumTimesClosedEarly {}", Queue->ComputeCommandBatch.NumTimesClosedFull, Queue->ComputeCommandBatch.NumTimesClosedEarly); - UR_LOG(DEBUG, + UR_LOG(Debug, "urQueueRelease(copy) NumTimesClosedFull {}, NumTimesClosedEarly {}", Queue->CopyCommandBatch.NumTimesClosedFull, Queue->CopyCommandBatch.NumTimesClosedEarly); @@ -2253,7 +2253,7 @@ ur_queue_handle_t_::ur_queue_group_t::getZeQueue(uint32_t *QueueGroupOrdinal) { ZeCommandQueueDesc.flags = ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY; } - UR_LOG(DEBUG, + UR_LOG(Debug, "[getZeQueue]: create queue ordinal = {}, index = {} " "(round robin in [{}, {}]) priority = {}", ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, LowerIndex, @@ -2318,7 +2318,7 @@ ur_result_t ur_queue_handle_t_::createCommandList( } UR_LOG( - DEBUG, + Debug, "create command list ordinal: {}, type: regular, device: {}, inOrder: {}", QueueGroupOrdinal, Device->ZeDevice, IsInOrderList); @@ -2486,12 +2486,12 @@ ur_command_list_ptr_t &ur_queue_handle_t_::ur_queue_group_t::getImmCmdList() { // If cache didn't contain a command list, create one. if (!ZeCommandList) { - UR_LOG(DEBUG, + UR_LOG(Debug, "[getZeQueue]: create queue ordinal = {}, index = {} " "(round robin in [{}, {}]) priority = {}", ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, LowerIndex, UpperIndex, Priority); - UR_LOG(DEBUG, + UR_LOG(Debug, "create command list ordinal: {}, type: immediate, device: " "{}, inOrder: {}", ZeCommandQueueDesc.ordinal, Queue->Device->ZeDevice, isInOrderList); diff --git a/unified-runtime/source/adapters/level_zero/sampler.cpp b/unified-runtime/source/adapters/level_zero/sampler.cpp index 82380f7185e4..2061961bcb9a 100644 --- a/unified-runtime/source/adapters/level_zero/sampler.cpp +++ b/unified-runtime/source/adapters/level_zero/sampler.cpp @@ -83,7 +83,7 @@ ur_result_t urSamplerCreate( ZeSamplerDesc.addressMode = ZE_SAMPLER_ADDRESS_MODE_MIRROR; break; default: - UR_LOG(ERROR, "urSamplerCreate: unsupported " + UR_LOG(Error, "urSamplerCreate: unsupported " "UR_SAMPLER_PROPERTIES_ADDRESSING_MODEE value"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -93,7 +93,7 @@ ur_result_t urSamplerCreate( else if (Props->filterMode == UR_SAMPLER_FILTER_MODE_LINEAR) ZeSamplerDesc.filterMode = ZE_SAMPLER_FILTER_MODE_LINEAR; else { - UR_LOG(ERROR, + UR_LOG(Error, "urSamplerCreate: unsupported UR_SAMPLER_FILTER_MODE value"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -159,7 +159,7 @@ ur_result_t urSamplerGetInfo( std::ignore = PropValueSize; std::ignore = PropValue; std::ignore = PropSizeRet; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -172,7 +172,7 @@ ur_result_t urSamplerGetNativeHandle( ur_native_handle_t *NativeSampler) { std::ignore = Sampler; std::ignore = NativeSampler; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -191,7 +191,7 @@ ur_result_t urSamplerCreateWithNativeHandle( std::ignore = Context; std::ignore = Properties; std::ignore = Sampler; - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/usm.cpp b/unified-runtime/source/adapters/level_zero/usm.cpp index c5ec5a55b1a1..560cd4aba70b 100644 --- a/unified-runtime/source/adapters/level_zero/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/usm.cpp @@ -450,7 +450,7 @@ ur_result_t urUSMGetMemAllocInfo( MemAllocaType = UR_USM_TYPE_SHARED; break; default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unexpected usm memory type"); + UR_LOG(Error, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(MemAllocaType); @@ -490,7 +490,7 @@ ur_result_t urUSMGetMemAllocInfo( return UR_RESULT_ERROR_INVALID_VALUE; } default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unsupported ParamName"); + UR_LOG(Error, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -855,7 +855,7 @@ umf_result_t L0MemoryProvider::open_ipc_handle(void *IpcData, void **Ptr) { memcpy(&fdRemote, &zeIpcData->zeHandle, sizeof(fdRemote)); fdLocal = ur_duplicate_fd(zeIpcData->pid, fdRemote); if (fdLocal == -1) { - UR_LOG(ERROR, "duplicating file descriptor from IPC handle failed"); + UR_LOG(Error, "duplicating file descriptor from IPC handle failed"); return UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC; } @@ -963,12 +963,12 @@ MakeProvider(ProviderParams *Params = nullptr) { } break; default: - UR_LOG(ERROR, "urUSMPoolCreate: invalid USM type found"); + UR_LOG(Error, "urUSMPoolCreate: invalid USM type found"); Ret = UMF_RESULT_ERROR_INVALID_ARGUMENT; } if (Ret != UMF_RESULT_SUCCESS) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to create UMF provider"); + UR_LOG(Error, "urUSMPoolCreate: failed to create UMF provider"); throw UsmAllocationException(umf::umf2urResult(Ret)); } @@ -1009,13 +1009,13 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store USM pool tag"); + UR_LOG(Error, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store UMF pool"); + UR_LOG(Error, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1069,12 +1069,12 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store USM pool tag"); + UR_LOG(Error, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store UMF pool"); + UR_LOG(Error, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1191,7 +1191,7 @@ ur_result_t ur_usm_pool_handle_t_::allocate(ur_context_handle_t Context, } if (*RetMem == nullptr) { auto umfRet = umfPoolGetLastAllocationError(umfPool); - UR_LOG(ERROR, + UR_LOG(Error, "enqueueUSMAllocHelper: allocation from the UMF pool {} failed", umfPool); return umf::umf2urResult(umfRet); diff --git a/unified-runtime/source/adapters/level_zero/v2/api.cpp b/unified-runtime/source/adapters/level_zero/v2/api.cpp index eeb70567910f..0307e12f3f01 100644 --- a/unified-runtime/source/adapters/level_zero/v2/api.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/api.cpp @@ -23,21 +23,21 @@ ur_result_t urContextSetExtendedDeleter(ur_context_handle_t hContext, ur_context_extended_deleter_t pfnDeleter, void *pUserData) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urKernelSetSpecializationConstants( ur_kernel_handle_t hKernel, uint32_t count, const ur_specialization_constant_info_t *pSpecConstants) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urEventSetCallback(ur_event_handle_t hEvent, ur_execution_info_t execStatus, ur_event_callback_t pfnNotify, void *pUserData) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -47,21 +47,21 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, ur_usm_pool_handle_t pool, size_t widthInBytes, size_t height, size_t elementSizeBytes, void **ppMem, size_t *pResultPitch) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -69,7 +69,7 @@ ur_result_t urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -77,7 +77,7 @@ ur_result_t urBindlessImagesImageFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -86,7 +86,7 @@ ur_result_t urBindlessImagesUnsampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_native_handle_t *phImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -95,14 +95,14 @@ ur_result_t urBindlessImagesSampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_sampler_handle_t hSampler, ur_exp_image_native_handle_t *phImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesImageGetInfoExp( ur_context_handle_t hContext, ur_exp_image_mem_native_handle_t hImageMem, ur_image_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -110,7 +110,7 @@ ur_result_t urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem, uint32_t mipmapLevel, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -118,7 +118,7 @@ ur_result_t urBindlessImagesMipmapFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -127,7 +127,7 @@ ur_result_t urBindlessImagesImportExternalMemoryExp( ur_exp_external_mem_type_t memHandleType, ur_exp_external_mem_desc_t *pExternalMemDesc, ur_exp_external_mem_handle_t *phExternalMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -136,21 +136,21 @@ ur_result_t urBindlessImagesMapExternalArrayExp( const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_external_mem_handle_t hExternalMem, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesMapExternalLinearMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, uint64_t offset, uint64_t size, ur_exp_external_mem_handle_t hExternalMem, void **ppRetMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_mem_handle_t hExternalMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -159,14 +159,14 @@ ur_result_t urBindlessImagesImportExternalSemaphoreExp( ur_exp_external_semaphore_type_t semHandleType, ur_exp_external_semaphore_desc_t *pExternalSemaphoreDesc, ur_exp_external_semaphore_handle_t *phExternalSemaphore) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalSemaphoreExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_semaphore_handle_t hExternalSemaphore) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -174,21 +174,21 @@ ur_result_t urCommandBufferUpdateKernelLaunchExp( ur_exp_command_buffer_handle_t hCommandBuffer, uint32_t numKernelUpdates, const ur_exp_command_buffer_update_kernel_launch_desc_t *pUpdateKernelLaunch) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateSignalEventExp( ur_exp_command_buffer_command_handle_t hCommand, ur_event_handle_t *phEvent) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateWaitEventsExp( ur_exp_command_buffer_command_handle_t hCommand, uint32_t NumEventsInWaitList, const ur_event_handle_t *phEventWaitList) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -196,28 +196,28 @@ ur_result_t UR_APICALL urUSMPoolCreateExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_desc_t *PoolDesc, ur_usm_pool_handle_t *pPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolSetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t propSize) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -225,21 +225,21 @@ ur_result_t UR_APICALL urUSMPoolGetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -247,7 +247,7 @@ ur_result_t UR_APICALL urUSMPoolTrimToExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool, size_t minBytesToKeep) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp index 01894cdd789b..0ce1845c6b83 100644 --- a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp @@ -20,7 +20,7 @@ namespace { // given context. void checkImmediateAppendSupport(ur_context_handle_t context) { if (!context->getPlatform()->ZeCommandListImmediateAppendExt.Supported) { - UR_LOG(ERROR, + UR_LOG(Error, "Adapter v2 is used but the current driver does not support " "the zeCommandListImmediateAppendCommandListsExp entrypoint."); throw UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp b/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp index dc57241a20ab..ad5878df0337 100644 --- a/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp @@ -62,12 +62,12 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { std::visit([](auto &&arg) { return arg.CopyOffloadEnabled; }, desc); if (ForceDisableCopyOffload && requestedCopyOffload) { - UR_LOG(INFO, "Copy offload is disabled by the environment variable."); + UR_LOG(Info, "Copy offload is disabled by the environment variable."); requestedCopyOffload = false; } if (!ZeCopyOffloadExtensionSupported && requestedCopyOffload) { - UR_LOG(INFO, + UR_LOG(Info, "Copy offload is requested but is not supported by the driver."); requestedCopyOffload = false; } @@ -89,7 +89,7 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { } QueueDesc.pNext = &offloadDesc; - UR_LOG(DEBUG, + UR_LOG(Debug, "create command list ordinal: {}, type: immediate, " "device: {}, inOrder: {}", ImmCmdDesc->Ordinal, ImmCmdDesc->ZeDevice, ImmCmdDesc->IsInOrder); @@ -106,7 +106,7 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { CmdListDesc.commandQueueGroupOrdinal = RegCmdDesc.Ordinal; CmdListDesc.pNext = &offloadDesc; - UR_LOG(DEBUG, + UR_LOG(Debug, "create command list ordinal: {}, type: immediate, " "device: {}, inOrder: {}", RegCmdDesc.Ordinal, RegCmdDesc.ZeDevice, RegCmdDesc.IsInOrder); diff --git a/unified-runtime/source/adapters/level_zero/v2/event.cpp b/unified-runtime/source/adapters/level_zero/v2/event.cpp index 36116d5ec35a..412b6f08b7a7 100644 --- a/unified-runtime/source/adapters/level_zero/v2/event.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/event.cpp @@ -271,7 +271,7 @@ ur_result_t urEventGetInfo(ur_event_handle_t hEvent, ur_event_info_t propName, return returnValue(hEvent->getCommandType()); } default: - UR_LOG(ERROR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + UR_LOG(Error, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", propName, logger::toHex(propName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -317,7 +317,7 @@ ur_result_t urEventGetProfilingInfo( return returnValue(hEvent->getEventEndTimestamp()); } default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(Error, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -367,7 +367,7 @@ ur_result_t urEventGetProfilingInfo( // return returnValue(uint64_t{0}); default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(Error, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp b/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp index 6239f3f5f741..6240aec2297b 100644 --- a/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp @@ -50,7 +50,7 @@ provider_pool::provider_pool(ur_context_handle_t context, queue_type queue, devices.push_back(d->ZeDevice); } - UR_LOG(DEBUG, "ze_event_pool_desc_t flags set to: {}", desc.flags); + UR_LOG(Debug, "ze_event_pool_desc_t flags set to: {}", desc.flags); ZE2UR_CALL_THROWS(zeEventPoolCreate, (context->getZeHandle(), &desc, devices.size(), diff --git a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp index b6d8ab9393ff..5eb775e34148 100644 --- a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp @@ -265,7 +265,7 @@ ur_result_t ur_kernel_handle_t_::setExecInfo(ur_kernel_exec_info_t propName, ZE2UR_CALL(zeKernelSetCacheConfig, (kernel->hKernel.get(), zeCacheConfig);); } else { - UR_LOG(ERROR, "urKernelSetExecInfo: unsupported ParamName"); + UR_LOG(Error, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -561,7 +561,7 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - UR_LOG(ERROR, + UR_LOG(Error, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; @@ -646,7 +646,7 @@ ur_result_t urKernelGetInfo(ur_kernel_handle_t hKernel, return ReturnValue(static_cast(attributes.data())); } default: - UR_LOG(ERROR, + UR_LOG(Error, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; diff --git a/unified-runtime/source/adapters/level_zero/v2/memory.cpp b/unified-runtime/source/adapters/level_zero/v2/memory.cpp index 4bbb71e85106..b79e2a59b473 100644 --- a/unified-runtime/source/adapters/level_zero/v2/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/memory.cpp @@ -95,7 +95,7 @@ ur_integrated_buffer_handle_t::ur_integrated_buffer_handle_t( this->ptr = usm_unique_ptr_t(rawPtr, [hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to free host memory: {}", ret); + UR_LOG(Error, "Failed to free host memory: {}", ret); } }); @@ -184,7 +184,7 @@ void *ur_discrete_buffer_handle_t::allocateOnDevice(ur_device_handle_t hDevice, usm_unique_ptr_t(ptr, [hContext = this->hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to free device memory: {}", ret); + UR_LOG(Error, "Failed to free device memory: {}", ret); } }); @@ -313,7 +313,7 @@ void *ur_discrete_buffer_handle_t::mapHostPtr( if (ownsAlloc) { auto ret = hContext->getDefaultUSMPool()->free(p); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to mapped memory: {}", ret); + UR_LOG(Error, "Failed to mapped memory: {}", ret); } } }); @@ -744,7 +744,7 @@ ur_result_t urMemImageCreateWithNativeHandle( ur_result_t urMemImageGetInfo(ur_mem_handle_t hMemory, ur_image_info_t propName, size_t propSize, void *pPropValue, size_t *pPropSizeRet) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(Error, "{} function not implemented!", __FUNCTION__); std::ignore = hMemory; std::ignore = propName; diff --git a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp index c64ce280bfbe..af5e959c448a 100644 --- a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp @@ -129,7 +129,7 @@ ur_queue_immediate_in_order_t::queueGetInfo(ur_queue_info_t propName, } } default: - UR_LOG(ERROR, + UR_LOG(Error, "Unsupported ParamName in urQueueGetInfo: " "ParamName=ParamName={}(0x{})", propName, logger::toHex(propName)); @@ -191,7 +191,7 @@ ur_queue_immediate_in_order_t::~ur_queue_immediate_in_order_t() { try { UR_CALL_THROWS(queueFinish()); } catch (...) { - UR_LOG(ERROR, "Failed to finish queue on destruction"); + UR_LOG(Error, "Failed to finish queue on destruction"); } } diff --git a/unified-runtime/source/adapters/level_zero/v2/usm.cpp b/unified-runtime/source/adapters/level_zero/v2/usm.cpp index 5fe928741bc7..53b7898e7bb0 100644 --- a/unified-runtime/source/adapters/level_zero/v2/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/usm.cpp @@ -163,7 +163,7 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t hContext, } } else { // If pooling is disabled, do nothing. - UR_LOG(INFO, "USM pooling is disabled. Skiping pool limits adjustment."); + UR_LOG(Info, "USM pooling is disabled. Skiping pool limits adjustment."); } auto devicesAndSubDevices = @@ -236,7 +236,7 @@ ur_result_t ur_usm_pool_handle_t_::free(void *ptr) { if (umfPool) { return umf::umf2urResult(umfPoolFree(umfPool, ptr)); } else { - UR_LOG(ERROR, "Failed to find pool for pointer: {}", ptr); + UR_LOG(Error, "Failed to find pool for pointer: {}", ptr); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -440,7 +440,7 @@ ur_result_t urUSMGetMemAllocInfo( memAllocType = UR_USM_TYPE_SHARED; break; default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unexpected usm memory type"); + UR_LOG(Error, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(memAllocType); @@ -469,7 +469,7 @@ ur_result_t urUSMGetMemAllocInfo( // TODO return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unsupported ParamName"); + UR_LOG(Error, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp index e07bf050345a..e63e04e96864 100644 --- a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp +++ b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp @@ -38,7 +38,7 @@ ur_result_t urVirtualMemGranularityGetInfo( return ReturnValue(PageSize); } default: - UR_LOG(ERROR, "Unsupported propName in urQueueGetInfo: propName={}({})", + UR_LOG(Error, "Unsupported propName in urQueueGetInfo: propName={}({})", propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -120,7 +120,7 @@ ur_result_t urVirtualMemGetInfo(ur_context_handle_t hContext, return ReturnValue(RetFlags); } default: - UR_LOG(ERROR, "Unsupported propName in urQueueGetInfo: propName={}({})", + UR_LOG(Error, "Unsupported propName in urQueueGetInfo: propName={}({})", propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/native_cpu/common.hpp b/unified-runtime/source/adapters/native_cpu/common.hpp index b2396daeebc8..95faa1aa6bc1 100644 --- a/unified-runtime/source/adapters/native_cpu/common.hpp +++ b/unified-runtime/source/adapters/native_cpu/common.hpp @@ -21,19 +21,19 @@ extern thread_local char ErrorMessage[MaxMessageSize]; #define DIE_NO_IMPLEMENTATION \ do { \ - UR_LOG(ERROR, "Not Implemented : {}", __FUNCTION__) \ + UR_LOG(Error, "Not Implemented : {}", __FUNCTION__) \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; \ } while (false) #define CONTINUE_NO_IMPLEMENTATION \ do { \ - UR_LOG(WARN, "Not Implemented : {}", __FUNCTION__) \ + UR_LOG(Warning, "Not Implemented : {}", __FUNCTION__) \ return UR_RESULT_SUCCESS; \ } while (false) #define CASE_UR_UNSUPPORTED(not_supported) \ case not_supported: \ - UR_LOG(ERROR, "Unsupported UR case : {} in {}", #not_supported, \ + UR_LOG(Error, "Unsupported UR case : {} in {}", #not_supported, \ __FUNCTION__) \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/native_cpu/device.cpp b/unified-runtime/source/adapters/native_cpu/device.cpp index 97c985543632..9a0be162822f 100644 --- a/unified-runtime/source/adapters/native_cpu/device.cpp +++ b/unified-runtime/source/adapters/native_cpu/device.cpp @@ -99,7 +99,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGet(ur_platform_handle_t hPlatform, if (NumEntries == 0) { /// Runtime queries number of devices if (phDevices != nullptr) { - UR_LOG(ERROR, "Invalid Arguments for urDevicesGet"); + UR_LOG(Error, "Invalid Arguments for urDevicesGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/adapters/native_cpu/platform.cpp b/unified-runtime/source/adapters/native_cpu/platform.cpp index 63cd25b9da32..c4a9e53ca9f3 100644 --- a/unified-runtime/source/adapters/native_cpu/platform.cpp +++ b/unified-runtime/source/adapters/native_cpu/platform.cpp @@ -29,7 +29,7 @@ urPlatformGet(ur_adapter_handle_t, uint32_t NumEntries, if (NumEntries == 0) { if (phPlatforms != nullptr) { - UR_LOG(ERROR, "Invalid argument combination for urPlatformsGet"); + UR_LOG(Error, "Invalid argument combination for urPlatformsGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/adapters/opencl/context.cpp b/unified-runtime/source/adapters/opencl/context.cpp index 9f91fabba87c..2b8b03dc3e3f 100644 --- a/unified-runtime/source/adapters/opencl/context.cpp +++ b/unified-runtime/source/adapters/opencl/context.cpp @@ -158,7 +158,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextSetExtendedDeleter( ur_context_handle_t hContext, ur_context_extended_deleter_t pfnDeleter, void *pUserData) { if (!ur::cl::getAdapter()->clSetContextDestructorCallback) { - UR_LOG_L(ur::cl::getAdapter()->log, WARN, + UR_LOG_L(ur::cl::getAdapter()->log, Warning, "clSetContextDestructorCallback not found, consider upgrading the " "OpenCL-ICD-Loader to the latest version."); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/common/latency_tracker.hpp b/unified-runtime/source/common/latency_tracker.hpp index f15790f20a64..0e87d89c331b 100644 --- a/unified-runtime/source/common/latency_tracker.hpp +++ b/unified-runtime/source/common/latency_tracker.hpp @@ -64,7 +64,7 @@ static inline latencyValues getValues(const struct hdr_histogram *histogram) { auto ret = hdr_value_at_percentiles(histogram, percentiles, values.percentileValues, numPercentiles); if (ret != 0) { - UR_LOG(ERROR, "Failed to get percentiles from latency histogram"); + UR_LOG(Error, "Failed to get percentiles from latency histogram"); } return values; @@ -137,7 +137,7 @@ class latency_histogram { auto ret = hdr_init(lowestDiscernibleValue, highestTrackableValue, significantFigures, &cHistogram); if (ret != 0) { - UR_LOG(ERROR, "Failed to initialize latency histogram"); + UR_LOG(Error, "Failed to initialize latency histogram"); } histogram = std::unique_ptr( cHistogram, &hdr_close); @@ -153,7 +153,7 @@ class latency_histogram { } if (hdr_min(histogram.get()) == std::numeric_limits::max()) { - UR_LOG(INFO, "[{}] latency: no data", name); + UR_LOG(Info, "[{}] latency: no data", name); return; } diff --git a/unified-runtime/source/common/linux/ur_lib_loader.cpp b/unified-runtime/source/common/linux/ur_lib_loader.cpp index 22353016176f..77d3556f2f4c 100644 --- a/unified-runtime/source/common/linux/ur_lib_loader.cpp +++ b/unified-runtime/source/common/linux/ur_lib_loader.cpp @@ -25,11 +25,11 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { int res = dlclose(handle); if (res) { - UR_LOG(ERROR, + UR_LOG(Error, "Failed to unload the library with the handle at address {}", handle); } else { - UR_LOG(INFO, "unloaded adapter 0x{}", handle); + UR_LOG(Info, "unloaded adapter 0x{}", handle); } } } @@ -59,21 +59,21 @@ LibLoader::loadAdapterLibrary(const char *name) { (strstr(err, name) == NULL || strstr(err, "required by") != NULL)) { // If the adapter cannot be loaded due to missing dependencies or any // other related error, it is considered as an error. - UR_LOG(ERROR, "failed to load adapter '{}' with error: {}", name, err); + UR_LOG(Error, "failed to load adapter '{}' with error: {}", name, err); } else { // Simply having the adapter library missing isn't an error. - UR_LOG(INFO, "failed to load adapter '{}' with error: {}", name, + UR_LOG(Info, "failed to load adapter '{}' with error: {}", name, err ? err : "unknown error"); } } else { #if defined(ADD_FULL_PATH_LOG) struct link_map *dlinfo_map; if (dlinfo(handle, RTLD_DI_LINKMAP, &dlinfo_map) == 0) { - UR_LOG(INFO, "loaded adapter 0x{} ({}) from {}", handle, name, + UR_LOG(Info, "loaded adapter 0x{} ({}) from {}", handle, name, dlinfo_map->l_name); } else #endif - UR_LOG(INFO, "loaded adapter 0x{} ({})", handle, name); + UR_LOG(Info, "loaded adapter 0x{} ({})", handle, name); } return std::unique_ptr(handle); } diff --git a/unified-runtime/source/common/logger/ur_logger.hpp b/unified-runtime/source/common/logger/ur_logger.hpp index 7cc27ac68a2c..32890d59b041 100644 --- a/unified-runtime/source/common/logger/ur_logger.hpp +++ b/unified-runtime/source/common/logger/ur_logger.hpp @@ -32,10 +32,10 @@ inline void init(const std::string &name) { get_logger(name.c_str()); } #define UR_LOG(...) URLOG_(logger::get_logger(), __VA_ARGS__) #define UR_LOG_LEGACY(...) URLOG_LEGACY_(logger::get_logger(), __VA_ARGS__) -#define UR_LOG_L(...) URLOG_(__VA_ARGS__) // TODO: consider removing UR_LOG_L and maybe UR_LOG_LEGACY macros, using UR_LOG // instead +#define UR_LOG_L(...) URLOG_(__VA_ARGS__) inline void setLevel(ur_logger_level_t level) { get_logger().setLevel(level); } diff --git a/unified-runtime/source/common/logger/ur_logger_details.hpp b/unified-runtime/source/common/logger/ur_logger_details.hpp index 21582609e8ea..74afdb332eae 100644 --- a/unified-runtime/source/common/logger/ur_logger_details.hpp +++ b/unified-runtime/source/common/logger/ur_logger_details.hpp @@ -115,21 +115,27 @@ class Logger { #define UR_STRIMPL_(x) #x #define UR_STR_(x) UR_STRIMPL_(x) +#define UR_STRIMPL_LOWERCASE_(x) \ + ([] { \ + std::string _str = #x; \ + std::transform(_str.begin(), _str.end(), _str.begin(), \ + [](unsigned char _c) { return std::tolower(_c); }); \ + return _str; \ + }()) +#define UR_STR_LCASE_(x) UR_STRIMPL_LOWERCASE_(x) + #define URLOG_(logger_instance, level, ...) \ { \ - (logger_instance) \ - .log(UR_LOGGER_LEVEL_##level, SHORT_FILE, UR_STR_(__LINE__), \ - __VA_ARGS__); \ + ur_logger_level_t _lvl = logger::str_to_level(UR_STR_LCASE_(level)); \ + (logger_instance).log(_lvl, SHORT_FILE, UR_STR_(__LINE__), __VA_ARGS__); \ } -#define URLOG_ALWAYS_(logger_instance, ...) \ - URLOG_(logger_instance, QUIET, __VA_ARGS__) - #define URLOG_LEGACY_(logger_instance, level, legacy_message, ...) \ { \ + ur_logger_level_t _lvl = logger::str_to_level(UR_STR_LCASE_(level)); \ (logger_instance) \ - .log(legacy_message, UR_LOGGER_LEVEL_##level, SHORT_FILE, \ - UR_STR_(__LINE__), __VA_ARGS__); \ + .log(legacy_message, _lvl, SHORT_FILE, UR_STR_(__LINE__), \ + __VA_ARGS__); \ } #endif /* UR_LOGGER_DETAILS_HPP */ diff --git a/unified-runtime/source/common/umf_helpers.hpp b/unified-runtime/source/common/umf_helpers.hpp index 28003ea5bd6a..0e079408f1fc 100644 --- a/unified-runtime/source/common/umf_helpers.hpp +++ b/unified-runtime/source/common/umf_helpers.hpp @@ -296,7 +296,7 @@ inline ur_result_t umf2urResult(umf_result_t umfResult) { umfMemoryProviderGetLastNativeError(hProvider, &Msg, &Err); if (Msg) { - UR_LOG(ERROR, "UMF failed with: {}", Msg); + UR_LOG(Error, "UMF failed with: {}", Msg); } return getProviderNativeError(umfMemoryProviderGetName(hProvider), Err); diff --git a/unified-runtime/source/common/ur_pool_manager.hpp b/unified-runtime/source/common/ur_pool_manager.hpp index 3b7fdfda1f29..7e768d9d3a2b 100644 --- a/unified-runtime/source/common/ur_pool_manager.hpp +++ b/unified-runtime/source/common/ur_pool_manager.hpp @@ -176,7 +176,7 @@ template struct pool_manager { ur_result_t addPool(const D &desc, unique_pool_handle_t &&hPool) { if (!descToPoolMap.try_emplace(desc, std::move(hPool)).second) { - UR_LOG(ERROR, "Pool for pool descriptor: {}, already exists", desc); + UR_LOG(Error, "Pool for pool descriptor: {}, already exists", desc); return UR_RESULT_ERROR_INVALID_ARGUMENT; } @@ -186,7 +186,7 @@ template struct pool_manager { std::optional getPool(const D &desc) { auto it = descToPoolMap.find(desc); if (it == descToPoolMap.end()) { - UR_LOG(ERROR, "Pool descriptor doesn't match any existing pool: {}", + UR_LOG(Error, "Pool descriptor doesn't match any existing pool: {}", desc); return std::nullopt; } diff --git a/unified-runtime/source/common/ur_util.cpp b/unified-runtime/source/common/ur_util.cpp index 74a8e8511949..7afd05c443f8 100644 --- a/unified-runtime/source/common/ur_util.cpp +++ b/unified-runtime/source/common/ur_util.cpp @@ -45,14 +45,14 @@ int ur_duplicate_fd(int pid, int fd_in) { errno = 0; int pid_fd = syscall(__NR_pidfd_open, pid, 0); if (pid_fd == -1) { - UR_LOG(ERROR, "__NR_pidfd_open"); + UR_LOG(Error, "__NR_pidfd_open"); return -1; } int fd_dup = syscall(__NR_pidfd_getfd, pid_fd, fd_in, 0); close(pid_fd); if (fd_dup == -1) { - UR_LOG(ERROR, "__NR_pidfd_getfd"); + UR_LOG(Error, "__NR_pidfd_getfd"); return -1; } @@ -63,7 +63,7 @@ int ur_duplicate_fd(int pid, int fd_in) { (void)pid; // unused (void)fd_in; // unused errno = ENOTSUP; // unsupported - UR_LOG(ERROR, "__NR_pidfd_open or __NR_pidfd_getfd not available"); + UR_LOG(Error, "__NR_pidfd_open or __NR_pidfd_getfd not available"); return -1; #endif /* defined(__NR_pidfd_open) && defined(__NR_pidfd_getfd) */ } diff --git a/unified-runtime/source/common/windows/ur_lib_loader.cpp b/unified-runtime/source/common/windows/ur_lib_loader.cpp index c4981526de8e..962b2c288de4 100644 --- a/unified-runtime/source/common/windows/ur_lib_loader.cpp +++ b/unified-runtime/source/common/windows/ur_lib_loader.cpp @@ -17,11 +17,11 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { BOOL res = FreeLibrary(handle); if (!res) { - UR_LOG(ERROR, + UR_LOG(Error, "Failed to unload the library with the handle at address 0x{}", handle); } else { - UR_LOG(INFO, "unloaded adapter 0x{}", handle); + UR_LOG(Info, "unloaded adapter 0x{}", handle); } } } @@ -29,10 +29,10 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { std::unique_ptr LibLoader::loadAdapterLibrary(const char *name) { if (HMODULE handle = LoadLibraryExA(name, nullptr, 0)) { - UR_LOG(INFO, "loaded adapter 0x{}: {}", handle, name); + UR_LOG(Info, "loaded adapter 0x{}: {}", handle, name); return std::unique_ptr{handle}; } else { - UR_LOG(DEBUG, "loading adapter failed with error {}: {}", GetLastError(), + UR_LOG(Debug, "loading adapter failed with error {}: {}", GetLastError(), name); } return nullptr; diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp index 9a100cd4bc5a..d8e3443802f8 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp @@ -18,7 +18,7 @@ namespace ur_sanitizer_layer { namespace asan { void AllocInfo::print() { - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "AllocInfo(Alloc=[{}-{}), User=[{}-{}), AllocSize={}, Type={})", (void *)AllocBegin, (void *)(AllocBegin + AllocSize), (void *)UserBegin, (void *)(UserEnd), AllocSize, ToString(Type)); diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp index d83d10235b91..54277a05c80e 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp @@ -97,7 +97,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::MEM_BUFFER, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -108,7 +108,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { UR_LOG_L( - getContext()->logger, ERROR, + getContext()->logger, Error, "Failed to copy {} bytes data from host pointer {} to buffer {}", Size, HostPtr, this); return URes; @@ -135,7 +135,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Context, nullptr, &USMDesc, Pool, Size, AllocType::HOST_USM, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to allocate {} bytes host USM for buffer {} migration", Size, this); return URes; @@ -149,7 +149,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to migrate memory buffer data"); return URes; } @@ -161,7 +161,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to migrate memory buffer data"); return URes; } @@ -177,7 +177,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getAsanInterceptor()->releaseMemory(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to free buffer handle {}", + UR_LOG_L(getContext()->logger, Error, "Failed to free buffer handle {}", Ptr); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp index 45f3d0963231..b134ff0456ef 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp @@ -40,19 +40,19 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getAsanInterceptor()->insertDevice(hDevice, DI)); DI->Type = GetDeviceType(Context, hDevice); if (DI->Type == DeviceType::UNKNOWN) { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport device"); + UR_LOG_L(getContext()->logger, Error, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } if (DI->Type != DeviceType) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Different device type in the same context"); return UR_RESULT_ERROR_INVALID_DEVICE; } - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", (void *)DI->Handle, ToString(DI->Type), DI->IsSupportSharedSystemUSM); - UR_LOG_L(getContext()->logger, INFO, "Add {} into context {}", + UR_LOG_L(getContext()->logger, Info, "Add {} into context {}", (void *)DI->Handle, (void *)Context); DI->Shadow = ShadowMemory; CI->DeviceList.emplace_back(hDevice); @@ -113,7 +113,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMHostAlloc"); + UR_LOG_L(getContext()->logger, Debug, "==== urUSMHostAlloc"); return getAsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -140,7 +140,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMDeviceAlloc"); + UR_LOG_L(getContext()->logger, Debug, "==== urUSMDeviceAlloc"); return getAsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -167,7 +167,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMSharedAlloc"); + UR_LOG_L(getContext()->logger, Debug, "==== urUSMSharedAlloc"); return getAsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -186,7 +186,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMFree"); + UR_LOG_L(getContext()->logger, Debug, "==== urUSMFree"); return getAsanInterceptor()->releaseMemory(hContext, pMem); } @@ -211,7 +211,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithIL"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithIL"); UR_CALL( pfnProgramCreateWithIL(hContext, pIL, length, pProperties, phProgram)); @@ -247,7 +247,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithBinary"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithBinary"); UR_CALL(pfnProgramCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, pProperties, phProgram)); @@ -274,7 +274,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithNativeHandle"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithNativeHandle"); UR_CALL(pfnProgramCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram)); @@ -295,7 +295,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramRetain"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramRetain"); UR_CALL(pfnRetain(hProgram)); @@ -322,7 +322,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuild"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuild"); auto UrRes = pfnProgramBuild(hContext, hProgram, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -353,7 +353,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuildExp"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuildExp"); auto UrRes = pfnBuildExp(hProgram, numDevices, phDevices, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -385,7 +385,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLink"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramLink"); auto UrRes = pfnProgramLink(hContext, count, phPrograms, pOptions, phProgram); if (UrRes != UR_RESULT_SUCCESS) { @@ -423,7 +423,7 @@ ur_result_t UR_APICALL urProgramLinkExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLinkExp"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramLinkExp"); auto UrRes = pfnProgramLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram); @@ -449,7 +449,7 @@ ur_result_t UR_APICALL urProgramRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramRelease"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramRelease"); UR_CALL(pfnProgramRelease(hProgram)); @@ -507,7 +507,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueKernelLaunch"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueKernelLaunch"); LaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue), pGlobalWorkSize, pLocalWorkSize, pGlobalWorkOffset, workDim); @@ -550,7 +550,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreate"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextCreate"); ur_result_t result = pfnCreate(numDevices, phDevices, pProperties, phContext); @@ -582,7 +582,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreateWithNativeHandle"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextCreateWithNativeHandle"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -605,7 +605,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRetain"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextRetain"); UR_CALL(pfnRetain(hContext)); @@ -627,7 +627,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRelease"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextRelease"); UR_CALL(pfnRelease(hContext)); @@ -663,7 +663,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferCreate"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferCreate"); void *Host = nullptr; if (pProperties) { @@ -717,7 +717,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetInfo"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemGetInfo"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMemory)) { UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); @@ -750,7 +750,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRetain"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemRetain"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { MemBuffer->RefCount++; @@ -772,7 +772,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRelease"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemRelease"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { if (--MemBuffer->RefCount != 0) { @@ -807,7 +807,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferPartition"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferPartition"); if (auto ParentBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { @@ -838,7 +838,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetNativeHandle"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemGetNativeHandle"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { char *Handle = nullptr; @@ -882,7 +882,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferRead"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferRead"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -930,7 +930,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWrite"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWrite"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -992,7 +992,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferReadRect"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferReadRect"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *SrcHandle = nullptr; @@ -1057,7 +1057,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWriteRect"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWriteRect"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *DstHandle = nullptr; @@ -1109,7 +1109,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopy"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopy"); auto SrcBuffer = getAsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getAsanInterceptor()->getMemBuffer(hBufferDst); @@ -1177,7 +1177,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopyRect"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopyRect"); auto SrcBuffer = getAsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getAsanInterceptor()->getMemBuffer(hBufferDst); @@ -1239,7 +1239,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferFill"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferFill"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *Handle = nullptr; @@ -1291,7 +1291,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferMap"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferMap"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { @@ -1378,7 +1378,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemUnmap"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemUnmap"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { MemBuffer::Mapping Mapping{}; @@ -1423,7 +1423,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRetain"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelRetain"); UR_CALL(pfnRetain(hKernel)); @@ -1444,7 +1444,7 @@ __urdlllocal ur_result_t urKernelRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRelease"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelRelease"); auto &KernelInfo = getAsanInterceptor()->getOrCreateKernelInfo(hKernel); if (--KernelInfo.RefCount == 0) { @@ -1474,7 +1474,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgValue"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgValue"); std::shared_ptr MemBuffer; if (argSize == sizeof(ur_mem_handle_t) && @@ -1507,7 +1507,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgMemObj"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgMemObj"); std::shared_ptr MemBuffer; if ((MemBuffer = getAsanInterceptor()->getMemBuffer(hArgValue))) { @@ -1538,7 +1538,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgLocal (argIndex={}, argSize={})", argIndex, argSize); @@ -1575,7 +1575,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgPointer (argIndex={}, pArgValue={})", argIndex, pArgValue); @@ -1960,7 +1960,7 @@ template struct NotSupportedApi; template struct NotSupportedApi { R static ReportError(A...) { - UR_LOG_L(getContext()->logger, ERROR, MsgType::value); + UR_LOG_L(getContext()->logger, Error, MsgType::value); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } }; @@ -2151,7 +2151,7 @@ ur_result_t initAsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Initialize ASAN DDI table failed: {}", result); } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp index 60709a60b413..f5677260da0d 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp @@ -116,7 +116,7 @@ ur_result_t AsanInterceptor::allocateMemory(ur_context_handle_t Context, UR_CALL(getContext()->urDdiTable.USM.pfnDeviceAlloc( Context, Device, Properties, Pool, NeededSize, &Allocated)); } else { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport memory type"); + UR_LOG_L(getContext()->logger, Error, "Unsupport memory type"); return UR_RESULT_ERROR_INVALID_ARGUMENT; } @@ -224,7 +224,7 @@ ur_result_t AsanInterceptor::releaseMemory(ur_context_handle_t Context, // If quarantine is disabled, USM is freed immediately if (!m_Quarantine) { - UR_LOG_L(getContext()->logger, DEBUG, "Free: {}", + UR_LOG_L(getContext()->logger, Debug, "Free: {}", (void *)AllocInfo->AllocBegin); ContextInfo->Stats.UpdateUSMRealFreed(AllocInfo->AllocSize, @@ -243,7 +243,7 @@ ur_result_t AsanInterceptor::releaseMemory(ur_context_handle_t Context, std::scoped_lock Guard(m_AllocationMapMutex); for (auto &It : ReleaseList) { auto ToFreeAllocInfo = It->second; - UR_LOG_L(getContext()->logger, INFO, "Quarantine Free: {}", + UR_LOG_L(getContext()->logger, Info, "Quarantine Free: {}", (void *)ToFreeAllocInfo->AllocBegin); ContextInfo->Stats.UpdateUSMRealFreed(ToFreeAllocInfo->AllocSize, @@ -271,7 +271,7 @@ ur_result_t AsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(Context, Device); if (!InternalQueue) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to create internal queue"); + UR_LOG_L(getContext()->logger, Error, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -431,13 +431,13 @@ AsanInterceptor::updateShadowMemory(std::shared_ptr &ContextInfo, ur_result_t AsanInterceptor::registerProgram(ur_program_handle_t Program) { ur_result_t Result = UR_RESULT_SUCCESS; - UR_LOG_L(getContext()->logger, INFO, "registerSpirKernels"); + UR_LOG_L(getContext()->logger, Info, "registerSpirKernels"); Result = registerSpirKernels(Program); if (Result != UR_RESULT_SUCCESS) { return Result; } - UR_LOG_L(getContext()->logger, INFO, "registerDeviceGlobals"); + UR_LOG_L(getContext()->logger, Info, "registerDeviceGlobals"); Result = registerDeviceGlobals(Program); if (Result != UR_RESULT_SUCCESS) { return Result; @@ -487,7 +487,7 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, &SKInfo[0], MetadataPtr, sizeof(SpirKernelInfo) * NumOfSpirKernel, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Can't read the value of <{}>: {}", + UR_LOG_L(getContext()->logger, Error, "Can't read the value of <{}>: {}", kSPIR_AsanSpirKernelMetadata, Result); return Result; } @@ -503,7 +503,7 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, KernelNameV.data(), (void *)SKI.KernelName, sizeof(char) * SKI.Size, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Can't read kernel name: {}", + UR_LOG_L(getContext()->logger, Error, "Can't read kernel name: {}", Result); return Result; } @@ -511,12 +511,12 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { std::string KernelName = std::string(KernelNameV.begin(), KernelNameV.end()); - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "SpirKernel(name='{}', isInstrumented={})", KernelName, true); PI->InstrumentedKernels.insert(std::move(KernelName)); } - UR_LOG_L(getContext()->logger, INFO, "Number of sanitized kernel: {}", + UR_LOG_L(getContext()->logger, Info, "Number of sanitized kernel: {}", PI->InstrumentedKernels.size()); } @@ -541,7 +541,7 @@ AsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Device, Program, kSPIR_AsanDeviceGlobalMetadata, &MetadataSize, &MetadataPtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, INFO, "No device globals"); + UR_LOG_L(getContext()->logger, Info, "No device globals"); continue; } @@ -553,7 +553,7 @@ AsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Device Global[{}] Read Failed: {}", + UR_LOG_L(getContext()->logger, Error, "Device Global[{}] Read Failed: {}", kSPIR_AsanDeviceGlobalMetadata, Result); return Result; } @@ -720,7 +720,7 @@ ur_result_t AsanInterceptor::prepareLaunch( auto PrivateMemoryUsage = GetKernelPrivateMemorySize(Kernel, DeviceInfo->Handle); - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "KernelInfo {} (Name={}, ArgNums={}, IsInstrumented={}, " "LocalMemory={}, PrivateMemory={})", (void *)Kernel, GetKernelName(Kernel), ArgNums, @@ -751,7 +751,7 @@ ur_result_t AsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); @@ -772,7 +772,7 @@ ur_result_t AsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgNums - 1, nullptr, LaunchInfo.Data.getDevicePtr()); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to set launch info: {}", + UR_LOG_L(getContext()->logger, Error, "Failed to set launch info: {}", URes); return URes; } @@ -813,15 +813,15 @@ ur_result_t AsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocLocalShadow( Queue, NumWG, LaunchInfo.Data.Host.LocalShadowOffset, LaunchInfo.Data.Host.LocalShadowOffsetEnd) != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, WARN, + UR_LOG_L(getContext()->logger, Warning, "Failed to allocate shadow memory for local memory, " "maybe the number of workgroup ({}) is too large", NumWG); - UR_LOG_L(getContext()->logger, WARN, + UR_LOG_L(getContext()->logger, Warning, "Skip checking local memory of kernel <{}>", GetKernelName(Kernel)); } else { - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "ShadowMemory(Local, WorkGroup{}, {} - {})", NumWG, (void *)LaunchInfo.Data.Host.LocalShadowOffset, (void *)LaunchInfo.Data.Host.LocalShadowOffsetEnd); @@ -833,15 +833,15 @@ ur_result_t AsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocPrivateShadow( Queue, NumWG, LaunchInfo.Data.Host.PrivateShadowOffset, LaunchInfo.Data.Host.PrivateShadowOffsetEnd) != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, WARN, + UR_LOG_L(getContext()->logger, Warning, "Failed to allocate shadow memory for private memory, " "maybe the number of workgroup ({}) is too large", NumWG); - UR_LOG_L(getContext()->logger, WARN, + UR_LOG_L(getContext()->logger, Warning, "Skip checking private memory of kernel <{}>", GetKernelName(Kernel)); } else { - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "ShadowMemory(Private, WorkGroup{}, {} - {})", NumWG, (void *)LaunchInfo.Data.Host.PrivateShadowOffset, (void *)LaunchInfo.Data.Host.PrivateShadowOffsetEnd); @@ -853,7 +853,7 @@ ur_result_t AsanInterceptor::prepareLaunch( std::vector LocalArgsInfo; for (auto [ArgIndex, ArgInfo] : KernelInfo.LocalArgs) { LocalArgsInfo.push_back(ArgInfo); - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "local_args (argIndex={}, size={}, sizeWithRZ={})", ArgIndex, ArgInfo.Size, ArgInfo.SizeWithRedZone); } @@ -863,7 +863,7 @@ ur_result_t AsanInterceptor::prepareLaunch( // sync asan runtime data to device side UR_CALL(LaunchInfo.Data.syncToDevice(Queue)); - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "LaunchInfo {} (device={}, debug={}, numLocalArgs={}, localArgs={})", (void *)LaunchInfo.Data.getDevicePtr(), ToString(LaunchInfo.Data.Host.DeviceTy), LaunchInfo.Data.Host.Debug, @@ -941,7 +941,7 @@ ur_usm_pool_handle_t ContextInfo::getUSMPool() { getContext()->urDdiTable.USM.pfnPoolCreate(Handle, &Desc, &USMPool); if (URes != UR_RESULT_SUCCESS && URes != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) { - UR_LOG_L(getContext()->logger, WARN, + UR_LOG_L(getContext()->logger, Warning, "Failed to create USM pool, the memory overhead " "may increase: {}", URes); diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp index 5d5df8bbbe72..938a91b69709 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp @@ -185,7 +185,7 @@ struct AsanRuntimeDataWrapper { Context, Device, nullptr, nullptr, sizeof(AsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to alloc device usm for asan runtime data: {}", Result); } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp index 6108d2ac4bbb..e8f83577579c 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp @@ -49,7 +49,7 @@ ur_result_t ShadowMemoryCPU::Setup() { auto URes = EnqueuePoisonShadow({}, 0, NullptrRedzoneSize, kNullPointerRedzoneMagic); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "EnqueuePoisonShadow(NullPointerRZ): {}", URes); return URes; } @@ -82,7 +82,7 @@ ur_result_t ShadowMemoryCPU::EnqueuePoisonShadow(ur_queue_handle_t, uptr Ptr, uptr ShadowBegin = MemToShadow(Ptr); uptr ShadowEnd = MemToShadow(Ptr + Size - 1); assert(ShadowBegin <= ShadowEnd); - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "EnqueuePoisonShadow(addr={}, count={}, value={})", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value); @@ -105,7 +105,7 @@ ur_result_t ShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; @@ -120,7 +120,7 @@ ur_result_t ShadowMemoryGPU::Setup() { Result = EnqueuePoisonShadow(Queue, 0, NullptrRedzoneSize, kNullPointerRedzoneMagic); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "EnqueuePoisonShadow(NullPointerRZ): {}", Result); return Result; } @@ -185,7 +185,7 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, &Desc, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urPhysicalMemCreate(): {}", + UR_LOG_L(getContext()->logger, Error, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -194,18 +194,18 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urVirtualMemMap({}, {}): {}", + UR_LOG_L(getContext()->logger, Error, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } - UR_LOG_L(getContext()->logger, DEBUG, "urVirtualMemMap: {} ~ {}", + UR_LOG_L(getContext()->logger, Debug, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); // Initialize to zero URes = EnqueueUSMBlockingSet(Queue, (void *)MappedPtr, 0, PageSize); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", + UR_LOG_L(getContext()->logger, Error, "EnqueueUSMBlockingSet(): {}", URes); return URes; } @@ -217,12 +217,12 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, auto URes = EnqueueUSMBlockingSet(Queue, (void *)ShadowBegin, Value, ShadowEnd - ShadowBegin + 1); - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "EnqueuePoisonShadow (addr={}, count={}, value={}): {}", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value, URes); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", URes); + UR_LOG_L(getContext()->logger, Error, "EnqueueUSMBlockingSet(): {}", URes); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp index 969b650a2f50..b64f4c4605cb 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp @@ -54,7 +54,7 @@ void AsanStats::Print(ur_context_handle_t Context) { void AsanStats::UpdateUSMMalloced(uptr MallocedSize, uptr RedzoneSize) { UsmMalloced += MallocedSize; UsmMallocedRedzones += RedzoneSize; - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "Stats: UpdateUSMMalloced(UsmMalloced={}, UsmMallocedRedzones={})", UsmMalloced, UsmMallocedRedzones); UpdateOverhead(); @@ -62,7 +62,7 @@ void AsanStats::UpdateUSMMalloced(uptr MallocedSize, uptr RedzoneSize) { void AsanStats::UpdateUSMFreed(uptr FreedSize) { UsmFreed += FreedSize; - UR_LOG_L(getContext()->logger, DEBUG, "Stats: UpdateUSMFreed(UsmFreed={})", + UR_LOG_L(getContext()->logger, Debug, "Stats: UpdateUSMFreed(UsmFreed={})", UsmFreed); } @@ -72,7 +72,7 @@ void AsanStats::UpdateUSMRealFreed(uptr FreedSize, uptr RedzoneSize) { if (getContext()->Options.MaxQuarantineSizeMB) { UsmFreed -= FreedSize; } - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "Stats: UpdateUSMRealFreed(UsmMalloced={}, UsmMallocedRedzones={})", UsmMalloced, UsmMallocedRedzones); UpdateOverhead(); @@ -80,14 +80,14 @@ void AsanStats::UpdateUSMRealFreed(uptr FreedSize, uptr RedzoneSize) { void AsanStats::UpdateShadowMalloced(uptr ShadowSize) { ShadowMalloced += ShadowSize; - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "Stats: UpdateShadowMalloced(ShadowMalloced={})", ShadowMalloced); UpdateOverhead(); } void AsanStats::UpdateShadowFreed(uptr ShadowSize) { ShadowMalloced -= ShadowSize; - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "Stats: UpdateShadowFreed(ShadowMalloced={})", ShadowMalloced); UpdateOverhead(); } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp index 42175132c0b9..4bebf0f1eed6 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp @@ -18,7 +18,7 @@ namespace ur_sanitizer_layer { namespace msan { void MsanAllocInfo::print() { - UR_LOG_L(getContext()->logger, INFO, "AllocInfo(Alloc=[{}-{}), AllocSize={})", + UR_LOG_L(getContext()->logger, Info, "AllocInfo(Alloc=[{}-{}), AllocSize={})", (void *)AllocBegin, (void *)(AllocBegin + AllocSize), AllocSize); } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp index dffae3e834fe..5984a66f4b05 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp @@ -137,7 +137,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::DEVICE_USM, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -148,7 +148,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { UR_LOG_L( - getContext()->logger, ERROR, + getContext()->logger, Error, "Failed to copy {} bytes data from host pointer {} to buffer {}", Size, HostPtr, this); return URes; @@ -180,7 +180,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.USM.pfnHostAlloc( Context, &USMDesc, Pool, Size, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to allocate {} bytes host " "USM for buffer {} migration", Size, this); @@ -195,7 +195,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to migrate memory buffer data"); return URes; } @@ -207,7 +207,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to migrate memory buffer data"); return URes; } @@ -223,7 +223,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getContext()->urDdiTable.USM.pfnFree(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to free buffer handle {}", + UR_LOG_L(getContext()->logger, Error, "Failed to free buffer handle {}", Ptr); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp index 772af80d8222..40f0ccee5b1f 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp @@ -33,14 +33,14 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getMsanInterceptor()->insertDevice(hDevice, DI)); DI->Type = GetDeviceType(Context, hDevice); if (DI->Type == DeviceType::UNKNOWN) { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport device"); + UR_LOG_L(getContext()->logger, Error, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", (void *)DI->Handle, ToString(DI->Type), DI->IsSupportSharedSystemUSM); - UR_LOG_L(getContext()->logger, INFO, "Add {} into context {}", + UR_LOG_L(getContext()->logger, Info, "Add {} into context {}", (void *)DI->Handle, (void *)Context); if (!DI->Shadow) { UR_CALL(DI->allocShadowMemory(Context)); @@ -99,7 +99,7 @@ ur_result_t urUSMDeviceAlloc( size_t size, /// [out] pointer to USM device memory object void **ppMem) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMDeviceAlloc"); + UR_LOG_L(getContext()->logger, Debug, "==== urUSMDeviceAlloc"); return getMsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -117,7 +117,7 @@ ur_result_t UR_APICALL urUSMHostAlloc( size, ///< [in] size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM host memory object ) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMHostAlloc"); + UR_LOG_L(getContext()->logger, Debug, "==== urUSMHostAlloc"); return getMsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -136,7 +136,7 @@ ur_result_t UR_APICALL urUSMSharedAlloc( size, ///< [in] size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM shared memory object ) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMSharedAlloc"); + UR_LOG_L(getContext()->logger, Debug, "==== urUSMSharedAlloc"); return getMsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -149,7 +149,7 @@ ur_result_t UR_APICALL urUSMFree( ur_context_handle_t hContext, /// [in] pointer to USM memory object void *pMem) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMFree"); + UR_LOG_L(getContext()->logger, Debug, "==== urUSMFree"); return getMsanInterceptor()->releaseMemory(hContext, pMem); } @@ -170,7 +170,7 @@ ur_result_t urProgramCreateWithIL( auto pfnProgramCreateWithIL = getContext()->urDdiTable.Program.pfnCreateWithIL; - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithIL"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithIL"); UR_CALL( pfnProgramCreateWithIL(hContext, pIL, length, pProperties, phProgram)); @@ -202,7 +202,7 @@ ur_result_t urProgramCreateWithBinary( auto pfnProgramCreateWithBinary = getContext()->urDdiTable.Program.pfnCreateWithBinary; - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithBinary"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithBinary"); UR_CALL(pfnProgramCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, pProperties, phProgram)); @@ -225,7 +225,7 @@ ur_result_t urProgramCreateWithNativeHandle( auto pfnProgramCreateWithNativeHandle = getContext()->urDdiTable.Program.pfnCreateWithNativeHandle; - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithNativeHandle"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithNativeHandle"); UR_CALL(pfnProgramCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram)); @@ -242,7 +242,7 @@ urProgramRetain(ur_program_handle_t hProgram) { auto pfnRetain = getContext()->urDdiTable.Program.pfnRetain; - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramRetain"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramRetain"); UR_CALL(pfnRetain(hProgram)); @@ -264,7 +264,7 @@ ur_result_t urProgramBuild( const char *pOptions) { auto pfnProgramBuild = getContext()->urDdiTable.Program.pfnBuild; - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuild"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuild"); auto UrRes = pfnProgramBuild(hContext, hProgram, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -291,7 +291,7 @@ ur_result_t urProgramBuildExp( const char *pOptions) { auto pfnBuildExp = getContext()->urDdiTable.ProgramExp.pfnBuildExp; - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuildExp"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuildExp"); auto UrRes = pfnBuildExp(hProgram, numDevices, phDevices, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -319,7 +319,7 @@ ur_result_t urProgramLink( ur_program_handle_t *phProgram) { auto pfnProgramLink = getContext()->urDdiTable.Program.pfnLink; - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLink"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramLink"); auto UrRes = pfnProgramLink(hContext, count, phPrograms, pOptions, phProgram); if (UrRes != UR_RESULT_SUCCESS) { @@ -353,7 +353,7 @@ ur_result_t urProgramLinkExp( ur_program_handle_t *phProgram) { auto pfnProgramLinkExp = getContext()->urDdiTable.ProgramExp.pfnLinkExp; - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLinkExp"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramLinkExp"); auto UrRes = pfnProgramLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram); @@ -375,7 +375,7 @@ ur_result_t urProgramRelease( ur_program_handle_t hProgram) { auto pfnProgramRelease = getContext()->urDdiTable.Program.pfnRelease; - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramRelease"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramRelease"); UR_CALL(pfnProgramRelease(hProgram)); @@ -423,7 +423,7 @@ ur_result_t urEnqueueKernelLaunch( ur_event_handle_t *phEvent) { auto pfnKernelLaunch = getContext()->urDdiTable.Enqueue.pfnKernelLaunch; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueKernelLaunch"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueKernelLaunch"); USMLaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue), pGlobalWorkSize, pLocalWorkSize, pGlobalWorkOffset, @@ -463,7 +463,7 @@ ur_result_t urContextCreate( ur_context_handle_t *phContext) { auto pfnCreate = getContext()->urDdiTable.Context.pfnCreate; - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreate"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextCreate"); ur_result_t result = pfnCreate(numDevices, phDevices, pProperties, phContext); @@ -491,7 +491,7 @@ ur_result_t urContextCreateWithNativeHandle( auto pfnCreateWithNativeHandle = getContext()->urDdiTable.Context.pfnCreateWithNativeHandle; - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreateWithNativeHandle"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextCreateWithNativeHandle"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -511,7 +511,7 @@ ur_result_t urContextRetain( ur_context_handle_t hContext) { auto pfnRetain = getContext()->urDdiTable.Context.pfnRetain; - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRetain"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextRetain"); UR_CALL(pfnRetain(hContext)); @@ -529,7 +529,7 @@ ur_result_t urContextRelease( ur_context_handle_t hContext) { auto pfnRelease = getContext()->urDdiTable.Context.pfnRelease; - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRelease"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextRelease"); UR_CALL(pfnRelease(hContext)); @@ -559,7 +559,7 @@ ur_result_t urMemBufferCreate( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferCreate"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferCreate"); void *Host = nullptr; if (pProperties) { @@ -615,7 +615,7 @@ ur_result_t urMemGetInfo( size_t *pPropSizeRet) { auto pfnGetInfo = getContext()->urDdiTable.Mem.pfnGetInfo; - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetInfo"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemGetInfo"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMemory)) { UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); @@ -644,7 +644,7 @@ ur_result_t urMemRetain( ur_mem_handle_t hMem) { auto pfnRetain = getContext()->urDdiTable.Mem.pfnRetain; - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRetain"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemRetain"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { MemBuffer->RefCount++; @@ -662,7 +662,7 @@ ur_result_t urMemRelease( ur_mem_handle_t hMem) { auto pfnRelease = getContext()->urDdiTable.Mem.pfnRelease; - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRelease"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemRelease"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { if (--MemBuffer->RefCount != 0) { @@ -693,7 +693,7 @@ ur_result_t urMemBufferPartition( ur_mem_handle_t *phMem) { auto pfnBufferPartition = getContext()->urDdiTable.Mem.pfnBufferPartition; - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferPartition"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferPartition"); if (auto ParentBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { @@ -720,7 +720,7 @@ ur_result_t urMemGetNativeHandle( ur_native_handle_t *phNativeMem) { auto pfnGetNativeHandle = getContext()->urDdiTable.Mem.pfnGetNativeHandle; - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetNativeHandle"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemGetNativeHandle"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { char *Handle = nullptr; @@ -760,7 +760,7 @@ ur_result_t urEnqueueMemBufferRead( ur_event_handle_t *phEvent) { auto pfnMemBufferRead = getContext()->urDdiTable.Enqueue.pfnMemBufferRead; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferRead"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferRead"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -804,7 +804,7 @@ ur_result_t urEnqueueMemBufferWrite( ur_event_handle_t *phEvent) { auto pfnMemBufferWrite = getContext()->urDdiTable.Enqueue.pfnMemBufferWrite; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWrite"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWrite"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -881,7 +881,7 @@ ur_result_t urEnqueueMemBufferReadRect( auto pfnMemBufferReadRect = getContext()->urDdiTable.Enqueue.pfnMemBufferReadRect; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferReadRect"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferReadRect"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *SrcHandle = nullptr; @@ -942,7 +942,7 @@ ur_result_t urEnqueueMemBufferWriteRect( auto pfnMemBufferWriteRect = getContext()->urDdiTable.Enqueue.pfnMemBufferWriteRect; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWriteRect"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWriteRect"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *DstHandle = nullptr; @@ -990,7 +990,7 @@ ur_result_t urEnqueueMemBufferCopy( ur_event_handle_t *phEvent) { auto pfnMemBufferCopy = getContext()->urDdiTable.Enqueue.pfnMemBufferCopy; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopy"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopy"); auto SrcBuffer = getMsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getMsanInterceptor()->getMemBuffer(hBufferDst); @@ -1075,7 +1075,7 @@ ur_result_t urEnqueueMemBufferCopyRect( auto pfnMemBufferCopyRect = getContext()->urDdiTable.Enqueue.pfnMemBufferCopyRect; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopyRect"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopyRect"); auto SrcBuffer = getMsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getMsanInterceptor()->getMemBuffer(hBufferDst); @@ -1132,7 +1132,7 @@ ur_result_t urEnqueueMemBufferFill( ur_event_handle_t *phEvent) { auto pfnMemBufferFill = getContext()->urDdiTable.Enqueue.pfnMemBufferFill; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferFill"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferFill"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *Handle = nullptr; @@ -1199,7 +1199,7 @@ ur_result_t urEnqueueMemBufferMap( void **ppRetMap) { auto pfnMemBufferMap = getContext()->urDdiTable.Enqueue.pfnMemBufferMap; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferMap"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferMap"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { @@ -1281,7 +1281,7 @@ ur_result_t urEnqueueMemUnmap( ur_event_handle_t *phEvent) { auto pfnMemUnmap = getContext()->urDdiTable.Enqueue.pfnMemUnmap; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemUnmap"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemUnmap"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { MemBuffer::Mapping Mapping{}; @@ -1322,7 +1322,7 @@ ur_result_t urKernelRetain( ur_kernel_handle_t hKernel) { auto pfnRetain = getContext()->urDdiTable.Kernel.pfnRetain; - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRetain"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelRetain"); UR_CALL(pfnRetain(hKernel)); @@ -1339,7 +1339,7 @@ ur_result_t urKernelRelease( ur_kernel_handle_t hKernel) { auto pfnRelease = getContext()->urDdiTable.Kernel.pfnRelease; - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRelease"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelRelease"); auto &KernelInfo = getMsanInterceptor()->getOrCreateKernelInfo(hKernel); if (--KernelInfo.RefCount == 0) { @@ -1365,7 +1365,7 @@ ur_result_t urKernelSetArgValue( const void *pArgValue) { auto pfnSetArgValue = getContext()->urDdiTable.Kernel.pfnSetArgValue; - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgValue"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgValue"); std::shared_ptr MemBuffer; if (argSize == sizeof(ur_mem_handle_t) && @@ -1394,7 +1394,7 @@ ur_result_t urKernelSetArgMemObj( ur_mem_handle_t hArgValue) { auto pfnSetArgMemObj = getContext()->urDdiTable.Kernel.pfnSetArgMemObj; - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgMemObj"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgMemObj"); std::shared_ptr MemBuffer; std::shared_ptr KernelInfo; @@ -1422,7 +1422,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( const ur_kernel_arg_local_properties_t *pProperties) { auto pfnSetArgLocal = getContext()->urDdiTable.Kernel.pfnSetArgLocal; - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgLocal (argIndex={}, argSize={})", argIndex, argSize); @@ -1461,7 +1461,7 @@ ur_result_t UR_APICALL urEnqueueUSMFill( /// must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMFill = getContext()->urDdiTable.Enqueue.pfnUSMFill; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueUSMFill"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueUSMFill"); std::vector Events; ur_event_handle_t Event{}; @@ -1517,7 +1517,7 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy( /// must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMMemcpy = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueUSMMemcpy"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueUSMMemcpy"); std::vector Events; ur_event_handle_t Event{}; @@ -1594,7 +1594,7 @@ ur_result_t UR_APICALL urEnqueueUSMFill2D( /// phEvent must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMFill2D = getContext()->urDdiTable.Enqueue.pfnUSMFill2D; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueUSMFill2D"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueUSMFill2D"); std::vector Events; ur_event_handle_t Event{}; @@ -1658,7 +1658,7 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( /// phEvent must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMMemcpy2D = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy2D; - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueUSMMemcpy2D"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueUSMMemcpy2D"); std::vector Events; ur_event_handle_t Event{}; @@ -1948,7 +1948,7 @@ ur_result_t initMsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Initialize MSAN DDI table failed: {}", result); } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp index e3fe7af85cc4..01e0e2446a60 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp @@ -123,7 +123,7 @@ ur_result_t MsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(Context, Device); if (!InternalQueue) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to create internal queue"); + UR_LOG_L(getContext()->logger, Error, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -157,13 +157,13 @@ ur_result_t MsanInterceptor::postLaunchKernel(ur_kernel_handle_t Kernel, ur_result_t MsanInterceptor::registerProgram(ur_program_handle_t Program) { ur_result_t Result = UR_RESULT_SUCCESS; - UR_LOG_L(getContext()->logger, INFO, "registerSpirKernels"); + UR_LOG_L(getContext()->logger, Info, "registerSpirKernels"); Result = registerSpirKernels(Program); if (Result != UR_RESULT_SUCCESS) { return Result; } - UR_LOG_L(getContext()->logger, INFO, "registerDeviceGlobals"); + UR_LOG_L(getContext()->logger, Info, "registerDeviceGlobals"); Result = registerDeviceGlobals(Program); if (Result != UR_RESULT_SUCCESS) { return Result; @@ -202,7 +202,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, &SKInfo[0], MetadataPtr, sizeof(SpirKernelInfo) * NumOfSpirKernel, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Can't read the value of <{}>: {}", + UR_LOG_L(getContext()->logger, Error, "Can't read the value of <{}>: {}", kSPIR_MsanSpirKernelMetadata, Result); return Result; } @@ -217,7 +217,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, KernelNameV.data(), (void *)SKI.KernelName, sizeof(char) * SKI.Size, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Can't read kernel name: {}", + UR_LOG_L(getContext()->logger, Error, "Can't read kernel name: {}", Result); return Result; } @@ -225,7 +225,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { std::string KernelName = std::string(KernelNameV.begin(), KernelNameV.end()); - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "SpirKernel(name='{}', isInstrumented={}, " "checkLocals={}, checkPrivates={})", KernelName, true, (bool)SKI.CheckLocals, @@ -234,7 +234,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { PI->KernelMetadataMap[KernelName] = ProgramInfo::KernelMetada{ (bool)SKI.CheckLocals, (bool)SKI.CheckPrivates}; } - UR_LOG_L(getContext()->logger, INFO, "Number of sanitized kernel: {}", + UR_LOG_L(getContext()->logger, Info, "Number of sanitized kernel: {}", PI->KernelMetadataMap.size()); } @@ -259,7 +259,7 @@ MsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Device, Program, kSPIR_MsanDeviceGlobalMetadata, &MetadataSize, &MetadataPtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, INFO, "No device globals"); + UR_LOG_L(getContext()->logger, Info, "No device globals"); continue; } @@ -271,7 +271,7 @@ MsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Device Global[{}] Read Failed: {}", + UR_LOG_L(getContext()->logger, Error, "Device Global[{}] Read Failed: {}", kSPIR_MsanDeviceGlobalMetadata, Result); return Result; } @@ -438,7 +438,7 @@ ur_result_t MsanInterceptor::prepareLaunch( auto Result = getContext()->urDdiTable.Enqueue.pfnDeviceGlobalVariableWrite( Queue, Program, Name, false, Size, 0, Value, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to write device global \"{}\": {}", Name, Result); return Result; } @@ -447,7 +447,7 @@ ur_result_t MsanInterceptor::prepareLaunch( // Set membuffer arguments auto &KernelInfo = getOrCreateKernelInfo(Kernel); - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "KernelInfo {} (Name=<{}>, IsInstrumented={}, " "IsCheckLocals={}, IsCheckPrivates={})", (void *)Kernel, GetKernelName(Kernel), KernelInfo.IsInstrumented, @@ -461,7 +461,7 @@ ur_result_t MsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); @@ -512,15 +512,15 @@ ur_result_t MsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocLocalShadow( Queue, NumWG, LaunchInfo.Data->LocalShadowOffset, LaunchInfo.Data->LocalShadowOffsetEnd) != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, WARN, + UR_LOG_L(getContext()->logger, Warning, "Failed to allocate shadow memory for local memory, " "maybe the number of workgroup ({}) is too large", NumWG); - UR_LOG_L(getContext()->logger, WARN, + UR_LOG_L(getContext()->logger, Warning, "Skip checking local memory of kernel <{}> ", GetKernelName(Kernel)); } else { - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "ShadowMemory(Local, WorkGroup={}, {} - {})", NumWG, (void *)LaunchInfo.Data->LocalShadowOffset, (void *)LaunchInfo.Data->LocalShadowOffsetEnd); @@ -532,15 +532,15 @@ ur_result_t MsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocPrivateShadow( Queue, NumWG, LaunchInfo.Data->PrivateShadowOffset, LaunchInfo.Data->PrivateShadowOffsetEnd) != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, WARN, + UR_LOG_L(getContext()->logger, Warning, "Failed to allocate shadow memory for private memory, " "maybe the number of workgroup ({}) is too large", NumWG); - UR_LOG_L(getContext()->logger, WARN, + UR_LOG_L(getContext()->logger, Warning, "Skip checking private memory of kernel <{}>", GetKernelName(Kernel)); } else { - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "ShadowMemory(Private, WorkGroup={}, {} - {})", NumWG, (void *)LaunchInfo.Data->PrivateShadowOffset, (void *)LaunchInfo.Data->PrivateShadowOffsetEnd); @@ -550,7 +550,7 @@ ur_result_t MsanInterceptor::prepareLaunch( std::vector LocalArgsInfo; for (auto [ArgIndex, ArgInfo] : KernelInfo.LocalArgs) { LocalArgsInfo.push_back(ArgInfo); - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "LocalArgs (argIndex={}, size={})", ArgIndex, ArgInfo.Size); } UR_CALL(LaunchInfo.importLocalArgsInfo(Queue, LocalArgsInfo)); @@ -558,7 +558,7 @@ ur_result_t MsanInterceptor::prepareLaunch( } UR_LOG_L( - getContext()->logger, INFO, + getContext()->logger, Info, "LaunchInfo {} (GlobalShadow={}, LocalShadow={}, PrivateShadow={}, " "CleanShadow={}, LocalArgs={}, NumLocalArgs={}, Device={}, Debug={})", (void *)LaunchInfo.Data, (void *)LaunchInfo.Data->GlobalShadowOffset, @@ -571,7 +571,7 @@ ur_result_t MsanInterceptor::prepareLaunch( ur_result_t URes = EnqueueWriteGlobal("__MsanLaunchInfo", &LaunchInfo.Data, sizeof(uptr)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "EnqueueWriteGlobal(__MsanLaunchInfo) " "failed, maybe empty kernel: {}", URes); @@ -616,7 +616,7 @@ ur_result_t DeviceInfo::allocShadowMemory(ur_context_handle_t Context) { Shadow = GetMsanShadowMemory(Context, Handle, Type); assert(Shadow && "Failed to get shadow memory"); UR_CALL(Shadow->Setup()); - UR_LOG_L(getContext()->logger, INFO, "ShadowMemory(Global): {} - {}", + UR_LOG_L(getContext()->logger, Info, "ShadowMemory(Global): {} - {}", (void *)Shadow->ShadowBegin, (void *)Shadow->ShadowEnd); return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp index 4f304021fbe1..d669aaca8c25 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp @@ -45,7 +45,7 @@ GetMsanShadowMemory(ur_context_handle_t Context, ur_device_handle_t Device, std::make_shared(Context, Device); return ShadowDG2; } else { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport device type"); + UR_LOG_L(getContext()->logger, Error, "Unsupport device type"); return nullptr; } } @@ -118,7 +118,7 @@ ur_result_t MsanShadowMemoryCPU::EnqueuePoisonShadow( const uptr ShadowBegin = MemToShadow(Ptr); const uptr ShadowEnd = MemToShadow(Ptr + Size - 1); assert(ShadowBegin <= ShadowEnd); - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "EnqueuePoisonShadow(addr={}, count={}, value={})", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value); @@ -147,7 +147,7 @@ ur_result_t MsanShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; @@ -193,7 +193,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, nullptr, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urPhysicalMemCreate(): {}", + UR_LOG_L(getContext()->logger, Error, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -202,12 +202,12 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urVirtualMemMap({}, {}): {}", + UR_LOG_L(getContext()->logger, Error, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } - UR_LOG_L(getContext()->logger, DEBUG, "urVirtualMemMap: {} ~ {}", + UR_LOG_L(getContext()->logger, Debug, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); // Initialize to zero @@ -215,7 +215,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( EventWaitList.size(), EventWaitList.data(), OutEvent); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMSet(): {}", URes); + UR_LOG_L(getContext()->logger, Error, "EnqueueUSMSet(): {}", URes); return URes; } @@ -259,7 +259,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueuePoisonShadow( ShadowEnd - ShadowBegin + 1, Events.size(), Events.data(), OutEvent); - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "EnqueuePoisonShadow(addr={}, count={}, value={}): {}", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value, Result); @@ -287,7 +287,7 @@ MsanShadowMemoryGPU::ReleaseShadow(std::shared_ptr AI) { Context, (void *)MappedPtr, PageSize)); UR_CALL(getContext()->urDdiTable.PhysicalMem.pfnRelease( VirtualMemMaps[MappedPtr].first)); - UR_LOG_L(getContext()->logger, DEBUG, "urVirtualMemUnmap: {} ~ {}", + UR_LOG_L(getContext()->logger, Debug, "urVirtualMemUnmap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); } } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp index 2c1e55e202b2..5dbfc508a268 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp @@ -67,12 +67,12 @@ bool DontCoredumpRange(uptr Addr, uptr Size) { void *GetMemFunctionPointer(const char *FuncName) { void *handle = dlopen(LIBC_SO, RTLD_LAZY | RTLD_NOLOAD); if (!handle) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to dlopen {}", LIBC_SO); + UR_LOG_L(getContext()->logger, Error, "Failed to dlopen {}", LIBC_SO); return nullptr; } auto ptr = dlsym(handle, FuncName); if (!ptr) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to get '{}' from {}", + UR_LOG_L(getContext()->logger, Error, "Failed to get '{}' from {}", FuncName, LIBC_SO); } return ptr; diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp index f09320dc6f59..ece566d7b13d 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp @@ -28,7 +28,7 @@ void SanitizerOptions::Init(const std::string &EnvName, std::stringstream SS; SS << "[ERROR]: "; SS << e.what(); - URLOG_ALWAYS_(Logger, SS.str().c_str()); + UR_LOG_L(Logger, QUIET, SS.str().c_str()); die("Sanitizer failed to parse options.\n"); } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp index e7f712ead5b2..18ea68440a7f 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp @@ -72,7 +72,7 @@ struct OptionParser { SS << " \"" << S << "\""; } SS << "."; - UR_LOG_L(Logger, ERROR, SS.str().c_str()); + UR_LOG_L(Logger, Error, SS.str().c_str()); die("Sanitizer failed to parse options.\n"); } } @@ -93,13 +93,13 @@ struct OptionParser { uint64_t Value = std::stoul(ValueStr.c_str()); if (Value < Min) { - UR_LOG_L(Logger, WARN, + UR_LOG_L(Logger, Warning, "The valid range of \"{}\" is [{}, {}]. " "Setting to the minimum value {}.", Name, Min, Max, Min); Result = Min; } else if (Value > Max) { - UR_LOG_L(Logger, WARN, + UR_LOG_L(Logger, Warning, "The valid range of \"{}\" is [{}, {}]. " "Setting to the maximum value {}.", Name, Min, Max, Max); @@ -108,7 +108,7 @@ struct OptionParser { Result = Value; } } catch (...) { - UR_LOG_L(Logger, ERROR, + UR_LOG_L(Logger, Error, "The valid range of \"{}\" is [{}, {}]. Failed " "to parse the value \"{}\".", Name, Min, Max, ValueStr); diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp index d9ff5b89c107..4328dc2dd6e5 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp @@ -22,16 +22,16 @@ ManagedQueue::ManagedQueue(ur_context_handle_t Context, [[maybe_unused]] auto Result = getContext()->urDdiTable.Queue.pfnCreate( Context, Device, nullptr, &Handle); assert(Result == UR_RESULT_SUCCESS && "Failed to create ManagedQueue"); - UR_LOG_L(getContext()->logger, DEBUG, ">>> ManagedQueue {}", (void *)Handle); + UR_LOG_L(getContext()->logger, Debug, ">>> ManagedQueue {}", (void *)Handle); } ManagedQueue::~ManagedQueue() { - UR_LOG_L(getContext()->logger, DEBUG, "<<< ~ManagedQueue {}", (void *)Handle); + UR_LOG_L(getContext()->logger, Debug, "<<< ~ManagedQueue {}", (void *)Handle); [[maybe_unused]] ur_result_t Result; Result = getContext()->urDdiTable.Queue.pfnFinish(Handle); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to finish ManagedQueue: {}", + UR_LOG_L(getContext()->logger, Error, "Failed to finish ManagedQueue: {}", Result); } assert(Result == UR_RESULT_SUCCESS && "Failed to finish ManagedQueue"); @@ -150,7 +150,7 @@ DeviceType GetDeviceType(ur_context_handle_t Context, [[maybe_unused]] ur_result_t Result = getContext()->urDdiTable.USM.pfnDeviceAlloc(Context, Device, nullptr, nullptr, 4, (void **)&Ptr); - UR_LOG_L(getContext()->logger, DEBUG, "GetDeviceType: {}", (void *)Ptr); + UR_LOG_L(getContext()->logger, Debug, "GetDeviceType: {}", (void *)Ptr); assert(Result == UR_RESULT_SUCCESS && "getDeviceType() failed at allocating device USM"); // FIXME: There's no API querying the address bits of device, so we guess it @@ -259,7 +259,7 @@ ur_result_t EnqueueUSMBlockingSet(ur_queue_handle_t Queue, void *Ptr, void PrintUrBuildLog(ur_program_handle_t hProgram, ur_device_handle_t *phDevices, size_t numDevices) { - UR_LOG_L(getContext()->logger, ERROR, "Printing build log for program {}", + UR_LOG_L(getContext()->logger, Error, "Printing build log for program {}", (void *)hProgram); for (size_t i = 0; i < numDevices; i++) { std::vector LogBuf; @@ -269,7 +269,7 @@ void PrintUrBuildLog(ur_program_handle_t hProgram, auto UrRes = getContext()->urDdiTable.Program.pfnGetBuildInfo( hProgram, hDevice, UR_PROGRAM_BUILD_INFO_LOG, 0, nullptr, &LogSize); if (UrRes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "For device {}: failed to get build log size.", (void *)hDevice); continue; } @@ -279,12 +279,12 @@ void PrintUrBuildLog(ur_program_handle_t hProgram, hProgram, hDevice, UR_PROGRAM_BUILD_INFO_LOG, LogSize, LogBuf.data(), nullptr); if (UrRes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "For device {}: failed to get build log.", (void *)hDevice); continue; } - UR_LOG_L(getContext()->logger, ERROR, "For device {}:\n{}", (void *)hDevice, + UR_LOG_L(getContext()->logger, Error, "For device {}:\n{}", (void *)hDevice, LogBuf.data()); } } diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp index 9b88941143b2..6b211e745e15 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp @@ -105,7 +105,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::DEVICE_USM, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -115,7 +115,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to copy {} bytes data from host " "pointer {} to buffer {}", Size, HostPtr, this); @@ -142,7 +142,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.USM.pfnHostAlloc( Context, &USMDesc, Pool, Size, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to allocate {} bytes host " "USM for buffer {} migration", Size, this); @@ -157,7 +157,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to migrate memory buffer data"); return URes; } @@ -169,7 +169,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to migrate memory buffer data"); return URes; } @@ -185,7 +185,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getContext()->urDdiTable.USM.pfnFree(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to free buffer handle {}", + UR_LOG_L(getContext()->logger, Error, "Failed to free buffer handle {}", Ptr); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp index 348d8304af49..9136c8b5a883 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp @@ -31,7 +31,7 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getTsanInterceptor()->insertDevice(phDevices[i], DI)); DI->Type = GetDeviceType(Context, DI->Handle); if (DI->Type == DeviceType::UNKNOWN) { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport device"); + UR_LOG_L(getContext()->logger, Error, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } if (!DI->Shadow) @@ -54,7 +54,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( const ur_context_properties_t *pProperties, /// [out] pointer to handle of context object created ur_context_handle_t *phContext) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreate"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextCreate"); UR_CALL(getContext()->urDdiTable.Context.pfnCreate(numDevices, phDevices, pProperties, phContext)); @@ -78,7 +78,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( const ur_context_native_properties_t *pProperties, /// [out] pointer to the handle of the context object created. ur_context_handle_t *phContext) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreateWithNativeHandle"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextCreateWithNativeHandle"); UR_CALL(getContext()->urDdiTable.Context.pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext)); @@ -94,13 +94,13 @@ ur_result_t urContextRetain( /// [in] handle of the context to get a reference of. ur_context_handle_t hContext) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRetain"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextRetain"); UR_CALL(getContext()->urDdiTable.Context.pfnRetain(hContext)); auto ContextInfo = getTsanInterceptor()->getContextInfo(hContext); if (!ContextInfo) { - UR_LOG_L(getContext()->logger, ERROR, "Invalid context"); + UR_LOG_L(getContext()->logger, Error, "Invalid context"); return UR_RESULT_ERROR_INVALID_CONTEXT; } ContextInfo->RefCount++; @@ -113,13 +113,13 @@ ur_result_t urContextRetain( ur_result_t urContextRelease( /// [in] handle of the context to release. ur_context_handle_t hContext) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRelease"); + UR_LOG_L(getContext()->logger, Debug, "==== urContextRelease"); UR_CALL(getContext()->urDdiTable.Context.pfnRelease(hContext)); auto ContextInfo = getTsanInterceptor()->getContextInfo(hContext); if (!ContextInfo) { - UR_LOG_L(getContext()->logger, ERROR, "Invalid context"); + UR_LOG_L(getContext()->logger, Error, "Invalid context"); return UR_RESULT_ERROR_INVALID_CONTEXT; } @@ -138,7 +138,7 @@ ur_result_t urProgramBuild( ur_program_handle_t hProgram, /// [in] string of build options const char *pOptions) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuild"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuild"); UR_CALL( getContext()->urDdiTable.Program.pfnBuild(hContext, hProgram, pOptions)); @@ -161,7 +161,7 @@ ur_result_t urProgramLink( const char *pOptions, /// [out] pointer to handle of program object created. ur_program_handle_t *phProgram) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLink"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramLink"); UR_CALL(getContext()->urDdiTable.Program.pfnLink(hContext, count, phPrograms, pOptions, phProgram)); @@ -182,7 +182,7 @@ ur_result_t urProgramBuildExp( ur_device_handle_t *phDevices, /// [in][optional] pointer to build options null-terminated string. const char *pOptions) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuildExp"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuildExp"); UR_CALL(getContext()->urDdiTable.ProgramExp.pfnBuildExp(hProgram, numDevices, phDevices, pOptions)); @@ -207,7 +207,7 @@ ur_result_t urProgramLinkExp( const char *pOptions, /// [out] pointer to handle of program object created. ur_program_handle_t *phProgram) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLinkExp"); + UR_LOG_L(getContext()->logger, Debug, "==== urProgramLinkExp"); UR_CALL(getContext()->urDdiTable.ProgramExp.pfnLinkExp( hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram)); @@ -234,7 +234,7 @@ ur_result_t urMemBufferCreate( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferCreate"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferCreate"); void *Host = nullptr; if (pProperties) { @@ -270,7 +270,7 @@ ur_result_t urMemBufferCreate( ur_result_t urMemRetain( /// [in] handle of the memory object to get access ur_mem_handle_t hMem) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRetain"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemRetain"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { MemBuffer->RefCount++; @@ -286,7 +286,7 @@ ur_result_t urMemRetain( ur_result_t urMemRelease( /// [in] handle of the memory object to release ur_mem_handle_t hMem) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRelease"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemRelease"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { if (--MemBuffer->RefCount != 0) { @@ -315,7 +315,7 @@ ur_result_t urMemBufferPartition( const ur_buffer_region_t *pRegion, /// [out] pointer to the handle of sub buffer created ur_mem_handle_t *phMem) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferPartition"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferPartition"); if (auto ParentBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { @@ -340,7 +340,7 @@ ur_result_t urMemGetNativeHandle( ur_mem_handle_t hMem, ur_device_handle_t hDevice, /// [out] a pointer to the native handle of the mem. ur_native_handle_t *phNativeMem) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetNativeHandle"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemGetNativeHandle"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { char *Handle = nullptr; @@ -371,7 +371,7 @@ ur_result_t urMemGetInfo( /// [out][optional] pointer to the actual size in bytes of the queried /// propName. size_t *pPropSizeRet) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetInfo"); + UR_LOG_L(getContext()->logger, Debug, "==== urMemGetInfo"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMemory)) { UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); @@ -419,7 +419,7 @@ ur_result_t urEnqueueMemBufferRead( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferRead"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferRead"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -462,7 +462,7 @@ ur_result_t urEnqueueMemBufferWrite( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWrite"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWrite"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -525,7 +525,7 @@ ur_result_t urEnqueueMemBufferReadRect( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferReadRect"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferReadRect"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { char *SrcHandle = nullptr; @@ -583,7 +583,7 @@ ur_result_t urEnqueueMemBufferWriteRect( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWriteRect"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWriteRect"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { char *DstHandle = nullptr; @@ -629,7 +629,7 @@ ur_result_t urEnqueueMemBufferCopy( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopy"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopy"); auto SrcBuffer = getTsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getTsanInterceptor()->getMemBuffer(hBufferDst); @@ -700,7 +700,7 @@ ur_result_t urEnqueueMemBufferCopyRect( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopyRect"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopyRect"); auto SrcBuffer = getTsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getTsanInterceptor()->getMemBuffer(hBufferDst); @@ -755,7 +755,7 @@ ur_result_t urEnqueueMemBufferFill( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferFill"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferFill"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { char *Handle = nullptr; @@ -809,7 +809,7 @@ ur_result_t urEnqueueMemBufferMap( ur_event_handle_t *phEvent, /// [out] return mapped pointer. TODO: move it before numEventsInWaitList? void **ppRetMap) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferMap"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferMap"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { // Translate the host access mode info. @@ -888,7 +888,7 @@ ur_result_t urEnqueueMemUnmap( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemUnmap"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemUnmap"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { MemBuffer::Mapping Mapping{}; @@ -932,7 +932,7 @@ ur_result_t UR_APICALL urKernelCreate( const char *pKernelName, /// [out][alloc] pointer to handle of kernel object created. ur_kernel_handle_t *phKernel) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelCreate"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelCreate"); UR_CALL(getContext()->urDdiTable.Kernel.pfnCreate(hProgram, pKernelName, phKernel)); @@ -952,7 +952,7 @@ ur_result_t UR_APICALL urKernelCreateWithNativeHandle( const ur_kernel_native_properties_t *pProperties, /// [out][alloc] pointer to the handle of the kernel object created. ur_kernel_handle_t *phKernel) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelCreate"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelCreate"); UR_CALL(getContext()->urDdiTable.Kernel.pfnCreateWithNativeHandle( hNativeKernel, hContext, hProgram, pProperties, phKernel)); @@ -967,7 +967,7 @@ ur_result_t UR_APICALL urKernelCreateWithNativeHandle( ur_result_t urKernelRetain( /// [in] handle for the Kernel to retain ur_kernel_handle_t hKernel) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRetain"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelRetain"); UR_CALL(getContext()->urDdiTable.Kernel.pfnRetain(hKernel)); @@ -984,7 +984,7 @@ ur_result_t urKernelRelease( ur_kernel_handle_t hKernel) { auto pfnRelease = getContext()->urDdiTable.Kernel.pfnRelease; - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRelease"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelRelease"); auto &KernelInfo = getTsanInterceptor()->getKernelInfo(hKernel); if (--KernelInfo.RefCount == 0) { @@ -1008,7 +1008,7 @@ ur_result_t urKernelSetArgValue( const ur_kernel_arg_value_properties_t *pProperties, /// [in] argument value represented as matching arg type. const void *pArgValue) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgValue"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgValue"); std::shared_ptr MemBuffer; if (argSize == sizeof(ur_mem_handle_t) && @@ -1036,7 +1036,7 @@ ur_result_t urKernelSetArgMemObj( const ur_kernel_arg_mem_obj_properties_t *pProperties, /// [in][optional] handle of Memory object. ur_mem_handle_t hArgValue) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgMemObj"); + UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgMemObj"); if (std::shared_ptr MemBuffer = getTsanInterceptor()->getMemBuffer(hArgValue)) { @@ -1066,7 +1066,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( size_t size, /// [out] pointer to USM device memory object void **ppMem) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMDeviceAlloc"); + UR_LOG_L(getContext()->logger, Debug, "==== urUSMDeviceAlloc"); return getTsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -1085,7 +1085,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( size_t size, /// [out] pointer to USM host memory object void **ppMem) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMHostAlloc"); + UR_LOG_L(getContext()->logger, Debug, "==== urUSMHostAlloc"); return getTsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -1106,7 +1106,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( size_t size, /// [out] pointer to USM shared memory object void **ppMem) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMSharedAlloc"); + UR_LOG_L(getContext()->logger, Debug, "==== urUSMSharedAlloc"); return getTsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -1144,7 +1144,7 @@ ur_result_t urEnqueueKernelLaunch( /// [out][optional] return an event object that identifies this /// particular kernel execution instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueKernelLaunch"); + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueKernelLaunch"); LaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue)); @@ -1191,7 +1191,7 @@ ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( /// are not NULL, phEvent must not refer to an element of the /// phEventWaitList array. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueCooperativeKernelLaunchExp"); LaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue)); @@ -1454,7 +1454,7 @@ ur_result_t initTsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Initialize TSAN DDI table failed: {}", result); } diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp index 9a9a13252859..aa7f7e91add5 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp @@ -33,7 +33,7 @@ TsanRuntimeData *TsanRuntimeDataWrapper::getDevicePtr() { Context, Device, nullptr, nullptr, sizeof(TsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to alloc device usm for asan runtime data: {}", + UR_LOG(Error, "Failed to alloc device usm for asan runtime data: {}", Result); } } @@ -63,7 +63,7 @@ ur_result_t DeviceInfo::allocShadowMemory() { Shadow = GetShadowMemory(ShadowContext, Handle, Type); assert(Shadow && "Failed to get shadow memory"); UR_CALL(Shadow->Setup()); - UR_LOG_L(getContext()->logger, INFO, "ShadowMemory(Global): {} - {}", + UR_LOG_L(getContext()->logger, Info, "ShadowMemory(Global): {} - {}", (void *)Shadow->ShadowBegin, (void *)Shadow->ShadowEnd); return UR_RESULT_SUCCESS; } @@ -110,7 +110,7 @@ ur_result_t TsanInterceptor::allocateMemory(ur_context_handle_t Context, } ur_result_t TsanInterceptor::registerProgram(ur_program_handle_t Program) { - UR_LOG_L(getContext()->logger, INFO, "registerDeviceGlobals"); + UR_LOG_L(getContext()->logger, Info, "registerDeviceGlobals"); UR_CALL(registerDeviceGlobals(Program)); return UR_RESULT_SUCCESS; } @@ -131,7 +131,7 @@ TsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Device, Program, kSPIR_TsanDeviceGlobalMetadata, &MetadataSize, &MetadataPtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, INFO, "No device globals"); + UR_LOG_L(getContext()->logger, Info, "No device globals"); continue; } @@ -143,7 +143,7 @@ TsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Device Global[{}] Read Failed: {}", + UR_LOG_L(getContext()->logger, Error, "Device Global[{}] Read Failed: {}", kSPIR_TsanDeviceGlobalMetadata, Result); return Result; } @@ -252,7 +252,7 @@ ur_result_t TsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(CI->Handle, DI->Handle); if (!InternalQueue) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to create internal queue"); + UR_LOG_L(getContext()->logger, Error, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -295,7 +295,7 @@ ur_result_t TsanInterceptor::prepareLaunch(std::shared_ptr &, ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); @@ -318,7 +318,7 @@ ur_result_t TsanInterceptor::prepareLaunch(std::shared_ptr &, Queue, GetProgram(Kernel), "__TsanLaunchInfo", true, sizeof(LaunchInfoPtr), 0, &LaunchInfoPtr, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, INFO, + UR_LOG_L(getContext()->logger, Info, "EnqueueWriteGlobal(__TsanLaunchInfo) " "failed, maybe empty kernel: {}", URes); diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp index da0e1f8ad9cb..1c78899bd764 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp @@ -29,7 +29,7 @@ std::shared_ptr GetShadowMemory(ur_context_handle_t Context, } else if (Type == DeviceType::GPU_PVC) { return std::make_shared(Context, Device); } else { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport device type"); + UR_LOG_L(getContext()->logger, Error, "Unsupport device type"); return nullptr; } } @@ -71,7 +71,7 @@ ur_result_t ShadowMemoryCPU::CleanShadow(ur_queue_handle_t, uptr Ptr, Size = RoundUpTo(Size, kShadowCell); RawShadow *Begin = MemToShadow(Ptr); - UR_LOG_L(getContext()->logger, DEBUG, "CleanShadow(addr={}, count={})", + UR_LOG_L(getContext()->logger, Debug, "CleanShadow(addr={}, count={})", (void *)Begin, Size / kShadowCell); memset((void *)Begin, 0, Size / kShadowCell * kShadowCnt * kShadowSize); } @@ -91,7 +91,7 @@ ur_result_t ShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; @@ -147,7 +147,7 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, &Desc, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urPhysicalMemCreate(): {}", + UR_LOG_L(getContext()->logger, Error, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -156,18 +156,18 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urVirtualMemMap({}, {}): {}", + UR_LOG_L(getContext()->logger, Error, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } - UR_LOG_L(getContext()->logger, DEBUG, "urVirtualMemMap: {} ~ {}", + UR_LOG_L(getContext()->logger, Debug, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); // Initialize to zero URes = EnqueueUSMBlockingSet(Queue, (void *)MappedPtr, 0, PageSize); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", + UR_LOG_L(getContext()->logger, Error, "EnqueueUSMBlockingSet(): {}", URes); return URes; } @@ -180,11 +180,11 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, auto URes = EnqueueUSMBlockingSet( Queue, (void *)Begin, 0, Size / kShadowCell * kShadowCnt * kShadowSize); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", URes); + UR_LOG_L(getContext()->logger, Error, "EnqueueUSMBlockingSet(): {}", URes); return URes; } - UR_LOG_L(getContext()->logger, DEBUG, "CleanShadow(addr={}, count={})", + UR_LOG_L(getContext()->logger, Debug, "CleanShadow(addr={}, count={})", (void *)Begin, Size / kShadowCell); return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp b/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp index 132a8db17ec0..46afafd0aeb2 100644 --- a/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp @@ -26,7 +26,7 @@ ur_result_t context_t::init(ur_dditable_t *dditable, bool tsanEnabled = enabledLayerNames.count("UR_LAYER_TSAN"); if ((asanEnabled + msanEnabled + tsanEnabled) >= 2) { - UR_LOG(WARN, + UR_LOG(Warning, "Enabling ASAN or MSAN or TSAN at the same time is not supported."); return UR_RESULT_SUCCESS; } else if (asanEnabled) { diff --git a/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp b/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp index 77a79a23e1a9..b550b42132e1 100644 --- a/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp +++ b/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp @@ -42,7 +42,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGet( "urAdapterGet", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urAdapterGet\n"); + UR_LOG_L(logger, Info, " ---> urAdapterGet\n"); ur_result_t result = pfnAdapterGet(NumEntries, phAdapters, pNumAdapters); @@ -52,7 +52,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGet( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_GET, ¶ms); - UR_LOG_L(logger, INFO, " <--- urAdapterGet({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urAdapterGet({}) -> {};\n", args_str.str(), result); } @@ -74,7 +74,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRelease( "urAdapterRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urAdapterRelease\n"); + UR_LOG_L(logger, Info, " ---> urAdapterRelease\n"); ur_result_t result = pfnAdapterRelease(hAdapter); @@ -85,7 +85,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_RELEASE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urAdapterRelease({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urAdapterRelease({}) -> {};\n", args_str.str(), result); } @@ -107,7 +107,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain( "urAdapterRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urAdapterRetain\n"); + UR_LOG_L(logger, Info, " ---> urAdapterRetain\n"); ur_result_t result = pfnAdapterRetain(hAdapter); @@ -118,7 +118,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_RETAIN, ¶ms); - UR_LOG_L(logger, INFO, " <--- urAdapterRetain({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urAdapterRetain({}) -> {};\n", args_str.str(), result); } @@ -147,7 +147,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetLastError( UR_FUNCTION_ADAPTER_GET_LAST_ERROR, "urAdapterGetLastError", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urAdapterGetLastError\n"); + UR_LOG_L(logger, Info, " ---> urAdapterGetLastError\n"); ur_result_t result = pfnAdapterGetLastError(hAdapter, ppMessage, pError); @@ -158,7 +158,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetLastError( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ADAPTER_GET_LAST_ERROR, ¶ms); - UR_LOG_L(logger, INFO, " <--- urAdapterGetLastError({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urAdapterGetLastError({}) -> {};\n", args_str.str(), result); } @@ -194,7 +194,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetInfo( "urAdapterGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urAdapterGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urAdapterGetInfo\n"); ur_result_t result = pfnAdapterGetInfo(hAdapter, propName, propSize, pPropValue, pPropSizeRet); @@ -206,7 +206,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urAdapterGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urAdapterGetInfo({}) -> {};\n", args_str.str(), result); } @@ -237,7 +237,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterSetLoggerCallback( "urAdapterSetLoggerCallback", ¶ms); auto &logger = getContext()->logger; - UR_LOG(INFO, " ---> urAdapterSetLoggerCallback\n"); + UR_LOG_L(logger, Info, " ---> urAdapterSetLoggerCallback\n"); ur_result_t result = pfnSetLoggerCallback(hAdapter, pfnLoggerCallback, pUserData, level); @@ -250,8 +250,8 @@ __urdlllocal ur_result_t UR_APICALL urAdapterSetLoggerCallback( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ADAPTER_SET_LOGGER_CALLBACK, ¶ms); - UR_LOG(INFO, " <--- urAdapterSetLoggerCallback({}) -> {};\n", - args_str.str(), result); + UR_LOG_L(logger, Info, " <--- urAdapterSetLoggerCallback({}) -> {};\n", + args_str.str(), result); } return result; @@ -276,7 +276,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterSetLoggerCallbackLevel( "urAdapterSetLoggerCallbackLevel", ¶ms); auto &logger = getContext()->logger; - UR_LOG(INFO, " ---> urAdapterSetLoggerCallbackLevel\n"); + UR_LOG_L(logger, Info, " ---> urAdapterSetLoggerCallbackLevel\n"); ur_result_t result = pfnSetLoggerCallbackLevel(hAdapter, level); @@ -288,8 +288,9 @@ __urdlllocal ur_result_t UR_APICALL urAdapterSetLoggerCallbackLevel( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ADAPTER_SET_LOGGER_CALLBACK_LEVEL, ¶ms); - UR_LOG(INFO, " <--- urAdapterSetLoggerCallbackLevel({}) -> {};\n", - args_str.str(), result); + UR_LOG_L(logger, Info, + " <--- urAdapterSetLoggerCallbackLevel({}) -> {};\n", + args_str.str(), result); } return result; @@ -322,7 +323,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGet( "urPlatformGet", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urPlatformGet\n"); + UR_LOG_L(logger, Info, " ---> urPlatformGet\n"); ur_result_t result = pfnGet(hAdapter, NumEntries, phPlatforms, pNumPlatforms); @@ -333,7 +334,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGet( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PLATFORM_GET, ¶ms); - UR_LOG_L(logger, INFO, " <--- urPlatformGet({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urPlatformGet({}) -> {};\n", args_str.str(), result); } @@ -369,7 +370,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetInfo( "urPlatformGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urPlatformGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urPlatformGetInfo\n"); ur_result_t result = pfnGetInfo(hPlatform, propName, propSize, pPropValue, pPropSizeRet); @@ -381,7 +382,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PLATFORM_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urPlatformGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urPlatformGetInfo({}) -> {};\n", args_str.str(), result); } @@ -405,7 +406,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetApiVersion( UR_FUNCTION_PLATFORM_GET_API_VERSION, "urPlatformGetApiVersion", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urPlatformGetApiVersion\n"); + UR_LOG_L(logger, Info, " ---> urPlatformGetApiVersion\n"); ur_result_t result = pfnGetApiVersion(hPlatform, pVersion); @@ -417,7 +418,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetApiVersion( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_API_VERSION, ¶ms); - UR_LOG_L(logger, INFO, " <--- urPlatformGetApiVersion({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urPlatformGetApiVersion({}) -> {};\n", args_str.str(), result); } @@ -444,7 +445,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle( "urPlatformGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urPlatformGetNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urPlatformGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hPlatform, phNativePlatform); @@ -456,7 +457,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urPlatformGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urPlatformGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -487,7 +488,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( "urPlatformCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urPlatformCreateWithNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urPlatformCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativePlatform, hAdapter, pProperties, phPlatform); @@ -500,7 +501,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urPlatformCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -531,7 +532,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption( "urPlatformGetBackendOption", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urPlatformGetBackendOption\n"); + UR_LOG_L(logger, Info, " ---> urPlatformGetBackendOption\n"); ur_result_t result = pfnGetBackendOption(hPlatform, pFrontendOption, ppPlatformOption); @@ -544,7 +545,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_BACKEND_OPTION, ¶ms); - UR_LOG_L(logger, INFO, " <--- urPlatformGetBackendOption({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urPlatformGetBackendOption({}) -> {};\n", args_str.str(), result); } @@ -581,7 +582,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGet( "urDeviceGet", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urDeviceGet\n"); + UR_LOG_L(logger, Info, " ---> urDeviceGet\n"); ur_result_t result = pfnGet(hPlatform, DeviceType, NumEntries, phDevices, pNumDevices); @@ -592,7 +593,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGet( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_GET, ¶ms); - UR_LOG_L(logger, INFO, " <--- urDeviceGet({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urDeviceGet({}) -> {};\n", args_str.str(), result); } @@ -629,7 +630,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( "urDeviceGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urDeviceGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urDeviceGetInfo\n"); ur_result_t result = pfnGetInfo(hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -641,7 +642,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urDeviceGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urDeviceGetInfo({}) -> {};\n", args_str.str(), result); } @@ -663,7 +664,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain( "urDeviceRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urDeviceRetain\n"); + UR_LOG_L(logger, Info, " ---> urDeviceRetain\n"); ur_result_t result = pfnRetain(hDevice); @@ -674,7 +675,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_RETAIN, ¶ms); - UR_LOG_L(logger, INFO, " <--- urDeviceRetain({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urDeviceRetain({}) -> {};\n", args_str.str(), result); } @@ -696,7 +697,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRelease( "urDeviceRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urDeviceRelease\n"); + UR_LOG_L(logger, Info, " ---> urDeviceRelease\n"); ur_result_t result = pfnRelease(hDevice); @@ -707,7 +708,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_RELEASE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urDeviceRelease({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urDeviceRelease({}) -> {};\n", args_str.str(), result); } @@ -741,7 +742,7 @@ __urdlllocal ur_result_t UR_APICALL urDevicePartition( "urDevicePartition", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urDevicePartition\n"); + UR_LOG_L(logger, Info, " ---> urDevicePartition\n"); ur_result_t result = pfnPartition(hDevice, pProperties, NumDevices, phSubDevices, pNumDevicesRet); @@ -753,7 +754,7 @@ __urdlllocal ur_result_t UR_APICALL urDevicePartition( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_PARTITION, ¶ms); - UR_LOG_L(logger, INFO, " <--- urDevicePartition({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urDevicePartition({}) -> {};\n", args_str.str(), result); } @@ -786,7 +787,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceSelectBinary( UR_FUNCTION_DEVICE_SELECT_BINARY, "urDeviceSelectBinary", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urDeviceSelectBinary\n"); + UR_LOG_L(logger, Info, " ---> urDeviceSelectBinary\n"); ur_result_t result = pfnSelectBinary(hDevice, pBinaries, NumBinaries, pSelectedBinary); @@ -798,7 +799,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceSelectBinary( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_SELECT_BINARY, ¶ms); - UR_LOG_L(logger, INFO, " <--- urDeviceSelectBinary({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urDeviceSelectBinary({}) -> {};\n", args_str.str(), result); } @@ -822,7 +823,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( UR_FUNCTION_DEVICE_GET_NATIVE_HANDLE, "urDeviceGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urDeviceGetNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urDeviceGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hDevice, phNativeDevice); @@ -834,7 +835,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urDeviceGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urDeviceGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -865,7 +866,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( "urDeviceCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urDeviceCreateWithNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urDeviceCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeDevice, hAdapter, pProperties, phDevice); @@ -878,7 +879,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urDeviceCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -910,7 +911,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( "urDeviceGetGlobalTimestamps", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urDeviceGetGlobalTimestamps\n"); + UR_LOG_L(logger, Info, " ---> urDeviceGetGlobalTimestamps\n"); ur_result_t result = pfnGetGlobalTimestamps(hDevice, pDeviceTimestamp, pHostTimestamp); @@ -923,7 +924,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_GET_GLOBAL_TIMESTAMPS, ¶ms); - UR_LOG_L(logger, INFO, " <--- urDeviceGetGlobalTimestamps({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urDeviceGetGlobalTimestamps({}) -> {};\n", args_str.str(), result); } @@ -952,7 +953,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( "urContextCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urContextCreate\n"); + UR_LOG_L(logger, Info, " ---> urContextCreate\n"); ur_result_t result = pfnCreate(DeviceCount, phDevices, pProperties, phContext); @@ -964,7 +965,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_CREATE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urContextCreate({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urContextCreate({}) -> {};\n", args_str.str(), result); } @@ -986,7 +987,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( "urContextRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urContextRetain\n"); + UR_LOG_L(logger, Info, " ---> urContextRetain\n"); ur_result_t result = pfnRetain(hContext); @@ -997,7 +998,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_RETAIN, ¶ms); - UR_LOG_L(logger, INFO, " <--- urContextRetain({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urContextRetain({}) -> {};\n", args_str.str(), result); } @@ -1019,7 +1020,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( "urContextRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urContextRelease\n"); + UR_LOG_L(logger, Info, " ---> urContextRelease\n"); ur_result_t result = pfnRelease(hContext); @@ -1030,7 +1031,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_RELEASE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urContextRelease({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urContextRelease({}) -> {};\n", args_str.str(), result); } @@ -1067,7 +1068,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo( "urContextGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urContextGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urContextGetInfo\n"); ur_result_t result = pfnGetInfo(hContext, propName, propSize, pPropValue, pPropSizeRet); @@ -1079,7 +1080,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urContextGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urContextGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1104,7 +1105,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetNativeHandle( "urContextGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urContextGetNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urContextGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hContext, phNativeContext); @@ -1116,7 +1117,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urContextGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urContextGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1153,7 +1154,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( "urContextCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urContextCreateWithNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urContextCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -1166,7 +1167,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urContextCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1196,7 +1197,7 @@ __urdlllocal ur_result_t UR_APICALL urContextSetExtendedDeleter( "urContextSetExtendedDeleter", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urContextSetExtendedDeleter\n"); + UR_LOG_L(logger, Info, " ---> urContextSetExtendedDeleter\n"); ur_result_t result = pfnSetExtendedDeleter(hContext, pfnDeleter, pUserData); @@ -1208,7 +1209,7 @@ __urdlllocal ur_result_t UR_APICALL urContextSetExtendedDeleter( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_SET_EXTENDED_DELETER, ¶ms); - UR_LOG_L(logger, INFO, " <--- urContextSetExtendedDeleter({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urContextSetExtendedDeleter({}) -> {};\n", args_str.str(), result); } @@ -1241,7 +1242,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreate( "urMemImageCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urMemImageCreate\n"); + UR_LOG_L(logger, Info, " ---> urMemImageCreate\n"); ur_result_t result = pfnImageCreate(hContext, flags, pImageFormat, pImageDesc, pHost, phMem); @@ -1253,7 +1254,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_IMAGE_CREATE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urMemImageCreate({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urMemImageCreate({}) -> {};\n", args_str.str(), result); } @@ -1284,7 +1285,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( "urMemBufferCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urMemBufferCreate\n"); + UR_LOG_L(logger, Info, " ---> urMemBufferCreate\n"); ur_result_t result = pfnBufferCreate(hContext, flags, size, pProperties, phBuffer); @@ -1296,7 +1297,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_BUFFER_CREATE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urMemBufferCreate({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urMemBufferCreate({}) -> {};\n", args_str.str(), result); } @@ -1318,7 +1319,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( "urMemRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urMemRetain\n"); + UR_LOG_L(logger, Info, " ---> urMemRetain\n"); ur_result_t result = pfnRetain(hMem); @@ -1328,7 +1329,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_RETAIN, ¶ms); - UR_LOG_L(logger, INFO, " <--- urMemRetain({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urMemRetain({}) -> {};\n", args_str.str(), result); } @@ -1350,7 +1351,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( "urMemRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urMemRelease\n"); + UR_LOG_L(logger, Info, " ---> urMemRelease\n"); ur_result_t result = pfnRelease(hMem); @@ -1360,7 +1361,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_RELEASE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urMemRelease({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urMemRelease({}) -> {};\n", args_str.str(), result); } @@ -1391,7 +1392,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( UR_FUNCTION_MEM_BUFFER_PARTITION, "urMemBufferPartition", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urMemBufferPartition\n"); + UR_LOG_L(logger, Info, " ---> urMemBufferPartition\n"); ur_result_t result = pfnBufferPartition(hBuffer, flags, bufferCreateType, pRegion, phMem); @@ -1403,7 +1404,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_BUFFER_PARTITION, ¶ms); - UR_LOG_L(logger, INFO, " <--- urMemBufferPartition({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urMemBufferPartition({}) -> {};\n", args_str.str(), result); } @@ -1430,7 +1431,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( UR_FUNCTION_MEM_GET_NATIVE_HANDLE, "urMemGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urMemGetNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urMemGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hMem, hDevice, phNativeMem); @@ -1441,7 +1442,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urMemGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urMemGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1472,7 +1473,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( "urMemBufferCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urMemBufferCreateWithNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urMemBufferCreateWithNativeHandle\n"); ur_result_t result = pfnBufferCreateWithNativeHandle(hNativeMem, hContext, pProperties, phMem); @@ -1485,7 +1486,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_MEM_BUFFER_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urMemBufferCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1521,7 +1522,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( "urMemImageCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urMemImageCreateWithNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urMemImageCreateWithNativeHandle\n"); ur_result_t result = pfnImageCreateWithNativeHandle( hNativeMem, hContext, pImageFormat, pImageDesc, pProperties, phMem); @@ -1534,7 +1535,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_MEM_IMAGE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urMemImageCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1571,7 +1572,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( "urMemGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urMemGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urMemGetInfo\n"); ur_result_t result = pfnGetInfo(hMemory, propName, propSize, pPropValue, pPropSizeRet); @@ -1583,7 +1584,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urMemGetInfo({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urMemGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1619,7 +1620,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageGetInfo( "urMemImageGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urMemImageGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urMemImageGetInfo\n"); ur_result_t result = pfnImageGetInfo(hMemory, propName, propSize, pPropValue, pPropSizeRet); @@ -1631,7 +1632,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_IMAGE_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urMemImageGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urMemImageGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1657,7 +1658,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreate( "urSamplerCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urSamplerCreate\n"); + UR_LOG_L(logger, Info, " ---> urSamplerCreate\n"); ur_result_t result = pfnCreate(hContext, pDesc, phSampler); @@ -1668,7 +1669,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_CREATE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urSamplerCreate({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urSamplerCreate({}) -> {};\n", args_str.str(), result); } @@ -1690,7 +1691,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain( "urSamplerRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urSamplerRetain\n"); + UR_LOG_L(logger, Info, " ---> urSamplerRetain\n"); ur_result_t result = pfnRetain(hSampler); @@ -1701,7 +1702,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_RETAIN, ¶ms); - UR_LOG_L(logger, INFO, " <--- urSamplerRetain({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urSamplerRetain({}) -> {};\n", args_str.str(), result); } @@ -1723,7 +1724,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRelease( "urSamplerRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urSamplerRelease\n"); + UR_LOG_L(logger, Info, " ---> urSamplerRelease\n"); ur_result_t result = pfnRelease(hSampler); @@ -1734,7 +1735,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_RELEASE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urSamplerRelease({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urSamplerRelease({}) -> {};\n", args_str.str(), result); } @@ -1766,7 +1767,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo( "urSamplerGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urSamplerGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urSamplerGetInfo\n"); ur_result_t result = pfnGetInfo(hSampler, propName, propSize, pPropValue, pPropSizeRet); @@ -1778,7 +1779,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urSamplerGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urSamplerGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1803,7 +1804,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetNativeHandle( "urSamplerGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urSamplerGetNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urSamplerGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hSampler, phNativeSampler); @@ -1815,7 +1816,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_SAMPLER_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urSamplerGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urSamplerGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1846,7 +1847,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( "urSamplerCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urSamplerCreateWithNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urSamplerCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeSampler, hContext, pProperties, phSampler); @@ -1859,7 +1860,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_SAMPLER_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urSamplerCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1891,7 +1892,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( "urUSMHostAlloc", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMHostAlloc\n"); + UR_LOG_L(logger, Info, " ---> urUSMHostAlloc\n"); ur_result_t result = pfnHostAlloc(hContext, pUSMDesc, pool, size, ppMem); @@ -1902,7 +1903,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_HOST_ALLOC, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMHostAlloc({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMHostAlloc({}) -> {};\n", args_str.str(), result); } @@ -1935,7 +1936,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( "urUSMDeviceAlloc", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMDeviceAlloc\n"); + UR_LOG_L(logger, Info, " ---> urUSMDeviceAlloc\n"); ur_result_t result = pfnDeviceAlloc(hContext, hDevice, pUSMDesc, pool, size, ppMem); @@ -1947,7 +1948,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_DEVICE_ALLOC, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMDeviceAlloc({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMDeviceAlloc({}) -> {};\n", args_str.str(), result); } @@ -1980,7 +1981,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( "urUSMSharedAlloc", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMSharedAlloc\n"); + UR_LOG_L(logger, Info, " ---> urUSMSharedAlloc\n"); ur_result_t result = pfnSharedAlloc(hContext, hDevice, pUSMDesc, pool, size, ppMem); @@ -1992,7 +1993,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_SHARED_ALLOC, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMSharedAlloc({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMSharedAlloc({}) -> {};\n", args_str.str(), result); } @@ -2016,7 +2017,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( getContext()->notify_begin(UR_FUNCTION_USM_FREE, "urUSMFree", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMFree\n"); + UR_LOG_L(logger, Info, " ---> urUSMFree\n"); ur_result_t result = pfnFree(hContext, pMem); @@ -2026,7 +2027,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_FREE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMFree({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urUSMFree({}) -> {};\n", args_str.str(), result); } @@ -2060,7 +2061,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMGetMemAllocInfo( UR_FUNCTION_USM_GET_MEM_ALLOC_INFO, "urUSMGetMemAllocInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMGetMemAllocInfo\n"); + UR_LOG_L(logger, Info, " ---> urUSMGetMemAllocInfo\n"); ur_result_t result = pfnGetMemAllocInfo(hContext, pMem, propName, propSize, pPropValue, pPropSizeRet); @@ -2072,7 +2073,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMGetMemAllocInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_GET_MEM_ALLOC_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMGetMemAllocInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMGetMemAllocInfo({}) -> {};\n", args_str.str(), result); } @@ -2099,7 +2100,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreate( "urUSMPoolCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolCreate\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolCreate\n"); ur_result_t result = pfnPoolCreate(hContext, pPoolDesc, ppPool); @@ -2110,7 +2111,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_CREATE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPoolCreate({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPoolCreate({}) -> {};\n", args_str.str(), result); } @@ -2132,7 +2133,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain( "urUSMPoolRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolRetain\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolRetain\n"); ur_result_t result = pfnPoolRetain(pPool); @@ -2143,7 +2144,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_RETAIN, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPoolRetain({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPoolRetain({}) -> {};\n", args_str.str(), result); } @@ -2165,7 +2166,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRelease( "urUSMPoolRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolRelease\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolRelease\n"); ur_result_t result = pfnPoolRelease(pPool); @@ -2176,7 +2177,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_RELEASE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPoolRelease({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPoolRelease({}) -> {};\n", args_str.str(), result); } @@ -2208,7 +2209,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfo( "urUSMPoolGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolGetInfo\n"); ur_result_t result = pfnPoolGetInfo(hPool, propName, propSize, pPropValue, pPropSizeRet); @@ -2220,7 +2221,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPoolGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPoolGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2261,7 +2262,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGranularityGetInfo( "urVirtualMemGranularityGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urVirtualMemGranularityGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urVirtualMemGranularityGetInfo\n"); ur_result_t result = pfnGranularityGetInfo( hContext, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -2274,7 +2275,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGranularityGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_VIRTUAL_MEM_GRANULARITY_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urVirtualMemGranularityGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2307,7 +2308,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemReserve( UR_FUNCTION_VIRTUAL_MEM_RESERVE, "urVirtualMemReserve", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urVirtualMemReserve\n"); + UR_LOG_L(logger, Info, " ---> urVirtualMemReserve\n"); ur_result_t result = pfnReserve(hContext, pStart, size, ppStart); @@ -2318,7 +2319,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemReserve( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_RESERVE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urVirtualMemReserve({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urVirtualMemReserve({}) -> {};\n", args_str.str(), result); } @@ -2344,7 +2345,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemFree( "urVirtualMemFree", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urVirtualMemFree\n"); + UR_LOG_L(logger, Info, " ---> urVirtualMemFree\n"); ur_result_t result = pfnFree(hContext, pStart, size); @@ -2355,7 +2356,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemFree( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_FREE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urVirtualMemFree({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urVirtualMemFree({}) -> {};\n", args_str.str(), result); } @@ -2388,7 +2389,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemMap( "urVirtualMemMap", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urVirtualMemMap\n"); + UR_LOG_L(logger, Info, " ---> urVirtualMemMap\n"); ur_result_t result = pfnMap(hContext, pStart, size, hPhysicalMem, offset, flags); @@ -2400,7 +2401,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemMap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_MAP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urVirtualMemMap({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urVirtualMemMap({}) -> {};\n", args_str.str(), result); } @@ -2426,7 +2427,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemUnmap( "urVirtualMemUnmap", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urVirtualMemUnmap\n"); + UR_LOG_L(logger, Info, " ---> urVirtualMemUnmap\n"); ur_result_t result = pfnUnmap(hContext, pStart, size); @@ -2437,7 +2438,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemUnmap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_UNMAP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urVirtualMemUnmap({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urVirtualMemUnmap({}) -> {};\n", args_str.str(), result); } @@ -2466,7 +2467,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemSetAccess( UR_FUNCTION_VIRTUAL_MEM_SET_ACCESS, "urVirtualMemSetAccess", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urVirtualMemSetAccess\n"); + UR_LOG_L(logger, Info, " ---> urVirtualMemSetAccess\n"); ur_result_t result = pfnSetAccess(hContext, pStart, size, flags); @@ -2477,7 +2478,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemSetAccess( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_VIRTUAL_MEM_SET_ACCESS, ¶ms); - UR_LOG_L(logger, INFO, " <--- urVirtualMemSetAccess({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urVirtualMemSetAccess({}) -> {};\n", args_str.str(), result); } @@ -2517,7 +2518,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGetInfo( UR_FUNCTION_VIRTUAL_MEM_GET_INFO, "urVirtualMemGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urVirtualMemGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urVirtualMemGetInfo\n"); ur_result_t result = pfnGetInfo(hContext, pStart, size, propName, propSize, pPropValue, pPropSizeRet); @@ -2529,7 +2530,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urVirtualMemGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urVirtualMemGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2561,7 +2562,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemCreate( UR_FUNCTION_PHYSICAL_MEM_CREATE, "urPhysicalMemCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urPhysicalMemCreate\n"); + UR_LOG_L(logger, Info, " ---> urPhysicalMemCreate\n"); ur_result_t result = pfnCreate(hContext, hDevice, size, pProperties, phPhysicalMem); @@ -2573,7 +2574,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_CREATE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urPhysicalMemCreate({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urPhysicalMemCreate({}) -> {};\n", args_str.str(), result); } @@ -2595,7 +2596,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain( UR_FUNCTION_PHYSICAL_MEM_RETAIN, "urPhysicalMemRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urPhysicalMemRetain\n"); + UR_LOG_L(logger, Info, " ---> urPhysicalMemRetain\n"); ur_result_t result = pfnRetain(hPhysicalMem); @@ -2606,7 +2607,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_RETAIN, ¶ms); - UR_LOG_L(logger, INFO, " <--- urPhysicalMemRetain({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urPhysicalMemRetain({}) -> {};\n", args_str.str(), result); } @@ -2628,7 +2629,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( UR_FUNCTION_PHYSICAL_MEM_RELEASE, "urPhysicalMemRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urPhysicalMemRelease\n"); + UR_LOG_L(logger, Info, " ---> urPhysicalMemRelease\n"); ur_result_t result = pfnRelease(hPhysicalMem); @@ -2639,7 +2640,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_RELEASE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urPhysicalMemRelease({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urPhysicalMemRelease({}) -> {};\n", args_str.str(), result); } @@ -2674,7 +2675,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( UR_FUNCTION_PHYSICAL_MEM_GET_INFO, "urPhysicalMemGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urPhysicalMemGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urPhysicalMemGetInfo\n"); ur_result_t result = pfnGetInfo(hPhysicalMem, propName, propSize, pPropValue, pPropSizeRet); @@ -2686,7 +2687,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urPhysicalMemGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urPhysicalMemGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2717,7 +2718,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( UR_FUNCTION_PROGRAM_CREATE_WITH_IL, "urProgramCreateWithIL", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramCreateWithIL\n"); + UR_LOG_L(logger, Info, " ---> urProgramCreateWithIL\n"); ur_result_t result = pfnCreateWithIL(hContext, pIL, length, pProperties, phProgram); @@ -2729,7 +2730,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_IL, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramCreateWithIL({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramCreateWithIL({}) -> {};\n", args_str.str(), result); } @@ -2770,7 +2771,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( "urProgramCreateWithBinary", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramCreateWithBinary\n"); + UR_LOG_L(logger, Info, " ---> urProgramCreateWithBinary\n"); ur_result_t result = pfnCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, @@ -2784,7 +2785,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_BINARY, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramCreateWithBinary({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramCreateWithBinary({}) -> {};\n", args_str.str(), result); } @@ -2810,7 +2811,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( "urProgramBuild", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramBuild\n"); + UR_LOG_L(logger, Info, " ---> urProgramBuild\n"); ur_result_t result = pfnBuild(hContext, hProgram, pOptions); @@ -2821,7 +2822,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_BUILD, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramBuild({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramBuild({}) -> {};\n", args_str.str(), result); } @@ -2847,7 +2848,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompile( "urProgramCompile", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramCompile\n"); + UR_LOG_L(logger, Info, " ---> urProgramCompile\n"); ur_result_t result = pfnCompile(hContext, hProgram, pOptions); @@ -2858,7 +2859,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompile( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_COMPILE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramCompile({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramCompile({}) -> {};\n", args_str.str(), result); } @@ -2892,7 +2893,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( "urProgramLink", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramLink\n"); + UR_LOG_L(logger, Info, " ---> urProgramLink\n"); ur_result_t result = pfnLink(hContext, count, phPrograms, pOptions, phProgram); @@ -2904,7 +2905,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_LINK, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramLink({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urProgramLink({}) -> {};\n", args_str.str(), result); } @@ -2926,7 +2927,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( "urProgramRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramRetain\n"); + UR_LOG_L(logger, Info, " ---> urProgramRetain\n"); ur_result_t result = pfnRetain(hProgram); @@ -2937,7 +2938,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_RETAIN, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramRetain({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramRetain({}) -> {};\n", args_str.str(), result); } @@ -2959,7 +2960,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRelease( "urProgramRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramRelease\n"); + UR_LOG_L(logger, Info, " ---> urProgramRelease\n"); ur_result_t result = pfnRelease(hProgram); @@ -2970,7 +2971,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_RELEASE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramRelease({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramRelease({}) -> {};\n", args_str.str(), result); } @@ -3003,7 +3004,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetFunctionPointer( "urProgramGetFunctionPointer", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramGetFunctionPointer\n"); + UR_LOG_L(logger, Info, " ---> urProgramGetFunctionPointer\n"); ur_result_t result = pfnGetFunctionPointer(hDevice, hProgram, pFunctionName, ppFunctionPointer); @@ -3016,7 +3017,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetFunctionPointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_FUNCTION_POINTER, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramGetFunctionPointer({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramGetFunctionPointer({}) -> {};\n", args_str.str(), result); } @@ -3052,7 +3053,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetGlobalVariablePointer( "urProgramGetGlobalVariablePointer", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramGetGlobalVariablePointer\n"); + UR_LOG_L(logger, Info, " ---> urProgramGetGlobalVariablePointer\n"); ur_result_t result = pfnGetGlobalVariablePointer( hDevice, hProgram, pGlobalVariableName, pGlobalVariableSizeRet, @@ -3066,7 +3067,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetGlobalVariablePointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_GLOBAL_VARIABLE_POINTER, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urProgramGetGlobalVariablePointer({}) -> {};\n", args_str.str(), result); } @@ -3104,7 +3105,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetInfo( "urProgramGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urProgramGetInfo\n"); ur_result_t result = pfnGetInfo(hProgram, propName, propSize, pPropValue, pPropSizeRet); @@ -3116,7 +3117,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramGetInfo({}) -> {};\n", args_str.str(), result); } @@ -3154,7 +3155,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetBuildInfo( UR_FUNCTION_PROGRAM_GET_BUILD_INFO, "urProgramGetBuildInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramGetBuildInfo\n"); + UR_LOG_L(logger, Info, " ---> urProgramGetBuildInfo\n"); ur_result_t result = pfnGetBuildInfo(hProgram, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3166,7 +3167,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetBuildInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_BUILD_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramGetBuildInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramGetBuildInfo({}) -> {};\n", args_str.str(), result); } @@ -3196,7 +3197,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramSetSpecializationConstants( "urProgramSetSpecializationConstants", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramSetSpecializationConstants\n"); + UR_LOG_L(logger, Info, " ---> urProgramSetSpecializationConstants\n"); ur_result_t result = pfnSetSpecializationConstants(hProgram, count, pSpecConstants); @@ -3209,7 +3210,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramSetSpecializationConstants( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_SET_SPECIALIZATION_CONSTANTS, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urProgramSetSpecializationConstants({}) -> {};\n", args_str.str(), result); } @@ -3235,7 +3236,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetNativeHandle( "urProgramGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramGetNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urProgramGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hProgram, phNativeProgram); @@ -3247,7 +3248,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3278,7 +3279,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( "urProgramCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramCreateWithNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urProgramCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram); @@ -3291,7 +3292,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urProgramCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3318,7 +3319,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreate( "urKernelCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelCreate\n"); + UR_LOG_L(logger, Info, " ---> urKernelCreate\n"); ur_result_t result = pfnCreate(hProgram, pKernelName, phKernel); @@ -3329,7 +3330,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_CREATE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelCreate({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelCreate({}) -> {};\n", args_str.str(), result); } @@ -3362,7 +3363,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( UR_FUNCTION_KERNEL_SET_ARG_VALUE, "urKernelSetArgValue", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelSetArgValue\n"); + UR_LOG_L(logger, Info, " ---> urKernelSetArgValue\n"); ur_result_t result = pfnSetArgValue(hKernel, argIndex, argSize, pProperties, pArgValue); @@ -3374,7 +3375,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_ARG_VALUE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelSetArgValue({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelSetArgValue({}) -> {};\n", args_str.str(), result); } @@ -3403,7 +3404,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( UR_FUNCTION_KERNEL_SET_ARG_LOCAL, "urKernelSetArgLocal", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelSetArgLocal\n"); + UR_LOG_L(logger, Info, " ---> urKernelSetArgLocal\n"); ur_result_t result = pfnSetArgLocal(hKernel, argIndex, argSize, pProperties); @@ -3414,7 +3415,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_ARG_LOCAL, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelSetArgLocal({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelSetArgLocal({}) -> {};\n", args_str.str(), result); } @@ -3451,7 +3452,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetInfo( "urKernelGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urKernelGetInfo\n"); ur_result_t result = pfnGetInfo(hKernel, propName, propSize, pPropValue, pPropSizeRet); @@ -3463,7 +3464,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelGetInfo({}) -> {};\n", args_str.str(), result); } @@ -3498,7 +3499,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetGroupInfo( UR_FUNCTION_KERNEL_GET_GROUP_INFO, "urKernelGetGroupInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelGetGroupInfo\n"); + UR_LOG_L(logger, Info, " ---> urKernelGetGroupInfo\n"); ur_result_t result = pfnGetGroupInfo(hKernel, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3510,7 +3511,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetGroupInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_GET_GROUP_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelGetGroupInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelGetGroupInfo({}) -> {};\n", args_str.str(), result); } @@ -3546,7 +3547,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSubGroupInfo( "urKernelGetSubGroupInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelGetSubGroupInfo\n"); + UR_LOG_L(logger, Info, " ---> urKernelGetSubGroupInfo\n"); ur_result_t result = pfnGetSubGroupInfo(hKernel, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3559,7 +3560,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSubGroupInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_SUB_GROUP_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelGetSubGroupInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelGetSubGroupInfo({}) -> {};\n", args_str.str(), result); } @@ -3581,7 +3582,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( "urKernelRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelRetain\n"); + UR_LOG_L(logger, Info, " ---> urKernelRetain\n"); ur_result_t result = pfnRetain(hKernel); @@ -3592,7 +3593,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_RETAIN, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelRetain({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelRetain({}) -> {};\n", args_str.str(), result); } @@ -3614,7 +3615,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRelease( "urKernelRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelRelease\n"); + UR_LOG_L(logger, Info, " ---> urKernelRelease\n"); ur_result_t result = pfnRelease(hKernel); @@ -3625,7 +3626,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_RELEASE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelRelease({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelRelease({}) -> {};\n", args_str.str(), result); } @@ -3655,7 +3656,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( UR_FUNCTION_KERNEL_SET_ARG_POINTER, "urKernelSetArgPointer", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelSetArgPointer\n"); + UR_LOG_L(logger, Info, " ---> urKernelSetArgPointer\n"); ur_result_t result = pfnSetArgPointer(hKernel, argIndex, pProperties, pArgValue); @@ -3667,7 +3668,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_POINTER, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelSetArgPointer({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelSetArgPointer({}) -> {};\n", args_str.str(), result); } @@ -3699,7 +3700,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetExecInfo( UR_FUNCTION_KERNEL_SET_EXEC_INFO, "urKernelSetExecInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelSetExecInfo\n"); + UR_LOG_L(logger, Info, " ---> urKernelSetExecInfo\n"); ur_result_t result = pfnSetExecInfo(hKernel, propName, propSize, pProperties, pPropValue); @@ -3711,7 +3712,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetExecInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_EXEC_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelSetExecInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelSetExecInfo({}) -> {};\n", args_str.str(), result); } @@ -3740,7 +3741,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( UR_FUNCTION_KERNEL_SET_ARG_SAMPLER, "urKernelSetArgSampler", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelSetArgSampler\n"); + UR_LOG_L(logger, Info, " ---> urKernelSetArgSampler\n"); ur_result_t result = pfnSetArgSampler(hKernel, argIndex, pProperties, hArgValue); @@ -3752,7 +3753,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_SAMPLER, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelSetArgSampler({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelSetArgSampler({}) -> {};\n", args_str.str(), result); } @@ -3781,7 +3782,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, "urKernelSetArgMemObj", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelSetArgMemObj\n"); + UR_LOG_L(logger, Info, " ---> urKernelSetArgMemObj\n"); ur_result_t result = pfnSetArgMemObj(hKernel, argIndex, pProperties, hArgValue); @@ -3793,7 +3794,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelSetArgMemObj({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelSetArgMemObj({}) -> {};\n", args_str.str(), result); } @@ -3822,7 +3823,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetSpecializationConstants( "urKernelSetSpecializationConstants", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelSetSpecializationConstants\n"); + UR_LOG_L(logger, Info, " ---> urKernelSetSpecializationConstants\n"); ur_result_t result = pfnSetSpecializationConstants(hKernel, count, pSpecConstants); @@ -3835,7 +3836,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetSpecializationConstants( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_SPECIALIZATION_CONSTANTS, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urKernelSetSpecializationConstants({}) -> {};\n", args_str.str(), result); } @@ -3860,7 +3861,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetNativeHandle( UR_FUNCTION_KERNEL_GET_NATIVE_HANDLE, "urKernelGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelGetNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urKernelGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hKernel, phNativeKernel); @@ -3872,7 +3873,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urKernelGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urKernelGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3905,7 +3906,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreateWithNativeHandle( "urKernelCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelCreateWithNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urKernelCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle( hNativeKernel, hContext, hProgram, pProperties, phKernel); @@ -3918,7 +3919,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urKernelCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3960,7 +3961,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize( "urKernelGetSuggestedLocalWorkSize", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urKernelGetSuggestedLocalWorkSize\n"); + UR_LOG_L(logger, Info, " ---> urKernelGetSuggestedLocalWorkSize\n"); ur_result_t result = pfnGetSuggestedLocalWorkSize( hKernel, hQueue, numWorkDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -3974,7 +3975,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_SUGGESTED_LOCAL_WORK_SIZE, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urKernelGetSuggestedLocalWorkSize({}) -> {};\n", args_str.str(), result); } @@ -4007,7 +4008,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetInfo( "urQueueGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urQueueGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urQueueGetInfo\n"); ur_result_t result = pfnGetInfo(hQueue, propName, propSize, pPropValue, pPropSizeRet); @@ -4019,7 +4020,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urQueueGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urQueueGetInfo({}) -> {};\n", args_str.str(), result); } @@ -4048,7 +4049,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreate( "urQueueCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urQueueCreate\n"); + UR_LOG_L(logger, Info, " ---> urQueueCreate\n"); ur_result_t result = pfnCreate(hContext, hDevice, pProperties, phQueue); @@ -4059,7 +4060,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_CREATE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urQueueCreate({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urQueueCreate({}) -> {};\n", args_str.str(), result); } @@ -4081,7 +4082,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain( "urQueueRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urQueueRetain\n"); + UR_LOG_L(logger, Info, " ---> urQueueRetain\n"); ur_result_t result = pfnRetain(hQueue); @@ -4092,7 +4093,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_RETAIN, ¶ms); - UR_LOG_L(logger, INFO, " <--- urQueueRetain({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urQueueRetain({}) -> {};\n", args_str.str(), result); } @@ -4114,7 +4115,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRelease( "urQueueRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urQueueRelease\n"); + UR_LOG_L(logger, Info, " ---> urQueueRelease\n"); ur_result_t result = pfnRelease(hQueue); @@ -4125,7 +4126,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_RELEASE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urQueueRelease({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urQueueRelease({}) -> {};\n", args_str.str(), result); } @@ -4152,7 +4153,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetNativeHandle( UR_FUNCTION_QUEUE_GET_NATIVE_HANDLE, "urQueueGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urQueueGetNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urQueueGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hQueue, pDesc, phNativeQueue); @@ -4164,7 +4165,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_QUEUE_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urQueueGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urQueueGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4197,7 +4198,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreateWithNativeHandle( "urQueueCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urQueueCreateWithNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urQueueCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeQueue, hContext, hDevice, pProperties, phQueue); @@ -4210,7 +4211,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_QUEUE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urQueueCreateWithNativeHandle({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urQueueCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4232,7 +4233,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFinish( "urQueueFinish", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urQueueFinish\n"); + UR_LOG_L(logger, Info, " ---> urQueueFinish\n"); ur_result_t result = pfnFinish(hQueue); @@ -4243,7 +4244,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFinish( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_FINISH, ¶ms); - UR_LOG_L(logger, INFO, " <--- urQueueFinish({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urQueueFinish({}) -> {};\n", args_str.str(), result); } @@ -4265,7 +4266,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFlush( "urQueueFlush", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urQueueFlush\n"); + UR_LOG_L(logger, Info, " ---> urQueueFlush\n"); ur_result_t result = pfnFlush(hQueue); @@ -4275,7 +4276,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFlush( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_FLUSH, ¶ms); - UR_LOG_L(logger, INFO, " <--- urQueueFlush({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urQueueFlush({}) -> {};\n", args_str.str(), result); } @@ -4307,7 +4308,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetInfo( "urEventGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEventGetInfo\n"); + UR_LOG_L(logger, Info, " ---> urEventGetInfo\n"); ur_result_t result = pfnGetInfo(hEvent, propName, propSize, pPropValue, pPropSizeRet); @@ -4319,7 +4320,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_GET_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEventGetInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEventGetInfo({}) -> {};\n", args_str.str(), result); } @@ -4352,7 +4353,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetProfilingInfo( UR_FUNCTION_EVENT_GET_PROFILING_INFO, "urEventGetProfilingInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEventGetProfilingInfo\n"); + UR_LOG_L(logger, Info, " ---> urEventGetProfilingInfo\n"); ur_result_t result = pfnGetProfilingInfo(hEvent, propName, propSize, pPropValue, pPropSizeRet); @@ -4365,7 +4366,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetProfilingInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_GET_PROFILING_INFO, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEventGetProfilingInfo({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEventGetProfilingInfo({}) -> {};\n", args_str.str(), result); } @@ -4390,7 +4391,7 @@ __urdlllocal ur_result_t UR_APICALL urEventWait( "urEventWait", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEventWait\n"); + UR_LOG_L(logger, Info, " ---> urEventWait\n"); ur_result_t result = pfnWait(numEvents, phEventWaitList); @@ -4400,7 +4401,7 @@ __urdlllocal ur_result_t UR_APICALL urEventWait( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_WAIT, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEventWait({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urEventWait({}) -> {};\n", args_str.str(), result); } @@ -4422,7 +4423,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain( "urEventRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEventRetain\n"); + UR_LOG_L(logger, Info, " ---> urEventRetain\n"); ur_result_t result = pfnRetain(hEvent); @@ -4433,7 +4434,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_RETAIN, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEventRetain({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, Info, " <--- urEventRetain({}) -> {};\n", args_str.str(), result); } @@ -4455,7 +4456,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRelease( "urEventRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEventRelease\n"); + UR_LOG_L(logger, Info, " ---> urEventRelease\n"); ur_result_t result = pfnRelease(hEvent); @@ -4466,7 +4467,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_RELEASE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEventRelease({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEventRelease({}) -> {};\n", args_str.str(), result); } @@ -4490,7 +4491,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetNativeHandle( UR_FUNCTION_EVENT_GET_NATIVE_HANDLE, "urEventGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEventGetNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urEventGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hEvent, phNativeEvent); @@ -4502,7 +4503,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEventGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEventGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4533,7 +4534,7 @@ __urdlllocal ur_result_t UR_APICALL urEventCreateWithNativeHandle( "urEventCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEventCreateWithNativeHandle\n"); + UR_LOG_L(logger, Info, " ---> urEventCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeEvent, hContext, pProperties, phEvent); @@ -4546,7 +4547,7 @@ __urdlllocal ur_result_t UR_APICALL urEventCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEventCreateWithNativeHandle({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEventCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4575,7 +4576,7 @@ __urdlllocal ur_result_t UR_APICALL urEventSetCallback( "urEventSetCallback", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEventSetCallback\n"); + UR_LOG_L(logger, Info, " ---> urEventSetCallback\n"); ur_result_t result = pfnSetCallback(hEvent, execStatus, pfnNotify, pUserData); @@ -4586,7 +4587,7 @@ __urdlllocal ur_result_t UR_APICALL urEventSetCallback( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_SET_CALLBACK, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEventSetCallback({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEventSetCallback({}) -> {};\n", args_str.str(), result); } @@ -4645,7 +4646,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH, "urEnqueueKernelLaunch", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueKernelLaunch\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueKernelLaunch\n"); ur_result_t result = pfnKernelLaunch( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -4658,7 +4659,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueKernelLaunch({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueKernelLaunch({}) -> {};\n", args_str.str(), result); } @@ -4693,7 +4694,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWait( UR_FUNCTION_ENQUEUE_EVENTS_WAIT, "urEnqueueEventsWait", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueEventsWait\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueEventsWait\n"); ur_result_t result = pfnEventsWait(hQueue, numEventsInWaitList, phEventWaitList, phEvent); @@ -4705,7 +4706,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWait( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueEventsWait({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueEventsWait({}) -> {};\n", args_str.str(), result); } @@ -4742,7 +4743,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( "urEnqueueEventsWaitWithBarrier", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueEventsWaitWithBarrier\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueEventsWaitWithBarrier\n"); ur_result_t result = pfnEventsWaitWithBarrier(hQueue, numEventsInWaitList, phEventWaitList, phEvent); @@ -4755,7 +4756,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urEnqueueEventsWaitWithBarrier({}) -> {};\n", args_str.str(), result); } @@ -4802,7 +4803,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ, "urEnqueueMemBufferRead", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferRead\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferRead\n"); ur_result_t result = pfnMemBufferRead(hQueue, hBuffer, blockingRead, offset, size, pDst, @@ -4816,7 +4817,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferRead({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferRead({}) -> {};\n", args_str.str(), result); } @@ -4862,7 +4863,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE, "urEnqueueMemBufferWrite", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferWrite\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferWrite\n"); ur_result_t result = pfnMemBufferWrite(hQueue, hBuffer, blockingWrite, offset, size, pSrc, @@ -4876,7 +4877,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferWrite({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferWrite({}) -> {};\n", args_str.str(), result); } @@ -4937,7 +4938,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( "urEnqueueMemBufferReadRect", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferReadRect\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferReadRect\n"); ur_result_t result = pfnMemBufferReadRect( hQueue, hBuffer, blockingRead, bufferOrigin, hostOrigin, region, @@ -4952,7 +4953,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ_RECT, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferReadRect({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferReadRect({}) -> {};\n", args_str.str(), result); } @@ -5014,7 +5015,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( "urEnqueueMemBufferWriteRect", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferWriteRect\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferWriteRect\n"); ur_result_t result = pfnMemBufferWriteRect( hQueue, hBuffer, blockingWrite, bufferOrigin, hostOrigin, region, @@ -5029,7 +5030,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE_RECT, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferWriteRect({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferWriteRect({}) -> {};\n", args_str.str(), result); } @@ -5074,7 +5075,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY, "urEnqueueMemBufferCopy", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferCopy\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferCopy\n"); ur_result_t result = pfnMemBufferCopy(hQueue, hBufferSrc, hBufferDst, srcOffset, dstOffset, @@ -5088,7 +5089,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferCopy({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferCopy({}) -> {};\n", args_str.str(), result); } @@ -5145,7 +5146,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( "urEnqueueMemBufferCopyRect", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferCopyRect\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferCopyRect\n"); ur_result_t result = pfnMemBufferCopyRect( hQueue, hBufferSrc, hBufferDst, srcOrigin, dstOrigin, region, srcRowPitch, @@ -5160,7 +5161,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY_RECT, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferCopyRect({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferCopyRect({}) -> {};\n", args_str.str(), result); } @@ -5211,7 +5212,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( UR_FUNCTION_ENQUEUE_MEM_BUFFER_FILL, "urEnqueueMemBufferFill", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferFill\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferFill\n"); ur_result_t result = pfnMemBufferFill(hQueue, hBuffer, pPattern, patternSize, offset, size, @@ -5225,7 +5226,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_FILL, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferFill({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferFill({}) -> {};\n", args_str.str(), result); } @@ -5277,7 +5278,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageRead( UR_FUNCTION_ENQUEUE_MEM_IMAGE_READ, "urEnqueueMemImageRead", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemImageRead\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemImageRead\n"); ur_result_t result = pfnMemImageRead( hQueue, hImage, blockingRead, origin, region, rowPitch, slicePitch, pDst, @@ -5290,7 +5291,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_READ, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemImageRead({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemImageRead({}) -> {};\n", args_str.str(), result); } @@ -5342,7 +5343,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageWrite( UR_FUNCTION_ENQUEUE_MEM_IMAGE_WRITE, "urEnqueueMemImageWrite", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemImageWrite\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemImageWrite\n"); ur_result_t result = pfnMemImageWrite( hQueue, hImage, blockingWrite, origin, region, rowPitch, slicePitch, pSrc, @@ -5356,7 +5357,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_WRITE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemImageWrite({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemImageWrite({}) -> {};\n", args_str.str(), result); } @@ -5404,7 +5405,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageCopy( UR_FUNCTION_ENQUEUE_MEM_IMAGE_COPY, "urEnqueueMemImageCopy", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemImageCopy\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemImageCopy\n"); ur_result_t result = pfnMemImageCopy(hQueue, hImageSrc, hImageDst, srcOrigin, dstOrigin, @@ -5417,7 +5418,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageCopy( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_COPY, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemImageCopy({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemImageCopy({}) -> {};\n", args_str.str(), result); } @@ -5466,7 +5467,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( UR_FUNCTION_ENQUEUE_MEM_BUFFER_MAP, "urEnqueueMemBufferMap", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferMap\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferMap\n"); ur_result_t result = pfnMemBufferMap(hQueue, hBuffer, blockingMap, mapFlags, offset, size, @@ -5479,7 +5480,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_MAP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferMap({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferMap({}) -> {};\n", args_str.str(), result); } @@ -5518,7 +5519,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( "urEnqueueMemUnmap", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueMemUnmap\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueMemUnmap\n"); ur_result_t result = pfnMemUnmap( hQueue, hMem, pMappedPtr, numEventsInWaitList, phEventWaitList, phEvent); @@ -5530,7 +5531,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_MEM_UNMAP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueMemUnmap({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueMemUnmap({}) -> {};\n", args_str.str(), result); } @@ -5575,7 +5576,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill( "urEnqueueUSMFill", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueUSMFill\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueUSMFill\n"); ur_result_t result = pfnUSMFill(hQueue, pMem, patternSize, pPattern, size, numEventsInWaitList, @@ -5588,7 +5589,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FILL, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueUSMFill({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueUSMFill({}) -> {};\n", args_str.str(), result); } @@ -5631,7 +5632,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy( "urEnqueueUSMMemcpy", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueUSMMemcpy\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueUSMMemcpy\n"); ur_result_t result = pfnUSMMemcpy(hQueue, blocking, pDst, pSrc, size, numEventsInWaitList, @@ -5644,7 +5645,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_MEMCPY, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueUSMMemcpy({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueUSMMemcpy({}) -> {};\n", args_str.str(), result); } @@ -5685,7 +5686,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMPrefetch( UR_FUNCTION_ENQUEUE_USM_PREFETCH, "urEnqueueUSMPrefetch", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueUSMPrefetch\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueUSMPrefetch\n"); ur_result_t result = pfnUSMPrefetch( hQueue, pMem, size, flags, numEventsInWaitList, phEventWaitList, phEvent); @@ -5697,7 +5698,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMPrefetch( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_PREFETCH, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueUSMPrefetch({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueUSMPrefetch({}) -> {};\n", args_str.str(), result); } @@ -5729,7 +5730,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMAdvise( "urEnqueueUSMAdvise", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueUSMAdvise\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueUSMAdvise\n"); ur_result_t result = pfnUSMAdvise(hQueue, pMem, size, advice, phEvent); @@ -5740,7 +5741,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMAdvise( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_ADVISE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueUSMAdvise({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueUSMAdvise({}) -> {};\n", args_str.str(), result); } @@ -5791,7 +5792,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill2D( UR_FUNCTION_ENQUEUE_USM_FILL_2D, "urEnqueueUSMFill2D", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueUSMFill2D\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueUSMFill2D\n"); ur_result_t result = pfnUSMFill2D(hQueue, pMem, pitch, patternSize, pPattern, width, height, @@ -5804,7 +5805,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill2D( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FILL_2D, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueUSMFill2D({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueUSMFill2D({}) -> {};\n", args_str.str(), result); } @@ -5857,7 +5858,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( UR_FUNCTION_ENQUEUE_USM_MEMCPY_2D, "urEnqueueUSMMemcpy2D", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueUSMMemcpy2D\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueUSMMemcpy2D\n"); ur_result_t result = pfnUSMMemcpy2D(hQueue, blocking, pDst, dstPitch, pSrc, srcPitch, width, @@ -5870,7 +5871,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_MEMCPY_2D, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueUSMMemcpy2D({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueUSMMemcpy2D({}) -> {};\n", args_str.str(), result); } @@ -5921,7 +5922,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( "urEnqueueDeviceGlobalVariableWrite", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueDeviceGlobalVariableWrite\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueDeviceGlobalVariableWrite\n"); ur_result_t result = pfnDeviceGlobalVariableWrite( hQueue, hProgram, name, blockingWrite, count, offset, pSrc, @@ -5935,7 +5936,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_DEVICE_GLOBAL_VARIABLE_WRITE, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urEnqueueDeviceGlobalVariableWrite({}) -> {};\n", args_str.str(), result); } @@ -5987,7 +5988,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( "urEnqueueDeviceGlobalVariableRead", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueDeviceGlobalVariableRead\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueDeviceGlobalVariableRead\n"); ur_result_t result = pfnDeviceGlobalVariableRead( hQueue, hProgram, name, blockingRead, count, offset, pDst, @@ -6001,7 +6002,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_DEVICE_GLOBAL_VARIABLE_READ, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urEnqueueDeviceGlobalVariableRead({}) -> {};\n", args_str.str(), result); } @@ -6053,7 +6054,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueReadHostPipe( UR_FUNCTION_ENQUEUE_READ_HOST_PIPE, "urEnqueueReadHostPipe", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueReadHostPipe\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueReadHostPipe\n"); ur_result_t result = pfnReadHostPipe(hQueue, hProgram, pipe_symbol, blocking, pDst, size, @@ -6066,7 +6067,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueReadHostPipe( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_READ_HOST_PIPE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueReadHostPipe({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueReadHostPipe({}) -> {};\n", args_str.str(), result); } @@ -6118,7 +6119,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueWriteHostPipe( UR_FUNCTION_ENQUEUE_WRITE_HOST_PIPE, "urEnqueueWriteHostPipe", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueWriteHostPipe\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueWriteHostPipe\n"); ur_result_t result = pfnWriteHostPipe(hQueue, hProgram, pipe_symbol, blocking, pSrc, size, @@ -6132,7 +6133,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueWriteHostPipe( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_WRITE_HOST_PIPE, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueWriteHostPipe({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueWriteHostPipe({}) -> {};\n", args_str.str(), result); } @@ -6175,7 +6176,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMDeviceAllocExp( "urEnqueueUSMDeviceAllocExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueUSMDeviceAllocExp\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueUSMDeviceAllocExp\n"); ur_result_t result = pfnUSMDeviceAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6189,7 +6190,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMDeviceAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_DEVICE_ALLOC_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueUSMDeviceAllocExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueUSMDeviceAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6232,7 +6233,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMSharedAllocExp( "urEnqueueUSMSharedAllocExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueUSMSharedAllocExp\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueUSMSharedAllocExp\n"); ur_result_t result = pfnUSMSharedAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6246,7 +6247,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMSharedAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_SHARED_ALLOC_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueUSMSharedAllocExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueUSMSharedAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6289,7 +6290,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMHostAllocExp( "urEnqueueUSMHostAllocExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueUSMHostAllocExp\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueUSMHostAllocExp\n"); ur_result_t result = pfnUSMHostAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6303,7 +6304,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMHostAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_HOST_ALLOC_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueUSMHostAllocExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueUSMHostAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6339,7 +6340,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFreeExp( UR_FUNCTION_ENQUEUE_USM_FREE_EXP, "urEnqueueUSMFreeExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueUSMFreeExp\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueUSMFreeExp\n"); ur_result_t result = pfnUSMFreeExp(hQueue, pPool, pMem, numEventsInWaitList, phEventWaitList, phEvent); @@ -6351,7 +6352,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FREE_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueUSMFreeExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueUSMFreeExp({}) -> {};\n", args_str.str(), result); } @@ -6381,7 +6382,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreateExp( UR_FUNCTION_USM_POOL_CREATE_EXP, "urUSMPoolCreateExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolCreateExp\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolCreateExp\n"); ur_result_t result = pfnPoolCreateExp(hContext, hDevice, pPoolDesc, pPool); @@ -6392,7 +6393,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreateExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_CREATE_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPoolCreateExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPoolCreateExp({}) -> {};\n", args_str.str(), result); } @@ -6418,7 +6419,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( UR_FUNCTION_USM_POOL_DESTROY_EXP, "urUSMPoolDestroyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolDestroyExp\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolDestroyExp\n"); ur_result_t result = pfnPoolDestroyExp(hContext, hDevice, hPool); @@ -6429,7 +6430,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_DESTROY_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPoolDestroyExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPoolDestroyExp({}) -> {};\n", args_str.str(), result); } @@ -6458,7 +6459,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( "urUSMPoolGetDefaultDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolGetDefaultDevicePoolExp\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolGetDefaultDevicePoolExp\n"); ur_result_t result = pfnPoolGetDefaultDevicePoolExp(hContext, hDevice, pPool); @@ -6470,7 +6471,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_GET_DEFAULT_DEVICE_POOL_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urUSMPoolGetDefaultDevicePoolExp({}) -> {};\n", args_str.str(), result); } @@ -6500,7 +6501,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( UR_FUNCTION_USM_POOL_GET_INFO_EXP, "urUSMPoolGetInfoExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolGetInfoExp\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolGetInfoExp\n"); ur_result_t result = pfnPoolGetInfoExp(hPool, propName, pPropValue, pPropSizeRet); @@ -6512,7 +6513,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_GET_INFO_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPoolGetInfoExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPoolGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -6541,7 +6542,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetInfoExp( UR_FUNCTION_USM_POOL_SET_INFO_EXP, "urUSMPoolSetInfoExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolSetInfoExp\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolSetInfoExp\n"); ur_result_t result = pfnPoolSetInfoExp(hPool, propName, pPropValue, propSize); @@ -6552,7 +6553,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_SET_INFO_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPoolSetInfoExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPoolSetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -6581,7 +6582,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( "urUSMPoolSetDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolSetDevicePoolExp\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolSetDevicePoolExp\n"); ur_result_t result = pfnPoolSetDevicePoolExp(hContext, hDevice, hPool); @@ -6593,7 +6594,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_SET_DEVICE_POOL_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPoolSetDevicePoolExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPoolSetDevicePoolExp({}) -> {};\n", args_str.str(), result); } @@ -6622,7 +6623,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp( "urUSMPoolGetDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolGetDevicePoolExp\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolGetDevicePoolExp\n"); ur_result_t result = pfnPoolGetDevicePoolExp(hContext, hDevice, pPool); @@ -6634,7 +6635,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_GET_DEVICE_POOL_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPoolGetDevicePoolExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPoolGetDevicePoolExp({}) -> {};\n", args_str.str(), result); } @@ -6663,7 +6664,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolTrimToExp( UR_FUNCTION_USM_POOL_TRIM_TO_EXP, "urUSMPoolTrimToExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPoolTrimToExp\n"); + UR_LOG_L(logger, Info, " ---> urUSMPoolTrimToExp\n"); ur_result_t result = pfnPoolTrimToExp(hContext, hDevice, hPool, minBytesToKeep); @@ -6675,7 +6676,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolTrimToExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_TRIM_TO_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPoolTrimToExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPoolTrimToExp({}) -> {};\n", args_str.str(), result); } @@ -6715,7 +6716,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( UR_FUNCTION_USM_PITCHED_ALLOC_EXP, "urUSMPitchedAllocExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMPitchedAllocExp\n"); + UR_LOG_L(logger, Info, " ---> urUSMPitchedAllocExp\n"); ur_result_t result = pfnPitchedAllocExp(hContext, hDevice, pUSMDesc, pool, widthInBytes, @@ -6728,7 +6729,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_PITCHED_ALLOC_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMPitchedAllocExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMPitchedAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6759,7 +6760,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp( "urBindlessImagesUnsampledImageHandleDestroyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " ---> urBindlessImagesUnsampledImageHandleDestroyExp\n"); ur_result_t result = @@ -6777,7 +6778,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp( UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_HANDLE_DESTROY_EXP, ¶ms); UR_LOG_L( - logger, INFO, + logger, Info, " <--- urBindlessImagesUnsampledImageHandleDestroyExp({}) -> {};\n", args_str.str(), result); } @@ -6809,7 +6810,7 @@ urBindlessImagesSampledImageHandleDestroyExp( "urBindlessImagesSampledImageHandleDestroyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " ---> urBindlessImagesSampledImageHandleDestroyExp\n"); ur_result_t result = @@ -6826,7 +6827,7 @@ urBindlessImagesSampledImageHandleDestroyExp( args_str, UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_HANDLE_DESTROY_EXP, ¶ms); UR_LOG_L( - logger, INFO, + logger, Info, " <--- urBindlessImagesSampledImageHandleDestroyExp({}) -> {};\n", args_str.str(), result); } @@ -6860,7 +6861,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( "urBindlessImagesImageAllocateExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesImageAllocateExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesImageAllocateExp\n"); ur_result_t result = pfnImageAllocateExp(hContext, hDevice, pImageFormat, pImageDesc, phImageMem); @@ -6873,7 +6874,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_ALLOCATE_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesImageAllocateExp({}) -> {};\n", args_str.str(), result); } @@ -6903,7 +6904,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( "urBindlessImagesImageFreeExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesImageFreeExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesImageFreeExp\n"); ur_result_t result = pfnImageFreeExp(hContext, hDevice, hImageMem); @@ -6915,7 +6916,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_FREE_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urBindlessImagesImageFreeExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urBindlessImagesImageFreeExp({}) -> {};\n", args_str.str(), result); } @@ -6950,7 +6951,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( "urBindlessImagesUnsampledImageCreateExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesUnsampledImageCreateExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesUnsampledImageCreateExp\n"); ur_result_t result = pfnUnsampledImageCreateExp( hContext, hDevice, hImageMem, pImageFormat, pImageDesc, phImage); @@ -6964,7 +6965,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_CREATE_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesUnsampledImageCreateExp({}) -> {};\n", args_str.str(), result); } @@ -7003,7 +7004,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( "urBindlessImagesSampledImageCreateExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesSampledImageCreateExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesSampledImageCreateExp\n"); ur_result_t result = pfnSampledImageCreateExp(hContext, hDevice, hImageMem, pImageFormat, @@ -7018,7 +7019,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_CREATE_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesSampledImageCreateExp({}) -> {};\n", args_str.str(), result); } @@ -7083,7 +7084,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( "urBindlessImagesImageCopyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesImageCopyExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesImageCopyExp\n"); ur_result_t result = pfnImageCopyExp( hQueue, pSrc, pDst, pSrcImageDesc, pDstImageDesc, pSrcImageFormat, @@ -7098,7 +7099,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_COPY_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urBindlessImagesImageCopyExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urBindlessImagesImageCopyExp({}) -> {};\n", args_str.str(), result); } @@ -7131,7 +7132,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( "urBindlessImagesImageGetInfoExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesImageGetInfoExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesImageGetInfoExp\n"); ur_result_t result = pfnImageGetInfoExp(hContext, hImageMem, propName, pPropValue, pPropSizeRet); @@ -7144,7 +7145,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_GET_INFO_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesImageGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -7178,7 +7179,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( "urBindlessImagesMipmapGetLevelExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesMipmapGetLevelExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesMipmapGetLevelExp\n"); ur_result_t result = pfnMipmapGetLevelExp(hContext, hDevice, hImageMem, mipmapLevel, phImageMem); @@ -7191,7 +7192,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_GET_LEVEL_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesMipmapGetLevelExp({}) -> {};\n", args_str.str(), result); } @@ -7221,7 +7222,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( "urBindlessImagesMipmapFreeExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesMipmapFreeExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesMipmapFreeExp\n"); ur_result_t result = pfnMipmapFreeExp(hContext, hDevice, hMem); @@ -7233,7 +7234,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_FREE_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urBindlessImagesMipmapFreeExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urBindlessImagesMipmapFreeExp({}) -> {};\n", args_str.str(), result); } @@ -7269,7 +7270,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalMemoryExp( "urBindlessImagesImportExternalMemoryExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesImportExternalMemoryExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesImportExternalMemoryExp\n"); ur_result_t result = pfnImportExternalMemoryExp( hContext, hDevice, size, memHandleType, pExternalMemDesc, phExternalMem); @@ -7283,7 +7284,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_MEMORY_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesImportExternalMemoryExp({}) -> {};\n", args_str.str(), result); } @@ -7320,7 +7321,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( "urBindlessImagesMapExternalArrayExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesMapExternalArrayExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesMapExternalArrayExp\n"); ur_result_t result = pfnMapExternalArrayExp( hContext, hDevice, pImageFormat, pImageDesc, hExternalMem, phImageMem); @@ -7333,7 +7334,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_ARRAY_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesMapExternalArrayExp({}) -> {};\n", args_str.str(), result); } @@ -7369,7 +7370,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalLinearMemoryExp( "urBindlessImagesMapExternalLinearMemoryExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " ---> urBindlessImagesMapExternalLinearMemoryExp\n"); ur_result_t result = pfnMapExternalLinearMemoryExp( @@ -7384,7 +7385,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalLinearMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesMapExternalLinearMemoryExp({}) -> {};\n", args_str.str(), result); } @@ -7414,7 +7415,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalMemoryExp( "urBindlessImagesReleaseExternalMemoryExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesReleaseExternalMemoryExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesReleaseExternalMemoryExp\n"); ur_result_t result = pfnReleaseExternalMemoryExp(hContext, hDevice, hExternalMem); @@ -7428,7 +7429,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_RELEASE_EXTERNAL_MEMORY_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesReleaseExternalMemoryExp({}) -> {};\n", args_str.str(), result); } @@ -7463,7 +7464,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreExp( "urBindlessImagesImportExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " ---> urBindlessImagesImportExternalSemaphoreExp\n"); ur_result_t result = pfnImportExternalSemaphoreExp( @@ -7479,7 +7480,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_SEMAPHORE_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesImportExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7509,7 +7510,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalSemaphoreExp( "urBindlessImagesReleaseExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " ---> urBindlessImagesReleaseExternalSemaphoreExp\n"); ur_result_t result = @@ -7525,7 +7526,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_RELEASE_EXTERNAL_SEMAPHORE_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesReleaseExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7574,7 +7575,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesWaitExternalSemaphoreExp( "urBindlessImagesWaitExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urBindlessImagesWaitExternalSemaphoreExp\n"); + UR_LOG_L(logger, Info, " ---> urBindlessImagesWaitExternalSemaphoreExp\n"); ur_result_t result = pfnWaitExternalSemaphoreExp( hQueue, hSemaphore, hasWaitValue, waitValue, numEventsInWaitList, @@ -7589,7 +7590,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesWaitExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_WAIT_EXTERNAL_SEMAPHORE_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesWaitExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7638,7 +7639,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSignalExternalSemaphoreExp( "urBindlessImagesSignalExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " ---> urBindlessImagesSignalExternalSemaphoreExp\n"); ur_result_t result = pfnSignalExternalSemaphoreExp( @@ -7654,7 +7655,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSignalExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_SIGNAL_EXTERNAL_SEMAPHORE_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urBindlessImagesSignalExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7685,7 +7686,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferCreateExp( "urCommandBufferCreateExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferCreateExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferCreateExp\n"); ur_result_t result = pfnCreateExp(hContext, hDevice, pCommandBufferDesc, phCommandBuffer); @@ -7698,7 +7699,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferCreateExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_CREATE_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urCommandBufferCreateExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urCommandBufferCreateExp({}) -> {};\n", args_str.str(), result); } @@ -7721,7 +7722,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainExp( "urCommandBufferRetainExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferRetainExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferRetainExp\n"); ur_result_t result = pfnRetainExp(hCommandBuffer); @@ -7733,7 +7734,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_RETAIN_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urCommandBufferRetainExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urCommandBufferRetainExp({}) -> {};\n", args_str.str(), result); } @@ -7756,7 +7757,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferReleaseExp( "urCommandBufferReleaseExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferReleaseExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferReleaseExp\n"); ur_result_t result = pfnReleaseExp(hCommandBuffer); @@ -7768,7 +7769,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferReleaseExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_RELEASE_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urCommandBufferReleaseExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urCommandBufferReleaseExp({}) -> {};\n", args_str.str(), result); } @@ -7792,7 +7793,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferFinalizeExp( "urCommandBufferFinalizeExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferFinalizeExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferFinalizeExp\n"); ur_result_t result = pfnFinalizeExp(hCommandBuffer); @@ -7804,7 +7805,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferFinalizeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_FINALIZE_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urCommandBufferFinalizeExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urCommandBufferFinalizeExp({}) -> {};\n", args_str.str(), result); } @@ -7884,7 +7885,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( "urCommandBufferAppendKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendKernelLaunchExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendKernelLaunchExp\n"); ur_result_t result = pfnAppendKernelLaunchExp( hCommandBuffer, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -7900,7 +7901,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_KERNEL_LAUNCH_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendKernelLaunchExp({}) -> {};\n", args_str.str(), result); } @@ -7961,7 +7962,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp( "urCommandBufferAppendUSMMemcpyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendUSMMemcpyExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendUSMMemcpyExp\n"); ur_result_t result = pfnAppendUSMMemcpyExp( hCommandBuffer, pDst, pSrc, size, numSyncPointsInWaitList, @@ -7976,7 +7977,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_MEMCPY_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendUSMMemcpyExp({}) -> {};\n", args_str.str(), result); } @@ -8040,7 +8041,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMFillExp( "urCommandBufferAppendUSMFillExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendUSMFillExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendUSMFillExp\n"); ur_result_t result = pfnAppendUSMFillExp( hCommandBuffer, pMemory, pPattern, patternSize, size, @@ -8055,7 +8056,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMFillExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_FILL_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendUSMFillExp({}) -> {};\n", args_str.str(), result); } @@ -8122,7 +8123,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp( "urCommandBufferAppendMemBufferCopyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferCopyExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferCopyExp\n"); ur_result_t result = pfnAppendMemBufferCopyExp( hCommandBuffer, hSrcMem, hDstMem, srcOffset, dstOffset, size, @@ -8138,7 +8139,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_COPY_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendMemBufferCopyExp({}) -> {};\n", args_str.str(), result); } @@ -8202,7 +8203,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp( "urCommandBufferAppendMemBufferWriteExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferWriteExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferWriteExp\n"); ur_result_t result = pfnAppendMemBufferWriteExp( hCommandBuffer, hBuffer, offset, size, pSrc, numSyncPointsInWaitList, @@ -8218,7 +8219,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_WRITE_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendMemBufferWriteExp({}) -> {};\n", args_str.str(), result); } @@ -8282,7 +8283,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp( "urCommandBufferAppendMemBufferReadExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferReadExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferReadExp\n"); ur_result_t result = pfnAppendMemBufferReadExp( hCommandBuffer, hBuffer, offset, size, pDst, numSyncPointsInWaitList, @@ -8298,7 +8299,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_READ_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendMemBufferReadExp({}) -> {};\n", args_str.str(), result); } @@ -8377,7 +8378,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp( "urCommandBufferAppendMemBufferCopyRectExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferCopyRectExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferCopyRectExp\n"); ur_result_t result = pfnAppendMemBufferCopyRectExp( hCommandBuffer, hSrcMem, hDstMem, srcOrigin, dstOrigin, region, @@ -8394,7 +8395,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_COPY_RECT_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendMemBufferCopyRectExp({}) -> {};\n", args_str.str(), result); } @@ -8476,7 +8477,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp( "urCommandBufferAppendMemBufferWriteRectExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferWriteRectExp\n"); ur_result_t result = pfnAppendMemBufferWriteRectExp( @@ -8494,7 +8495,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_WRITE_RECT_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendMemBufferWriteRectExp({}) -> {};\n", args_str.str(), result); } @@ -8575,7 +8576,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp( "urCommandBufferAppendMemBufferReadRectExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferReadRectExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferReadRectExp\n"); ur_result_t result = pfnAppendMemBufferReadRectExp( hCommandBuffer, hBuffer, bufferOffset, hostOffset, region, bufferRowPitch, @@ -8592,7 +8593,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_READ_RECT_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendMemBufferReadRectExp({}) -> {};\n", args_str.str(), result); } @@ -8659,7 +8660,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp( "urCommandBufferAppendMemBufferFillExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferFillExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferFillExp\n"); ur_result_t result = pfnAppendMemBufferFillExp( hCommandBuffer, hBuffer, pPattern, patternSize, offset, size, @@ -8675,7 +8676,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_FILL_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendMemBufferFillExp({}) -> {};\n", args_str.str(), result); } @@ -8736,7 +8737,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMPrefetchExp( "urCommandBufferAppendUSMPrefetchExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendUSMPrefetchExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendUSMPrefetchExp\n"); ur_result_t result = pfnAppendUSMPrefetchExp( hCommandBuffer, pMemory, size, flags, numSyncPointsInWaitList, @@ -8751,7 +8752,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMPrefetchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_PREFETCH_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendUSMPrefetchExp({}) -> {};\n", args_str.str(), result); } @@ -8812,7 +8813,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp( "urCommandBufferAppendUSMAdviseExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendUSMAdviseExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendUSMAdviseExp\n"); ur_result_t result = pfnAppendUSMAdviseExp( hCommandBuffer, pMemory, size, advice, numSyncPointsInWaitList, @@ -8827,7 +8828,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_ADVISE_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendUSMAdviseExp({}) -> {};\n", args_str.str(), result); } @@ -8873,7 +8874,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendNativeCommandExp( "urCommandBufferAppendNativeCommandExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendNativeCommandExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferAppendNativeCommandExp\n"); ur_result_t result = pfnAppendNativeCommandExp( hCommandBuffer, pfnNativeCommand, pData, hChildCommandBuffer, @@ -8888,7 +8889,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendNativeCommandExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_NATIVE_COMMAND_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferAppendNativeCommandExp({}) -> {};\n", args_str.str(), result); } @@ -8929,7 +8930,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCommandBufferExp( "urEnqueueCommandBufferExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueCommandBufferExp\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueCommandBufferExp\n"); ur_result_t result = pfnCommandBufferExp( hQueue, hCommandBuffer, numEventsInWaitList, phEventWaitList, phEvent); @@ -8942,7 +8943,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCommandBufferExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueCommandBufferExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueCommandBufferExp({}) -> {};\n", args_str.str(), result); } @@ -8973,7 +8974,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp( "urCommandBufferUpdateKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferUpdateKernelLaunchExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferUpdateKernelLaunchExp\n"); ur_result_t result = pfnUpdateKernelLaunchExp( hCommandBuffer, numKernelUpdates, pUpdateKernelLaunch); @@ -8986,7 +8987,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_KERNEL_LAUNCH_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferUpdateKernelLaunchExp({}) -> {};\n", args_str.str(), result); } @@ -9014,7 +9015,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateSignalEventExp( "urCommandBufferUpdateSignalEventExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferUpdateSignalEventExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferUpdateSignalEventExp\n"); ur_result_t result = pfnUpdateSignalEventExp(hCommand, phSignalEvent); @@ -9026,7 +9027,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateSignalEventExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferUpdateSignalEventExp({}) -> {};\n", args_str.str(), result); } @@ -9058,7 +9059,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateWaitEventsExp( "urCommandBufferUpdateWaitEventsExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferUpdateWaitEventsExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferUpdateWaitEventsExp\n"); ur_result_t result = pfnUpdateWaitEventsExp(hCommand, numEventsInWaitList, phEventWaitList); @@ -9071,7 +9072,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateWaitEventsExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_WAIT_EVENTS_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferUpdateWaitEventsExp({}) -> {};\n", args_str.str(), result); } @@ -9105,7 +9106,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetInfoExp( "urCommandBufferGetInfoExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferGetInfoExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferGetInfoExp\n"); ur_result_t result = pfnGetInfoExp(hCommandBuffer, propName, propSize, pPropValue, pPropSizeRet); @@ -9118,7 +9119,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_GET_INFO_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urCommandBufferGetInfoExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urCommandBufferGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -9145,7 +9146,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetNativeHandleExp( "urCommandBufferGetNativeHandleExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urCommandBufferGetNativeHandleExp\n"); + UR_LOG_L(logger, Info, " ---> urCommandBufferGetNativeHandleExp\n"); ur_result_t result = pfnGetNativeHandleExp(hCommandBuffer, phNativeCommandBuffer); @@ -9158,7 +9159,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetNativeHandleExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_GET_NATIVE_HANDLE_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urCommandBufferGetNativeHandleExp({}) -> {};\n", args_str.str(), result); } @@ -9221,7 +9222,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( "urEnqueueCooperativeKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueCooperativeKernelLaunchExp\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueCooperativeKernelLaunchExp\n"); ur_result_t result = pfnCooperativeKernelLaunchExp( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -9235,7 +9236,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_COOPERATIVE_KERNEL_LAUNCH_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urEnqueueCooperativeKernelLaunchExp({}) -> {};\n", args_str.str(), result); } @@ -9280,7 +9281,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp( "urKernelSuggestMaxCooperativeGroupCountExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " ---> urKernelSuggestMaxCooperativeGroupCountExp\n"); ur_result_t result = pfnSuggestMaxCooperativeGroupCountExp( @@ -9296,7 +9297,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SUGGEST_MAX_COOPERATIVE_GROUP_COUNT_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urKernelSuggestMaxCooperativeGroupCountExp({}) -> {};\n", args_str.str(), result); } @@ -9344,7 +9345,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp( "urEnqueueTimestampRecordingExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueTimestampRecordingExp\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueTimestampRecordingExp\n"); ur_result_t result = pfnTimestampRecordingExp( hQueue, blocking, numEventsInWaitList, phEventWaitList, phEvent); @@ -9357,7 +9358,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_TIMESTAMP_RECORDING_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urEnqueueTimestampRecordingExp({}) -> {};\n", args_str.str(), result); } @@ -9426,7 +9427,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp( "urEnqueueKernelLaunchCustomExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueKernelLaunchCustomExp\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueKernelLaunchCustomExp\n"); ur_result_t result = pfnKernelLaunchCustomExp( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -9441,7 +9442,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH_CUSTOM_EXP, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urEnqueueKernelLaunchCustomExp({}) -> {};\n", args_str.str(), result); } @@ -9471,7 +9472,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( "urProgramBuildExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramBuildExp\n"); + UR_LOG_L(logger, Info, " ---> urProgramBuildExp\n"); ur_result_t result = pfnBuildExp(hProgram, numDevices, phDevices, pOptions); @@ -9482,7 +9483,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_BUILD_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramBuildExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramBuildExp({}) -> {};\n", args_str.str(), result); } @@ -9511,7 +9512,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompileExp( UR_FUNCTION_PROGRAM_COMPILE_EXP, "urProgramCompileExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramCompileExp\n"); + UR_LOG_L(logger, Info, " ---> urProgramCompileExp\n"); ur_result_t result = pfnCompileExp(hProgram, numDevices, phDevices, pOptions); @@ -9522,7 +9523,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompileExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_COMPILE_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramCompileExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramCompileExp({}) -> {};\n", args_str.str(), result); } @@ -9561,7 +9562,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLinkExp( "urProgramLinkExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urProgramLinkExp\n"); + UR_LOG_L(logger, Info, " ---> urProgramLinkExp\n"); ur_result_t result = pfnLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram); @@ -9573,7 +9574,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLinkExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_LINK_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urProgramLinkExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urProgramLinkExp({}) -> {};\n", args_str.str(), result); } @@ -9599,7 +9600,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( "urUSMImportExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMImportExp\n"); + UR_LOG_L(logger, Info, " ---> urUSMImportExp\n"); ur_result_t result = pfnImportExp(hContext, pMem, size); @@ -9610,7 +9611,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_IMPORT_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMImportExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMImportExp({}) -> {};\n", args_str.str(), result); } @@ -9634,7 +9635,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( "urUSMReleaseExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUSMReleaseExp\n"); + UR_LOG_L(logger, Info, " ---> urUSMReleaseExp\n"); ur_result_t result = pfnReleaseExp(hContext, pMem); @@ -9645,7 +9646,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_RELEASE_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUSMReleaseExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUSMReleaseExp({}) -> {};\n", args_str.str(), result); } @@ -9672,7 +9673,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp( "urUsmP2PEnablePeerAccessExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUsmP2PEnablePeerAccessExp\n"); + UR_LOG_L(logger, Info, " ---> urUsmP2PEnablePeerAccessExp\n"); ur_result_t result = pfnEnablePeerAccessExp(commandDevice, peerDevice); @@ -9684,7 +9685,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_ENABLE_PEER_ACCESS_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUsmP2PEnablePeerAccessExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUsmP2PEnablePeerAccessExp({}) -> {};\n", args_str.str(), result); } @@ -9711,7 +9712,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( "urUsmP2PDisablePeerAccessExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUsmP2PDisablePeerAccessExp\n"); + UR_LOG_L(logger, Info, " ---> urUsmP2PDisablePeerAccessExp\n"); ur_result_t result = pfnDisablePeerAccessExp(commandDevice, peerDevice); @@ -9723,7 +9724,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_DISABLE_PEER_ACCESS_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUsmP2PDisablePeerAccessExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUsmP2PDisablePeerAccessExp({}) -> {};\n", args_str.str(), result); } @@ -9765,7 +9766,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( "urUsmP2PPeerAccessGetInfoExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urUsmP2PPeerAccessGetInfoExp\n"); + UR_LOG_L(logger, Info, " ---> urUsmP2PPeerAccessGetInfoExp\n"); ur_result_t result = pfnPeerAccessGetInfoExp( commandDevice, peerDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -9778,7 +9779,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_PEER_ACCESS_GET_INFO_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urUsmP2PPeerAccessGetInfoExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urUsmP2PPeerAccessGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -9817,7 +9818,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrierExt( "urEnqueueEventsWaitWithBarrierExt", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueEventsWaitWithBarrierExt\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueEventsWaitWithBarrierExt\n"); ur_result_t result = pfnEventsWaitWithBarrierExt( hQueue, pProperties, numEventsInWaitList, phEventWaitList, phEvent); @@ -9830,7 +9831,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrierExt( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT, ¶ms); - UR_LOG_L(logger, INFO, + UR_LOG_L(logger, Info, " <--- urEnqueueEventsWaitWithBarrierExt({}) -> {};\n", args_str.str(), result); } @@ -9890,7 +9891,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( "urEnqueueNativeCommandExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, INFO, " ---> urEnqueueNativeCommandExp\n"); + UR_LOG_L(logger, Info, " ---> urEnqueueNativeCommandExp\n"); ur_result_t result = pfnNativeCommandExp( hQueue, pfnNativeEnqueue, data, numMemsInMemList, phMemList, pProperties, @@ -9904,7 +9905,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_NATIVE_COMMAND_EXP, ¶ms); - UR_LOG_L(logger, INFO, " <--- urEnqueueNativeCommandExp({}) -> {};\n", + UR_LOG_L(logger, Info, " <--- urEnqueueNativeCommandExp({}) -> {};\n", args_str.str(), result); } diff --git a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp index 355cd0596048..cec0cea6ba2b 100644 --- a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp +++ b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp @@ -68,13 +68,13 @@ struct RefCountContext { ptr, RefRuntimeInfo{1, std::type_index(typeid(handle)), getCurrentBacktrace()}); } else { - UR_LOG_L(getContext()->logger, ERROR, "Handle {} already exists", ptr); + UR_LOG_L(getContext()->logger, Error, "Handle {} already exists", ptr); return; } break; case REFCOUNT_INCREASE: if (it == counts.end()) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, Error, "Attempting to retain nonexistent handle {}", ptr); return; } else { @@ -91,14 +91,14 @@ struct RefCountContext { } if (it->second.refCount < 0) { - UR_LOG(ERROR, "Attempting to release nonexistent handle {}", ptr); + UR_LOG(Error, "Attempting to release nonexistent handle {}", ptr); } else if (it->second.refCount == 0 && isAdapterHandle) { adapterCount--; } break; } - UR_LOG_L(getContext()->logger, DEBUG, + UR_LOG_L(getContext()->logger, Debug, "Reference count for handle {} changed to {}", ptr, it->second.refCount); diff --git a/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp b/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp index 98aab0d2aead..cc83f7d59f4a 100644 --- a/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp +++ b/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp @@ -33,7 +33,7 @@ context_t::~context_t() {} result == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) \ return UR_RESULT_SUCCESS; \ if (result != UR_RESULT_SUCCESS) { \ - UR_LOG_L(getContext()->logger, ERROR, \ + UR_LOG_L(getContext()->logger, Error, \ "Unexpected non-success result code from {}", #result); \ assert(0); \ return result; \ diff --git a/unified-runtime/source/loader/ur_adapter_registry.hpp b/unified-runtime/source/loader/ur_adapter_registry.hpp index c005f24cb102..6ce29ae82cc1 100644 --- a/unified-runtime/source/loader/ur_adapter_registry.hpp +++ b/unified-runtime/source/loader/ur_adapter_registry.hpp @@ -49,7 +49,7 @@ struct FilterTerm { auto backendIter = backendNameMap.find(backend); if (backendIter == backendNameMap.end()) { - UR_LOG(DEBUG, + UR_LOG(Debug, "ONEAPI_DEVICE_SELECTOR Pre-Filter with illegal backend '{}' ", backend); return false; @@ -74,7 +74,7 @@ struct FilterTerm { } auto deviceIter = deviceTypeMap.find(deviceString); if (deviceIter == deviceTypeMap.end()) { - UR_LOG(DEBUG, + UR_LOG(Debug, "ONEAPI_DEVICE_SELECTOR Pre-Filter with illegal device '{}' ", deviceString); continue; @@ -102,14 +102,14 @@ class AdapterRegistry { try { forceLoadedAdaptersOpt = getenv_to_vec("UR_ADAPTERS_FORCE_LOAD"); } catch (const std::invalid_argument &e) { - UR_LOG(ERROR, e.what()); + UR_LOG(Error, e.what()); } if (forceLoadedAdaptersOpt.has_value()) { for (const auto &s : forceLoadedAdaptersOpt.value()) { auto path = fs::path(s); if (path.filename().extension() == STATIC_LIBRARY_EXTENSION) { - UR_LOG(WARN, + UR_LOG(Warning, "UR_ADAPTERS_FORCE_LOAD contains a path to a static" "library {}, it will be skipped", s); @@ -120,14 +120,14 @@ class AdapterRegistry { try { exists = fs::exists(path); } catch (std::exception &e) { - UR_LOG(ERROR, e.what()); + UR_LOG(Error, e.what()); } if (exists) { forceLoaded = true; adaptersLoadPaths.emplace_back(std::vector{std::move(path)}); } else { - UR_LOG(WARN, + UR_LOG(Warning, "Detected nonexistent path {} in environment " "variable UR_ADAPTERS_FORCE_LOAD", s); @@ -205,7 +205,7 @@ class AdapterRegistry { try { pathStringsOpt = getenv_to_vec("UR_ADAPTERS_SEARCH_PATH"); } catch (const std::invalid_argument &e) { - UR_LOG(ERROR, e.what()); + UR_LOG(Error, e.what()); return std::nullopt; } @@ -216,7 +216,7 @@ class AdapterRegistry { if (fs::exists(path)) { paths.emplace_back(path); } else { - UR_LOG(WARN, + UR_LOG(Warning, "Detected nonexistent path {} in environmental " "variable UR_ADAPTERS_SEARCH_PATH", s); @@ -235,11 +235,11 @@ class AdapterRegistry { } catch (...) { // If the selector is malformed, then we ignore selector and return // success. - UR_LOG(ERROR, "ERROR: missing backend, format of filter = " + UR_LOG(Error, "ERROR: missing backend, format of filter = " "'[!]backend:filterStrings'"); return UR_RESULT_SUCCESS; } - UR_LOG(DEBUG, "getenv_to_map parsed env var and {} a map", + UR_LOG(Debug, "getenv_to_map parsed env var and {} a map", (odsEnvMap.has_value() ? "produced" : "failed to produce")); // if the ODS env var is not set at all, then pretend it was set to the @@ -257,22 +257,22 @@ class AdapterRegistry { // on the first error. if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case - // malformed term: missing backend -- output ERROR, then continue - UR_LOG(ERROR, "ERROR: missing backend, format of filter = " + // malformed term: missing backend -- output Error, then continue + UR_LOG(Error, "ERROR: missing backend, format of filter = " "'[!]backend:filterStrings'"); continue; } - UR_LOG(DEBUG, "ONEAPI_DEVICE_SELECTOR Pre-Filter with backend '{}' ", + UR_LOG(Debug, "ONEAPI_DEVICE_SELECTOR Pre-Filter with backend '{}' ", backend); bool PositiveFilter = backend.front() != '!'; - UR_LOG(DEBUG, "term is a {} filter", + UR_LOG(Debug, "term is a {} filter", (PositiveFilter ? "positive" : "negative")); if (!PositiveFilter) { - UR_LOG(DEBUG, "DEBUG: backend was '{}'", backend); + UR_LOG(Debug, "DEBUG: backend was '{}'", backend); // Trim off the "!" from the backend backend.erase(backend.cbegin()); - UR_LOG(DEBUG, "DEBUG: backend now '{}'", backend); + UR_LOG(Debug, "DEBUG: backend now '{}'", backend); } // Make sure the backend is lower case @@ -341,7 +341,7 @@ class AdapterRegistry { std::string(adapterName).find("v2") != std::string::npos; if (v2Requested != v2Adapter) { - UR_LOG(INFO, "The adapter '{}' is skipped because {} {}.", + UR_LOG(Info, "The adapter '{}' is skipped because {} {}.", adapterName, "UR_LOADER_USE_LEVEL_ZERO_V2 or SYCL_UR_USE_LEVEL_ZERO_V2", v2Requested ? "is set" : "is not set"); diff --git a/unified-runtime/source/loader/ur_lib.cpp b/unified-runtime/source/loader/ur_lib.cpp index 6558c11381af..83a6b77c1886 100644 --- a/unified-runtime/source/loader/ur_lib.cpp +++ b/unified-runtime/source/loader/ur_lib.cpp @@ -76,7 +76,7 @@ __urdlllocal ur_result_t context_t::Init( ur_result_t result; const char *logger_name = "loader"; logger::init(logger_name); - UR_LOG(DEBUG, "Logger {} initialized successfully!", logger_name); + UR_LOG(Debug, "Logger {} initialized successfully!", logger_name); result = ur_loader::getContext()->init(); @@ -215,7 +215,7 @@ ur_result_t urLoaderTearDown() { ur_result_t result = ret == 0 ? UR_RESULT_SUCCESS : UR_RESULT_ERROR_UNINITIALIZED; - UR_LOG(INFO, "---> urLoaderTearDown() -> {}", result); + UR_LOG(Info, "---> urLoaderTearDown() -> {}", result); return result; } @@ -324,7 +324,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // `std::map` with `std::queue>` or // something similar.) auto maybeEnvVarMap = getenv_to_map("ONEAPI_DEVICE_SELECTOR", false); - UR_LOG(DEBUG, "getenv_to_map parsed env var and {} a map", + UR_LOG(Debug, "getenv_to_map parsed env var and {} a map", (maybeEnvVarMap.has_value() ? "produced" : "failed to produce")); // if the ODS env var is not set at all, then pretend it was set to the @@ -459,8 +459,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // on the first error. if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case - // malformed term: missing backend -- output ERROR, then continue - UR_LOG(ERROR, "ERROR: missing backend, format of filter = " + // malformed term: missing backend -- output Error, then continue + UR_LOG(Error, "ERROR: missing backend, format of filter = " "'[!]backend:filterStrings'"); continue; } @@ -468,14 +468,14 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, AcceptFilter, DiscardFilter, } termType = (backend.front() != '!') ? AcceptFilter : DiscardFilter; - UR_LOG(DEBUG, "termType is {}", + UR_LOG(Debug, "termType is {}", (termType != AcceptFilter ? "DiscardFilter" : "AcceptFilter")); auto &deviceList = (termType != AcceptFilter) ? discardDeviceList : acceptDeviceList; if (termType != AcceptFilter) { - UR_LOG(DEBUG, "DEBUG: backend was '{}'", backend); + UR_LOG(Debug, "DEBUG: backend was '{}'", backend); backend.erase(backend.cbegin()); - UR_LOG(DEBUG, "DEBUG: backend now '{}'", backend); + UR_LOG(Debug, "DEBUG: backend now '{}'", backend); } // Note the hPlatform -> platformBackend -> platformBackendName conversion // above guarantees minimal sanity for the comparison with backend from the @@ -490,12 +490,12 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, })) { // irrelevant term for current request: different backend -- silently // ignore - UR_LOG(ERROR, "unrecognised backend '{}'", backend); + UR_LOG(Error, "unrecognised backend '{}'", backend); return UR_RESULT_ERROR_INVALID_VALUE; } if (termPair.second.size() == 0) { // malformed term: missing filterStrings -- output ERROR - UR_LOG(ERROR, "missing filterStrings, format of filter = " + UR_LOG(Error, "missing filterStrings, format of filter = " "'[!]backend:filterStrings'"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -504,8 +504,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, termPair.second.cend()) { // FIXME: never true because getenv_to_map rejects this case // malformed term: missing filterString -- output warning, then continue - UR_LOG(WARN, "WARNING: empty filterString, format of filterStrings " - "= 'filterString[,filterString[,...]]'"); + UR_LOG(Warning, "WARNING: empty filterString, format of filterStrings " + "= 'filterString[,filterString[,...]]'"); continue; } if (std::find_if(termPair.second.cbegin(), termPair.second.cend(), @@ -513,7 +513,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return std::count(s.cbegin(), s.cend(), '.') > 2; }) != termPair.second.cend()) { // malformed term: too many dots in filterString - UR_LOG(ERROR, "too many dots in filterString, format of " + UR_LOG(Error, "too many dots in filterString, format of " "filterString = 'root[.sub[.subsub]]'"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -535,7 +535,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return false; // no BAD things, so must be okay }) != termPair.second.cend()) { // malformed term: star dot no-star in filterString - UR_LOG(ERROR, "invalid wildcard in filterString, '*.' => '*.*'"); + UR_LOG(Error, "invalid wildcard in filterString, '*.' => '*.*'"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -594,9 +594,9 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, 0, 0, nullptr}); } - UR_LOG(DEBUG, "DEBUG: size of acceptDeviceList = {}", + UR_LOG(Debug, "DEBUG: size of acceptDeviceList = {}", acceptDeviceList.size()); - UR_LOG(DEBUG, "DEBUG: size of discardDeviceList = {}", + UR_LOG(Debug, "DEBUG: size of discardDeviceList = {}", discardDeviceList.size()); std::vector rootDevices; @@ -723,18 +723,18 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // is a subsubdevice filter, then it must be '*.*.*' matches = (filter.hwType == device.hwType) || (filter.hwType == DeviceHardwareType::UR_DEVICE_TYPE_ALL); - UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 1, matches = {}", + UR_LOG(Debug, "DEBUG: In ApplyFilter, if block case 1, matches = {}", matches); } else if (filter.rootId != device.rootId) { // root part in filter is a number but does not match the number in the // root part of device matches = false; - UR_LOG(DEBUG, + UR_LOG(Debug, "DEBUG: In ApplyFilter, if block case 2, matches = ", matches); } else if (filter.level == DevicePartLevel::ROOT) { // this is a root device filter with a number that matches matches = true; - UR_LOG(DEBUG, + UR_LOG(Debug, "DEBUG: In ApplyFilter, if block case 3, matches = ", matches); } else if (filter.subId == DeviceIdTypeALL) { // sub type of star always matches (when root part matches, which we @@ -742,30 +742,30 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // 'matches.*' if this is a subsubdevice filter, then it must be // 'matches.*.*' matches = true; - UR_LOG(DEBUG, + UR_LOG(Debug, "DEBUG: In ApplyFilter, if block case 4, matches = ", matches); } else if (filter.subId != device.subId) { // sub part in filter is a number but does not match the number in the sub // part of device matches = false; - UR_LOG(DEBUG, + UR_LOG(Debug, "DEBUG: In ApplyFilter, if block case 5, matches = ", matches); } else if (filter.level == DevicePartLevel::SUB) { // this is a sub device number filter, numbers match in both parts matches = true; - UR_LOG(DEBUG, + UR_LOG(Debug, "DEBUG: In ApplyFilter, if block case 6, matches = ", matches); } else if (filter.subsubId == DeviceIdTypeALL) { // subsub type of star always matches (when other parts match, which we // already know here) this is a subsub device filter, it must be // 'matches.matches.*' matches = true; - UR_LOG(DEBUG, + UR_LOG(Debug, "DEBUG: In ApplyFilter, if block case 7, matches = ", matches); } else { // this is a subsub device filter, numbers in all three parts match matches = (filter.subsubId == device.subsubId); - UR_LOG(DEBUG, + UR_LOG(Debug, "DEBUG: In ApplyFilter, if block case 8, matches = ", matches); } return matches; @@ -830,7 +830,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, subSubDevices.end()); } if (numAlreadySelected == selectedDevices.size()) { - UR_LOG(WARN, + UR_LOG(Warning, "WARNING: an accept term was ignored because it " "does not select any additional devices" "selectedDevices.size() = {}", diff --git a/unified-runtime/test/loader/platforms/platforms.cpp b/unified-runtime/test/loader/platforms/platforms.cpp index babe269db649..b10a10851dac 100644 --- a/unified-runtime/test/loader/platforms/platforms.cpp +++ b/unified-runtime/test/loader/platforms/platforms.cpp @@ -27,23 +27,23 @@ int main(int, char *[]) { // Initialize the platform status = urLoaderInit(0, nullptr); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urLoaderInit failed with return code: {}", status); + UR_LOG_L(out, Error, "urLoaderInit failed with return code: {}", status); return 1; } - UR_LOG_L(out, INFO, "urLoaderInit succeeded."); + UR_LOG_L(out, Info, "urLoaderInit succeeded."); uint32_t adapterCount = 0; std::vector adapters; status = urAdapterGet(0, nullptr, &adapterCount); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urAdapterGet failed with return code: {}", status); + UR_LOG_L(out, Error, "urAdapterGet failed with return code: {}", status); return 1; } adapters.resize(adapterCount); status = urAdapterGet(adapterCount, adapters.data(), nullptr); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urAdapterGet failed with return code: {}", status); + UR_LOG_L(out, Error, "urAdapterGet failed with return code: {}", status); return 1; } @@ -53,16 +53,16 @@ int main(int, char *[]) { uint32_t adapterPlatformCount = 0; status = urPlatformGet(adapter, 0, nullptr, &adapterPlatformCount); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urPlatformGet failed with return code: {}", status); + UR_LOG_L(out, Error, "urPlatformGet failed with return code: {}", status); goto out; } - out.info("urPlatformGet found {} platforms", platformCount); + UR_LOG_L(out, Info, "urPlatformGet found {} platforms", platformCount); platforms.reserve(platformCount + adapterPlatformCount); status = urPlatformGet(adapter, adapterPlatformCount, &platforms[platformCount], &adapterPlatformCount); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urPlatformGet failed with return code: {}", status); + UR_LOG_L(out, Error, "urPlatformGet failed with return code: {}", status); goto out; } platformCount += adapterPlatformCount; @@ -73,7 +73,7 @@ int main(int, char *[]) { size_t name_len; status = urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, 0, nullptr, &name_len); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urPlatformGetInfo failed with return code: {}", + UR_LOG_L(out, Error, "urPlatformGetInfo failed with return code: {}", status); goto out; } @@ -84,12 +84,12 @@ int main(int, char *[]) { status = urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, name_len, name, nullptr); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urPlatformGetInfo failed with return code: {}", + UR_LOG_L(out, Error, "urPlatformGetInfo failed with return code: {}", status); free(name); goto out; } - UR_LOG_L(out, INFO, "Found {} ", name); + UR_LOG_L(out, Info, "Found {} ", name); free(name); } diff --git a/unified-runtime/test/logger/env_var.cpp b/unified-runtime/test/logger/env_var.cpp index 763985299791..200b7f7bbc76 100644 --- a/unified-runtime/test/logger/env_var.cpp +++ b/unified-runtime/test/logger/env_var.cpp @@ -8,17 +8,17 @@ ////////////////////////////////////////////////////////////////////////////// TEST_F(LoggerFromEnvVar, DebugMessage) { - UR_LOG(DEBUG, "Test message: {}", "success"); + UR_LOG(Debug, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, InfoMessage) { - UR_LOG(INFO, "Test message: {}", "success"); + UR_LOG(Info, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, WarningMessage) { - UR_LOG(WARN, "Test message: {}", "success"); + UR_LOG(Warning, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, ErrorMessage) { - UR_LOG(ERROR, "Test message: {}", "success"); + UR_LOG(Error, "Test message: {}", "success"); } diff --git a/unified-runtime/test/unit/logger.cpp b/unified-runtime/test/unit/logger.cpp index c275c2e3d5c6..675c144f6e5f 100644 --- a/unified-runtime/test/unit/logger.cpp +++ b/unified-runtime/test/unit/logger.cpp @@ -14,41 +14,41 @@ ////////////////////////////////////////////////////////////////////////////// TEST_F(DefaultLoggerWithFileSink, DefaultLevelNoOutput) { - UR_LOG_L(*logger, INFO, "This should not be printed: {}", 42); + UR_LOG_L(*logger, Info, "This should not be printed: {}", 42); test_msg.clear(); } TEST_F(DefaultLoggerWithFileSink, MultipleLines) { - UR_LOG_L(*logger, WARN, "Test message: {}", "success"); - UR_LOG_L(*logger, DEBUG, "This should not be printed: {}", 42); - UR_LOG_L(*logger, ERROR, "Test message: {}", "success"); + UR_LOG_L(*logger, Warning, "Test message: {}", "success"); + UR_LOG_L(*logger, Debug, "This should not be printed: {}", 42); + UR_LOG_L(*logger, Error, "Test message: {}", "success"); test_msg << test_msg_prefix << "[WARNING]: Test message: success\n" << test_msg_prefix << "[ERROR]: Test message: success\n"; } TEST_F(DefaultLoggerWithFileSink, ThreeParams) { - UR_LOG_L(*logger, ERROR, "{} {}: {}", "Test", 42, 3.8); + UR_LOG_L(*logger, Error, "{} {}: {}", "Test", 42, 3.8); test_msg << test_msg_prefix << "[ERROR]: Test 42: 3.8\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces) { - UR_LOG_L(*logger, ERROR, "{{}} {}: {}", "Test", 42); + UR_LOG_L(*logger, Error, "{{}} {}: {}", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: {} Test: 42\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces2) { - UR_LOG_L(*logger, ERROR, "200 {{ {}: {{{}}} 3.8", "Test", 42); + UR_LOG_L(*logger, Error, "200 {{ {}: {{{}}} 3.8", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: 200 { Test: {42} 3.8\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces3) { - UR_LOG_L(*logger, ERROR, "{{ {}:}} {}}}", "Test", 42); + UR_LOG_L(*logger, Error, "{{ {}:}} {}}}", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: { Test:} 42}\n"; } TEST_F(DefaultLoggerWithFileSink, NoBraces) { - UR_LOG_L(*logger, ERROR, " Test: 42"); + UR_LOG_L(*logger, Error, " Test: 42"); test_msg << test_msg_prefix << "[ERROR]: Test: 42\n"; } @@ -56,7 +56,7 @@ TEST_F(DefaultLoggerWithFileSink, SetLevelDebug) { auto level = UR_LOGGER_LEVEL_DEBUG; logger->setLevel(level); logger->setFlushLevel(level); - UR_LOG_L(*logger, DEBUG, "Test message: {}", "success"); + UR_LOG_L(*logger, Debug, "Test message: {}", "success"); test_msg << test_msg_prefix << "[DEBUG]: Test message: success\n"; } @@ -65,8 +65,8 @@ TEST_F(DefaultLoggerWithFileSink, SetLevelInfo) { auto level = UR_LOGGER_LEVEL_INFO; logger->setLevel(level); logger->setFlushLevel(level); - UR_LOG_L(*logger, INFO, "Test message: {}", "success"); - UR_LOG_L(*logger, DEBUG, "This should not be printed: {}", 42); + UR_LOG_L(*logger, Info, "Test message: {}", "success"); + UR_LOG_L(*logger, Debug, "This should not be printed: {}", 42); test_msg << test_msg_prefix << "[INFO]: Test message: success\n"; } @@ -74,16 +74,16 @@ TEST_F(DefaultLoggerWithFileSink, SetLevelInfo) { TEST_F(DefaultLoggerWithFileSink, SetLevelWarning) { auto level = UR_LOGGER_LEVEL_WARN; logger->setLevel(level); - UR_LOG_L(*logger, WARN, "Test message: {}", "success"); - UR_LOG_L(*logger, INFO, "This should not be printed: {}", 42); + UR_LOG_L(*logger, Warning, "Test message: {}", "success"); + UR_LOG_L(*logger, Info, "This should not be printed: {}", 42); test_msg << test_msg_prefix << "[WARNING]: Test message: success\n"; } TEST_F(DefaultLoggerWithFileSink, SetLevelError) { logger->setLevel(UR_LOGGER_LEVEL_ERROR); - UR_LOG_L(*logger, ERROR, "Test message: {}", "success"); - UR_LOG_L(*logger, WARN, "This should not be printed: {}", 42); + UR_LOG_L(*logger, Error, "Test message: {}", "success"); + UR_LOG_L(*logger, Warning, "This should not be printed: {}", 42); test_msg << test_msg_prefix << "[ERROR]: Test message: success\n"; } @@ -94,7 +94,7 @@ TEST_F(UniquePtrLoggerWithFilesink, SetLogLevelAndFlushLevelDebugWithCtor) { logger = std::make_unique( level, std::make_unique(logger_name, file_path, level)); - UR_LOG_L(*logger, DEBUG, "Test message: {}", "success"); + UR_LOG_L(*logger, Debug, "Test message: {}", "success"); test_msg << test_msg_prefix << "[DEBUG]: Test message: success\n"; } @@ -110,13 +110,13 @@ TEST_F(UniquePtrLoggerWithFilesink, NestedFilePath) { UR_LOGGER_LEVEL_WARN, std::make_unique( logger_name, file_path, UR_LOGGER_LEVEL_WARN)); - UR_LOG_L(*logger, WARN, "Test message: {}", "success"); + UR_LOG_L(*logger, Warning, "Test message: {}", "success"); test_msg << test_msg_prefix << "[WARNING]: Test message: success\n"; } TEST_F(UniquePtrLoggerWithFilesinkFail, NullSink) { logger = std::make_unique(UR_LOGGER_LEVEL_INFO, nullptr); - UR_LOG_L(*logger, INFO, "This should not be printed: {}", 42); + UR_LOG_L(*logger, Info, "This should not be printed: {}", 42); test_msg.clear(); } @@ -137,7 +137,7 @@ TEST_P(FileSinkLoggerMultipleThreads, Multithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - UR_LOG_L(local_logger, WARN, "Test message: {}", "it's a success"); + UR_LOG_L(local_logger, Warning, "Test message: {}", "it's a success"); } }); } @@ -151,7 +151,7 @@ TEST_P(FileSinkLoggerMultipleThreads, Multithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - UR_LOG_L(local_logger, ERROR, "Flushed test message: {}", + UR_LOG_L(local_logger, Error, "Flushed test message: {}", "it's a success"); } }); @@ -183,7 +183,7 @@ TEST_P(CommonLoggerWithMultipleThreads, StdoutMultithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - UR_LOG_L(local_logger, WARN, "Test message: {}", "it's a success"); + UR_LOG_L(local_logger, Warning, "Test message: {}", "it's a success"); } }); } @@ -197,7 +197,7 @@ TEST_P(CommonLoggerWithMultipleThreads, StdoutMultithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - UR_LOG_L(local_logger, ERROR, "Flushed test message: {}", + UR_LOG_L(local_logger, Error, "Flushed test message: {}", "it's a success"); } }); diff --git a/unified-runtime/tools/urtrace/collector.cpp b/unified-runtime/tools/urtrace/collector.cpp index 613d47be996f..dc348cd9c160 100644 --- a/unified-runtime/tools/urtrace/collector.cpp +++ b/unified-runtime/tools/urtrace/collector.cpp @@ -86,7 +86,7 @@ std::string time_to_str(std::chrono::nanoseconds dur, enum time_unit unit) { ostr << d.count() << "s"; } break; default: { - UR_LOG_L(out, ERROR, "invalid time unit {}", unit); + UR_LOG_L(out, Error, "invalid time unit {}", unit); break; } } @@ -123,7 +123,8 @@ static class cli_args { return std::nullopt; } if (arg_values.size() != 1) { - UR_LOG_L(out, WARN, "{} requires a single argument, skipping...", name); + UR_LOG_L(out, Warning, "{} requires a single argument, skipping...", + name); return std::nullopt; } return arg_values.at(0); @@ -161,15 +162,15 @@ static class cli_args { try { filter = filter_str; } catch (const std::regex_error &err) { - UR_LOG_L(out, WARN, "invalid filter regex {} {}", *filter_str, + UR_LOG_L(out, Warning, "invalid filter regex {} {}", *filter_str, err.what()); } } else { - UR_LOG_L(out, WARN, "unknown {} argument {}.", ARGS_ENV, arg_name); + UR_LOG_L(out, Warning, "unknown {} argument {}.", ARGS_ENV, arg_name); } } } - UR_LOG_L(out, DEBUG, + UR_LOG_L(out, Debug, "collector args (.print_begin = {}, .profiling = {}, " ".time_unit = {}, .filter = {}, .output_format = {})", print_begin, profiling, time_unit_str[time_unit], @@ -204,7 +205,7 @@ class TraceWriter { class HumanReadable : public TraceWriter { void begin(uint64_t id, const char *fname, std::string args) override { if (cli_args.print_begin) { - UR_LOG_L(out, INFO, "begin({}) - {}({});", id, fname, args); + UR_LOG_L(out, Info, "begin({}) - {}({});", id, fname, args); } } void end(uint64_t id, const char *fname, std::string args, Timepoint tp, @@ -220,7 +221,7 @@ class HumanReadable : public TraceWriter { std::chrono::duration_cast(tp - start_tp); profile_str << " (" << time_to_str(dur, cli_args.time_unit) << ")"; } - UR_LOG_L(out, INFO, "{}{}({}) -> {};{}", prefix_str.str(), fname, args, + UR_LOG_L(out, Info, "{}{}({}) -> {};{}", prefix_str.str(), fname, args, *resultp, profile_str.str()); } }; @@ -236,16 +237,16 @@ class JsonWriter : public TraceWriter { // not much we can do here... } } - void prologue() override { UR_LOG_L(out, INFO, "{{\n \"traceEvents\": ["); } + void prologue() override { UR_LOG_L(out, Info, "{{\n \"traceEvents\": ["); } void epilogue() override { // Empty trace to avoid ending in a comma // To prevent that last comma from being printed in the first place // we could synchronize the entire 'end' function, while reversing the // logic and printing commas at the front. Not worth it probably. - UR_LOG_L(out, INFO, + UR_LOG_L(out, Info, "{{\"name\": \"\", \"cat\": \"\", \"ph\": \"\", \"pid\": \"\", " "\"tid\": \"\", \"ts\": \"\"}}"); - UR_LOG_L(out, INFO, "]\n}}"); + UR_LOG_L(out, Info, "]\n}}"); } void begin(uint64_t, const char *, std::string) override {} @@ -257,7 +258,7 @@ class JsonWriter : public TraceWriter { .count(); auto dur_us = std::chrono::duration_cast(dur).count(); - UR_LOG_L(out, INFO, "{{\ + UR_LOG_L(out, Info, "{{\ \"cat\": \"UR\", \ \"ph\": \"X\",\ \"pid\": {},\ @@ -323,7 +324,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, if (auto regex = cli_args.filter) { if (!std::regex_match(args->function_name, *regex)) { - UR_LOG_L(out, DEBUG, + UR_LOG_L(out, Debug, "function {} does not match regex filter, skipping...", args->function_name); return; @@ -346,7 +347,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, } else if (trace_type == TRACE_FN_END) { auto ctx = pop_instance_data(instance); if (!ctx) { - UR_LOG_L(out, ERROR, + UR_LOG_L(out, Error, "Received TRACE_FN_END without corresponding " "TRACE_FN_BEGIN, instance {}. Skipping...", instance); @@ -357,7 +358,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, writer()->end(instance, args->function_name, args_str.str(), time_for_end, *ctx->start, resultp); } else { - UR_LOG_L(out, WARN, "unsupported trace type"); + UR_LOG_L(out, Warning, "unsupported trace type"); } } @@ -370,17 +371,17 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, unsigned int minor_version, const char *, const char *stream_name) { if (stream_name == nullptr) { - UR_LOG_L(out, DEBUG, "Found stream with null name. Skipping..."); + UR_LOG_L(out, Debug, "Found stream with null name. Skipping..."); return; } if (std::string_view(stream_name) != UR_STREAM_NAME) { - UR_LOG_L(out, DEBUG, "Found stream: {}. Expected: {}. Skipping...", + UR_LOG_L(out, Debug, "Found stream: {}. Expected: {}. Skipping...", stream_name, UR_STREAM_NAME); return; } if (UR_MAKE_VERSION(major_version, minor_version) != UR_API_VERSION_CURRENT) { - UR_LOG_L(out, ERROR, + UR_LOG_L(out, Error, "Invalid stream version: {}.{}. Expected: {}.{}. Skipping...", major_version, minor_version, UR_MAJOR_VERSION(UR_API_VERSION_CURRENT), @@ -390,7 +391,7 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, uint8_t stream_id = xptiRegisterStream(stream_name); - UR_LOG_L(out, DEBUG, "Registered stream {} ({}.{}).", stream_name, + UR_LOG_L(out, Debug, "Registered stream {} ({}.{}).", stream_name, major_version, minor_version); writer()->prologue(); @@ -403,11 +404,11 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, */ XPTI_CALLBACK_API void xptiTraceFinish(const char *stream_name) { if (stream_name == nullptr) { - UR_LOG_L(out, DEBUG, "Found stream with null name. Skipping..."); + UR_LOG_L(out, Debug, "Found stream with null name. Skipping..."); return; } if (std::string_view(stream_name) != UR_STREAM_NAME) { - UR_LOG_L(out, DEBUG, "Found stream: {}. Expected: {}. Skipping...", + UR_LOG_L(out, Debug, "Found stream: {}. Expected: {}. Skipping...", stream_name, UR_STREAM_NAME); return; } From 149119f9dac7b6f36e29e2bbfa4706f25fa5946d Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Wed, 16 Apr 2025 10:32:51 +0000 Subject: [PATCH 07/16] revert changes outside unified-runtime --- flang/lib/Lower/Bridge.cpp | 2 +- flang/lib/Lower/IO.cpp | 2 +- flang/lib/Lower/PFTBuilder.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp index 1e290fe5f86d..feab1b7f0a8d 100644 --- a/flang/lib/Lower/Bridge.cpp +++ b/flang/lib/Lower/Bridge.cpp @@ -1557,7 +1557,7 @@ class FirConverter : public Fortran::lower::AbstractConverter { /// or REAL type. /// /// A nonpositive \p valuelist value indicates an IO statement context - /// (0 for ERROR, -1 for END, -2 for EOR). An ERR branch must be taken for + /// (0 for ERR, -1 for END, -2 for EOR). An ERR branch must be taken for /// any positive (IOSTAT) value. A missing (zero) label requires a branch /// to \p defaultEval for that value. /// diff --git a/flang/lib/Lower/IO.cpp b/flang/lib/Lower/IO.cpp index bd452506dad8..16e6d05bd3b1 100644 --- a/flang/lib/Lower/IO.cpp +++ b/flang/lib/Lower/IO.cpp @@ -1401,7 +1401,7 @@ static void threadSpecs(Fortran::lower::AbstractConverter &converter, } /// Most IO statements allow one or more of five optional exception condition -/// handling specifiers: ERROR, EOR, END, IOSTAT, and IOMSG. The first three +/// handling specifiers: ERR, EOR, END, IOSTAT, and IOMSG. The first three /// cause control flow to transfer to another statement. The final two return /// information from the runtime, via a variable, about the nature of the /// condition that occurred. These condition specifiers are handled here. diff --git a/flang/lib/Lower/PFTBuilder.cpp b/flang/lib/Lower/PFTBuilder.cpp index 03403ab94f90..41bdff4dca47 100644 --- a/flang/lib/Lower/PFTBuilder.cpp +++ b/flang/lib/Lower/PFTBuilder.cpp @@ -654,7 +654,7 @@ class PFTBuilder { } } - /// Mark IO statement ERROR, EOR, and END specifier branch targets. + /// Mark IO statement ERR, EOR, and END specifier branch targets. /// Mark an IO statement with an assigned format as unstructured. template void analyzeIoBranches(lower::pft::Evaluation &eval, const A &stmt) { From e78a0a776a51979cf3f0d4665547a7b6c293685e Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Fri, 18 Apr 2025 10:51:25 +0000 Subject: [PATCH 08/16] apply comments --- unified-runtime/source/adapters/level_zero/device.cpp | 2 +- unified-runtime/source/common/linux/ur_lib_loader.cpp | 2 +- unified-runtime/source/common/logger/ur_logger.hpp | 4 ++-- unified-runtime/source/common/logger/ur_logger_details.hpp | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/unified-runtime/source/adapters/level_zero/device.cpp b/unified-runtime/source/adapters/level_zero/device.cpp index c92f7b8f4ada..b8d1a0d620a7 100644 --- a/unified-runtime/source/adapters/level_zero/device.cpp +++ b/unified-runtime/source/adapters/level_zero/device.cpp @@ -1794,7 +1794,7 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal, if (numQueueGroups == 0) { return UR_RESULT_ERROR_UNKNOWN; } - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(Info, logger::LegacyMessage("NOTE: Number of queue groups = {}"), "Number of queue groups = {}", numQueueGroups); diff --git a/unified-runtime/source/common/linux/ur_lib_loader.cpp b/unified-runtime/source/common/linux/ur_lib_loader.cpp index 77d3556f2f4c..ee82554758c4 100644 --- a/unified-runtime/source/common/linux/ur_lib_loader.cpp +++ b/unified-runtime/source/common/linux/ur_lib_loader.cpp @@ -59,7 +59,7 @@ LibLoader::loadAdapterLibrary(const char *name) { (strstr(err, name) == NULL || strstr(err, "required by") != NULL)) { // If the adapter cannot be loaded due to missing dependencies or any // other related error, it is considered as an error. - UR_LOG(Error, "failed to load adapter '{}' with error: {}", name, err); + UR_LOG(Info, "failed to load adapter '{}' with error: {}", name, err); } else { // Simply having the adapter library missing isn't an error. UR_LOG(Info, "failed to load adapter '{}' with error: {}", name, diff --git a/unified-runtime/source/common/logger/ur_logger.hpp b/unified-runtime/source/common/logger/ur_logger.hpp index 07a1aa8abc20..7bfe4d94f015 100644 --- a/unified-runtime/source/common/logger/ur_logger.hpp +++ b/unified-runtime/source/common/logger/ur_logger.hpp @@ -30,8 +30,8 @@ get_logger(std::string name = "common", inline void init(const std::string &name) { get_logger(name.c_str()); } -#define UR_LOG(...) URLOG_(logger::get_logger(), __VA_ARGS__) -#define UR_LOG_LEGACY(...) URLOG_LEGACY_(logger::get_logger(), __VA_ARGS__) +#define UR_LOG(...) URLOG_(::logger::get_logger(), __VA_ARGS__) +#define UR_LOG_LEGACY(...) URLOG_LEGACY_(::logger::get_logger(), __VA_ARGS__) // TODO: consider removing UR_LOG_L and maybe UR_LOG_LEGACY macros, using UR_LOG // instead diff --git a/unified-runtime/source/common/logger/ur_logger_details.hpp b/unified-runtime/source/common/logger/ur_logger_details.hpp index 74afdb332eae..ddc83983686d 100644 --- a/unified-runtime/source/common/logger/ur_logger_details.hpp +++ b/unified-runtime/source/common/logger/ur_logger_details.hpp @@ -7,6 +7,9 @@ #ifndef UR_LOGGER_DETAILS_HPP #define UR_LOGGER_DETAILS_HPP 1 +#include +#include + #include "ur_level.hpp" #include "ur_sinks.hpp" @@ -107,7 +110,7 @@ class Logger { } // namespace logger #ifdef SRC_PATH_SIZE -#define SHORT_FILE ((__FILE__) + (SRC_PATH_SIZE)) +#define SHORT_FILE ((__FILE__ + SRC_PATH_SIZE < __FILE__ + sizeof(__FILE__)) ? (__FILE__ + SRC_PATH_SIZE) : __FILE__) #else #define SHORT_FILE __FILE__ #endif From 937bc2251c0c040869f60509b6ae56f4795b4b54 Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Tue, 22 Apr 2025 12:40:22 +0000 Subject: [PATCH 09/16] apply comments --- .../scripts/templates/trcddi.cpp.mako | 4 +- .../source/adapters/cuda/common.cpp | 6 +- .../source/adapters/cuda/enqueue.cpp | 14 +- .../source/adapters/cuda/image.cpp | 2 +- unified-runtime/source/adapters/cuda/usm.cpp | 4 +- .../source/adapters/hip/common.cpp | 6 +- .../source/adapters/hip/enqueue.cpp | 22 +- unified-runtime/source/adapters/hip/image.cpp | 2 +- .../source/adapters/level_zero/adapter.cpp | 24 +- .../adapters/level_zero/async_alloc.cpp | 2 +- .../adapters/level_zero/command_buffer.cpp | 10 +- .../source/adapters/level_zero/common.cpp | 6 +- .../source/adapters/level_zero/common.hpp | 2 +- .../source/adapters/level_zero/context.cpp | 14 +- .../source/adapters/level_zero/device.cpp | 32 +- .../source/adapters/level_zero/event.cpp | 20 +- .../level_zero/helpers/image_helpers.cpp | 38 +- .../level_zero/helpers/kernel_helpers.cpp | 14 +- .../source/adapters/level_zero/image.cpp | 28 +- .../source/adapters/level_zero/kernel.cpp | 24 +- .../source/adapters/level_zero/memory.cpp | 28 +- .../source/adapters/level_zero/platform.cpp | 2 +- .../source/adapters/level_zero/program.cpp | 6 +- .../source/adapters/level_zero/queue.cpp | 32 +- .../source/adapters/level_zero/sampler.cpp | 10 +- .../source/adapters/level_zero/usm.cpp | 20 +- .../source/adapters/level_zero/v2/api.cpp | 60 +- .../adapters/level_zero/v2/command_buffer.cpp | 2 +- .../level_zero/v2/command_list_cache.cpp | 8 +- .../source/adapters/level_zero/v2/event.cpp | 6 +- .../level_zero/v2/event_provider_normal.cpp | 2 +- .../source/adapters/level_zero/v2/kernel.cpp | 6 +- .../source/adapters/level_zero/v2/memory.cpp | 8 +- .../v2/queue_immediate_in_order.cpp | 4 +- .../source/adapters/level_zero/v2/usm.cpp | 8 +- .../adapters/level_zero/virtual_mem.cpp | 4 +- .../source/adapters/native_cpu/common.hpp | 6 +- .../source/adapters/native_cpu/device.cpp | 2 +- .../source/adapters/native_cpu/platform.cpp | 2 +- .../source/adapters/opencl/context.cpp | 2 +- .../source/common/latency_tracker.hpp | 6 +- .../source/common/linux/ur_lib_loader.cpp | 12 +- .../common/logger/ur_logger_details.hpp | 40 +- unified-runtime/source/common/umf_helpers.hpp | 2 +- .../source/common/ur_pool_manager.hpp | 4 +- unified-runtime/source/common/ur_util.cpp | 6 +- .../source/common/windows/ur_lib_loader.cpp | 8 +- .../layers/sanitizer/asan/asan_allocator.cpp | 2 +- .../layers/sanitizer/asan/asan_buffer.cpp | 12 +- .../loader/layers/sanitizer/asan/asan_ddi.cpp | 90 +- .../sanitizer/asan/asan_interceptor.cpp | 48 +- .../sanitizer/asan/asan_interceptor.hpp | 2 +- .../layers/sanitizer/asan/asan_shadow.cpp | 20 +- .../layers/sanitizer/asan/asan_statistics.cpp | 10 +- .../layers/sanitizer/msan/msan_allocator.cpp | 2 +- .../layers/sanitizer/msan/msan_buffer.cpp | 12 +- .../loader/layers/sanitizer/msan/msan_ddi.cpp | 92 +- .../sanitizer/msan/msan_interceptor.cpp | 44 +- .../sanitizer/msan/msan_interceptor.hpp | 2 +- .../layers/sanitizer/msan/msan_shadow.cpp | 18 +- .../linux/sanitizer_utils.cpp | 4 +- .../sanitizer_common/sanitizer_options.cpp | 4 +- .../sanitizer_options_impl.hpp | 8 +- .../sanitizer_common/sanitizer_utils.cpp | 16 +- .../layers/sanitizer/tsan/tsan_buffer.cpp | 12 +- .../loader/layers/sanitizer/tsan/tsan_ddi.cpp | 76 +- .../sanitizer/tsan/tsan_interceptor.cpp | 16 +- .../layers/sanitizer/tsan/tsan_shadow.cpp | 18 +- .../loader/layers/sanitizer/ur_sanddi.cpp | 2 +- .../loader/layers/tracing/ur_trcddi.cpp | 816 +++++++++--------- .../layers/validation/ur_leak_check.hpp | 8 +- .../layers/validation/ur_validation_layer.cpp | 2 +- .../source/loader/ur_adapter_registry.hpp | 34 +- unified-runtime/source/loader/ur_lib.cpp | 50 +- .../test/loader/platforms/platforms.cpp | 20 +- unified-runtime/test/logger/env_var.cpp | 8 +- unified-runtime/test/unit/logger.cpp | 46 +- unified-runtime/tools/urtrace/collector.cpp | 41 +- 78 files changed, 1059 insertions(+), 1046 deletions(-) diff --git a/unified-runtime/scripts/templates/trcddi.cpp.mako b/unified-runtime/scripts/templates/trcddi.cpp.mako index c76c98042c3a..4c7ba67813da 100644 --- a/unified-runtime/scripts/templates/trcddi.cpp.mako +++ b/unified-runtime/scripts/templates/trcddi.cpp.mako @@ -48,7 +48,7 @@ namespace ur_tracing_layer uint64_t instance = getContext()->notify_begin(${th.make_func_etor(n, tags, obj)}, "${th.make_func_name(n, tags, obj)}", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> ${th.make_func_name(n, tags, obj)}\n"); + UR_LOG_L(logger, INFO, " ---> ${th.make_func_name(n, tags, obj)}\n"); ${x}_result_t result = ${th.make_pfn_name(n, tags, obj)}( ${", ".join(th.make_param_lines(n, tags, obj, format=["name"]))} ); @@ -57,7 +57,7 @@ namespace ur_tracing_layer if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, ${th.make_func_etor(n, tags, obj)}, ¶ms); - UR_LOG_L(logger, Info, " <--- ${th.make_func_name(n, tags, obj)}({}) -> {};\n", args_str.str(), result); + UR_LOG_L(logger, INFO, " <--- ${th.make_func_name(n, tags, obj)}({}) -> {};\n", args_str.str(), result); } return result; diff --git a/unified-runtime/source/adapters/cuda/common.cpp b/unified-runtime/source/adapters/cuda/common.cpp index 3f8d7084b500..a7180b4d1a90 100644 --- a/unified-runtime/source/adapters/cuda/common.cpp +++ b/unified-runtime/source/adapters/cuda/common.cpp @@ -71,7 +71,7 @@ void checkErrorUR(CUresult Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(Error, "{}", SS.str()); + UR_LOG(ERROR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr || std::getenv("UR_CUDA_ABORT") != nullptr) { @@ -95,7 +95,7 @@ void checkErrorUR(nvmlReturn_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(Error, "{}", SS.str()); + UR_LOG(ERROR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr || std::getenv("UR_CUDA_ABORT") != nullptr) { @@ -115,7 +115,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(Error, "{}", SS.str()); + UR_LOG(ERROR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr) { std::abort(); diff --git a/unified-runtime/source/adapters/cuda/enqueue.cpp b/unified-runtime/source/adapters/cuda/enqueue.cpp index 4df84541df8b..6b909b58e2d5 100644 --- a/unified-runtime/source/adapters/cuda/enqueue.cpp +++ b/unified-runtime/source/adapters/cuda/enqueue.cpp @@ -97,8 +97,8 @@ ur_result_t setCuMemAdvise(CUdeviceptr DevPtr, size_t Size, for (auto &UnmappedFlag : UnmappedMemAdviceFlags) { if (URAdviceFlags & UnmappedFlag) { - UR_LOG(Warning, "Memory advice ignored because the CUDA backend does not " - "support some of the specified flags."); + UR_LOG(WARN, "Memory advice ignored because the CUDA backend does not " + "support some of the specified flags."); return UR_RESULT_SUCCESS; } } @@ -1606,8 +1606,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch( // for managed memory. Therefore, ignore prefetch hint if concurrent managed // memory access is not available. if (!getAttribute(Device, CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS)) { - UR_LOG(Warning, "Prefetch hint ignored as device does not support " - "concurrent managed access."); + UR_LOG(WARN, "Prefetch hint ignored as device does not support " + "concurrent managed access."); return UR_RESULT_SUCCESS; } @@ -1615,7 +1615,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch( UR_CHECK_ERROR(cuPointerGetAttribute( &IsManaged, CU_POINTER_ATTRIBUTE_IS_MANAGED, (CUdeviceptr)pMem)); if (!IsManaged) { - UR_LOG(Warning, "Prefetch hint ignored as prefetch only works with USM."); + UR_LOG(WARN, "Prefetch hint ignored as prefetch only works with USM."); return UR_RESULT_SUCCESS; } @@ -1666,8 +1666,8 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size, (advice & UR_USM_ADVICE_FLAG_DEFAULT)) { ur_device_handle_t Device = hQueue->getDevice(); if (!getAttribute(Device, CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS)) { - UR_LOG(Warning, "Mem advise ignored as device does not support " - "concurrent managed access."); + UR_LOG(WARN, "Mem advise ignored as device does not support " + "concurrent managed access."); return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/adapters/cuda/image.cpp b/unified-runtime/source/adapters/cuda/image.cpp index 0173c103d317..d7585933c391 100644 --- a/unified-runtime/source/adapters/cuda/image.cpp +++ b/unified-runtime/source/adapters/cuda/image.cpp @@ -803,7 +803,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - UR_LOG(Error, + UR_LOG(ERROR, "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/cuda/usm.cpp b/unified-runtime/source/adapters/cuda/usm.cpp index e16842fa237d..de7bb9f35a1a 100644 --- a/unified-runtime/source/adapters/cuda/usm.cpp +++ b/unified-runtime/source/adapters/cuda/usm.cpp @@ -361,8 +361,8 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, // Otherwise, do nothing. // Set maximum size is effectively ignored. if (Limits->maxPoolableSize > 0) - UR_LOG(Warning, "The memory pool maximum size feature requires CUDA " - "12.2 or later.\n"); + UR_LOG(WARN, "The memory pool maximum size feature requires CUDA " + "12.2 or later.\n"); #endif maxSize = Limits->maxPoolableSize; size_t chunkSize = 33554432; // 32MB diff --git a/unified-runtime/source/adapters/hip/common.cpp b/unified-runtime/source/adapters/hip/common.cpp index ac6662c553a7..7a5d81feddce 100644 --- a/unified-runtime/source/adapters/hip/common.cpp +++ b/unified-runtime/source/adapters/hip/common.cpp @@ -86,7 +86,7 @@ void checkErrorUR(amd_comgr_status_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(Error, "{}", SS.str()); + UR_LOG(ERROR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -113,7 +113,7 @@ void checkErrorUR(hipError_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(Error, "{}", SS.str()); + UR_LOG(ERROR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -133,7 +133,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR HIP ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(Error, "{}", SS.str()); + UR_LOG(ERROR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { diff --git a/unified-runtime/source/adapters/hip/enqueue.cpp b/unified-runtime/source/adapters/hip/enqueue.cpp index 76f6424b5096..f24aaedeaf12 100644 --- a/unified-runtime/source/adapters/hip/enqueue.cpp +++ b/unified-runtime/source/adapters/hip/enqueue.cpp @@ -1374,8 +1374,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch( // mem_advise. if (!Device->getManagedMemSupport()) { releaseEvent(); - UR_LOG(Warning, "mem_advise ignored as device does not support " - "managed memory access."); + UR_LOG(WARN, "mem_advise ignored as device does not support " + "managed memory access."); return UR_RESULT_SUCCESS; } @@ -1389,7 +1389,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urEnqueueUSMPrefetch( // async prefetch requires USM pointer (or hip SVM) to work. if (!attribs.isManaged) { releaseEvent(); - UR_LOG(Warning, "Prefetch hint ignored as prefetch only works with USM."); + UR_LOG(WARN, "Prefetch hint ignored as prefetch only works with USM."); return UR_RESULT_SUCCESS; } @@ -1444,8 +1444,8 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size, // mem_advise. if (!Device->getManagedMemSupport()) { releaseEvent(); - UR_LOG(Warning, "mem_advise ignored as device does not support " - "managed memory access."); + UR_LOG(WARN, "mem_advise ignored as device does not support " + "managed memory access."); return UR_RESULT_SUCCESS; } @@ -1461,8 +1461,8 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size, UR_USM_ADVICE_FLAG_DEFAULT)) { if (!Device->getConcurrentManagedAccess()) { releaseEvent(); - UR_LOG(Warning, "mem_advise ignored as device does not support " - "concurrent memory access."); + UR_LOG(WARN, "mem_advise ignored as device does not support " + "concurrent memory access."); return UR_RESULT_SUCCESS; } @@ -1481,8 +1481,8 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size, if (auto ptrAttribs = getPointerAttributes(pMem); !ptrAttribs || !ptrAttribs->isManaged) { releaseEvent(); - UR_LOG(Warning, "mem_advise is ignored as the pointer argument is not " - "a shared USM pointer."); + UR_LOG(WARN, "mem_advise is ignored as the pointer argument is not " + "a shared USM pointer."); return UR_RESULT_SUCCESS; } @@ -1510,8 +1510,8 @@ urEnqueueUSMAdvise(ur_queue_handle_t hQueue, const void *pMem, size_t size, // the runtime. if (Result == UR_RESULT_ERROR_INVALID_ENUMERATION) { releaseEvent(); - UR_LOG(Warning, "mem_advise is ignored as the advice argument is not " - "supported by this device."); + UR_LOG(WARN, "mem_advise is ignored as the advice argument is not " + "supported by this device."); return UR_RESULT_SUCCESS; } UR_CHECK_ERROR(Result); diff --git a/unified-runtime/source/adapters/hip/image.cpp b/unified-runtime/source/adapters/hip/image.cpp index 2711612627bb..ed015748057c 100644 --- a/unified-runtime/source/adapters/hip/image.cpp +++ b/unified-runtime/source/adapters/hip/image.cpp @@ -822,7 +822,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - UR_LOG(Error, + UR_LOG(ERROR, "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/adapter.cpp b/unified-runtime/source/adapters/level_zero/adapter.cpp index 0d9c377b7bc9..275abb0d6c7e 100644 --- a/unified-runtime/source/adapters/level_zero/adapter.cpp +++ b/unified-runtime/source/adapters/level_zero/adapter.cpp @@ -163,7 +163,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, ZE2UR_CALL(zeDriverGet, (&ZeDriverGetCount, ZeDriverGetHandles.data())); } if (ZeDriverGetCount == 0 && GlobalAdapter->ZeInitDriversCount == 0) { - UR_LOG(Error, "\nNo Valid L0 Drivers found.\n"); + UR_LOG(ERROR, "\nNo Valid L0 Drivers found.\n"); return UR_RESULT_SUCCESS; } @@ -188,7 +188,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, // newer drivers. if (ZeDriverGetProperties.driverVersion != ZeInitDriverProperties.driverVersion) { - UR_LOG(Debug, + UR_LOG(DEBUG, "\nzeDriverHandle {} added to the zeInitDrivers list " "of possible handles.\n", ZeDriverGetHandles[Y]); @@ -202,7 +202,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, ZeDrivers.assign(ZeDriverGetHandles.begin(), ZeDriverGetHandles.end()); } ZeDriverCount = ZeDrivers.size(); - UR_LOG(Debug, "\n{} L0 Drivers found.\n", ZeDriverCount); + UR_LOG(DEBUG, "\n{} L0 Drivers found.\n", ZeDriverCount); for (uint32_t I = 0; I < ZeDriverCount; ++I) { // Keep track of the first platform init for this Driver bool DriverPlatformInit = false; @@ -361,7 +361,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (getenv("SYCL_ENABLE_PCI") != nullptr) { UR_LOG( - Warning, + WARN, "WARNING: SYCL_ENABLE_PCI is deprecated and no longer needed.\n"); } @@ -383,13 +383,13 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (UrL0InitAllDrivers) { L0InitFlags |= ZE_INIT_FLAG_VPU_ONLY; } - UR_LOG(Debug, "\nzeInit with flags value of {}\n", + UR_LOG(DEBUG, "\nzeInit with flags value of {}\n", static_cast(L0InitFlags)); GlobalAdapter->ZeInitResult = ZE_CALL_NOCHECK(zeInit, (L0InitFlags)); if (GlobalAdapter->ZeInitResult != ZE_RESULT_SUCCESS) { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitResult, ErrorString); - UR_LOG(Error, "\nzeInit failed with {}\n", ErrorString); + UR_LOG(ERROR, "\nzeInit failed with {}\n", ErrorString); } bool useInitDrivers = false; @@ -405,7 +405,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (strncmp(versions[i].component_name, "loader", strlen("loader")) == 0) { loader_version = versions[i].component_lib_version; - UR_LOG(Debug, "\nLevel Zero Loader Version: {}.{}.{}\n", + UR_LOG(DEBUG, "\nLevel Zero Loader Version: {}.{}.{}\n", loader_version.major, loader_version.minor, loader_version.patch); break; @@ -430,7 +430,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() GlobalAdapter->processHandle, "zeInitDrivers"); #endif if (GlobalAdapter->initDriversFunctionPtr) { - UR_LOG(Debug, "\nzeInitDrivers with flags value of {}\n", + UR_LOG(DEBUG, "\nzeInitDrivers with flags value of {}\n", static_cast(GlobalAdapter->InitDriversDesc.flags)); GlobalAdapter->ZeInitDriversResult = ZE_CALL_NOCHECK(GlobalAdapter->initDriversFunctionPtr, @@ -441,7 +441,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() } else { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitDriversResult, ErrorString); - UR_LOG(Error, "\nzeInitDrivers failed with {}\n", ErrorString); + UR_LOG(ERROR, "\nzeInitDrivers failed with {}\n", ErrorString); } } } @@ -459,12 +459,12 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() // Absorb the ZE_RESULT_ERROR_UNINITIALIZED and just return 0 Platforms. if (*GlobalAdapter->ZeResult == ZE_RESULT_ERROR_UNINITIALIZED) { - UR_LOG(Error, "Level Zero Uninitialized\n"); + UR_LOG(ERROR, "Level Zero Uninitialized\n"); result = std::move(platforms); return; } if (*GlobalAdapter->ZeResult != ZE_RESULT_SUCCESS) { - UR_LOG(Error, "Level Zero initialization failure\n"); + UR_LOG(ERROR, "Level Zero initialization failure\n"); result = ze2urResult(*GlobalAdapter->ZeResult); return; @@ -511,7 +511,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() GlobalAdapter->getSysManDriversFunctionPtr && GlobalAdapter->sysManInitFunctionPtr) { ze_init_flags_t L0ZesInitFlags = 0; - UR_LOG(Debug, "\nzesInit with flags value of {}\n", + UR_LOG(DEBUG, "\nzesInit with flags value of {}\n", static_cast(L0ZesInitFlags)); GlobalAdapter->ZesResult = ZE_CALL_NOCHECK( GlobalAdapter->sysManInitFunctionPtr, (L0ZesInitFlags)); diff --git a/unified-runtime/source/adapters/level_zero/async_alloc.cpp b/unified-runtime/source/adapters/level_zero/async_alloc.cpp index b02a74e9458a..cd363c49504c 100644 --- a/unified-runtime/source/adapters/level_zero/async_alloc.cpp +++ b/unified-runtime/source/adapters/level_zero/async_alloc.cpp @@ -92,7 +92,7 @@ static ur_result_t enqueueUSMAllocHelper( CommandType = UR_COMMAND_ENQUEUE_USM_SHARED_ALLOC_EXP; break; default: - UR_LOG(Error, "enqueueUSMAllocHelper: unsupported USM type"); + UR_LOG(ERROR, "enqueueUSMAllocHelper: unsupported USM type"); throw UR_RESULT_ERROR_UNKNOWN; } UR_CALL(createEventAndAssociateQueue(Queue, Event, CommandType, CommandList, diff --git a/unified-runtime/source/adapters/level_zero/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/command_buffer.cpp index f7425d654e4c..2753827d1f95 100644 --- a/unified-runtime/source/adapters/level_zero/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/command_buffer.cpp @@ -19,7 +19,7 @@ */ // Print the name of a variable and its value in the L0 debug log -#define DEBUG_LOG(VAR) UR_LOG(Debug, #VAR " {}", VAR); +#define DEBUG_LOG(VAR) UR_LOG(DEBUG, #VAR " {}", VAR); namespace { @@ -44,7 +44,7 @@ bool checkImmediateAppendSupport(ur_context_handle_t Context, const bool EnableAppendPath = std::atoi(UrRet) == 1; if (EnableAppendPath && !Device->ImmCommandListUsed) { - UR_LOG(Error, + UR_LOG(ERROR, "{} is set but immediate command-lists are currently " "disabled. Immediate command-lists are " "required to use the immediate append path.", @@ -52,7 +52,7 @@ bool checkImmediateAppendSupport(ur_context_handle_t Context, std::abort(); } if (EnableAppendPath && !DriverSupportsImmediateAppend) { - UR_LOG(Error, + UR_LOG(ERROR, "{} is set but the current driver does not support the " "zeCommandListImmediateAppendCommandListsExp entrypoint.", AppendEnvVarName); @@ -1847,7 +1847,7 @@ ur_result_t validateCommandDesc( auto SupportedFeatures = CommandBuffer->Device->ZeDeviceMutableCmdListsProperties ->mutableCommandFlags; - UR_LOG(Debug, "Mutable features supported by device {}", SupportedFeatures); + UR_LOG(DEBUG, "Mutable features supported by device {}", SupportedFeatures); auto Command = static_cast(CommandDesc.hCommand); UR_ASSERT(CommandBuffer == Command->CommandBuffer, @@ -1876,7 +1876,7 @@ ur_result_t validateCommandDesc( if (NewGlobalWorkOffset) { if (!CommandBuffer->Context->getPlatform() ->ZeDriverGlobalOffsetExtensionFound) { - UR_LOG(Error, "No global offset extension found on this driver"); + UR_LOG(ERROR, "No global offset extension found on this driver"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/common.cpp b/unified-runtime/source/adapters/level_zero/common.cpp index 7288dd10f66e..a0f150c142f1 100644 --- a/unified-runtime/source/adapters/level_zero/common.cpp +++ b/unified-runtime/source/adapters/level_zero/common.cpp @@ -76,7 +76,7 @@ bool setEnvVar(const char *name, const char *value) { int Res = setenv(name, value, 1); #endif if (Res != 0) { - UR_LOG(Debug, + UR_LOG(DEBUG, "UR L0 Adapter was unable to set the environment variable: {}", name); return false; @@ -139,7 +139,7 @@ void zeParseError(ze_result_t ZeError, const char *&ErrorString) { ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *ZeName, const char *ZeArgs, bool TraceError) { - UR_LOG(Debug, "ZE ---> {}{}", ZeName, ZeArgs); + UR_LOG(DEBUG, "ZE ---> {}{}", ZeName, ZeArgs); if (ZeResult == ZE_RESULT_SUCCESS) { if (UrL0LeaksDebug) { @@ -151,7 +151,7 @@ ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *ZeName, if (TraceError) { const char *ErrorString = "Unknown"; zeParseError(ZeResult, ErrorString); - UR_LOG(Error, "Error ({}) in {}", ErrorString, ZeName); + UR_LOG(ERROR, "Error ({}) in {}", ErrorString, ZeName); } return ZeResult; } diff --git a/unified-runtime/source/adapters/level_zero/common.hpp b/unified-runtime/source/adapters/level_zero/common.hpp index 65e749e586f8..b3ed8d09fe14 100644 --- a/unified-runtime/source/adapters/level_zero/common.hpp +++ b/unified-runtime/source/adapters/level_zero/common.hpp @@ -45,7 +45,7 @@ struct _ur_platform_handle_t; } } catch (...) { } - UR_LOG(Debug, + UR_LOG(DEBUG, "ZE ---> checkL0LoaderTeardown: Loader is in teardown or is unstable"); return false; } diff --git a/unified-runtime/source/adapters/level_zero/context.cpp b/unified-runtime/source/adapters/level_zero/context.cpp index 09fb5e736fe7..3ea565f4a2f0 100644 --- a/unified-runtime/source/adapters/level_zero/context.cpp +++ b/unified-runtime/source/adapters/level_zero/context.cpp @@ -167,7 +167,7 @@ ur_result_t urContextSetExtendedDeleter( ur_context_extended_deleter_t /*Deleter*/, /// [in][out][optional] pointer to data to be passed to callback. void * /*UserData*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -207,7 +207,7 @@ ur_result_t ur_context_handle_t_::initialize() { true /*Only Allow Driver In Order List if requested*/) && Device->useDriverCounterBasedEvents()) { UR_LOG( - Debug, + DEBUG, "L0 Synchronous Immediate Command List needed with In Order property."); ZeCommandQueueDesc.flags |= ZE_COMMAND_QUEUE_FLAG_IN_ORDER; } @@ -459,7 +459,7 @@ ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool( ZeEventPoolDesc.flags |= ZE_EVENT_POOL_FLAG_HOST_VISIBLE; if (ProfilingEnabled) ZeEventPoolDesc.flags |= ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP; - UR_LOG(Debug, "ze_event_pool_desc_t flags set to: {}", + UR_LOG(DEBUG, "ze_event_pool_desc_t flags set to: {}", ZeEventPoolDesc.flags); if (CounterBasedEventEnabled) { if (UsingImmCmdList) { @@ -468,7 +468,7 @@ ur_result_t ur_context_handle_t_::getFreeSlotInExistingOrNewPool( counterBasedExt.flags = ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_NON_IMMEDIATE; } - UR_LOG(Debug, "ze_event_pool_desc_t counter based flags set to: {}", + UR_LOG(DEBUG, "ze_event_pool_desc_t counter based flags set to: {}", counterBasedExt.flags); if (InterruptBasedEventEnabled) { counterBasedExt.pNext = &eventSyncMode; @@ -509,7 +509,7 @@ ur_event_handle_t ur_context_handle_t_::getEventFromContextCache( getEventCache(HostVisible, WithProfiling, Device, CounterBasedEventEnabled, InterruptBasedEventEnabled); if (Cache->empty()) { - UR_LOG(Info, + UR_LOG(INFO, "Cache empty (Host Visible: {}, Profiling: {}, Counter: {}, " "Interrupt: {}, Device: {})", HostVisible, WithProfiling, CounterBasedEventEnabled, @@ -524,7 +524,7 @@ ur_event_handle_t ur_context_handle_t_::getEventFromContextCache( // We have to reset event before using it. Event->reset(); - UR_LOG(Info, + UR_LOG(INFO, "Using {} event (Host Visible: {}, Profiling: {}, Counter: {}, " "Interrupt: {}, Device: {}) from cache {}", Event, Event->HostVisibleEvent, Event->isProfilingEnabled(), @@ -545,7 +545,7 @@ void ur_context_handle_t_::addEventToContextCache(ur_event_handle_t Event) { auto Cache = getEventCache( Event->isHostVisible(), Event->isProfilingEnabled(), Device, Event->CounterBasedEventsEnabled, Event->InterruptBasedEventsEnabled); - UR_LOG(Info, + UR_LOG(INFO, "Inserting {} event (Host Visible: {}, Profiling: {}, Counter: {}, " "Device: {}) into cache {}", Event, Event->HostVisibleEvent, Event->isProfilingEnabled(), diff --git a/unified-runtime/source/adapters/level_zero/device.cpp b/unified-runtime/source/adapters/level_zero/device.cpp index ec95f34d0ecd..004828e9d4ec 100644 --- a/unified-runtime/source/adapters/level_zero/device.cpp +++ b/unified-runtime/source/adapters/level_zero/device.cpp @@ -52,7 +52,7 @@ getRangeOfAllowedCopyEngines(const ur_device_handle_t &Device) { int UpperCopyEngineIndex = std::stoi(CopyEngineRange.substr(pos + 1)); if ((LowerCopyEngineIndex > UpperCopyEngineIndex) || (LowerCopyEngineIndex < -1) || (UpperCopyEngineIndex < -1)) { - UR_LOG(Error, "UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " + UR_LOG(ERROR, "UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " "default set."); LowerCopyEngineIndex = 0; UpperCopyEngineIndex = INT_MAX; @@ -141,7 +141,7 @@ ur_result_t urDeviceGet( break; default: Matched = false; - UR_LOG(Warning, "Unknown device type"); + UR_LOG(WARN, "Unknown device type"); break; } @@ -194,7 +194,7 @@ static std::tuple getZesDeviceData(ur_device_handle_t Device) { bool SysManEnv = getenv_tobool("ZES_ENABLE_SYSMAN", false); if ((Device->Platform->ZedeviceToZesDeviceMap.size() == 0) && !SysManEnv) { - UR_LOG(Error, "SysMan support is unavailable on this system. Please " + UR_LOG(ERROR, "SysMan support is unavailable on this system. Please " "check your level zero driver installation."); return {nullptr, {}, UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION}; } @@ -250,7 +250,7 @@ ur_result_t urDeviceGetInfo( case ZE_DEVICE_TYPE_FPGA: return ReturnValue(UR_DEVICE_TYPE_FPGA); default: - UR_LOG(Error, "This device type is not supported"); + UR_LOG(ERROR, "This device type is not supported"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1107,8 +1107,8 @@ ur_result_t urDeviceGetInfo( case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP: - UR_LOG(Error, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(Error, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERROR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP: { // L0 does not support mipmaps. @@ -1119,8 +1119,8 @@ ur_result_t urDeviceGetInfo( return ReturnValue(false); } case UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP: - UR_LOG(Error, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(Error, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERROR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP: { // L0 does not support creation of images from individual mipmap levels. @@ -1338,8 +1338,8 @@ ur_result_t urDeviceGetInfo( } } default: - UR_LOG(Error, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(Error, "ParamNameParamName={}(0x{})", ParamName, + UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERROR, "ParamNameParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; } @@ -1651,7 +1651,7 @@ ur_device_handle_t_::useImmediateCommandLists() { } } - UR_LOG(Info, "NOTE: L0 Immediate CommandList Setting: {}", + UR_LOG(INFO, "NOTE: L0 Immediate CommandList Setting: {}", ImmediateCommandlistsSetting); switch (ImmediateCommandlistsSetting) { @@ -1793,7 +1793,7 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal, if (numQueueGroups == 0) { return UR_RESULT_ERROR_UNKNOWN; } - UR_LOG_LEGACY(Info, + UR_LOG_LEGACY(INFO, logger::LegacyMessage("NOTE: Number of queue groups = {}"), "Number of queue groups = {}", numQueueGroups); @@ -1849,23 +1849,23 @@ ur_result_t ur_device_handle_t_::initialize(int SubSubDeviceOrdinal, } } if (QueueGroup[queue_group_info_t::MainCopy].ZeOrdinal < 0) - UR_LOG_LEGACY(Info, + UR_LOG_LEGACY(INFO, logger::LegacyMessage( "NOTE: main blitter/copy engine is not available"), "main blitter/copy engine is not available") else - UR_LOG_LEGACY(Info, + UR_LOG_LEGACY(INFO, logger::LegacyMessage( "NOTE: main blitter/copy engine is available"), "main blitter/copy engine is available") if (QueueGroup[queue_group_info_t::LinkCopy].ZeOrdinal < 0) - UR_LOG_LEGACY(Info, + UR_LOG_LEGACY(INFO, logger::LegacyMessage( "NOTE: link blitter/copy engines are not available"), "link blitter/copy engines are not available") else - UR_LOG_LEGACY(Info, + UR_LOG_LEGACY(INFO, logger::LegacyMessage( "NOTE: link blitter/copy engines are available"), "link blitter/copy engines are available") diff --git a/unified-runtime/source/adapters/level_zero/event.cpp b/unified-runtime/source/adapters/level_zero/event.cpp index 47ad5a75df81..dda91b5d456b 100644 --- a/unified-runtime/source/adapters/level_zero/event.cpp +++ b/unified-runtime/source/adapters/level_zero/event.cpp @@ -29,7 +29,7 @@ void printZeEventList(const _ur_ze_event_list_t &UrZeEventList) { for (uint32_t I = 0; I < UrZeEventList.Length; I++) { ss << " " << ur_cast(UrZeEventList.ZeEventList[I]); } - UR_LOG(Debug, ss.str().c_str()); + UR_LOG(DEBUG, ss.str().c_str()); } } @@ -510,7 +510,7 @@ ur_result_t urEventGetInfo( return ReturnValue(Event->RefCount.load()); } default: - UR_LOG(Error, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + UR_LOG(ERROR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", PropName, logger::toHex(PropName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -596,11 +596,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(Error, "urEventGetProfilingInfo: " + UR_LOG(ERROR, "urEventGetProfilingInfo: " "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(Error, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -663,11 +663,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(Error, "urEventGetProfilingInfo: " + UR_LOG(ERROR, "urEventGetProfilingInfo: " "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(Error, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } else { @@ -710,11 +710,11 @@ ur_result_t urEventGetProfilingInfo( // return ReturnValue(uint64_t{0}); case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(Error, "urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " + UR_LOG(ERROR, "urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " "not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(Error, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -829,7 +829,7 @@ urEventWait(uint32_t NumEvents, die("The host-visible proxy event missing"); ze_event_handle_t ZeEvent = HostVisibleEvent->ZeEvent; - UR_LOG(Debug, "ZeEvent = {}", ur_cast(ZeEvent)); + UR_LOG(DEBUG, "ZeEvent = {}", ur_cast(ZeEvent)); // If this event was an inner batched event, then sync with // the Queue instead of waiting on the event. if (HostVisibleEvent->IsInnerBatchedEvent && Event->ZeBatchedQueue) { @@ -1009,7 +1009,7 @@ ur_result_t urEventSetCallback( ur_event_callback_t /*Notify*/, /// [in][out][optional] pointer to data to be passed to callback. void * /*UserData*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp index ae061d437acb..160627953166 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp @@ -35,7 +35,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormatTypeSize = 32; break; default: - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unsupported image format layout: layout = {}", ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; @@ -54,7 +54,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_A; break; default: - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel x: x = {}", ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; @@ -64,7 +64,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, case ZE_IMAGE_FORMAT_LAYOUT_16_16: case ZE_IMAGE_FORMAT_LAYOUT_32_32: if (ZeImageFormat.x != ZE_IMAGE_FORMAT_SWIZZLE_R) { - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel x: x = {}", ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; @@ -80,7 +80,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RX; break; default: - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel y: y = {}\n", ZeImageFormat.y); return UR_RESULT_ERROR_INVALID_VALUE; @@ -99,13 +99,13 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGX; break; default: - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel z: z = {}\n", ZeImageFormat.z); return UR_RESULT_ERROR_INVALID_VALUE; } } else { - UR_LOG(Error, "ze2urImageFormat: unexpected image format channel"); + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -123,7 +123,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGBA; break; default: - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel w: w = {}", ZeImageFormat.w); return UR_RESULT_ERROR_INVALID_VALUE; @@ -139,12 +139,12 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormat.w == ZE_IMAGE_FORMAT_SWIZZLE_A) { ChannelOrder = UR_IMAGE_CHANNEL_ORDER_BGRA; } else { - UR_LOG(Error, "ze2urImageFormat: unexpected image format channel"); + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unsupported image format layout: layout = {}", ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; @@ -164,7 +164,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32; break; default: - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -182,7 +182,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SIGNED_INT32; break; default: - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -197,7 +197,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNORM_INT16; break; default: - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -212,7 +212,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SNORM_INT16; break; default: - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -227,14 +227,14 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_FLOAT; break; default: - UR_LOG(Error, + UR_LOG(ERROR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - UR_LOG(Error, "ze2urImageFormat: unsupported image format type: type = {}", + UR_LOG(ERROR, "ze2urImageFormat: unsupported image format type: type = {}", ZeImageFormat.type); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -281,13 +281,13 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - UR_LOG(Error, "ur2zeImageDesc: unexpected data type Size\n"); + UR_LOG(ERROR, "ur2zeImageDesc: unexpected data type Size\n"); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; } break; } default: - UR_LOG(Error, "format layout = {}", ImageFormat->channelOrder); + UR_LOG(ERROR, "format layout = {}", ImageFormat->channelOrder); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; break; } @@ -316,7 +316,7 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - UR_LOG(Error, "ur2zeImageDesc: unsupported image type"); + UR_LOG(ERROR, "ur2zeImageDesc: unsupported image type"); return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR; } @@ -513,7 +513,7 @@ getImageFormatTypeAndSize(const ur_image_format_t *ImageFormat) { break; } default: - UR_LOG(Error, "ur2zeImageDesc: unsupported image data type: data type = {}", + UR_LOG(ERROR, "ur2zeImageDesc: unsupported image data type: data type = {}", ImageFormat->channelType); ZeImageFormatType = ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32; ZeImageFormatTypeSize = 0; diff --git a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp index dbb76e37adf5..e015d14477cd 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp @@ -52,13 +52,13 @@ ur_result_t getSuggestedLocalWorkSize(ur_device_handle_t hDevice, --GroupSize[I]; } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - UR_LOG(Error, "getSuggestedLocalWorkSize: can't find a WG size " + UR_LOG(ERROR, "getSuggestedLocalWorkSize: can't find a WG size " "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } WG[I] = GroupSize[I]; } - UR_LOG(Debug, + UR_LOG(DEBUG, "getSuggestedLocalWorkSize: using computed WG size = {{{}, {}, {}}}", WG[0], WG[1], WG[2]); } @@ -70,7 +70,7 @@ ur_result_t setKernelGlobalOffset(ur_context_handle_t Context, ze_kernel_handle_t Kernel, uint32_t WorkDim, const size_t *GlobalWorkOffset) { if (!Context->getPlatform()->ZeDriverGlobalOffsetExtensionFound) { - UR_LOG(Debug, "No global offset extension found on this driver"); + UR_LOG(DEBUG, "No global offset extension found on this driver"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -130,26 +130,26 @@ ur_result_t calculateKernelWorkDimensions( break; default: - UR_LOG(Error, "calculateKernelWorkDimensions: unsupported work_dim"); + UR_LOG(ERROR, "calculateKernelWorkDimensions: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - UR_LOG(Error, "calculateKernelWorkDimensions: invalid work_dim. The range " + UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " "is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - UR_LOG(Error, "calculateKernelWorkDimensions: invalid work_dim. The range " + UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " "is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[2] != size_t(ZeThreadGroupDimensions.groupCountZ) * WG[2]) { - UR_LOG(Error, "calculateKernelWorkDimensions: invalid work_dim. The range " + UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " "is not a multiple of the group size in the 3rd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } diff --git a/unified-runtime/source/adapters/level_zero/image.cpp b/unified-runtime/source/adapters/level_zero/image.cpp index 31a32610db7c..d72b7bc6bf62 100644 --- a/unified-runtime/source/adapters/level_zero/image.cpp +++ b/unified-runtime/source/adapters/level_zero/image.cpp @@ -56,7 +56,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32; break; default: - UR_LOG(Error, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -75,7 +75,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32; break; default: - UR_LOG(Error, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -95,7 +95,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - UR_LOG(Error, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -113,13 +113,13 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32; break; default: - UR_LOG(Error, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; } default: - UR_LOG(Error, "format channel order = {}", ImageFormat->channelOrder); + UR_LOG(ERROR, "format channel order = {}", ImageFormat->channelOrder); die("ur2zeImageDescBindless: unsupported image channel order\n"); break; } @@ -148,7 +148,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - UR_LOG(Error, "ur2zeImageDescBindless: unsupported image type"); + UR_LOG(ERROR, "ur2zeImageDescBindless: unsupported image type"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -237,7 +237,7 @@ ur_result_t bindlessImagesCreateImpl(ur_context_handle_t hContext, DriverHandle, "zeImageGetDeviceOffsetExp", (void **)&zeImageGetDeviceOffsetExpFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - UR_LOG(Error, + UR_LOG(ERROR, "zeDriverGetExtensionFunctionAddress zeImageGetDeviceOffsetExpv " "failed, err = {}", Result); @@ -281,7 +281,7 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, DriverHandle, "zeMemGetPitchFor2dImage", (void **)&zeMemGetPitchFor2dImageFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - UR_LOG(Error, + UR_LOG(ERROR, "zeDriverGetExtensionFunctionAddress zeMemGetPitchFor2dImage " "failed, err = {}", Result); @@ -552,7 +552,7 @@ ur_result_t urBindlessImagesImageCopyExp( &DstRegion, &SrcRegion, ZeEvent, WaitList.Length, WaitList.ZeEventList)); } else { - UR_LOG(Error, "urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); + UR_LOG(ERROR, "urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -615,7 +615,7 @@ ur_result_t urBindlessImagesMipmapGetLevelExp( ur_context_handle_t /*hContext*/, ur_device_handle_t /*hDevice*/, ur_exp_image_mem_native_handle_t /*hImageMem*/, uint32_t /*mipmapLevel*/, ur_exp_image_mem_native_handle_t * /*phImageMem*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -800,7 +800,7 @@ ur_result_t urBindlessImagesImportExternalSemaphoreExp( auto UrPlatform = hContext->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] "), + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] "), " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -932,7 +932,7 @@ ur_result_t urBindlessImagesReleaseExternalSemaphoreExp( ur_exp_external_semaphore_handle_t hExternalSemaphore) { auto UrPlatform = hContext->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(Error, logger::LegacyMessage("[UR][L0] "), + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] "), " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -955,7 +955,7 @@ ur_result_t urBindlessImagesWaitExternalSemaphoreExp( const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { auto UrPlatform = hQueue->Context->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not supported!"), "{} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1040,7 +1040,7 @@ ur_result_t urBindlessImagesSignalExternalSemaphoreExp( const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { auto UrPlatform = hQueue->Context->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not supported!"), "{} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/kernel.cpp b/unified-runtime/source/adapters/level_zero/kernel.cpp index cc7a7b7696e7..d139a6881115 100644 --- a/unified-runtime/source/adapters/level_zero/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/kernel.cpp @@ -189,7 +189,7 @@ ur_result_t urEnqueueKernelLaunch( (*Event)->WaitList.Length, (*Event)->WaitList.ZeEventList)); } - UR_LOG(Debug, "calling zeCommandListAppendLaunchKernel() with ZeEvent {}", + UR_LOG(DEBUG, "calling zeCommandListAppendLaunchKernel() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList((*Event)->WaitList); @@ -316,14 +316,14 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - UR_LOG(Error, + UR_LOG(ERROR, "urEnqueueCooperativeKernelLaunchExp: can't find a WG size " "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } WG[I] = GroupSize[I]; } - UR_LOG(Debug, + UR_LOG(DEBUG, "urEnqueueCooperativeKernelLaunchExp: using computed WG " "size = {{{}, {}, {}}}", WG[0], WG[1], WG[2]); @@ -355,28 +355,28 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( break; default: - UR_LOG(Error, "urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); + UR_LOG(ERROR, "urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - UR_LOG(Error, + UR_LOG(ERROR, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - UR_LOG(Error, + UR_LOG(ERROR, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[2] != size_t(ZeThreadGroupDimensions.groupCountZ) * WG[2]) { - UR_LOG(Debug, + UR_LOG(DEBUG, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 3rd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; @@ -449,7 +449,7 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( (*Event)->WaitList.Length, (*Event)->WaitList.ZeEventList)); } - UR_LOG(Debug, + UR_LOG(DEBUG, "calling zeCommandListAppendLaunchCooperativeKernel() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList((*Event)->WaitList); @@ -788,7 +788,7 @@ ur_result_t urKernelGetInfo( return UR_RESULT_ERROR_UNKNOWN; } default: - UR_LOG(Error, + UR_LOG(ERROR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; @@ -877,7 +877,7 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - UR_LOG(Error, + UR_LOG(ERROR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; @@ -1019,7 +1019,7 @@ ur_result_t urKernelSetExecInfo( return UR_RESULT_ERROR_INVALID_VALUE; ZE2UR_CALL(zeKernelSetCacheConfig, (ZeKernel, ZeCacheConfig);); } else { - UR_LOG(Error, "urKernelSetExecInfo: unsupported ParamName"); + UR_LOG(ERROR, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1166,7 +1166,7 @@ ur_result_t urKernelSetSpecializationConstants( const ur_specialization_constant_info_t /// [in] array of specialization constant value descriptions * /*SpecConstants*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/memory.cpp b/unified-runtime/source/adapters/level_zero/memory.cpp index 52b089346d5f..98297451043d 100644 --- a/unified-runtime/source/adapters/level_zero/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/memory.cpp @@ -117,7 +117,7 @@ ur_result_t enqueueMemCopyHelper(ur_command_t CommandType, const auto &ZeCommandList = CommandList->first; const auto &WaitList = (*Event)->WaitList; - UR_LOG(Debug, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -169,7 +169,7 @@ ur_result_t enqueueMemCopyRectHelper( const auto &ZeCommandList = CommandList->first; const auto &WaitList = (*Event)->WaitList; - UR_LOG(Debug, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -182,7 +182,7 @@ ur_result_t enqueueMemCopyRectHelper( ZeParams.srcPitch, ZeParams.srcSlicePitch, ZeEvent, WaitList.Length, WaitList.ZeEventList)); - UR_LOG(Debug, "calling zeCommandListAppendMemoryCopyRegion()"); + UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopyRegion()"); UR_CALL(Queue->executeCommandList(CommandList, Blocking, OkToBatch)); @@ -257,7 +257,7 @@ static ur_result_t enqueueMemFillHelper(ur_command_t CommandType, (ZeCommandList, Ptr, Pattern, PatternSize, Size, ZeEvent, WaitList.Length, WaitList.ZeEventList)); - UR_LOG(Debug, "calling zeCommandListAppendMemoryFill() with ZeEvent {}", + UR_LOG(DEBUG, "calling zeCommandListAppendMemoryFill() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -278,7 +278,7 @@ static ur_result_t enqueueMemFillHelper(ur_command_t CommandType, WaitList.Length, WaitList.ZeEventList)); } - UR_LOG(Debug, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", + UR_LOG(DEBUG, "calling zeCommandListAppendMemoryCopy() with ZeEvent {}", ur_cast(ZeEvent)); printZeEventList(WaitList); @@ -460,7 +460,7 @@ static ur_result_t enqueueMemImageCommandHelper( ur_cast(ZeHandleSrc), &ZeDstRegion, &ZeSrcRegion, ZeEvent, 0, nullptr)); } else { - UR_LOG(Error, "enqueueMemImageUpdate: unsupported image command type"); + UR_LOG(ERROR, "enqueueMemImageUpdate: unsupported image command type"); return UR_RESULT_ERROR_INVALID_OPERATION; } @@ -1037,7 +1037,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - UR_LOG(Error, "urEnqueueMemBufferMap: duplicate mapping detected"); + UR_LOG(ERROR, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -1098,7 +1098,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - UR_LOG(Error, "urEnqueueMemBufferMap: duplicate mapping detected"); + UR_LOG(ERROR, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -1152,7 +1152,7 @@ ur_result_t urEnqueueMemUnmap( std::scoped_lock Guard(Buffer->Mutex); auto It = Buffer->Mappings.find(MappedPtr); if (It == Buffer->Mappings.end()) { - UR_LOG(Error, "urEnqueueMemUnmap: unknown memory mapping"); + UR_LOG(ERROR, "urEnqueueMemUnmap: unknown memory mapping"); return UR_RESULT_ERROR_INVALID_VALUE; } MapInfo = It->second; @@ -1424,7 +1424,7 @@ ur_result_t urEnqueueUSMFill2D( /// [in,out][optional] return an event object that identifies this /// particular kernel execution instance. ur_event_handle_t * /*OutEvent*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1868,7 +1868,7 @@ ur_result_t urMemImageGetInfo( /// [out][optional] pointer to the actual size in bytes of data queried by /// pImgInfo. size_t * /*PropSizeRet*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1915,7 +1915,7 @@ ur_result_t urEnqueueReadHostPipe(ur_queue_handle_t /*hQueue*/, uint32_t /*numEventsInWaitList*/, const ur_event_handle_t * /*phEventWaitList*/, ur_event_handle_t * /*phEvent*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1927,7 +1927,7 @@ ur_result_t urEnqueueWriteHostPipe( size_t /*size*/, uint32_t /*numEventsInWaitList*/, const ur_event_handle_t * /*phEventWaitList*/, ur_event_handle_t * /*phEvent*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -2193,7 +2193,7 @@ ur_result_t _ur_buffer::getBufferZeHandle(char *&ZeHandle, } } - UR_LOG(Debug, "getZeHandle(pi_device{{{}}}) = {}", (void *)Device, + UR_LOG(DEBUG, "getZeHandle(pi_device{{{}}}) = {}", (void *)Device, (void *)Allocation.ZeHandle); return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/adapters/level_zero/platform.cpp b/unified-runtime/source/adapters/level_zero/platform.cpp index 5eb65677de3e..8c95989035c0 100644 --- a/unified-runtime/source/adapters/level_zero/platform.cpp +++ b/unified-runtime/source/adapters/level_zero/platform.cpp @@ -102,7 +102,7 @@ ur_result_t urPlatformGetInfo( case UR_PLATFORM_INFO_ADAPTER: return ReturnValue(GlobalAdapter); default: - UR_LOG(Debug, "urPlatformGetInfo: unrecognized ParamName"); + UR_LOG(DEBUG, "urPlatformGetInfo: unrecognized ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/program.cpp b/unified-runtime/source/adapters/level_zero/program.cpp index 72d18aa5b5f1..30f8e90168ee 100644 --- a/unified-runtime/source/adapters/level_zero/program.cpp +++ b/unified-runtime/source/adapters/level_zero/program.cpp @@ -439,7 +439,7 @@ ur_result_t urProgramLinkExp( ZeModuleDesc.pInputModule = ZeExtModuleDesc.pInputModules[0]; ZeModuleDesc.pConstants = ZeExtModuleDesc.pConstants[0]; } else { - UR_LOG(Error, + UR_LOG(ERROR, "urProgramLink: level_zero driver does not have static linking " "support."); return UR_RESULT_ERROR_INVALID_VALUE; @@ -893,7 +893,7 @@ ur_result_t urProgramGetBuildInfo( // program. return ReturnValue(""); } else { - UR_LOG(Error, "urProgramGetBuildInfo: unsupported ParamName"); + UR_LOG(ERROR, "urProgramGetBuildInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -908,7 +908,7 @@ ur_result_t urProgramSetSpecializationConstant( size_t /*SpecSize*/, /// [in] pointer to the specialization value bytes const void * /*SpecValue*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/queue.cpp b/unified-runtime/source/adapters/level_zero/queue.cpp index 54f53c6a66ce..2e081d0ed2c5 100644 --- a/unified-runtime/source/adapters/level_zero/queue.cpp +++ b/unified-runtime/source/adapters/level_zero/queue.cpp @@ -456,7 +456,7 @@ ur_result_t urQueueGetInfo( } default: UR_LOG( - Error, + ERROR, "Unsupported ParamName in urQueueGetInfo: ParamName=ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_ENUMERATION; @@ -925,7 +925,7 @@ ur_result_t urEnqueueKernelLaunchCustomExp( uint32_t /*numEventsInWaitList*/, const ur_event_handle_t * /*phEventWaitList*/, ur_event_handle_t * /*phEvent*/) { - UR_LOG(Error, "[UR][L0] {} function not implemented!", + UR_LOG(ERROR, "[UR][L0] {} function not implemented!", "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1006,9 +1006,9 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { Val = std::stoi(BatchConfig.substr(Pos)); } catch (...) { if (IsCopy) - UR_LOG(Error, "UR_L0_COPY_BATCH_SIZE: failed to parse value") + UR_LOG(ERROR, "UR_L0_COPY_BATCH_SIZE: failed to parse value") else - UR_LOG(Error, "UR_L0_BATCH_SIZE: failed to parse value") + UR_LOG(ERROR, "UR_L0_BATCH_SIZE: failed to parse value") break; } switch (Ord) { @@ -1031,19 +1031,19 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { die("Unexpected batch config"); } if (IsCopy) - UR_LOG(Error, "UR_L0_COPY_BATCH_SIZE: dynamic batch param #{}: {}", + UR_LOG(ERROR, "UR_L0_COPY_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, (int)Val) else - UR_LOG(Error, "UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", + UR_LOG(ERROR, "UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, (int)Val) }; } else { // Negative batch sizes are silently ignored. if (IsCopy) - UR_LOG(Warning, "UR_L0_COPY_BATCH_SIZE: ignored negative value") + UR_LOG(WARN, "UR_L0_COPY_BATCH_SIZE: ignored negative value") else - UR_LOG(Warning, "UR_L0_BATCH_SIZE: ignored negative value") + UR_LOG(WARN, "UR_L0_BATCH_SIZE: ignored negative value") } } return Config; @@ -1223,7 +1223,7 @@ void ur_queue_handle_t_::adjustBatchSizeForFullBatch(bool IsCopy) { ZeCommandListBatchConfig.NumTimesClosedFullThreshold) { if (QueueBatchSize < ZeCommandListBatchConfig.DynamicSizeMax) { QueueBatchSize += ZeCommandListBatchConfig.DynamicSizeStep; - UR_LOG(Debug, "Raising QueueBatchSize to {}", QueueBatchSize); + UR_LOG(DEBUG, "Raising QueueBatchSize to {}", QueueBatchSize); } CommandBatch.NumTimesClosedEarly = 0; CommandBatch.NumTimesClosedFull = 0; @@ -1250,7 +1250,7 @@ void ur_queue_handle_t_::adjustBatchSizeForPartialBatch(bool IsCopy) { QueueBatchSize = CommandBatch.OpenCommandList->second.size() - 1; if (QueueBatchSize < 1) QueueBatchSize = 1; - UR_LOG(Debug, "Lowering QueueBatchSize to {}", QueueBatchSize); + UR_LOG(DEBUG, "Lowering QueueBatchSize to {}", QueueBatchSize); CommandBatch.NumTimesClosedEarly = 0; CommandBatch.NumTimesClosedFull = 0; } @@ -1618,12 +1618,12 @@ ur_result_t urQueueReleaseInternal(ur_queue_handle_t Queue) { Queue->clearEndTimeRecordings(); - UR_LOG(Debug, + UR_LOG(DEBUG, "urQueueRelease(compute) NumTimesClosedFull {}, " "NumTimesClosedEarly {}", Queue->ComputeCommandBatch.NumTimesClosedFull, Queue->ComputeCommandBatch.NumTimesClosedEarly); - UR_LOG(Debug, + UR_LOG(DEBUG, "urQueueRelease(copy) NumTimesClosedFull {}, NumTimesClosedEarly {}", Queue->CopyCommandBatch.NumTimesClosedFull, Queue->CopyCommandBatch.NumTimesClosedEarly); @@ -2243,7 +2243,7 @@ ur_queue_handle_t_::ur_queue_group_t::getZeQueue(uint32_t *QueueGroupOrdinal) { ZeCommandQueueDesc.flags = ZE_COMMAND_QUEUE_FLAG_EXPLICIT_ONLY; } - UR_LOG(Debug, + UR_LOG(DEBUG, "[getZeQueue]: create queue ordinal = {}, index = {} " "(round robin in [{}, {}]) priority = {}", ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, LowerIndex, @@ -2308,7 +2308,7 @@ ur_result_t ur_queue_handle_t_::createCommandList( } UR_LOG( - Debug, + DEBUG, "create command list ordinal: {}, type: regular, device: {}, inOrder: {}", QueueGroupOrdinal, Device->ZeDevice, IsInOrderList); @@ -2477,12 +2477,12 @@ ur_command_list_ptr_t &ur_queue_handle_t_::ur_queue_group_t::getImmCmdList() { // If cache didn't contain a command list, create one. if (!ZeCommandList) { - UR_LOG(Debug, + UR_LOG(DEBUG, "[getZeQueue]: create queue ordinal = {}, index = {} " "(round robin in [{}, {}]) priority = {}", ZeCommandQueueDesc.ordinal, ZeCommandQueueDesc.index, LowerIndex, UpperIndex, Priority); - UR_LOG(Debug, + UR_LOG(DEBUG, "create command list ordinal: {}, type: immediate, device: " "{}, inOrder: {}", ZeCommandQueueDesc.ordinal, Queue->Device->ZeDevice, isInOrderList); diff --git a/unified-runtime/source/adapters/level_zero/sampler.cpp b/unified-runtime/source/adapters/level_zero/sampler.cpp index 9df151839ed6..3f06020a5a5d 100644 --- a/unified-runtime/source/adapters/level_zero/sampler.cpp +++ b/unified-runtime/source/adapters/level_zero/sampler.cpp @@ -83,7 +83,7 @@ ur_result_t urSamplerCreate( ZeSamplerDesc.addressMode = ZE_SAMPLER_ADDRESS_MODE_MIRROR; break; default: - UR_LOG(Error, "urSamplerCreate: unsupported " + UR_LOG(ERROR, "urSamplerCreate: unsupported " "UR_SAMPLER_PROPERTIES_ADDRESSING_MODEE value"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -93,7 +93,7 @@ ur_result_t urSamplerCreate( else if (Props->filterMode == UR_SAMPLER_FILTER_MODE_LINEAR) ZeSamplerDesc.filterMode = ZE_SAMPLER_FILTER_MODE_LINEAR; else { - UR_LOG(Error, + UR_LOG(ERROR, "urSamplerCreate: unsupported UR_SAMPLER_FILTER_MODE value"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -154,7 +154,7 @@ ur_result_t urSamplerGetInfo( void * /*PropValue*/, /// [out] size in bytes returned in sampler property value size_t * /*PropSizeRet*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -165,7 +165,7 @@ ur_result_t urSamplerGetNativeHandle( ur_sampler_handle_t /*Sampler*/, /// [out] a pointer to the native handle of the sampler. ur_native_handle_t * /*NativeSampler*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -180,7 +180,7 @@ ur_result_t urSamplerCreateWithNativeHandle( const ur_sampler_native_properties_t * /*Properties*/, /// [out] pointer to the handle of the sampler object created. ur_sampler_handle_t * /*Sampler*/) { - UR_LOG_LEGACY(Error, + UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/usm.cpp b/unified-runtime/source/adapters/level_zero/usm.cpp index f8b9ce5ccf11..db20c546b6ab 100644 --- a/unified-runtime/source/adapters/level_zero/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/usm.cpp @@ -448,7 +448,7 @@ ur_result_t urUSMGetMemAllocInfo( MemAllocaType = UR_USM_TYPE_SHARED; break; default: - UR_LOG(Error, "urUSMGetMemAllocInfo: unexpected usm memory type"); + UR_LOG(ERROR, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(MemAllocaType); @@ -488,7 +488,7 @@ ur_result_t urUSMGetMemAllocInfo( return UR_RESULT_ERROR_INVALID_VALUE; } default: - UR_LOG(Error, "urUSMGetMemAllocInfo: unsupported ParamName"); + UR_LOG(ERROR, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -846,7 +846,7 @@ umf_result_t L0MemoryProvider::open_ipc_handle(void *IpcData, void **Ptr) { memcpy(&fdRemote, &zeIpcData->zeHandle, sizeof(fdRemote)); fdLocal = ur_duplicate_fd(zeIpcData->pid, fdRemote); if (fdLocal == -1) { - UR_LOG(Error, "duplicating file descriptor from IPC handle failed"); + UR_LOG(ERROR, "duplicating file descriptor from IPC handle failed"); return UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC; } @@ -953,12 +953,12 @@ MakeProvider(ProviderParams *Params = nullptr) { } break; default: - UR_LOG(Error, "urUSMPoolCreate: invalid USM type found"); + UR_LOG(ERROR, "urUSMPoolCreate: invalid USM type found"); Ret = UMF_RESULT_ERROR_INVALID_ARGUMENT; } if (Ret != UMF_RESULT_SUCCESS) { - UR_LOG(Error, "urUSMPoolCreate: failed to create UMF provider"); + UR_LOG(ERROR, "urUSMPoolCreate: failed to create UMF provider"); throw UsmAllocationException(umf::umf2urResult(Ret)); } @@ -999,13 +999,13 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - UR_LOG(Error, "urUSMPoolCreate: failed to store USM pool tag"); + UR_LOG(ERROR, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - UR_LOG(Error, "urUSMPoolCreate: failed to store UMF pool"); + UR_LOG(ERROR, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1059,12 +1059,12 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - UR_LOG(Error, "urUSMPoolCreate: failed to store USM pool tag"); + UR_LOG(ERROR, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - UR_LOG(Error, "urUSMPoolCreate: failed to store UMF pool"); + UR_LOG(ERROR, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1176,7 +1176,7 @@ ur_result_t ur_usm_pool_handle_t_::allocate(ur_context_handle_t Context, } if (*RetMem == nullptr) { auto umfRet = umfPoolGetLastAllocationError(umfPool); - UR_LOG(Error, + UR_LOG(ERROR, "enqueueUSMAllocHelper: allocation from the UMF pool {} failed", umfPool); return umf::umf2urResult(umfRet); diff --git a/unified-runtime/source/adapters/level_zero/v2/api.cpp b/unified-runtime/source/adapters/level_zero/v2/api.cpp index 0307e12f3f01..eeb70567910f 100644 --- a/unified-runtime/source/adapters/level_zero/v2/api.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/api.cpp @@ -23,21 +23,21 @@ ur_result_t urContextSetExtendedDeleter(ur_context_handle_t hContext, ur_context_extended_deleter_t pfnDeleter, void *pUserData) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urKernelSetSpecializationConstants( ur_kernel_handle_t hKernel, uint32_t count, const ur_specialization_constant_info_t *pSpecConstants) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urEventSetCallback(ur_event_handle_t hEvent, ur_execution_info_t execStatus, ur_event_callback_t pfnNotify, void *pUserData) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -47,21 +47,21 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, ur_usm_pool_handle_t pool, size_t widthInBytes, size_t height, size_t elementSizeBytes, void **ppMem, size_t *pResultPitch) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -69,7 +69,7 @@ ur_result_t urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -77,7 +77,7 @@ ur_result_t urBindlessImagesImageFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -86,7 +86,7 @@ ur_result_t urBindlessImagesUnsampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_native_handle_t *phImage) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -95,14 +95,14 @@ ur_result_t urBindlessImagesSampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_sampler_handle_t hSampler, ur_exp_image_native_handle_t *phImage) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesImageGetInfoExp( ur_context_handle_t hContext, ur_exp_image_mem_native_handle_t hImageMem, ur_image_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -110,7 +110,7 @@ ur_result_t urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem, uint32_t mipmapLevel, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -118,7 +118,7 @@ ur_result_t urBindlessImagesMipmapFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hMem) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -127,7 +127,7 @@ ur_result_t urBindlessImagesImportExternalMemoryExp( ur_exp_external_mem_type_t memHandleType, ur_exp_external_mem_desc_t *pExternalMemDesc, ur_exp_external_mem_handle_t *phExternalMem) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -136,21 +136,21 @@ ur_result_t urBindlessImagesMapExternalArrayExp( const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_external_mem_handle_t hExternalMem, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesMapExternalLinearMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, uint64_t offset, uint64_t size, ur_exp_external_mem_handle_t hExternalMem, void **ppRetMem) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_mem_handle_t hExternalMem) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -159,14 +159,14 @@ ur_result_t urBindlessImagesImportExternalSemaphoreExp( ur_exp_external_semaphore_type_t semHandleType, ur_exp_external_semaphore_desc_t *pExternalSemaphoreDesc, ur_exp_external_semaphore_handle_t *phExternalSemaphore) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalSemaphoreExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_semaphore_handle_t hExternalSemaphore) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -174,21 +174,21 @@ ur_result_t urCommandBufferUpdateKernelLaunchExp( ur_exp_command_buffer_handle_t hCommandBuffer, uint32_t numKernelUpdates, const ur_exp_command_buffer_update_kernel_launch_desc_t *pUpdateKernelLaunch) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateSignalEventExp( ur_exp_command_buffer_command_handle_t hCommand, ur_event_handle_t *phEvent) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateWaitEventsExp( ur_exp_command_buffer_command_handle_t hCommand, uint32_t NumEventsInWaitList, const ur_event_handle_t *phEventWaitList) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -196,28 +196,28 @@ ur_result_t UR_APICALL urUSMPoolCreateExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_desc_t *PoolDesc, ur_usm_pool_handle_t *pPool) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolSetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t propSize) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -225,21 +225,21 @@ ur_result_t UR_APICALL urUSMPoolGetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -247,7 +247,7 @@ ur_result_t UR_APICALL urUSMPoolTrimToExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool, size_t minBytesToKeep) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp index b3126d308f11..b6c472767c50 100644 --- a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp @@ -20,7 +20,7 @@ namespace { // given context. void checkImmediateAppendSupport(ur_context_handle_t context) { if (!context->getPlatform()->ZeCommandListImmediateAppendExt.Supported) { - UR_LOG(Error, + UR_LOG(ERROR, "Adapter v2 is used but the current driver does not support " "the zeCommandListImmediateAppendCommandListsExp entrypoint."); throw UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp b/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp index ad5878df0337..dc57241a20ab 100644 --- a/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/command_list_cache.cpp @@ -62,12 +62,12 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { std::visit([](auto &&arg) { return arg.CopyOffloadEnabled; }, desc); if (ForceDisableCopyOffload && requestedCopyOffload) { - UR_LOG(Info, "Copy offload is disabled by the environment variable."); + UR_LOG(INFO, "Copy offload is disabled by the environment variable."); requestedCopyOffload = false; } if (!ZeCopyOffloadExtensionSupported && requestedCopyOffload) { - UR_LOG(Info, + UR_LOG(INFO, "Copy offload is requested but is not supported by the driver."); requestedCopyOffload = false; } @@ -89,7 +89,7 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { } QueueDesc.pNext = &offloadDesc; - UR_LOG(Debug, + UR_LOG(DEBUG, "create command list ordinal: {}, type: immediate, " "device: {}, inOrder: {}", ImmCmdDesc->Ordinal, ImmCmdDesc->ZeDevice, ImmCmdDesc->IsInOrder); @@ -106,7 +106,7 @@ command_list_cache_t::createCommandList(const command_list_descriptor_t &desc) { CmdListDesc.commandQueueGroupOrdinal = RegCmdDesc.Ordinal; CmdListDesc.pNext = &offloadDesc; - UR_LOG(Debug, + UR_LOG(DEBUG, "create command list ordinal: {}, type: immediate, " "device: {}, inOrder: {}", RegCmdDesc.Ordinal, RegCmdDesc.ZeDevice, RegCmdDesc.IsInOrder); diff --git a/unified-runtime/source/adapters/level_zero/v2/event.cpp b/unified-runtime/source/adapters/level_zero/v2/event.cpp index 412b6f08b7a7..36116d5ec35a 100644 --- a/unified-runtime/source/adapters/level_zero/v2/event.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/event.cpp @@ -271,7 +271,7 @@ ur_result_t urEventGetInfo(ur_event_handle_t hEvent, ur_event_info_t propName, return returnValue(hEvent->getCommandType()); } default: - UR_LOG(Error, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + UR_LOG(ERROR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", propName, logger::toHex(propName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -317,7 +317,7 @@ ur_result_t urEventGetProfilingInfo( return returnValue(hEvent->getEventEndTimestamp()); } default: - UR_LOG(Error, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -367,7 +367,7 @@ ur_result_t urEventGetProfilingInfo( // return returnValue(uint64_t{0}); default: - UR_LOG(Error, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp b/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp index 6240aec2297b..6239f3f5f741 100644 --- a/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/event_provider_normal.cpp @@ -50,7 +50,7 @@ provider_pool::provider_pool(ur_context_handle_t context, queue_type queue, devices.push_back(d->ZeDevice); } - UR_LOG(Debug, "ze_event_pool_desc_t flags set to: {}", desc.flags); + UR_LOG(DEBUG, "ze_event_pool_desc_t flags set to: {}", desc.flags); ZE2UR_CALL_THROWS(zeEventPoolCreate, (context->getZeHandle(), &desc, devices.size(), diff --git a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp index cf72a51a0ff2..ae301eb36496 100644 --- a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp @@ -264,7 +264,7 @@ ur_result_t ur_kernel_handle_t_::setExecInfo(ur_kernel_exec_info_t propName, ZE2UR_CALL(zeKernelSetCacheConfig, (kernel->hKernel.get(), zeCacheConfig);); } else { - UR_LOG(Error, "urKernelSetExecInfo: unsupported ParamName"); + UR_LOG(ERROR, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -555,7 +555,7 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - UR_LOG(Error, + UR_LOG(ERROR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; @@ -640,7 +640,7 @@ ur_result_t urKernelGetInfo(ur_kernel_handle_t hKernel, return ReturnValue(static_cast(attributes.data())); } default: - UR_LOG(Error, + UR_LOG(ERROR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; diff --git a/unified-runtime/source/adapters/level_zero/v2/memory.cpp b/unified-runtime/source/adapters/level_zero/v2/memory.cpp index 3cb8095c121e..b07dcc1d724c 100644 --- a/unified-runtime/source/adapters/level_zero/v2/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/memory.cpp @@ -88,7 +88,7 @@ ur_integrated_buffer_handle_t::ur_integrated_buffer_handle_t( this->ptr = usm_unique_ptr_t(rawPtr, [hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(Error, "Failed to free host memory: {}", ret); + UR_LOG(ERROR, "Failed to free host memory: {}", ret); } }); @@ -168,7 +168,7 @@ void *ur_discrete_buffer_handle_t::allocateOnDevice(ur_device_handle_t hDevice, usm_unique_ptr_t(ptr, [hContext = this->hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(Error, "Failed to free device memory: {}", ret); + UR_LOG(ERROR, "Failed to free device memory: {}", ret); } }); @@ -295,7 +295,7 @@ void *ur_discrete_buffer_handle_t::mapHostPtr( if (ownsAlloc) { auto ret = hContext->getDefaultUSMPool()->free(p); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(Error, "Failed to mapped memory: {}", ret); + UR_LOG(ERROR, "Failed to mapped memory: {}", ret); } } }); @@ -725,7 +725,7 @@ ur_result_t urMemImageGetInfo(ur_mem_handle_t /*hMemory*/, ur_image_info_t /*propName*/, size_t /*propSize*/, void * /*pPropValue*/, size_t * /*pPropSizeRet*/) { - UR_LOG(Error, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp index 824c1e9c7f76..01ba6dfc6d13 100644 --- a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp @@ -129,7 +129,7 @@ ur_queue_immediate_in_order_t::queueGetInfo(ur_queue_info_t propName, } } default: - UR_LOG(Error, + UR_LOG(ERROR, "Unsupported ParamName in urQueueGetInfo: " "ParamName=ParamName={}(0x{})", propName, logger::toHex(propName)); @@ -190,7 +190,7 @@ ur_queue_immediate_in_order_t::~ur_queue_immediate_in_order_t() { try { UR_CALL_THROWS(queueFinish()); } catch (...) { - UR_LOG(Error, "Failed to finish queue on destruction"); + UR_LOG(ERROR, "Failed to finish queue on destruction"); } } diff --git a/unified-runtime/source/adapters/level_zero/v2/usm.cpp b/unified-runtime/source/adapters/level_zero/v2/usm.cpp index abfc89d33e7e..c3b60da231bf 100644 --- a/unified-runtime/source/adapters/level_zero/v2/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/usm.cpp @@ -163,7 +163,7 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t hContext, } } else { // If pooling is disabled, do nothing. - UR_LOG(Info, "USM pooling is disabled. Skiping pool limits adjustment."); + UR_LOG(INFO, "USM pooling is disabled. Skiping pool limits adjustment."); } auto devicesAndSubDevices = @@ -236,7 +236,7 @@ ur_result_t ur_usm_pool_handle_t_::free(void *ptr) { if (umfPool) { return umf::umf2urResult(umfPoolFree(umfPool, ptr)); } else { - UR_LOG(Error, "Failed to find pool for pointer: {}", ptr); + UR_LOG(ERROR, "Failed to find pool for pointer: {}", ptr); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -439,7 +439,7 @@ ur_result_t urUSMGetMemAllocInfo( memAllocType = UR_USM_TYPE_SHARED; break; default: - UR_LOG(Error, "urUSMGetMemAllocInfo: unexpected usm memory type"); + UR_LOG(ERROR, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(memAllocType); @@ -468,7 +468,7 @@ ur_result_t urUSMGetMemAllocInfo( // TODO return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; default: - UR_LOG(Error, "urUSMGetMemAllocInfo: unsupported ParamName"); + UR_LOG(ERROR, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp index e63e04e96864..e07bf050345a 100644 --- a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp +++ b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp @@ -38,7 +38,7 @@ ur_result_t urVirtualMemGranularityGetInfo( return ReturnValue(PageSize); } default: - UR_LOG(Error, "Unsupported propName in urQueueGetInfo: propName={}({})", + UR_LOG(ERROR, "Unsupported propName in urQueueGetInfo: propName={}({})", propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -120,7 +120,7 @@ ur_result_t urVirtualMemGetInfo(ur_context_handle_t hContext, return ReturnValue(RetFlags); } default: - UR_LOG(Error, "Unsupported propName in urQueueGetInfo: propName={}({})", + UR_LOG(ERROR, "Unsupported propName in urQueueGetInfo: propName={}({})", propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/native_cpu/common.hpp b/unified-runtime/source/adapters/native_cpu/common.hpp index 95faa1aa6bc1..b2396daeebc8 100644 --- a/unified-runtime/source/adapters/native_cpu/common.hpp +++ b/unified-runtime/source/adapters/native_cpu/common.hpp @@ -21,19 +21,19 @@ extern thread_local char ErrorMessage[MaxMessageSize]; #define DIE_NO_IMPLEMENTATION \ do { \ - UR_LOG(Error, "Not Implemented : {}", __FUNCTION__) \ + UR_LOG(ERROR, "Not Implemented : {}", __FUNCTION__) \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; \ } while (false) #define CONTINUE_NO_IMPLEMENTATION \ do { \ - UR_LOG(Warning, "Not Implemented : {}", __FUNCTION__) \ + UR_LOG(WARN, "Not Implemented : {}", __FUNCTION__) \ return UR_RESULT_SUCCESS; \ } while (false) #define CASE_UR_UNSUPPORTED(not_supported) \ case not_supported: \ - UR_LOG(Error, "Unsupported UR case : {} in {}", #not_supported, \ + UR_LOG(ERROR, "Unsupported UR case : {} in {}", #not_supported, \ __FUNCTION__) \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/native_cpu/device.cpp b/unified-runtime/source/adapters/native_cpu/device.cpp index f0d7e9cab29e..186e8d61e30b 100644 --- a/unified-runtime/source/adapters/native_cpu/device.cpp +++ b/unified-runtime/source/adapters/native_cpu/device.cpp @@ -99,7 +99,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGet(ur_platform_handle_t hPlatform, if (NumEntries == 0) { /// Runtime queries number of devices if (phDevices != nullptr) { - UR_LOG(Error, "Invalid Arguments for urDevicesGet"); + UR_LOG(ERROR, "Invalid Arguments for urDevicesGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/adapters/native_cpu/platform.cpp b/unified-runtime/source/adapters/native_cpu/platform.cpp index 3810aaac3ec7..760c2ce2da8e 100644 --- a/unified-runtime/source/adapters/native_cpu/platform.cpp +++ b/unified-runtime/source/adapters/native_cpu/platform.cpp @@ -29,7 +29,7 @@ urPlatformGet(ur_adapter_handle_t, uint32_t NumEntries, if (NumEntries == 0) { if (phPlatforms != nullptr) { - UR_LOG(Error, "Invalid argument combination for urPlatformsGet"); + UR_LOG(ERROR, "Invalid argument combination for urPlatformsGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/adapters/opencl/context.cpp b/unified-runtime/source/adapters/opencl/context.cpp index 2b8b03dc3e3f..9f91fabba87c 100644 --- a/unified-runtime/source/adapters/opencl/context.cpp +++ b/unified-runtime/source/adapters/opencl/context.cpp @@ -158,7 +158,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urContextSetExtendedDeleter( ur_context_handle_t hContext, ur_context_extended_deleter_t pfnDeleter, void *pUserData) { if (!ur::cl::getAdapter()->clSetContextDestructorCallback) { - UR_LOG_L(ur::cl::getAdapter()->log, Warning, + UR_LOG_L(ur::cl::getAdapter()->log, WARN, "clSetContextDestructorCallback not found, consider upgrading the " "OpenCL-ICD-Loader to the latest version."); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/common/latency_tracker.hpp b/unified-runtime/source/common/latency_tracker.hpp index 0e87d89c331b..f15790f20a64 100644 --- a/unified-runtime/source/common/latency_tracker.hpp +++ b/unified-runtime/source/common/latency_tracker.hpp @@ -64,7 +64,7 @@ static inline latencyValues getValues(const struct hdr_histogram *histogram) { auto ret = hdr_value_at_percentiles(histogram, percentiles, values.percentileValues, numPercentiles); if (ret != 0) { - UR_LOG(Error, "Failed to get percentiles from latency histogram"); + UR_LOG(ERROR, "Failed to get percentiles from latency histogram"); } return values; @@ -137,7 +137,7 @@ class latency_histogram { auto ret = hdr_init(lowestDiscernibleValue, highestTrackableValue, significantFigures, &cHistogram); if (ret != 0) { - UR_LOG(Error, "Failed to initialize latency histogram"); + UR_LOG(ERROR, "Failed to initialize latency histogram"); } histogram = std::unique_ptr( cHistogram, &hdr_close); @@ -153,7 +153,7 @@ class latency_histogram { } if (hdr_min(histogram.get()) == std::numeric_limits::max()) { - UR_LOG(Info, "[{}] latency: no data", name); + UR_LOG(INFO, "[{}] latency: no data", name); return; } diff --git a/unified-runtime/source/common/linux/ur_lib_loader.cpp b/unified-runtime/source/common/linux/ur_lib_loader.cpp index ee82554758c4..4c5e61a848d3 100644 --- a/unified-runtime/source/common/linux/ur_lib_loader.cpp +++ b/unified-runtime/source/common/linux/ur_lib_loader.cpp @@ -25,11 +25,11 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { int res = dlclose(handle); if (res) { - UR_LOG(Error, + UR_LOG(ERROR, "Failed to unload the library with the handle at address {}", handle); } else { - UR_LOG(Info, "unloaded adapter 0x{}", handle); + UR_LOG(INFO, "unloaded adapter 0x{}", handle); } } } @@ -59,21 +59,21 @@ LibLoader::loadAdapterLibrary(const char *name) { (strstr(err, name) == NULL || strstr(err, "required by") != NULL)) { // If the adapter cannot be loaded due to missing dependencies or any // other related error, it is considered as an error. - UR_LOG(Info, "failed to load adapter '{}' with error: {}", name, err); + UR_LOG(INFO, "failed to load adapter '{}' with error: {}", name, err); } else { // Simply having the adapter library missing isn't an error. - UR_LOG(Info, "failed to load adapter '{}' with error: {}", name, + UR_LOG(INFO, "failed to load adapter '{}' with error: {}", name, err ? err : "unknown error"); } } else { #if defined(ADD_FULL_PATH_LOG) struct link_map *dlinfo_map; if (dlinfo(handle, RTLD_DI_LINKMAP, &dlinfo_map) == 0) { - UR_LOG(Info, "loaded adapter 0x{} ({}) from {}", handle, name, + UR_LOG(INFO, "loaded adapter 0x{} ({}) from {}", handle, name, dlinfo_map->l_name); } else #endif - UR_LOG(Info, "loaded adapter 0x{} ({})", handle, name); + UR_LOG(INFO, "loaded adapter 0x{} ({})", handle, name); } return std::unique_ptr(handle); } diff --git a/unified-runtime/source/common/logger/ur_logger_details.hpp b/unified-runtime/source/common/logger/ur_logger_details.hpp index 837e7e8e8380..6366ffc0902f 100644 --- a/unified-runtime/source/common/logger/ur_logger_details.hpp +++ b/unified-runtime/source/common/logger/ur_logger_details.hpp @@ -121,27 +121,41 @@ class Logger { #define UR_STRIMPL_(x) #x #define UR_STR_(x) UR_STRIMPL_(x) -#define UR_STRIMPL_LOWERCASE_(x) \ - ([] { \ - std::string _str = #x; \ - std::transform(_str.begin(), _str.end(), _str.begin(), \ - [](unsigned char _c) { return std::tolower(_c); }); \ - return _str; \ - }()) -#define UR_STR_LCASE_(x) UR_STRIMPL_LOWERCASE_(x) +// #define UR_STRIMPL_LOWERCASE_(x) \ +// ([] { \ +// std::string _str = #x; \ +// std::transform(_str.begin(), _str.end(), _str.begin(), \ +// [](unsigned char _c) { return std::tolower(_c); }); \ +// return _str; \ +// }()) +// #define UR_STR_LCASE_(x) UR_STRIMPL_LOWERCASE_(x) + +// #define URLOG_(logger_instance, level, ...) \ +// { \ +// ur_logger_level_t _lvl = logger::str_to_level(UR_STR_LCASE_(level)); \ +// (logger_instance).log(_lvl, SHORT_FILE, UR_STR_(__LINE__), __VA_ARGS__); \ +// } #define URLOG_(logger_instance, level, ...) \ { \ - ur_logger_level_t _lvl = logger::str_to_level(UR_STR_LCASE_(level)); \ - (logger_instance).log(_lvl, SHORT_FILE, UR_STR_(__LINE__), __VA_ARGS__); \ + (logger_instance) \ + .log(UR_LOGGER_LEVEL_##level, SHORT_FILE, UR_STR_(__LINE__), \ + __VA_ARGS__); \ } +// #define URLOG_LEGACY_(logger_instance, level, legacy_message, ...) \ +// { \ +// ur_logger_level_t _lvl = logger::str_to_level(UR_STR_LCASE_(level)); \ +// (logger_instance) \ +// .log(legacy_message, _lvl, SHORT_FILE, UR_STR_(__LINE__), \ +// __VA_ARGS__); \ +// } + #define URLOG_LEGACY_(logger_instance, level, legacy_message, ...) \ { \ - ur_logger_level_t _lvl = logger::str_to_level(UR_STR_LCASE_(level)); \ (logger_instance) \ - .log(legacy_message, _lvl, SHORT_FILE, UR_STR_(__LINE__), \ - __VA_ARGS__); \ + .log(legacy_message, UR_LOGGER_LEVEL_##level, SHORT_FILE, \ + UR_STR_(__LINE__), __VA_ARGS__); \ } #endif /* UR_LOGGER_DETAILS_HPP */ diff --git a/unified-runtime/source/common/umf_helpers.hpp b/unified-runtime/source/common/umf_helpers.hpp index 0e079408f1fc..28003ea5bd6a 100644 --- a/unified-runtime/source/common/umf_helpers.hpp +++ b/unified-runtime/source/common/umf_helpers.hpp @@ -296,7 +296,7 @@ inline ur_result_t umf2urResult(umf_result_t umfResult) { umfMemoryProviderGetLastNativeError(hProvider, &Msg, &Err); if (Msg) { - UR_LOG(Error, "UMF failed with: {}", Msg); + UR_LOG(ERROR, "UMF failed with: {}", Msg); } return getProviderNativeError(umfMemoryProviderGetName(hProvider), Err); diff --git a/unified-runtime/source/common/ur_pool_manager.hpp b/unified-runtime/source/common/ur_pool_manager.hpp index 7e768d9d3a2b..3b7fdfda1f29 100644 --- a/unified-runtime/source/common/ur_pool_manager.hpp +++ b/unified-runtime/source/common/ur_pool_manager.hpp @@ -176,7 +176,7 @@ template struct pool_manager { ur_result_t addPool(const D &desc, unique_pool_handle_t &&hPool) { if (!descToPoolMap.try_emplace(desc, std::move(hPool)).second) { - UR_LOG(Error, "Pool for pool descriptor: {}, already exists", desc); + UR_LOG(ERROR, "Pool for pool descriptor: {}, already exists", desc); return UR_RESULT_ERROR_INVALID_ARGUMENT; } @@ -186,7 +186,7 @@ template struct pool_manager { std::optional getPool(const D &desc) { auto it = descToPoolMap.find(desc); if (it == descToPoolMap.end()) { - UR_LOG(Error, "Pool descriptor doesn't match any existing pool: {}", + UR_LOG(ERROR, "Pool descriptor doesn't match any existing pool: {}", desc); return std::nullopt; } diff --git a/unified-runtime/source/common/ur_util.cpp b/unified-runtime/source/common/ur_util.cpp index 7afd05c443f8..74a8e8511949 100644 --- a/unified-runtime/source/common/ur_util.cpp +++ b/unified-runtime/source/common/ur_util.cpp @@ -45,14 +45,14 @@ int ur_duplicate_fd(int pid, int fd_in) { errno = 0; int pid_fd = syscall(__NR_pidfd_open, pid, 0); if (pid_fd == -1) { - UR_LOG(Error, "__NR_pidfd_open"); + UR_LOG(ERROR, "__NR_pidfd_open"); return -1; } int fd_dup = syscall(__NR_pidfd_getfd, pid_fd, fd_in, 0); close(pid_fd); if (fd_dup == -1) { - UR_LOG(Error, "__NR_pidfd_getfd"); + UR_LOG(ERROR, "__NR_pidfd_getfd"); return -1; } @@ -63,7 +63,7 @@ int ur_duplicate_fd(int pid, int fd_in) { (void)pid; // unused (void)fd_in; // unused errno = ENOTSUP; // unsupported - UR_LOG(Error, "__NR_pidfd_open or __NR_pidfd_getfd not available"); + UR_LOG(ERROR, "__NR_pidfd_open or __NR_pidfd_getfd not available"); return -1; #endif /* defined(__NR_pidfd_open) && defined(__NR_pidfd_getfd) */ } diff --git a/unified-runtime/source/common/windows/ur_lib_loader.cpp b/unified-runtime/source/common/windows/ur_lib_loader.cpp index 962b2c288de4..c4981526de8e 100644 --- a/unified-runtime/source/common/windows/ur_lib_loader.cpp +++ b/unified-runtime/source/common/windows/ur_lib_loader.cpp @@ -17,11 +17,11 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { BOOL res = FreeLibrary(handle); if (!res) { - UR_LOG(Error, + UR_LOG(ERROR, "Failed to unload the library with the handle at address 0x{}", handle); } else { - UR_LOG(Info, "unloaded adapter 0x{}", handle); + UR_LOG(INFO, "unloaded adapter 0x{}", handle); } } } @@ -29,10 +29,10 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { std::unique_ptr LibLoader::loadAdapterLibrary(const char *name) { if (HMODULE handle = LoadLibraryExA(name, nullptr, 0)) { - UR_LOG(Info, "loaded adapter 0x{}: {}", handle, name); + UR_LOG(INFO, "loaded adapter 0x{}: {}", handle, name); return std::unique_ptr{handle}; } else { - UR_LOG(Debug, "loading adapter failed with error {}: {}", GetLastError(), + UR_LOG(DEBUG, "loading adapter failed with error {}: {}", GetLastError(), name); } return nullptr; diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp index d8e3443802f8..9a100cd4bc5a 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_allocator.cpp @@ -18,7 +18,7 @@ namespace ur_sanitizer_layer { namespace asan { void AllocInfo::print() { - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "AllocInfo(Alloc=[{}-{}), User=[{}-{}), AllocSize={}, Type={})", (void *)AllocBegin, (void *)(AllocBegin + AllocSize), (void *)UserBegin, (void *)(UserEnd), AllocSize, ToString(Type)); diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp index 54277a05c80e..d83d10235b91 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp @@ -97,7 +97,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::MEM_BUFFER, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -108,7 +108,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { UR_LOG_L( - getContext()->logger, Error, + getContext()->logger, ERROR, "Failed to copy {} bytes data from host pointer {} to buffer {}", Size, HostPtr, this); return URes; @@ -135,7 +135,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Context, nullptr, &USMDesc, Pool, Size, AllocType::HOST_USM, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to allocate {} bytes host USM for buffer {} migration", Size, this); return URes; @@ -149,7 +149,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to migrate memory buffer data"); return URes; } @@ -161,7 +161,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to migrate memory buffer data"); return URes; } @@ -177,7 +177,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getAsanInterceptor()->releaseMemory(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Failed to free buffer handle {}", + UR_LOG_L(getContext()->logger, ERROR, "Failed to free buffer handle {}", Ptr); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp index b134ff0456ef..45f3d0963231 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp @@ -40,19 +40,19 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getAsanInterceptor()->insertDevice(hDevice, DI)); DI->Type = GetDeviceType(Context, hDevice); if (DI->Type == DeviceType::UNKNOWN) { - UR_LOG_L(getContext()->logger, Error, "Unsupport device"); + UR_LOG_L(getContext()->logger, ERROR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } if (DI->Type != DeviceType) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Different device type in the same context"); return UR_RESULT_ERROR_INVALID_DEVICE; } - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", (void *)DI->Handle, ToString(DI->Type), DI->IsSupportSharedSystemUSM); - UR_LOG_L(getContext()->logger, Info, "Add {} into context {}", + UR_LOG_L(getContext()->logger, INFO, "Add {} into context {}", (void *)DI->Handle, (void *)Context); DI->Shadow = ShadowMemory; CI->DeviceList.emplace_back(hDevice); @@ -113,7 +113,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urUSMHostAlloc"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMHostAlloc"); return getAsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -140,7 +140,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urUSMDeviceAlloc"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMDeviceAlloc"); return getAsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -167,7 +167,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urUSMSharedAlloc"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMSharedAlloc"); return getAsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -186,7 +186,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urUSMFree"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMFree"); return getAsanInterceptor()->releaseMemory(hContext, pMem); } @@ -211,7 +211,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithIL"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithIL"); UR_CALL( pfnProgramCreateWithIL(hContext, pIL, length, pProperties, phProgram)); @@ -247,7 +247,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithBinary"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithBinary"); UR_CALL(pfnProgramCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, pProperties, phProgram)); @@ -274,7 +274,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithNativeHandle"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithNativeHandle"); UR_CALL(pfnProgramCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram)); @@ -295,7 +295,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urProgramRetain"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramRetain"); UR_CALL(pfnRetain(hProgram)); @@ -322,7 +322,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuild"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuild"); auto UrRes = pfnProgramBuild(hContext, hProgram, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -353,7 +353,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuildExp"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuildExp"); auto UrRes = pfnBuildExp(hProgram, numDevices, phDevices, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -385,7 +385,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urProgramLink"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLink"); auto UrRes = pfnProgramLink(hContext, count, phPrograms, pOptions, phProgram); if (UrRes != UR_RESULT_SUCCESS) { @@ -423,7 +423,7 @@ ur_result_t UR_APICALL urProgramLinkExp( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urProgramLinkExp"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLinkExp"); auto UrRes = pfnProgramLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram); @@ -449,7 +449,7 @@ ur_result_t UR_APICALL urProgramRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urProgramRelease"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramRelease"); UR_CALL(pfnProgramRelease(hProgram)); @@ -507,7 +507,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueKernelLaunch"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueKernelLaunch"); LaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue), pGlobalWorkSize, pLocalWorkSize, pGlobalWorkOffset, workDim); @@ -550,7 +550,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urContextCreate"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreate"); ur_result_t result = pfnCreate(numDevices, phDevices, pProperties, phContext); @@ -582,7 +582,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urContextCreateWithNativeHandle"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreateWithNativeHandle"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -605,7 +605,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urContextRetain"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRetain"); UR_CALL(pfnRetain(hContext)); @@ -627,7 +627,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urContextRelease"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRelease"); UR_CALL(pfnRelease(hContext)); @@ -663,7 +663,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferCreate"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferCreate"); void *Host = nullptr; if (pProperties) { @@ -717,7 +717,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urMemGetInfo"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetInfo"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMemory)) { UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); @@ -750,7 +750,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urMemRetain"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRetain"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { MemBuffer->RefCount++; @@ -772,7 +772,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urMemRelease"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRelease"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { if (--MemBuffer->RefCount != 0) { @@ -807,7 +807,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferPartition"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferPartition"); if (auto ParentBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { @@ -838,7 +838,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urMemGetNativeHandle"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetNativeHandle"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { char *Handle = nullptr; @@ -882,7 +882,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferRead"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferRead"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -930,7 +930,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWrite"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWrite"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -992,7 +992,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferReadRect"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferReadRect"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *SrcHandle = nullptr; @@ -1057,7 +1057,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWriteRect"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWriteRect"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *DstHandle = nullptr; @@ -1109,7 +1109,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopy"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopy"); auto SrcBuffer = getAsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getAsanInterceptor()->getMemBuffer(hBufferDst); @@ -1177,7 +1177,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopyRect"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopyRect"); auto SrcBuffer = getAsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getAsanInterceptor()->getMemBuffer(hBufferDst); @@ -1239,7 +1239,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferFill"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferFill"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { char *Handle = nullptr; @@ -1291,7 +1291,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferMap"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferMap"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hBuffer)) { @@ -1378,7 +1378,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemUnmap"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemUnmap"); if (auto MemBuffer = getAsanInterceptor()->getMemBuffer(hMem)) { MemBuffer::Mapping Mapping{}; @@ -1423,7 +1423,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urKernelRetain"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRetain"); UR_CALL(pfnRetain(hKernel)); @@ -1444,7 +1444,7 @@ __urdlllocal ur_result_t urKernelRelease( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urKernelRelease"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRelease"); auto &KernelInfo = getAsanInterceptor()->getOrCreateKernelInfo(hKernel); if (--KernelInfo.RefCount == 0) { @@ -1474,7 +1474,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgValue"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgValue"); std::shared_ptr MemBuffer; if (argSize == sizeof(ur_mem_handle_t) && @@ -1507,7 +1507,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgMemObj"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgMemObj"); std::shared_ptr MemBuffer; if ((MemBuffer = getAsanInterceptor()->getMemBuffer(hArgValue))) { @@ -1538,7 +1538,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgLocal (argIndex={}, argSize={})", argIndex, argSize); @@ -1575,7 +1575,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgPointer (argIndex={}, pArgValue={})", argIndex, pArgValue); @@ -1960,7 +1960,7 @@ template struct NotSupportedApi; template struct NotSupportedApi { R static ReportError(A...) { - UR_LOG_L(getContext()->logger, Error, MsgType::value); + UR_LOG_L(getContext()->logger, ERROR, MsgType::value); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } }; @@ -2151,7 +2151,7 @@ ur_result_t initAsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Initialize ASAN DDI table failed: {}", result); } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp index f5677260da0d..60709a60b413 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp @@ -116,7 +116,7 @@ ur_result_t AsanInterceptor::allocateMemory(ur_context_handle_t Context, UR_CALL(getContext()->urDdiTable.USM.pfnDeviceAlloc( Context, Device, Properties, Pool, NeededSize, &Allocated)); } else { - UR_LOG_L(getContext()->logger, Error, "Unsupport memory type"); + UR_LOG_L(getContext()->logger, ERROR, "Unsupport memory type"); return UR_RESULT_ERROR_INVALID_ARGUMENT; } @@ -224,7 +224,7 @@ ur_result_t AsanInterceptor::releaseMemory(ur_context_handle_t Context, // If quarantine is disabled, USM is freed immediately if (!m_Quarantine) { - UR_LOG_L(getContext()->logger, Debug, "Free: {}", + UR_LOG_L(getContext()->logger, DEBUG, "Free: {}", (void *)AllocInfo->AllocBegin); ContextInfo->Stats.UpdateUSMRealFreed(AllocInfo->AllocSize, @@ -243,7 +243,7 @@ ur_result_t AsanInterceptor::releaseMemory(ur_context_handle_t Context, std::scoped_lock Guard(m_AllocationMapMutex); for (auto &It : ReleaseList) { auto ToFreeAllocInfo = It->second; - UR_LOG_L(getContext()->logger, Info, "Quarantine Free: {}", + UR_LOG_L(getContext()->logger, INFO, "Quarantine Free: {}", (void *)ToFreeAllocInfo->AllocBegin); ContextInfo->Stats.UpdateUSMRealFreed(ToFreeAllocInfo->AllocSize, @@ -271,7 +271,7 @@ ur_result_t AsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(Context, Device); if (!InternalQueue) { - UR_LOG_L(getContext()->logger, Error, "Failed to create internal queue"); + UR_LOG_L(getContext()->logger, ERROR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -431,13 +431,13 @@ AsanInterceptor::updateShadowMemory(std::shared_ptr &ContextInfo, ur_result_t AsanInterceptor::registerProgram(ur_program_handle_t Program) { ur_result_t Result = UR_RESULT_SUCCESS; - UR_LOG_L(getContext()->logger, Info, "registerSpirKernels"); + UR_LOG_L(getContext()->logger, INFO, "registerSpirKernels"); Result = registerSpirKernels(Program); if (Result != UR_RESULT_SUCCESS) { return Result; } - UR_LOG_L(getContext()->logger, Info, "registerDeviceGlobals"); + UR_LOG_L(getContext()->logger, INFO, "registerDeviceGlobals"); Result = registerDeviceGlobals(Program); if (Result != UR_RESULT_SUCCESS) { return Result; @@ -487,7 +487,7 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, &SKInfo[0], MetadataPtr, sizeof(SpirKernelInfo) * NumOfSpirKernel, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Can't read the value of <{}>: {}", + UR_LOG_L(getContext()->logger, ERROR, "Can't read the value of <{}>: {}", kSPIR_AsanSpirKernelMetadata, Result); return Result; } @@ -503,7 +503,7 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, KernelNameV.data(), (void *)SKI.KernelName, sizeof(char) * SKI.Size, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Can't read kernel name: {}", + UR_LOG_L(getContext()->logger, ERROR, "Can't read kernel name: {}", Result); return Result; } @@ -511,12 +511,12 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { std::string KernelName = std::string(KernelNameV.begin(), KernelNameV.end()); - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "SpirKernel(name='{}', isInstrumented={})", KernelName, true); PI->InstrumentedKernels.insert(std::move(KernelName)); } - UR_LOG_L(getContext()->logger, Info, "Number of sanitized kernel: {}", + UR_LOG_L(getContext()->logger, INFO, "Number of sanitized kernel: {}", PI->InstrumentedKernels.size()); } @@ -541,7 +541,7 @@ AsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Device, Program, kSPIR_AsanDeviceGlobalMetadata, &MetadataSize, &MetadataPtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Info, "No device globals"); + UR_LOG_L(getContext()->logger, INFO, "No device globals"); continue; } @@ -553,7 +553,7 @@ AsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Device Global[{}] Read Failed: {}", + UR_LOG_L(getContext()->logger, ERROR, "Device Global[{}] Read Failed: {}", kSPIR_AsanDeviceGlobalMetadata, Result); return Result; } @@ -720,7 +720,7 @@ ur_result_t AsanInterceptor::prepareLaunch( auto PrivateMemoryUsage = GetKernelPrivateMemorySize(Kernel, DeviceInfo->Handle); - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "KernelInfo {} (Name={}, ArgNums={}, IsInstrumented={}, " "LocalMemory={}, PrivateMemory={})", (void *)Kernel, GetKernelName(Kernel), ArgNums, @@ -751,7 +751,7 @@ ur_result_t AsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); @@ -772,7 +772,7 @@ ur_result_t AsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgNums - 1, nullptr, LaunchInfo.Data.getDevicePtr()); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Failed to set launch info: {}", + UR_LOG_L(getContext()->logger, ERROR, "Failed to set launch info: {}", URes); return URes; } @@ -813,15 +813,15 @@ ur_result_t AsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocLocalShadow( Queue, NumWG, LaunchInfo.Data.Host.LocalShadowOffset, LaunchInfo.Data.Host.LocalShadowOffsetEnd) != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Warning, + UR_LOG_L(getContext()->logger, WARN, "Failed to allocate shadow memory for local memory, " "maybe the number of workgroup ({}) is too large", NumWG); - UR_LOG_L(getContext()->logger, Warning, + UR_LOG_L(getContext()->logger, WARN, "Skip checking local memory of kernel <{}>", GetKernelName(Kernel)); } else { - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "ShadowMemory(Local, WorkGroup{}, {} - {})", NumWG, (void *)LaunchInfo.Data.Host.LocalShadowOffset, (void *)LaunchInfo.Data.Host.LocalShadowOffsetEnd); @@ -833,15 +833,15 @@ ur_result_t AsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocPrivateShadow( Queue, NumWG, LaunchInfo.Data.Host.PrivateShadowOffset, LaunchInfo.Data.Host.PrivateShadowOffsetEnd) != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Warning, + UR_LOG_L(getContext()->logger, WARN, "Failed to allocate shadow memory for private memory, " "maybe the number of workgroup ({}) is too large", NumWG); - UR_LOG_L(getContext()->logger, Warning, + UR_LOG_L(getContext()->logger, WARN, "Skip checking private memory of kernel <{}>", GetKernelName(Kernel)); } else { - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "ShadowMemory(Private, WorkGroup{}, {} - {})", NumWG, (void *)LaunchInfo.Data.Host.PrivateShadowOffset, (void *)LaunchInfo.Data.Host.PrivateShadowOffsetEnd); @@ -853,7 +853,7 @@ ur_result_t AsanInterceptor::prepareLaunch( std::vector LocalArgsInfo; for (auto [ArgIndex, ArgInfo] : KernelInfo.LocalArgs) { LocalArgsInfo.push_back(ArgInfo); - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "local_args (argIndex={}, size={}, sizeWithRZ={})", ArgIndex, ArgInfo.Size, ArgInfo.SizeWithRedZone); } @@ -863,7 +863,7 @@ ur_result_t AsanInterceptor::prepareLaunch( // sync asan runtime data to device side UR_CALL(LaunchInfo.Data.syncToDevice(Queue)); - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "LaunchInfo {} (device={}, debug={}, numLocalArgs={}, localArgs={})", (void *)LaunchInfo.Data.getDevicePtr(), ToString(LaunchInfo.Data.Host.DeviceTy), LaunchInfo.Data.Host.Debug, @@ -941,7 +941,7 @@ ur_usm_pool_handle_t ContextInfo::getUSMPool() { getContext()->urDdiTable.USM.pfnPoolCreate(Handle, &Desc, &USMPool); if (URes != UR_RESULT_SUCCESS && URes != UR_RESULT_ERROR_UNSUPPORTED_FEATURE) { - UR_LOG_L(getContext()->logger, Warning, + UR_LOG_L(getContext()->logger, WARN, "Failed to create USM pool, the memory overhead " "may increase: {}", URes); diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp index 938a91b69709..5d5df8bbbe72 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp @@ -185,7 +185,7 @@ struct AsanRuntimeDataWrapper { Context, Device, nullptr, nullptr, sizeof(AsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to alloc device usm for asan runtime data: {}", Result); } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp index e8f83577579c..6108d2ac4bbb 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp @@ -49,7 +49,7 @@ ur_result_t ShadowMemoryCPU::Setup() { auto URes = EnqueuePoisonShadow({}, 0, NullptrRedzoneSize, kNullPointerRedzoneMagic); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "EnqueuePoisonShadow(NullPointerRZ): {}", URes); return URes; } @@ -82,7 +82,7 @@ ur_result_t ShadowMemoryCPU::EnqueuePoisonShadow(ur_queue_handle_t, uptr Ptr, uptr ShadowBegin = MemToShadow(Ptr); uptr ShadowEnd = MemToShadow(Ptr + Size - 1); assert(ShadowBegin <= ShadowEnd); - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={})", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value); @@ -105,7 +105,7 @@ ur_result_t ShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; @@ -120,7 +120,7 @@ ur_result_t ShadowMemoryGPU::Setup() { Result = EnqueuePoisonShadow(Queue, 0, NullptrRedzoneSize, kNullPointerRedzoneMagic); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "EnqueuePoisonShadow(NullPointerRZ): {}", Result); return Result; } @@ -185,7 +185,7 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, &Desc, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "urPhysicalMemCreate(): {}", + UR_LOG_L(getContext()->logger, ERROR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -194,18 +194,18 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "urVirtualMemMap({}, {}): {}", + UR_LOG_L(getContext()->logger, ERROR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } - UR_LOG_L(getContext()->logger, Debug, "urVirtualMemMap: {} ~ {}", + UR_LOG_L(getContext()->logger, DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); // Initialize to zero URes = EnqueueUSMBlockingSet(Queue, (void *)MappedPtr, 0, PageSize); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "EnqueueUSMBlockingSet(): {}", + UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } @@ -217,12 +217,12 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, auto URes = EnqueueUSMBlockingSet(Queue, (void *)ShadowBegin, Value, ShadowEnd - ShadowBegin + 1); - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "EnqueuePoisonShadow (addr={}, count={}, value={}): {}", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value, URes); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "EnqueueUSMBlockingSet(): {}", URes); + UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp index b64f4c4605cb..969b650a2f50 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_statistics.cpp @@ -54,7 +54,7 @@ void AsanStats::Print(ur_context_handle_t Context) { void AsanStats::UpdateUSMMalloced(uptr MallocedSize, uptr RedzoneSize) { UsmMalloced += MallocedSize; UsmMallocedRedzones += RedzoneSize; - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "Stats: UpdateUSMMalloced(UsmMalloced={}, UsmMallocedRedzones={})", UsmMalloced, UsmMallocedRedzones); UpdateOverhead(); @@ -62,7 +62,7 @@ void AsanStats::UpdateUSMMalloced(uptr MallocedSize, uptr RedzoneSize) { void AsanStats::UpdateUSMFreed(uptr FreedSize) { UsmFreed += FreedSize; - UR_LOG_L(getContext()->logger, Debug, "Stats: UpdateUSMFreed(UsmFreed={})", + UR_LOG_L(getContext()->logger, DEBUG, "Stats: UpdateUSMFreed(UsmFreed={})", UsmFreed); } @@ -72,7 +72,7 @@ void AsanStats::UpdateUSMRealFreed(uptr FreedSize, uptr RedzoneSize) { if (getContext()->Options.MaxQuarantineSizeMB) { UsmFreed -= FreedSize; } - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "Stats: UpdateUSMRealFreed(UsmMalloced={}, UsmMallocedRedzones={})", UsmMalloced, UsmMallocedRedzones); UpdateOverhead(); @@ -80,14 +80,14 @@ void AsanStats::UpdateUSMRealFreed(uptr FreedSize, uptr RedzoneSize) { void AsanStats::UpdateShadowMalloced(uptr ShadowSize) { ShadowMalloced += ShadowSize; - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "Stats: UpdateShadowMalloced(ShadowMalloced={})", ShadowMalloced); UpdateOverhead(); } void AsanStats::UpdateShadowFreed(uptr ShadowSize) { ShadowMalloced -= ShadowSize; - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "Stats: UpdateShadowFreed(ShadowMalloced={})", ShadowMalloced); UpdateOverhead(); } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp index 4bebf0f1eed6..42175132c0b9 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_allocator.cpp @@ -18,7 +18,7 @@ namespace ur_sanitizer_layer { namespace msan { void MsanAllocInfo::print() { - UR_LOG_L(getContext()->logger, Info, "AllocInfo(Alloc=[{}-{}), AllocSize={})", + UR_LOG_L(getContext()->logger, INFO, "AllocInfo(Alloc=[{}-{}), AllocSize={})", (void *)AllocBegin, (void *)(AllocBegin + AllocSize), AllocSize); } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp index 5984a66f4b05..dffae3e834fe 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp @@ -137,7 +137,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::DEVICE_USM, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -148,7 +148,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { UR_LOG_L( - getContext()->logger, Error, + getContext()->logger, ERROR, "Failed to copy {} bytes data from host pointer {} to buffer {}", Size, HostPtr, this); return URes; @@ -180,7 +180,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.USM.pfnHostAlloc( Context, &USMDesc, Pool, Size, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to allocate {} bytes host " "USM for buffer {} migration", Size, this); @@ -195,7 +195,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to migrate memory buffer data"); return URes; } @@ -207,7 +207,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to migrate memory buffer data"); return URes; } @@ -223,7 +223,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getContext()->urDdiTable.USM.pfnFree(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Failed to free buffer handle {}", + UR_LOG_L(getContext()->logger, ERROR, "Failed to free buffer handle {}", Ptr); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp index 40f0ccee5b1f..772af80d8222 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp @@ -33,14 +33,14 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getMsanInterceptor()->insertDevice(hDevice, DI)); DI->Type = GetDeviceType(Context, hDevice); if (DI->Type == DeviceType::UNKNOWN) { - UR_LOG_L(getContext()->logger, Error, "Unsupport device"); + UR_LOG_L(getContext()->logger, ERROR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "DeviceInfo {} (Type={}, IsSupportSharedSystemUSM={})", (void *)DI->Handle, ToString(DI->Type), DI->IsSupportSharedSystemUSM); - UR_LOG_L(getContext()->logger, Info, "Add {} into context {}", + UR_LOG_L(getContext()->logger, INFO, "Add {} into context {}", (void *)DI->Handle, (void *)Context); if (!DI->Shadow) { UR_CALL(DI->allocShadowMemory(Context)); @@ -99,7 +99,7 @@ ur_result_t urUSMDeviceAlloc( size_t size, /// [out] pointer to USM device memory object void **ppMem) { - UR_LOG_L(getContext()->logger, Debug, "==== urUSMDeviceAlloc"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMDeviceAlloc"); return getMsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -117,7 +117,7 @@ ur_result_t UR_APICALL urUSMHostAlloc( size, ///< [in] size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM host memory object ) { - UR_LOG_L(getContext()->logger, Debug, "==== urUSMHostAlloc"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMHostAlloc"); return getMsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -136,7 +136,7 @@ ur_result_t UR_APICALL urUSMSharedAlloc( size, ///< [in] size in bytes of the USM memory object to be allocated void **ppMem ///< [out] pointer to USM shared memory object ) { - UR_LOG_L(getContext()->logger, Debug, "==== urUSMSharedAlloc"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMSharedAlloc"); return getMsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -149,7 +149,7 @@ ur_result_t UR_APICALL urUSMFree( ur_context_handle_t hContext, /// [in] pointer to USM memory object void *pMem) { - UR_LOG_L(getContext()->logger, Debug, "==== urUSMFree"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMFree"); return getMsanInterceptor()->releaseMemory(hContext, pMem); } @@ -170,7 +170,7 @@ ur_result_t urProgramCreateWithIL( auto pfnProgramCreateWithIL = getContext()->urDdiTable.Program.pfnCreateWithIL; - UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithIL"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithIL"); UR_CALL( pfnProgramCreateWithIL(hContext, pIL, length, pProperties, phProgram)); @@ -202,7 +202,7 @@ ur_result_t urProgramCreateWithBinary( auto pfnProgramCreateWithBinary = getContext()->urDdiTable.Program.pfnCreateWithBinary; - UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithBinary"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithBinary"); UR_CALL(pfnProgramCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, pProperties, phProgram)); @@ -225,7 +225,7 @@ ur_result_t urProgramCreateWithNativeHandle( auto pfnProgramCreateWithNativeHandle = getContext()->urDdiTable.Program.pfnCreateWithNativeHandle; - UR_LOG_L(getContext()->logger, Debug, "==== urProgramCreateWithNativeHandle"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramCreateWithNativeHandle"); UR_CALL(pfnProgramCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram)); @@ -242,7 +242,7 @@ urProgramRetain(ur_program_handle_t hProgram) { auto pfnRetain = getContext()->urDdiTable.Program.pfnRetain; - UR_LOG_L(getContext()->logger, Debug, "==== urProgramRetain"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramRetain"); UR_CALL(pfnRetain(hProgram)); @@ -264,7 +264,7 @@ ur_result_t urProgramBuild( const char *pOptions) { auto pfnProgramBuild = getContext()->urDdiTable.Program.pfnBuild; - UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuild"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuild"); auto UrRes = pfnProgramBuild(hContext, hProgram, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -291,7 +291,7 @@ ur_result_t urProgramBuildExp( const char *pOptions) { auto pfnBuildExp = getContext()->urDdiTable.ProgramExp.pfnBuildExp; - UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuildExp"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuildExp"); auto UrRes = pfnBuildExp(hProgram, numDevices, phDevices, pOptions); if (UrRes != UR_RESULT_SUCCESS) { @@ -319,7 +319,7 @@ ur_result_t urProgramLink( ur_program_handle_t *phProgram) { auto pfnProgramLink = getContext()->urDdiTable.Program.pfnLink; - UR_LOG_L(getContext()->logger, Debug, "==== urProgramLink"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLink"); auto UrRes = pfnProgramLink(hContext, count, phPrograms, pOptions, phProgram); if (UrRes != UR_RESULT_SUCCESS) { @@ -353,7 +353,7 @@ ur_result_t urProgramLinkExp( ur_program_handle_t *phProgram) { auto pfnProgramLinkExp = getContext()->urDdiTable.ProgramExp.pfnLinkExp; - UR_LOG_L(getContext()->logger, Debug, "==== urProgramLinkExp"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLinkExp"); auto UrRes = pfnProgramLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram); @@ -375,7 +375,7 @@ ur_result_t urProgramRelease( ur_program_handle_t hProgram) { auto pfnProgramRelease = getContext()->urDdiTable.Program.pfnRelease; - UR_LOG_L(getContext()->logger, Debug, "==== urProgramRelease"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramRelease"); UR_CALL(pfnProgramRelease(hProgram)); @@ -423,7 +423,7 @@ ur_result_t urEnqueueKernelLaunch( ur_event_handle_t *phEvent) { auto pfnKernelLaunch = getContext()->urDdiTable.Enqueue.pfnKernelLaunch; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueKernelLaunch"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueKernelLaunch"); USMLaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue), pGlobalWorkSize, pLocalWorkSize, pGlobalWorkOffset, @@ -463,7 +463,7 @@ ur_result_t urContextCreate( ur_context_handle_t *phContext) { auto pfnCreate = getContext()->urDdiTable.Context.pfnCreate; - UR_LOG_L(getContext()->logger, Debug, "==== urContextCreate"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreate"); ur_result_t result = pfnCreate(numDevices, phDevices, pProperties, phContext); @@ -491,7 +491,7 @@ ur_result_t urContextCreateWithNativeHandle( auto pfnCreateWithNativeHandle = getContext()->urDdiTable.Context.pfnCreateWithNativeHandle; - UR_LOG_L(getContext()->logger, Debug, "==== urContextCreateWithNativeHandle"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreateWithNativeHandle"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -511,7 +511,7 @@ ur_result_t urContextRetain( ur_context_handle_t hContext) { auto pfnRetain = getContext()->urDdiTable.Context.pfnRetain; - UR_LOG_L(getContext()->logger, Debug, "==== urContextRetain"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRetain"); UR_CALL(pfnRetain(hContext)); @@ -529,7 +529,7 @@ ur_result_t urContextRelease( ur_context_handle_t hContext) { auto pfnRelease = getContext()->urDdiTable.Context.pfnRelease; - UR_LOG_L(getContext()->logger, Debug, "==== urContextRelease"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRelease"); UR_CALL(pfnRelease(hContext)); @@ -559,7 +559,7 @@ ur_result_t urMemBufferCreate( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferCreate"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferCreate"); void *Host = nullptr; if (pProperties) { @@ -615,7 +615,7 @@ ur_result_t urMemGetInfo( size_t *pPropSizeRet) { auto pfnGetInfo = getContext()->urDdiTable.Mem.pfnGetInfo; - UR_LOG_L(getContext()->logger, Debug, "==== urMemGetInfo"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetInfo"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMemory)) { UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); @@ -644,7 +644,7 @@ ur_result_t urMemRetain( ur_mem_handle_t hMem) { auto pfnRetain = getContext()->urDdiTable.Mem.pfnRetain; - UR_LOG_L(getContext()->logger, Debug, "==== urMemRetain"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRetain"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { MemBuffer->RefCount++; @@ -662,7 +662,7 @@ ur_result_t urMemRelease( ur_mem_handle_t hMem) { auto pfnRelease = getContext()->urDdiTable.Mem.pfnRelease; - UR_LOG_L(getContext()->logger, Debug, "==== urMemRelease"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRelease"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { if (--MemBuffer->RefCount != 0) { @@ -693,7 +693,7 @@ ur_result_t urMemBufferPartition( ur_mem_handle_t *phMem) { auto pfnBufferPartition = getContext()->urDdiTable.Mem.pfnBufferPartition; - UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferPartition"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferPartition"); if (auto ParentBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { @@ -720,7 +720,7 @@ ur_result_t urMemGetNativeHandle( ur_native_handle_t *phNativeMem) { auto pfnGetNativeHandle = getContext()->urDdiTable.Mem.pfnGetNativeHandle; - UR_LOG_L(getContext()->logger, Debug, "==== urMemGetNativeHandle"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetNativeHandle"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { char *Handle = nullptr; @@ -760,7 +760,7 @@ ur_result_t urEnqueueMemBufferRead( ur_event_handle_t *phEvent) { auto pfnMemBufferRead = getContext()->urDdiTable.Enqueue.pfnMemBufferRead; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferRead"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferRead"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -804,7 +804,7 @@ ur_result_t urEnqueueMemBufferWrite( ur_event_handle_t *phEvent) { auto pfnMemBufferWrite = getContext()->urDdiTable.Enqueue.pfnMemBufferWrite; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWrite"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWrite"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -881,7 +881,7 @@ ur_result_t urEnqueueMemBufferReadRect( auto pfnMemBufferReadRect = getContext()->urDdiTable.Enqueue.pfnMemBufferReadRect; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferReadRect"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferReadRect"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *SrcHandle = nullptr; @@ -942,7 +942,7 @@ ur_result_t urEnqueueMemBufferWriteRect( auto pfnMemBufferWriteRect = getContext()->urDdiTable.Enqueue.pfnMemBufferWriteRect; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWriteRect"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWriteRect"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *DstHandle = nullptr; @@ -990,7 +990,7 @@ ur_result_t urEnqueueMemBufferCopy( ur_event_handle_t *phEvent) { auto pfnMemBufferCopy = getContext()->urDdiTable.Enqueue.pfnMemBufferCopy; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopy"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopy"); auto SrcBuffer = getMsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getMsanInterceptor()->getMemBuffer(hBufferDst); @@ -1075,7 +1075,7 @@ ur_result_t urEnqueueMemBufferCopyRect( auto pfnMemBufferCopyRect = getContext()->urDdiTable.Enqueue.pfnMemBufferCopyRect; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopyRect"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopyRect"); auto SrcBuffer = getMsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getMsanInterceptor()->getMemBuffer(hBufferDst); @@ -1132,7 +1132,7 @@ ur_result_t urEnqueueMemBufferFill( ur_event_handle_t *phEvent) { auto pfnMemBufferFill = getContext()->urDdiTable.Enqueue.pfnMemBufferFill; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferFill"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferFill"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { char *Handle = nullptr; @@ -1199,7 +1199,7 @@ ur_result_t urEnqueueMemBufferMap( void **ppRetMap) { auto pfnMemBufferMap = getContext()->urDdiTable.Enqueue.pfnMemBufferMap; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferMap"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferMap"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hBuffer)) { @@ -1281,7 +1281,7 @@ ur_result_t urEnqueueMemUnmap( ur_event_handle_t *phEvent) { auto pfnMemUnmap = getContext()->urDdiTable.Enqueue.pfnMemUnmap; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemUnmap"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemUnmap"); if (auto MemBuffer = getMsanInterceptor()->getMemBuffer(hMem)) { MemBuffer::Mapping Mapping{}; @@ -1322,7 +1322,7 @@ ur_result_t urKernelRetain( ur_kernel_handle_t hKernel) { auto pfnRetain = getContext()->urDdiTable.Kernel.pfnRetain; - UR_LOG_L(getContext()->logger, Debug, "==== urKernelRetain"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRetain"); UR_CALL(pfnRetain(hKernel)); @@ -1339,7 +1339,7 @@ ur_result_t urKernelRelease( ur_kernel_handle_t hKernel) { auto pfnRelease = getContext()->urDdiTable.Kernel.pfnRelease; - UR_LOG_L(getContext()->logger, Debug, "==== urKernelRelease"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRelease"); auto &KernelInfo = getMsanInterceptor()->getOrCreateKernelInfo(hKernel); if (--KernelInfo.RefCount == 0) { @@ -1365,7 +1365,7 @@ ur_result_t urKernelSetArgValue( const void *pArgValue) { auto pfnSetArgValue = getContext()->urDdiTable.Kernel.pfnSetArgValue; - UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgValue"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgValue"); std::shared_ptr MemBuffer; if (argSize == sizeof(ur_mem_handle_t) && @@ -1394,7 +1394,7 @@ ur_result_t urKernelSetArgMemObj( ur_mem_handle_t hArgValue) { auto pfnSetArgMemObj = getContext()->urDdiTable.Kernel.pfnSetArgMemObj; - UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgMemObj"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgMemObj"); std::shared_ptr MemBuffer; std::shared_ptr KernelInfo; @@ -1422,7 +1422,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( const ur_kernel_arg_local_properties_t *pProperties) { auto pfnSetArgLocal = getContext()->urDdiTable.Kernel.pfnSetArgLocal; - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgLocal (argIndex={}, argSize={})", argIndex, argSize); @@ -1461,7 +1461,7 @@ ur_result_t UR_APICALL urEnqueueUSMFill( /// must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMFill = getContext()->urDdiTable.Enqueue.pfnUSMFill; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueUSMFill"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueUSMFill"); std::vector Events; ur_event_handle_t Event{}; @@ -1517,7 +1517,7 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy( /// must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMMemcpy = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueUSMMemcpy"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueUSMMemcpy"); std::vector Events; ur_event_handle_t Event{}; @@ -1594,7 +1594,7 @@ ur_result_t UR_APICALL urEnqueueUSMFill2D( /// phEvent must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMFill2D = getContext()->urDdiTable.Enqueue.pfnUSMFill2D; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueUSMFill2D"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueUSMFill2D"); std::vector Events; ur_event_handle_t Event{}; @@ -1658,7 +1658,7 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( /// phEvent must not refer to an element of the phEventWaitList array. ur_event_handle_t *phEvent) { auto pfnUSMMemcpy2D = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy2D; - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueUSMMemcpy2D"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueUSMMemcpy2D"); std::vector Events; ur_event_handle_t Event{}; @@ -1948,7 +1948,7 @@ ur_result_t initMsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Initialize MSAN DDI table failed: {}", result); } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp index 0cf570c1e9ee..2dcf20a5d395 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp @@ -125,7 +125,7 @@ ur_result_t MsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(Context, Device); if (!InternalQueue) { - UR_LOG_L(getContext()->logger, Error, "Failed to create internal queue"); + UR_LOG_L(getContext()->logger, ERROR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -160,13 +160,13 @@ ur_result_t MsanInterceptor::postLaunchKernel(ur_kernel_handle_t Kernel, ur_result_t MsanInterceptor::registerProgram(ur_program_handle_t Program) { ur_result_t Result = UR_RESULT_SUCCESS; - UR_LOG_L(getContext()->logger, Info, "registerSpirKernels"); + UR_LOG_L(getContext()->logger, INFO, "registerSpirKernels"); Result = registerSpirKernels(Program); if (Result != UR_RESULT_SUCCESS) { return Result; } - UR_LOG_L(getContext()->logger, Info, "registerDeviceGlobals"); + UR_LOG_L(getContext()->logger, INFO, "registerDeviceGlobals"); Result = registerDeviceGlobals(Program); if (Result != UR_RESULT_SUCCESS) { return Result; @@ -205,7 +205,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, &SKInfo[0], MetadataPtr, sizeof(SpirKernelInfo) * NumOfSpirKernel, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Can't read the value of <{}>: {}", + UR_LOG_L(getContext()->logger, ERROR, "Can't read the value of <{}>: {}", kSPIR_MsanSpirKernelMetadata, Result); return Result; } @@ -220,7 +220,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, KernelNameV.data(), (void *)SKI.KernelName, sizeof(char) * SKI.Size, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Can't read kernel name: {}", + UR_LOG_L(getContext()->logger, ERROR, "Can't read kernel name: {}", Result); return Result; } @@ -228,7 +228,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { std::string KernelName = std::string(KernelNameV.begin(), KernelNameV.end()); - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "SpirKernel(name='{}', isInstrumented={}, " "checkLocals={}, checkPrivates={})", KernelName, true, (bool)SKI.CheckLocals, @@ -237,7 +237,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { PI->KernelMetadataMap[KernelName] = ProgramInfo::KernelMetada{ (bool)SKI.CheckLocals, (bool)SKI.CheckPrivates}; } - UR_LOG_L(getContext()->logger, Info, "Number of sanitized kernel: {}", + UR_LOG_L(getContext()->logger, INFO, "Number of sanitized kernel: {}", PI->KernelMetadataMap.size()); } @@ -262,7 +262,7 @@ MsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Device, Program, kSPIR_MsanDeviceGlobalMetadata, &MetadataSize, &MetadataPtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Info, "No device globals"); + UR_LOG_L(getContext()->logger, INFO, "No device globals"); continue; } @@ -274,7 +274,7 @@ MsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Device Global[{}] Read Failed: {}", + UR_LOG_L(getContext()->logger, ERROR, "Device Global[{}] Read Failed: {}", kSPIR_MsanDeviceGlobalMetadata, Result); return Result; } @@ -441,7 +441,7 @@ ur_result_t MsanInterceptor::prepareLaunch( auto Result = getContext()->urDdiTable.Enqueue.pfnDeviceGlobalVariableWrite( Queue, Program, Name, false, Size, 0, Value, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to write device global \"{}\": {}", Name, Result); return Result; } @@ -450,7 +450,7 @@ ur_result_t MsanInterceptor::prepareLaunch( // Set membuffer arguments auto &KernelInfo = getOrCreateKernelInfo(Kernel); - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "KernelInfo {} (Name=<{}>, IsInstrumented={}, " "IsCheckLocals={}, IsCheckPrivates={})", (void *)Kernel, GetKernelName(Kernel), KernelInfo.IsInstrumented, @@ -464,7 +464,7 @@ ur_result_t MsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); @@ -522,15 +522,15 @@ ur_result_t MsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocLocalShadow( Queue, NumWG, LaunchInfo.Data.Host.LocalShadowOffset, LaunchInfo.Data.Host.LocalShadowOffsetEnd) != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Warning, + UR_LOG_L(getContext()->logger, WARN, "Failed to allocate shadow memory for local memory, " "maybe the number of workgroup ({}) is too large", NumWG); - UR_LOG_L(getContext()->logger, Warning, + UR_LOG_L(getContext()->logger, WARN, "Skip checking local memory of kernel <{}> ", GetKernelName(Kernel)); } else { - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "ShadowMemory(Local, WorkGroup={}, {} - {})", NumWG, (void *)LaunchInfo.Data.Host.LocalShadowOffset, (void *)LaunchInfo.Data.Host.LocalShadowOffsetEnd); @@ -542,15 +542,15 @@ ur_result_t MsanInterceptor::prepareLaunch( if (DeviceInfo->Shadow->AllocPrivateShadow( Queue, NumWG, LaunchInfo.Data.Host.PrivateShadowOffset, LaunchInfo.Data.Host.PrivateShadowOffsetEnd) != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Warning, + UR_LOG_L(getContext()->logger, WARN, "Failed to allocate shadow memory for private memory, " "maybe the number of workgroup ({}) is too large", NumWG); - UR_LOG_L(getContext()->logger, Warning, + UR_LOG_L(getContext()->logger, WARN, "Skip checking private memory of kernel <{}>", GetKernelName(Kernel)); } else { - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "ShadowMemory(Private, WorkGroup={}, {} - {})", NumWG, (void *)LaunchInfo.Data.Host.PrivateShadowOffset, (void *)LaunchInfo.Data.Host.PrivateShadowOffsetEnd); @@ -560,7 +560,7 @@ ur_result_t MsanInterceptor::prepareLaunch( std::vector LocalArgsInfo; for (auto [ArgIndex, ArgInfo] : KernelInfo.LocalArgs) { LocalArgsInfo.push_back(ArgInfo); - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "LocalArgs (argIndex={}, size={})", ArgIndex, ArgInfo.Size); } UR_CALL(LaunchInfo.Data.importLocalArgsInfo(Queue, LocalArgsInfo)); @@ -571,7 +571,7 @@ ur_result_t MsanInterceptor::prepareLaunch( UR_CALL(LaunchInfo.Data.syncToDevice(Queue)); UR_LOG_L( - getContext()->logger, Info, + getContext()->logger, INFO, "LaunchInfo {} (GlobalShadow={}, LocalShadow={}, PrivateShadow={}, " "CleanShadow={}, LocalArgs={}, NumLocalArgs={}, Device={}, Debug={})", (void *)LaunchInfo.Data.getDevicePtr(), @@ -585,7 +585,7 @@ ur_result_t MsanInterceptor::prepareLaunch( ur_result_t URes = EnqueueWriteGlobal( "__MsanLaunchInfo", &LaunchInfo.Data.DevicePtr, sizeof(uptr)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "EnqueueWriteGlobal(__MsanLaunchInfo) " "failed, maybe empty kernel: {}", URes); @@ -630,7 +630,7 @@ ur_result_t DeviceInfo::allocShadowMemory(ur_context_handle_t Context) { Shadow = GetMsanShadowMemory(Context, Handle, Type); assert(Shadow && "Failed to get shadow memory"); UR_CALL(Shadow->Setup()); - UR_LOG_L(getContext()->logger, Info, "ShadowMemory(Global): {} - {}", + UR_LOG_L(getContext()->logger, INFO, "ShadowMemory(Global): {} - {}", (void *)Shadow->ShadowBegin, (void *)Shadow->ShadowEnd); return UR_RESULT_SUCCESS; } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.hpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.hpp index 5b0daac4c3e4..e057926aaccc 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.hpp @@ -168,7 +168,7 @@ struct MsanRuntimeDataWrapper { Context, Device, nullptr, nullptr, sizeof(MsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to alloc device usm for msan runtime data: {}", Result); } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp index d669aaca8c25..4f304021fbe1 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp @@ -45,7 +45,7 @@ GetMsanShadowMemory(ur_context_handle_t Context, ur_device_handle_t Device, std::make_shared(Context, Device); return ShadowDG2; } else { - UR_LOG_L(getContext()->logger, Error, "Unsupport device type"); + UR_LOG_L(getContext()->logger, ERROR, "Unsupport device type"); return nullptr; } } @@ -118,7 +118,7 @@ ur_result_t MsanShadowMemoryCPU::EnqueuePoisonShadow( const uptr ShadowBegin = MemToShadow(Ptr); const uptr ShadowEnd = MemToShadow(Ptr + Size - 1); assert(ShadowBegin <= ShadowEnd); - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={})", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value); @@ -147,7 +147,7 @@ ur_result_t MsanShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; @@ -193,7 +193,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, nullptr, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "urPhysicalMemCreate(): {}", + UR_LOG_L(getContext()->logger, ERROR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -202,12 +202,12 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "urVirtualMemMap({}, {}): {}", + UR_LOG_L(getContext()->logger, ERROR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } - UR_LOG_L(getContext()->logger, Debug, "urVirtualMemMap: {} ~ {}", + UR_LOG_L(getContext()->logger, DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); // Initialize to zero @@ -215,7 +215,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( EventWaitList.size(), EventWaitList.data(), OutEvent); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "EnqueueUSMSet(): {}", URes); + UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMSet(): {}", URes); return URes; } @@ -259,7 +259,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueuePoisonShadow( ShadowEnd - ShadowBegin + 1, Events.size(), Events.data(), OutEvent); - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "EnqueuePoisonShadow(addr={}, count={}, value={}): {}", (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value, Result); @@ -287,7 +287,7 @@ MsanShadowMemoryGPU::ReleaseShadow(std::shared_ptr AI) { Context, (void *)MappedPtr, PageSize)); UR_CALL(getContext()->urDdiTable.PhysicalMem.pfnRelease( VirtualMemMaps[MappedPtr].first)); - UR_LOG_L(getContext()->logger, Debug, "urVirtualMemUnmap: {} ~ {}", + UR_LOG_L(getContext()->logger, DEBUG, "urVirtualMemUnmap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); } } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp index 5dbfc508a268..2c1e55e202b2 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp @@ -67,12 +67,12 @@ bool DontCoredumpRange(uptr Addr, uptr Size) { void *GetMemFunctionPointer(const char *FuncName) { void *handle = dlopen(LIBC_SO, RTLD_LAZY | RTLD_NOLOAD); if (!handle) { - UR_LOG_L(getContext()->logger, Error, "Failed to dlopen {}", LIBC_SO); + UR_LOG_L(getContext()->logger, ERROR, "Failed to dlopen {}", LIBC_SO); return nullptr; } auto ptr = dlsym(handle, FuncName); if (!ptr) { - UR_LOG_L(getContext()->logger, Error, "Failed to get '{}' from {}", + UR_LOG_L(getContext()->logger, ERROR, "Failed to get '{}' from {}", FuncName, LIBC_SO); } return ptr; diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp index 9584cae9bdf0..362bf6ed778d 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options.cpp @@ -29,7 +29,7 @@ void SanitizerOptions::Init(const std::string &EnvName, std::stringstream SS; SS << "[ERROR]: "; SS << e.what(); - UR_LOG_L(Logger, Quiet, SS.str().c_str()); + UR_LOG_L(Logger, QUIET, SS.str().c_str()); die("Sanitizer failed to parse options.\n"); } @@ -52,7 +52,7 @@ void SanitizerOptions::Init(const std::string &EnvName, MinRZSize = IsPowerOfTwo(MinRZSize) ? MinRZSize : RoundUpToPowerOfTwo(MinRZSize); if (MinRZSize > 16) { - UR_LOG_L(Logger, Warning, + UR_LOG_L(Logger, WARN, "Increasing the redzone size may cause excessive memory overhead"); } } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp index 18ea68440a7f..e7f712ead5b2 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp @@ -72,7 +72,7 @@ struct OptionParser { SS << " \"" << S << "\""; } SS << "."; - UR_LOG_L(Logger, Error, SS.str().c_str()); + UR_LOG_L(Logger, ERROR, SS.str().c_str()); die("Sanitizer failed to parse options.\n"); } } @@ -93,13 +93,13 @@ struct OptionParser { uint64_t Value = std::stoul(ValueStr.c_str()); if (Value < Min) { - UR_LOG_L(Logger, Warning, + UR_LOG_L(Logger, WARN, "The valid range of \"{}\" is [{}, {}]. " "Setting to the minimum value {}.", Name, Min, Max, Min); Result = Min; } else if (Value > Max) { - UR_LOG_L(Logger, Warning, + UR_LOG_L(Logger, WARN, "The valid range of \"{}\" is [{}, {}]. " "Setting to the maximum value {}.", Name, Min, Max, Max); @@ -108,7 +108,7 @@ struct OptionParser { Result = Value; } } catch (...) { - UR_LOG_L(Logger, Error, + UR_LOG_L(Logger, ERROR, "The valid range of \"{}\" is [{}, {}]. Failed " "to parse the value \"{}\".", Name, Min, Max, ValueStr); diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp index 4328dc2dd6e5..d9ff5b89c107 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp @@ -22,16 +22,16 @@ ManagedQueue::ManagedQueue(ur_context_handle_t Context, [[maybe_unused]] auto Result = getContext()->urDdiTable.Queue.pfnCreate( Context, Device, nullptr, &Handle); assert(Result == UR_RESULT_SUCCESS && "Failed to create ManagedQueue"); - UR_LOG_L(getContext()->logger, Debug, ">>> ManagedQueue {}", (void *)Handle); + UR_LOG_L(getContext()->logger, DEBUG, ">>> ManagedQueue {}", (void *)Handle); } ManagedQueue::~ManagedQueue() { - UR_LOG_L(getContext()->logger, Debug, "<<< ~ManagedQueue {}", (void *)Handle); + UR_LOG_L(getContext()->logger, DEBUG, "<<< ~ManagedQueue {}", (void *)Handle); [[maybe_unused]] ur_result_t Result; Result = getContext()->urDdiTable.Queue.pfnFinish(Handle); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Failed to finish ManagedQueue: {}", + UR_LOG_L(getContext()->logger, ERROR, "Failed to finish ManagedQueue: {}", Result); } assert(Result == UR_RESULT_SUCCESS && "Failed to finish ManagedQueue"); @@ -150,7 +150,7 @@ DeviceType GetDeviceType(ur_context_handle_t Context, [[maybe_unused]] ur_result_t Result = getContext()->urDdiTable.USM.pfnDeviceAlloc(Context, Device, nullptr, nullptr, 4, (void **)&Ptr); - UR_LOG_L(getContext()->logger, Debug, "GetDeviceType: {}", (void *)Ptr); + UR_LOG_L(getContext()->logger, DEBUG, "GetDeviceType: {}", (void *)Ptr); assert(Result == UR_RESULT_SUCCESS && "getDeviceType() failed at allocating device USM"); // FIXME: There's no API querying the address bits of device, so we guess it @@ -259,7 +259,7 @@ ur_result_t EnqueueUSMBlockingSet(ur_queue_handle_t Queue, void *Ptr, void PrintUrBuildLog(ur_program_handle_t hProgram, ur_device_handle_t *phDevices, size_t numDevices) { - UR_LOG_L(getContext()->logger, Error, "Printing build log for program {}", + UR_LOG_L(getContext()->logger, ERROR, "Printing build log for program {}", (void *)hProgram); for (size_t i = 0; i < numDevices; i++) { std::vector LogBuf; @@ -269,7 +269,7 @@ void PrintUrBuildLog(ur_program_handle_t hProgram, auto UrRes = getContext()->urDdiTable.Program.pfnGetBuildInfo( hProgram, hDevice, UR_PROGRAM_BUILD_INFO_LOG, 0, nullptr, &LogSize); if (UrRes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "For device {}: failed to get build log size.", (void *)hDevice); continue; } @@ -279,12 +279,12 @@ void PrintUrBuildLog(ur_program_handle_t hProgram, hProgram, hDevice, UR_PROGRAM_BUILD_INFO_LOG, LogSize, LogBuf.data(), nullptr); if (UrRes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "For device {}: failed to get build log.", (void *)hDevice); continue; } - UR_LOG_L(getContext()->logger, Error, "For device {}:\n{}", (void *)hDevice, + UR_LOG_L(getContext()->logger, ERROR, "For device {}:\n{}", (void *)hDevice, LogBuf.data()); } } diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp index 6b211e745e15..9b88941143b2 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp @@ -105,7 +105,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::DEVICE_USM, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -115,7 +115,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to copy {} bytes data from host " "pointer {} to buffer {}", Size, HostPtr, this); @@ -142,7 +142,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.USM.pfnHostAlloc( Context, &USMDesc, Pool, Size, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to allocate {} bytes host " "USM for buffer {} migration", Size, this); @@ -157,7 +157,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to migrate memory buffer data"); return URes; } @@ -169,7 +169,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to migrate memory buffer data"); return URes; } @@ -185,7 +185,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getContext()->urDdiTable.USM.pfnFree(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Failed to free buffer handle {}", + UR_LOG_L(getContext()->logger, ERROR, "Failed to free buffer handle {}", Ptr); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp index 9136c8b5a883..348d8304af49 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp @@ -31,7 +31,7 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getTsanInterceptor()->insertDevice(phDevices[i], DI)); DI->Type = GetDeviceType(Context, DI->Handle); if (DI->Type == DeviceType::UNKNOWN) { - UR_LOG_L(getContext()->logger, Error, "Unsupport device"); + UR_LOG_L(getContext()->logger, ERROR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } if (!DI->Shadow) @@ -54,7 +54,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( const ur_context_properties_t *pProperties, /// [out] pointer to handle of context object created ur_context_handle_t *phContext) { - UR_LOG_L(getContext()->logger, Debug, "==== urContextCreate"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreate"); UR_CALL(getContext()->urDdiTable.Context.pfnCreate(numDevices, phDevices, pProperties, phContext)); @@ -78,7 +78,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( const ur_context_native_properties_t *pProperties, /// [out] pointer to the handle of the context object created. ur_context_handle_t *phContext) { - UR_LOG_L(getContext()->logger, Debug, "==== urContextCreateWithNativeHandle"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextCreateWithNativeHandle"); UR_CALL(getContext()->urDdiTable.Context.pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext)); @@ -94,13 +94,13 @@ ur_result_t urContextRetain( /// [in] handle of the context to get a reference of. ur_context_handle_t hContext) { - UR_LOG_L(getContext()->logger, Debug, "==== urContextRetain"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRetain"); UR_CALL(getContext()->urDdiTable.Context.pfnRetain(hContext)); auto ContextInfo = getTsanInterceptor()->getContextInfo(hContext); if (!ContextInfo) { - UR_LOG_L(getContext()->logger, Error, "Invalid context"); + UR_LOG_L(getContext()->logger, ERROR, "Invalid context"); return UR_RESULT_ERROR_INVALID_CONTEXT; } ContextInfo->RefCount++; @@ -113,13 +113,13 @@ ur_result_t urContextRetain( ur_result_t urContextRelease( /// [in] handle of the context to release. ur_context_handle_t hContext) { - UR_LOG_L(getContext()->logger, Debug, "==== urContextRelease"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urContextRelease"); UR_CALL(getContext()->urDdiTable.Context.pfnRelease(hContext)); auto ContextInfo = getTsanInterceptor()->getContextInfo(hContext); if (!ContextInfo) { - UR_LOG_L(getContext()->logger, Error, "Invalid context"); + UR_LOG_L(getContext()->logger, ERROR, "Invalid context"); return UR_RESULT_ERROR_INVALID_CONTEXT; } @@ -138,7 +138,7 @@ ur_result_t urProgramBuild( ur_program_handle_t hProgram, /// [in] string of build options const char *pOptions) { - UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuild"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuild"); UR_CALL( getContext()->urDdiTable.Program.pfnBuild(hContext, hProgram, pOptions)); @@ -161,7 +161,7 @@ ur_result_t urProgramLink( const char *pOptions, /// [out] pointer to handle of program object created. ur_program_handle_t *phProgram) { - UR_LOG_L(getContext()->logger, Debug, "==== urProgramLink"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLink"); UR_CALL(getContext()->urDdiTable.Program.pfnLink(hContext, count, phPrograms, pOptions, phProgram)); @@ -182,7 +182,7 @@ ur_result_t urProgramBuildExp( ur_device_handle_t *phDevices, /// [in][optional] pointer to build options null-terminated string. const char *pOptions) { - UR_LOG_L(getContext()->logger, Debug, "==== urProgramBuildExp"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramBuildExp"); UR_CALL(getContext()->urDdiTable.ProgramExp.pfnBuildExp(hProgram, numDevices, phDevices, pOptions)); @@ -207,7 +207,7 @@ ur_result_t urProgramLinkExp( const char *pOptions, /// [out] pointer to handle of program object created. ur_program_handle_t *phProgram) { - UR_LOG_L(getContext()->logger, Debug, "==== urProgramLinkExp"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urProgramLinkExp"); UR_CALL(getContext()->urDdiTable.ProgramExp.pfnLinkExp( hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram)); @@ -234,7 +234,7 @@ ur_result_t urMemBufferCreate( return UR_RESULT_ERROR_INVALID_NULL_POINTER; } - UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferCreate"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferCreate"); void *Host = nullptr; if (pProperties) { @@ -270,7 +270,7 @@ ur_result_t urMemBufferCreate( ur_result_t urMemRetain( /// [in] handle of the memory object to get access ur_mem_handle_t hMem) { - UR_LOG_L(getContext()->logger, Debug, "==== urMemRetain"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRetain"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { MemBuffer->RefCount++; @@ -286,7 +286,7 @@ ur_result_t urMemRetain( ur_result_t urMemRelease( /// [in] handle of the memory object to release ur_mem_handle_t hMem) { - UR_LOG_L(getContext()->logger, Debug, "==== urMemRelease"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemRelease"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { if (--MemBuffer->RefCount != 0) { @@ -315,7 +315,7 @@ ur_result_t urMemBufferPartition( const ur_buffer_region_t *pRegion, /// [out] pointer to the handle of sub buffer created ur_mem_handle_t *phMem) { - UR_LOG_L(getContext()->logger, Debug, "==== urMemBufferPartition"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemBufferPartition"); if (auto ParentBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { if (ParentBuffer->Size < (pRegion->origin + pRegion->size)) { @@ -340,7 +340,7 @@ ur_result_t urMemGetNativeHandle( ur_mem_handle_t hMem, ur_device_handle_t hDevice, /// [out] a pointer to the native handle of the mem. ur_native_handle_t *phNativeMem) { - UR_LOG_L(getContext()->logger, Debug, "==== urMemGetNativeHandle"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetNativeHandle"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { char *Handle = nullptr; @@ -371,7 +371,7 @@ ur_result_t urMemGetInfo( /// [out][optional] pointer to the actual size in bytes of the queried /// propName. size_t *pPropSizeRet) { - UR_LOG_L(getContext()->logger, Debug, "==== urMemGetInfo"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urMemGetInfo"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMemory)) { UrReturnHelper ReturnValue(propSize, pPropValue, pPropSizeRet); @@ -419,7 +419,7 @@ ur_result_t urEnqueueMemBufferRead( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferRead"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferRead"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -462,7 +462,7 @@ ur_result_t urEnqueueMemBufferWrite( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWrite"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWrite"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { ur_device_handle_t Device = GetDevice(hQueue); @@ -525,7 +525,7 @@ ur_result_t urEnqueueMemBufferReadRect( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferReadRect"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferReadRect"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { char *SrcHandle = nullptr; @@ -583,7 +583,7 @@ ur_result_t urEnqueueMemBufferWriteRect( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferWriteRect"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferWriteRect"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { char *DstHandle = nullptr; @@ -629,7 +629,7 @@ ur_result_t urEnqueueMemBufferCopy( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopy"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopy"); auto SrcBuffer = getTsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getTsanInterceptor()->getMemBuffer(hBufferDst); @@ -700,7 +700,7 @@ ur_result_t urEnqueueMemBufferCopyRect( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferCopyRect"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferCopyRect"); auto SrcBuffer = getTsanInterceptor()->getMemBuffer(hBufferSrc); auto DstBuffer = getTsanInterceptor()->getMemBuffer(hBufferDst); @@ -755,7 +755,7 @@ ur_result_t urEnqueueMemBufferFill( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferFill"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferFill"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { char *Handle = nullptr; @@ -809,7 +809,7 @@ ur_result_t urEnqueueMemBufferMap( ur_event_handle_t *phEvent, /// [out] return mapped pointer. TODO: move it before numEventsInWaitList? void **ppRetMap) { - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemBufferMap"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemBufferMap"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hBuffer)) { // Translate the host access mode info. @@ -888,7 +888,7 @@ ur_result_t urEnqueueMemUnmap( /// [out][optional] return an event object that identifies this particular /// command instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueMemUnmap"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueMemUnmap"); if (auto MemBuffer = getTsanInterceptor()->getMemBuffer(hMem)) { MemBuffer::Mapping Mapping{}; @@ -932,7 +932,7 @@ ur_result_t UR_APICALL urKernelCreate( const char *pKernelName, /// [out][alloc] pointer to handle of kernel object created. ur_kernel_handle_t *phKernel) { - UR_LOG_L(getContext()->logger, Debug, "==== urKernelCreate"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelCreate"); UR_CALL(getContext()->urDdiTable.Kernel.pfnCreate(hProgram, pKernelName, phKernel)); @@ -952,7 +952,7 @@ ur_result_t UR_APICALL urKernelCreateWithNativeHandle( const ur_kernel_native_properties_t *pProperties, /// [out][alloc] pointer to the handle of the kernel object created. ur_kernel_handle_t *phKernel) { - UR_LOG_L(getContext()->logger, Debug, "==== urKernelCreate"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelCreate"); UR_CALL(getContext()->urDdiTable.Kernel.pfnCreateWithNativeHandle( hNativeKernel, hContext, hProgram, pProperties, phKernel)); @@ -967,7 +967,7 @@ ur_result_t UR_APICALL urKernelCreateWithNativeHandle( ur_result_t urKernelRetain( /// [in] handle for the Kernel to retain ur_kernel_handle_t hKernel) { - UR_LOG_L(getContext()->logger, Debug, "==== urKernelRetain"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRetain"); UR_CALL(getContext()->urDdiTable.Kernel.pfnRetain(hKernel)); @@ -984,7 +984,7 @@ ur_result_t urKernelRelease( ur_kernel_handle_t hKernel) { auto pfnRelease = getContext()->urDdiTable.Kernel.pfnRelease; - UR_LOG_L(getContext()->logger, Debug, "==== urKernelRelease"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelRelease"); auto &KernelInfo = getTsanInterceptor()->getKernelInfo(hKernel); if (--KernelInfo.RefCount == 0) { @@ -1008,7 +1008,7 @@ ur_result_t urKernelSetArgValue( const ur_kernel_arg_value_properties_t *pProperties, /// [in] argument value represented as matching arg type. const void *pArgValue) { - UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgValue"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgValue"); std::shared_ptr MemBuffer; if (argSize == sizeof(ur_mem_handle_t) && @@ -1036,7 +1036,7 @@ ur_result_t urKernelSetArgMemObj( const ur_kernel_arg_mem_obj_properties_t *pProperties, /// [in][optional] handle of Memory object. ur_mem_handle_t hArgValue) { - UR_LOG_L(getContext()->logger, Debug, "==== urKernelSetArgMemObj"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urKernelSetArgMemObj"); if (std::shared_ptr MemBuffer = getTsanInterceptor()->getMemBuffer(hArgValue)) { @@ -1066,7 +1066,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( size_t size, /// [out] pointer to USM device memory object void **ppMem) { - UR_LOG_L(getContext()->logger, Debug, "==== urUSMDeviceAlloc"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMDeviceAlloc"); return getTsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::DEVICE_USM, ppMem); @@ -1085,7 +1085,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( size_t size, /// [out] pointer to USM host memory object void **ppMem) { - UR_LOG_L(getContext()->logger, Debug, "==== urUSMHostAlloc"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMHostAlloc"); return getTsanInterceptor()->allocateMemory(hContext, nullptr, pUSMDesc, pool, size, AllocType::HOST_USM, ppMem); @@ -1106,7 +1106,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( size_t size, /// [out] pointer to USM shared memory object void **ppMem) { - UR_LOG_L(getContext()->logger, Debug, "==== urUSMSharedAlloc"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urUSMSharedAlloc"); return getTsanInterceptor()->allocateMemory( hContext, hDevice, pUSMDesc, pool, size, AllocType::SHARED_USM, ppMem); @@ -1144,7 +1144,7 @@ ur_result_t urEnqueueKernelLaunch( /// [out][optional] return an event object that identifies this /// particular kernel execution instance. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, Debug, "==== urEnqueueKernelLaunch"); + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueKernelLaunch"); LaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue)); @@ -1191,7 +1191,7 @@ ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( /// are not NULL, phEvent must not refer to an element of the /// phEventWaitList array. ur_event_handle_t *phEvent) { - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "==== urEnqueueCooperativeKernelLaunchExp"); LaunchInfo LaunchInfo(GetContext(hQueue), GetDevice(hQueue)); @@ -1454,7 +1454,7 @@ ur_result_t initTsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Initialize TSAN DDI table failed: {}", result); } diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp index aa7f7e91add5..9a9a13252859 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp @@ -33,7 +33,7 @@ TsanRuntimeData *TsanRuntimeDataWrapper::getDevicePtr() { Context, Device, nullptr, nullptr, sizeof(TsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG(Error, "Failed to alloc device usm for asan runtime data: {}", + UR_LOG(ERROR, "Failed to alloc device usm for asan runtime data: {}", Result); } } @@ -63,7 +63,7 @@ ur_result_t DeviceInfo::allocShadowMemory() { Shadow = GetShadowMemory(ShadowContext, Handle, Type); assert(Shadow && "Failed to get shadow memory"); UR_CALL(Shadow->Setup()); - UR_LOG_L(getContext()->logger, Info, "ShadowMemory(Global): {} - {}", + UR_LOG_L(getContext()->logger, INFO, "ShadowMemory(Global): {} - {}", (void *)Shadow->ShadowBegin, (void *)Shadow->ShadowEnd); return UR_RESULT_SUCCESS; } @@ -110,7 +110,7 @@ ur_result_t TsanInterceptor::allocateMemory(ur_context_handle_t Context, } ur_result_t TsanInterceptor::registerProgram(ur_program_handle_t Program) { - UR_LOG_L(getContext()->logger, Info, "registerDeviceGlobals"); + UR_LOG_L(getContext()->logger, INFO, "registerDeviceGlobals"); UR_CALL(registerDeviceGlobals(Program)); return UR_RESULT_SUCCESS; } @@ -131,7 +131,7 @@ TsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Device, Program, kSPIR_TsanDeviceGlobalMetadata, &MetadataSize, &MetadataPtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Info, "No device globals"); + UR_LOG_L(getContext()->logger, INFO, "No device globals"); continue; } @@ -143,7 +143,7 @@ TsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "Device Global[{}] Read Failed: {}", + UR_LOG_L(getContext()->logger, ERROR, "Device Global[{}] Read Failed: {}", kSPIR_TsanDeviceGlobalMetadata, Result); return Result; } @@ -252,7 +252,7 @@ ur_result_t TsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(CI->Handle, DI->Handle); if (!InternalQueue) { - UR_LOG_L(getContext()->logger, Error, "Failed to create internal queue"); + UR_LOG_L(getContext()->logger, ERROR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -295,7 +295,7 @@ ur_result_t TsanInterceptor::prepareLaunch(std::shared_ptr &, ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); @@ -318,7 +318,7 @@ ur_result_t TsanInterceptor::prepareLaunch(std::shared_ptr &, Queue, GetProgram(Kernel), "__TsanLaunchInfo", true, sizeof(LaunchInfoPtr), 0, &LaunchInfoPtr, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Info, + UR_LOG_L(getContext()->logger, INFO, "EnqueueWriteGlobal(__TsanLaunchInfo) " "failed, maybe empty kernel: {}", URes); diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp index 1c78899bd764..da0e1f8ad9cb 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp @@ -29,7 +29,7 @@ std::shared_ptr GetShadowMemory(ur_context_handle_t Context, } else if (Type == DeviceType::GPU_PVC) { return std::make_shared(Context, Device); } else { - UR_LOG_L(getContext()->logger, Error, "Unsupport device type"); + UR_LOG_L(getContext()->logger, ERROR, "Unsupport device type"); return nullptr; } } @@ -71,7 +71,7 @@ ur_result_t ShadowMemoryCPU::CleanShadow(ur_queue_handle_t, uptr Ptr, Size = RoundUpTo(Size, kShadowCell); RawShadow *Begin = MemToShadow(Ptr); - UR_LOG_L(getContext()->logger, Debug, "CleanShadow(addr={}, count={})", + UR_LOG_L(getContext()->logger, DEBUG, "CleanShadow(addr={}, count={})", (void *)Begin, Size / kShadowCell); memset((void *)Begin, 0, Size / kShadowCell * kShadowCnt * kShadowSize); } @@ -91,7 +91,7 @@ ur_result_t ShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; @@ -147,7 +147,7 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, &Desc, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "urPhysicalMemCreate(): {}", + UR_LOG_L(getContext()->logger, ERROR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -156,18 +156,18 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "urVirtualMemMap({}, {}): {}", + UR_LOG_L(getContext()->logger, ERROR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } - UR_LOG_L(getContext()->logger, Debug, "urVirtualMemMap: {} ~ {}", + UR_LOG_L(getContext()->logger, DEBUG, "urVirtualMemMap: {} ~ {}", (void *)MappedPtr, (void *)(MappedPtr + PageSize - 1)); // Initialize to zero URes = EnqueueUSMBlockingSet(Queue, (void *)MappedPtr, 0, PageSize); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "EnqueueUSMBlockingSet(): {}", + UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } @@ -180,11 +180,11 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, auto URes = EnqueueUSMBlockingSet( Queue, (void *)Begin, 0, Size / kShadowCell * kShadowCnt * kShadowSize); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, Error, "EnqueueUSMBlockingSet(): {}", URes); + UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } - UR_LOG_L(getContext()->logger, Debug, "CleanShadow(addr={}, count={})", + UR_LOG_L(getContext()->logger, DEBUG, "CleanShadow(addr={}, count={})", (void *)Begin, Size / kShadowCell); return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp b/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp index 46afafd0aeb2..132a8db17ec0 100644 --- a/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/ur_sanddi.cpp @@ -26,7 +26,7 @@ ur_result_t context_t::init(ur_dditable_t *dditable, bool tsanEnabled = enabledLayerNames.count("UR_LAYER_TSAN"); if ((asanEnabled + msanEnabled + tsanEnabled) >= 2) { - UR_LOG(Warning, + UR_LOG(WARN, "Enabling ASAN or MSAN or TSAN at the same time is not supported."); return UR_RESULT_SUCCESS; } else if (asanEnabled) { diff --git a/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp b/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp index b550b42132e1..0c245d6db51b 100644 --- a/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp +++ b/unified-runtime/source/loader/layers/tracing/ur_trcddi.cpp @@ -42,7 +42,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGet( "urAdapterGet", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urAdapterGet\n"); + UR_LOG_L(logger, INFO, " ---> urAdapterGet\n"); ur_result_t result = pfnAdapterGet(NumEntries, phAdapters, pNumAdapters); @@ -52,7 +52,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGet( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_GET, ¶ms); - UR_LOG_L(logger, Info, " <--- urAdapterGet({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urAdapterGet({}) -> {};\n", args_str.str(), result); } @@ -74,7 +74,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRelease( "urAdapterRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urAdapterRelease\n"); + UR_LOG_L(logger, INFO, " ---> urAdapterRelease\n"); ur_result_t result = pfnAdapterRelease(hAdapter); @@ -85,7 +85,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_RELEASE, ¶ms); - UR_LOG_L(logger, Info, " <--- urAdapterRelease({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urAdapterRelease({}) -> {};\n", args_str.str(), result); } @@ -107,7 +107,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain( "urAdapterRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urAdapterRetain\n"); + UR_LOG_L(logger, INFO, " ---> urAdapterRetain\n"); ur_result_t result = pfnAdapterRetain(hAdapter); @@ -118,7 +118,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_RETAIN, ¶ms); - UR_LOG_L(logger, Info, " <--- urAdapterRetain({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urAdapterRetain({}) -> {};\n", args_str.str(), result); } @@ -147,7 +147,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetLastError( UR_FUNCTION_ADAPTER_GET_LAST_ERROR, "urAdapterGetLastError", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urAdapterGetLastError\n"); + UR_LOG_L(logger, INFO, " ---> urAdapterGetLastError\n"); ur_result_t result = pfnAdapterGetLastError(hAdapter, ppMessage, pError); @@ -158,7 +158,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetLastError( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ADAPTER_GET_LAST_ERROR, ¶ms); - UR_LOG_L(logger, Info, " <--- urAdapterGetLastError({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urAdapterGetLastError({}) -> {};\n", args_str.str(), result); } @@ -194,7 +194,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetInfo( "urAdapterGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urAdapterGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urAdapterGetInfo\n"); ur_result_t result = pfnAdapterGetInfo(hAdapter, propName, propSize, pPropValue, pPropSizeRet); @@ -206,7 +206,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ADAPTER_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urAdapterGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urAdapterGetInfo({}) -> {};\n", args_str.str(), result); } @@ -237,7 +237,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterSetLoggerCallback( "urAdapterSetLoggerCallback", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urAdapterSetLoggerCallback\n"); + UR_LOG_L(logger, INFO, " ---> urAdapterSetLoggerCallback\n"); ur_result_t result = pfnSetLoggerCallback(hAdapter, pfnLoggerCallback, pUserData, level); @@ -250,7 +250,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterSetLoggerCallback( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ADAPTER_SET_LOGGER_CALLBACK, ¶ms); - UR_LOG_L(logger, Info, " <--- urAdapterSetLoggerCallback({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urAdapterSetLoggerCallback({}) -> {};\n", args_str.str(), result); } @@ -276,7 +276,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterSetLoggerCallbackLevel( "urAdapterSetLoggerCallbackLevel", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urAdapterSetLoggerCallbackLevel\n"); + UR_LOG_L(logger, INFO, " ---> urAdapterSetLoggerCallbackLevel\n"); ur_result_t result = pfnSetLoggerCallbackLevel(hAdapter, level); @@ -288,7 +288,7 @@ __urdlllocal ur_result_t UR_APICALL urAdapterSetLoggerCallbackLevel( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ADAPTER_SET_LOGGER_CALLBACK_LEVEL, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urAdapterSetLoggerCallbackLevel({}) -> {};\n", args_str.str(), result); } @@ -323,7 +323,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGet( "urPlatformGet", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urPlatformGet\n"); + UR_LOG_L(logger, INFO, " ---> urPlatformGet\n"); ur_result_t result = pfnGet(hAdapter, NumEntries, phPlatforms, pNumPlatforms); @@ -334,7 +334,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGet( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PLATFORM_GET, ¶ms); - UR_LOG_L(logger, Info, " <--- urPlatformGet({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urPlatformGet({}) -> {};\n", args_str.str(), result); } @@ -370,7 +370,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetInfo( "urPlatformGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urPlatformGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urPlatformGetInfo\n"); ur_result_t result = pfnGetInfo(hPlatform, propName, propSize, pPropValue, pPropSizeRet); @@ -382,7 +382,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PLATFORM_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urPlatformGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urPlatformGetInfo({}) -> {};\n", args_str.str(), result); } @@ -406,7 +406,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetApiVersion( UR_FUNCTION_PLATFORM_GET_API_VERSION, "urPlatformGetApiVersion", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urPlatformGetApiVersion\n"); + UR_LOG_L(logger, INFO, " ---> urPlatformGetApiVersion\n"); ur_result_t result = pfnGetApiVersion(hPlatform, pVersion); @@ -418,7 +418,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetApiVersion( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_API_VERSION, ¶ms); - UR_LOG_L(logger, Info, " <--- urPlatformGetApiVersion({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urPlatformGetApiVersion({}) -> {};\n", args_str.str(), result); } @@ -445,7 +445,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle( "urPlatformGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urPlatformGetNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urPlatformGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hPlatform, phNativePlatform); @@ -457,7 +457,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, " <--- urPlatformGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urPlatformGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -488,7 +488,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( "urPlatformCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urPlatformCreateWithNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urPlatformCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativePlatform, hAdapter, pProperties, phPlatform); @@ -501,7 +501,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urPlatformCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -532,7 +532,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption( "urPlatformGetBackendOption", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urPlatformGetBackendOption\n"); + UR_LOG_L(logger, INFO, " ---> urPlatformGetBackendOption\n"); ur_result_t result = pfnGetBackendOption(hPlatform, pFrontendOption, ppPlatformOption); @@ -545,7 +545,7 @@ __urdlllocal ur_result_t UR_APICALL urPlatformGetBackendOption( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PLATFORM_GET_BACKEND_OPTION, ¶ms); - UR_LOG_L(logger, Info, " <--- urPlatformGetBackendOption({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urPlatformGetBackendOption({}) -> {};\n", args_str.str(), result); } @@ -582,7 +582,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGet( "urDeviceGet", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urDeviceGet\n"); + UR_LOG_L(logger, INFO, " ---> urDeviceGet\n"); ur_result_t result = pfnGet(hPlatform, DeviceType, NumEntries, phDevices, pNumDevices); @@ -593,7 +593,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGet( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_GET, ¶ms); - UR_LOG_L(logger, Info, " <--- urDeviceGet({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urDeviceGet({}) -> {};\n", args_str.str(), result); } @@ -630,7 +630,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( "urDeviceGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urDeviceGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urDeviceGetInfo\n"); ur_result_t result = pfnGetInfo(hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -642,7 +642,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urDeviceGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urDeviceGetInfo({}) -> {};\n", args_str.str(), result); } @@ -664,7 +664,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain( "urDeviceRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urDeviceRetain\n"); + UR_LOG_L(logger, INFO, " ---> urDeviceRetain\n"); ur_result_t result = pfnRetain(hDevice); @@ -675,7 +675,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_RETAIN, ¶ms); - UR_LOG_L(logger, Info, " <--- urDeviceRetain({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urDeviceRetain({}) -> {};\n", args_str.str(), result); } @@ -697,7 +697,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRelease( "urDeviceRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urDeviceRelease\n"); + UR_LOG_L(logger, INFO, " ---> urDeviceRelease\n"); ur_result_t result = pfnRelease(hDevice); @@ -708,7 +708,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_RELEASE, ¶ms); - UR_LOG_L(logger, Info, " <--- urDeviceRelease({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urDeviceRelease({}) -> {};\n", args_str.str(), result); } @@ -742,7 +742,7 @@ __urdlllocal ur_result_t UR_APICALL urDevicePartition( "urDevicePartition", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urDevicePartition\n"); + UR_LOG_L(logger, INFO, " ---> urDevicePartition\n"); ur_result_t result = pfnPartition(hDevice, pProperties, NumDevices, phSubDevices, pNumDevicesRet); @@ -754,7 +754,7 @@ __urdlllocal ur_result_t UR_APICALL urDevicePartition( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_PARTITION, ¶ms); - UR_LOG_L(logger, Info, " <--- urDevicePartition({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urDevicePartition({}) -> {};\n", args_str.str(), result); } @@ -787,7 +787,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceSelectBinary( UR_FUNCTION_DEVICE_SELECT_BINARY, "urDeviceSelectBinary", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urDeviceSelectBinary\n"); + UR_LOG_L(logger, INFO, " ---> urDeviceSelectBinary\n"); ur_result_t result = pfnSelectBinary(hDevice, pBinaries, NumBinaries, pSelectedBinary); @@ -799,7 +799,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceSelectBinary( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_DEVICE_SELECT_BINARY, ¶ms); - UR_LOG_L(logger, Info, " <--- urDeviceSelectBinary({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urDeviceSelectBinary({}) -> {};\n", args_str.str(), result); } @@ -823,7 +823,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( UR_FUNCTION_DEVICE_GET_NATIVE_HANDLE, "urDeviceGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urDeviceGetNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urDeviceGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hDevice, phNativeDevice); @@ -835,7 +835,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, " <--- urDeviceGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urDeviceGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -866,7 +866,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( "urDeviceCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urDeviceCreateWithNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urDeviceCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeDevice, hAdapter, pProperties, phDevice); @@ -879,7 +879,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urDeviceCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -911,7 +911,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( "urDeviceGetGlobalTimestamps", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urDeviceGetGlobalTimestamps\n"); + UR_LOG_L(logger, INFO, " ---> urDeviceGetGlobalTimestamps\n"); ur_result_t result = pfnGetGlobalTimestamps(hDevice, pDeviceTimestamp, pHostTimestamp); @@ -924,7 +924,7 @@ __urdlllocal ur_result_t UR_APICALL urDeviceGetGlobalTimestamps( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_DEVICE_GET_GLOBAL_TIMESTAMPS, ¶ms); - UR_LOG_L(logger, Info, " <--- urDeviceGetGlobalTimestamps({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urDeviceGetGlobalTimestamps({}) -> {};\n", args_str.str(), result); } @@ -953,7 +953,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( "urContextCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urContextCreate\n"); + UR_LOG_L(logger, INFO, " ---> urContextCreate\n"); ur_result_t result = pfnCreate(DeviceCount, phDevices, pProperties, phContext); @@ -965,7 +965,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_CREATE, ¶ms); - UR_LOG_L(logger, Info, " <--- urContextCreate({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urContextCreate({}) -> {};\n", args_str.str(), result); } @@ -987,7 +987,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( "urContextRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urContextRetain\n"); + UR_LOG_L(logger, INFO, " ---> urContextRetain\n"); ur_result_t result = pfnRetain(hContext); @@ -998,7 +998,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_RETAIN, ¶ms); - UR_LOG_L(logger, Info, " <--- urContextRetain({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urContextRetain({}) -> {};\n", args_str.str(), result); } @@ -1020,7 +1020,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( "urContextRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urContextRelease\n"); + UR_LOG_L(logger, INFO, " ---> urContextRelease\n"); ur_result_t result = pfnRelease(hContext); @@ -1031,7 +1031,7 @@ __urdlllocal ur_result_t UR_APICALL urContextRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_RELEASE, ¶ms); - UR_LOG_L(logger, Info, " <--- urContextRelease({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urContextRelease({}) -> {};\n", args_str.str(), result); } @@ -1068,7 +1068,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo( "urContextGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urContextGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urContextGetInfo\n"); ur_result_t result = pfnGetInfo(hContext, propName, propSize, pPropValue, pPropSizeRet); @@ -1080,7 +1080,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_CONTEXT_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urContextGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urContextGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1105,7 +1105,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetNativeHandle( "urContextGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urContextGetNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urContextGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hContext, phNativeContext); @@ -1117,7 +1117,7 @@ __urdlllocal ur_result_t UR_APICALL urContextGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, " <--- urContextGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urContextGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1154,7 +1154,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( "urContextCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urContextCreateWithNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urContextCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle( hNativeContext, hAdapter, numDevices, phDevices, pProperties, phContext); @@ -1167,7 +1167,7 @@ __urdlllocal ur_result_t UR_APICALL urContextCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urContextCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1197,7 +1197,7 @@ __urdlllocal ur_result_t UR_APICALL urContextSetExtendedDeleter( "urContextSetExtendedDeleter", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urContextSetExtendedDeleter\n"); + UR_LOG_L(logger, INFO, " ---> urContextSetExtendedDeleter\n"); ur_result_t result = pfnSetExtendedDeleter(hContext, pfnDeleter, pUserData); @@ -1209,7 +1209,7 @@ __urdlllocal ur_result_t UR_APICALL urContextSetExtendedDeleter( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_CONTEXT_SET_EXTENDED_DELETER, ¶ms); - UR_LOG_L(logger, Info, " <--- urContextSetExtendedDeleter({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urContextSetExtendedDeleter({}) -> {};\n", args_str.str(), result); } @@ -1242,7 +1242,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreate( "urMemImageCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urMemImageCreate\n"); + UR_LOG_L(logger, INFO, " ---> urMemImageCreate\n"); ur_result_t result = pfnImageCreate(hContext, flags, pImageFormat, pImageDesc, pHost, phMem); @@ -1254,7 +1254,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_IMAGE_CREATE, ¶ms); - UR_LOG_L(logger, Info, " <--- urMemImageCreate({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urMemImageCreate({}) -> {};\n", args_str.str(), result); } @@ -1285,7 +1285,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( "urMemBufferCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urMemBufferCreate\n"); + UR_LOG_L(logger, INFO, " ---> urMemBufferCreate\n"); ur_result_t result = pfnBufferCreate(hContext, flags, size, pProperties, phBuffer); @@ -1297,7 +1297,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_BUFFER_CREATE, ¶ms); - UR_LOG_L(logger, Info, " <--- urMemBufferCreate({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urMemBufferCreate({}) -> {};\n", args_str.str(), result); } @@ -1319,7 +1319,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( "urMemRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urMemRetain\n"); + UR_LOG_L(logger, INFO, " ---> urMemRetain\n"); ur_result_t result = pfnRetain(hMem); @@ -1329,7 +1329,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRetain( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_RETAIN, ¶ms); - UR_LOG_L(logger, Info, " <--- urMemRetain({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urMemRetain({}) -> {};\n", args_str.str(), result); } @@ -1351,7 +1351,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( "urMemRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urMemRelease\n"); + UR_LOG_L(logger, INFO, " ---> urMemRelease\n"); ur_result_t result = pfnRelease(hMem); @@ -1361,7 +1361,7 @@ __urdlllocal ur_result_t UR_APICALL urMemRelease( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_RELEASE, ¶ms); - UR_LOG_L(logger, Info, " <--- urMemRelease({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urMemRelease({}) -> {};\n", args_str.str(), result); } @@ -1392,7 +1392,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( UR_FUNCTION_MEM_BUFFER_PARTITION, "urMemBufferPartition", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urMemBufferPartition\n"); + UR_LOG_L(logger, INFO, " ---> urMemBufferPartition\n"); ur_result_t result = pfnBufferPartition(hBuffer, flags, bufferCreateType, pRegion, phMem); @@ -1404,7 +1404,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferPartition( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_BUFFER_PARTITION, ¶ms); - UR_LOG_L(logger, Info, " <--- urMemBufferPartition({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urMemBufferPartition({}) -> {};\n", args_str.str(), result); } @@ -1431,7 +1431,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( UR_FUNCTION_MEM_GET_NATIVE_HANDLE, "urMemGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urMemGetNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urMemGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hMem, hDevice, phNativeMem); @@ -1442,7 +1442,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, " <--- urMemGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urMemGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1473,7 +1473,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( "urMemBufferCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urMemBufferCreateWithNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urMemBufferCreateWithNativeHandle\n"); ur_result_t result = pfnBufferCreateWithNativeHandle(hNativeMem, hContext, pProperties, phMem); @@ -1486,7 +1486,7 @@ __urdlllocal ur_result_t UR_APICALL urMemBufferCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_MEM_BUFFER_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urMemBufferCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1522,7 +1522,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( "urMemImageCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urMemImageCreateWithNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urMemImageCreateWithNativeHandle\n"); ur_result_t result = pfnImageCreateWithNativeHandle( hNativeMem, hContext, pImageFormat, pImageDesc, pProperties, phMem); @@ -1535,7 +1535,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_MEM_IMAGE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urMemImageCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1572,7 +1572,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( "urMemGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urMemGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urMemGetInfo\n"); ur_result_t result = pfnGetInfo(hMemory, propName, propSize, pPropValue, pPropSizeRet); @@ -1584,7 +1584,7 @@ __urdlllocal ur_result_t UR_APICALL urMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urMemGetInfo({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urMemGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1620,7 +1620,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageGetInfo( "urMemImageGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urMemImageGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urMemImageGetInfo\n"); ur_result_t result = pfnImageGetInfo(hMemory, propName, propSize, pPropValue, pPropSizeRet); @@ -1632,7 +1632,7 @@ __urdlllocal ur_result_t UR_APICALL urMemImageGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_MEM_IMAGE_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urMemImageGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urMemImageGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1658,7 +1658,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreate( "urSamplerCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urSamplerCreate\n"); + UR_LOG_L(logger, INFO, " ---> urSamplerCreate\n"); ur_result_t result = pfnCreate(hContext, pDesc, phSampler); @@ -1669,7 +1669,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_CREATE, ¶ms); - UR_LOG_L(logger, Info, " <--- urSamplerCreate({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urSamplerCreate({}) -> {};\n", args_str.str(), result); } @@ -1691,7 +1691,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain( "urSamplerRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urSamplerRetain\n"); + UR_LOG_L(logger, INFO, " ---> urSamplerRetain\n"); ur_result_t result = pfnRetain(hSampler); @@ -1702,7 +1702,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_RETAIN, ¶ms); - UR_LOG_L(logger, Info, " <--- urSamplerRetain({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urSamplerRetain({}) -> {};\n", args_str.str(), result); } @@ -1724,7 +1724,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRelease( "urSamplerRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urSamplerRelease\n"); + UR_LOG_L(logger, INFO, " ---> urSamplerRelease\n"); ur_result_t result = pfnRelease(hSampler); @@ -1735,7 +1735,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_RELEASE, ¶ms); - UR_LOG_L(logger, Info, " <--- urSamplerRelease({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urSamplerRelease({}) -> {};\n", args_str.str(), result); } @@ -1767,7 +1767,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo( "urSamplerGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urSamplerGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urSamplerGetInfo\n"); ur_result_t result = pfnGetInfo(hSampler, propName, propSize, pPropValue, pPropSizeRet); @@ -1779,7 +1779,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_SAMPLER_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urSamplerGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urSamplerGetInfo({}) -> {};\n", args_str.str(), result); } @@ -1804,7 +1804,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetNativeHandle( "urSamplerGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urSamplerGetNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urSamplerGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hSampler, phNativeSampler); @@ -1816,7 +1816,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_SAMPLER_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, " <--- urSamplerGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urSamplerGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1847,7 +1847,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( "urSamplerCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urSamplerCreateWithNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urSamplerCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeSampler, hContext, pProperties, phSampler); @@ -1860,7 +1860,7 @@ __urdlllocal ur_result_t UR_APICALL urSamplerCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_SAMPLER_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urSamplerCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -1892,7 +1892,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( "urUSMHostAlloc", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMHostAlloc\n"); + UR_LOG_L(logger, INFO, " ---> urUSMHostAlloc\n"); ur_result_t result = pfnHostAlloc(hContext, pUSMDesc, pool, size, ppMem); @@ -1903,7 +1903,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMHostAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_HOST_ALLOC, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMHostAlloc({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMHostAlloc({}) -> {};\n", args_str.str(), result); } @@ -1936,7 +1936,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( "urUSMDeviceAlloc", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMDeviceAlloc\n"); + UR_LOG_L(logger, INFO, " ---> urUSMDeviceAlloc\n"); ur_result_t result = pfnDeviceAlloc(hContext, hDevice, pUSMDesc, pool, size, ppMem); @@ -1948,7 +1948,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMDeviceAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_DEVICE_ALLOC, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMDeviceAlloc({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMDeviceAlloc({}) -> {};\n", args_str.str(), result); } @@ -1981,7 +1981,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( "urUSMSharedAlloc", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMSharedAlloc\n"); + UR_LOG_L(logger, INFO, " ---> urUSMSharedAlloc\n"); ur_result_t result = pfnSharedAlloc(hContext, hDevice, pUSMDesc, pool, size, ppMem); @@ -1993,7 +1993,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMSharedAlloc( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_SHARED_ALLOC, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMSharedAlloc({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMSharedAlloc({}) -> {};\n", args_str.str(), result); } @@ -2017,7 +2017,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( getContext()->notify_begin(UR_FUNCTION_USM_FREE, "urUSMFree", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMFree\n"); + UR_LOG_L(logger, INFO, " ---> urUSMFree\n"); ur_result_t result = pfnFree(hContext, pMem); @@ -2027,7 +2027,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMFree( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_FREE, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMFree({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urUSMFree({}) -> {};\n", args_str.str(), result); } @@ -2061,7 +2061,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMGetMemAllocInfo( UR_FUNCTION_USM_GET_MEM_ALLOC_INFO, "urUSMGetMemAllocInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMGetMemAllocInfo\n"); + UR_LOG_L(logger, INFO, " ---> urUSMGetMemAllocInfo\n"); ur_result_t result = pfnGetMemAllocInfo(hContext, pMem, propName, propSize, pPropValue, pPropSizeRet); @@ -2073,7 +2073,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMGetMemAllocInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_GET_MEM_ALLOC_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMGetMemAllocInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMGetMemAllocInfo({}) -> {};\n", args_str.str(), result); } @@ -2100,7 +2100,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreate( "urUSMPoolCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolCreate\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolCreate\n"); ur_result_t result = pfnPoolCreate(hContext, pPoolDesc, ppPool); @@ -2111,7 +2111,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_CREATE, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPoolCreate({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPoolCreate({}) -> {};\n", args_str.str(), result); } @@ -2133,7 +2133,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain( "urUSMPoolRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolRetain\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolRetain\n"); ur_result_t result = pfnPoolRetain(pPool); @@ -2144,7 +2144,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_RETAIN, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPoolRetain({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPoolRetain({}) -> {};\n", args_str.str(), result); } @@ -2166,7 +2166,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRelease( "urUSMPoolRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolRelease\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolRelease\n"); ur_result_t result = pfnPoolRelease(pPool); @@ -2177,7 +2177,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_RELEASE, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPoolRelease({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPoolRelease({}) -> {};\n", args_str.str(), result); } @@ -2209,7 +2209,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfo( "urUSMPoolGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolGetInfo\n"); ur_result_t result = pfnPoolGetInfo(hPool, propName, propSize, pPropValue, pPropSizeRet); @@ -2221,7 +2221,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPoolGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPoolGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2262,7 +2262,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGranularityGetInfo( "urVirtualMemGranularityGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urVirtualMemGranularityGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urVirtualMemGranularityGetInfo\n"); ur_result_t result = pfnGranularityGetInfo( hContext, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -2275,7 +2275,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGranularityGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_VIRTUAL_MEM_GRANULARITY_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urVirtualMemGranularityGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2308,7 +2308,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemReserve( UR_FUNCTION_VIRTUAL_MEM_RESERVE, "urVirtualMemReserve", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urVirtualMemReserve\n"); + UR_LOG_L(logger, INFO, " ---> urVirtualMemReserve\n"); ur_result_t result = pfnReserve(hContext, pStart, size, ppStart); @@ -2319,7 +2319,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemReserve( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_RESERVE, ¶ms); - UR_LOG_L(logger, Info, " <--- urVirtualMemReserve({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urVirtualMemReserve({}) -> {};\n", args_str.str(), result); } @@ -2345,7 +2345,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemFree( "urVirtualMemFree", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urVirtualMemFree\n"); + UR_LOG_L(logger, INFO, " ---> urVirtualMemFree\n"); ur_result_t result = pfnFree(hContext, pStart, size); @@ -2356,7 +2356,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemFree( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_FREE, ¶ms); - UR_LOG_L(logger, Info, " <--- urVirtualMemFree({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urVirtualMemFree({}) -> {};\n", args_str.str(), result); } @@ -2389,7 +2389,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemMap( "urVirtualMemMap", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urVirtualMemMap\n"); + UR_LOG_L(logger, INFO, " ---> urVirtualMemMap\n"); ur_result_t result = pfnMap(hContext, pStart, size, hPhysicalMem, offset, flags); @@ -2401,7 +2401,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemMap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_MAP, ¶ms); - UR_LOG_L(logger, Info, " <--- urVirtualMemMap({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urVirtualMemMap({}) -> {};\n", args_str.str(), result); } @@ -2427,7 +2427,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemUnmap( "urVirtualMemUnmap", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urVirtualMemUnmap\n"); + UR_LOG_L(logger, INFO, " ---> urVirtualMemUnmap\n"); ur_result_t result = pfnUnmap(hContext, pStart, size); @@ -2438,7 +2438,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemUnmap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_UNMAP, ¶ms); - UR_LOG_L(logger, Info, " <--- urVirtualMemUnmap({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urVirtualMemUnmap({}) -> {};\n", args_str.str(), result); } @@ -2467,7 +2467,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemSetAccess( UR_FUNCTION_VIRTUAL_MEM_SET_ACCESS, "urVirtualMemSetAccess", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urVirtualMemSetAccess\n"); + UR_LOG_L(logger, INFO, " ---> urVirtualMemSetAccess\n"); ur_result_t result = pfnSetAccess(hContext, pStart, size, flags); @@ -2478,7 +2478,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemSetAccess( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_VIRTUAL_MEM_SET_ACCESS, ¶ms); - UR_LOG_L(logger, Info, " <--- urVirtualMemSetAccess({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urVirtualMemSetAccess({}) -> {};\n", args_str.str(), result); } @@ -2518,7 +2518,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGetInfo( UR_FUNCTION_VIRTUAL_MEM_GET_INFO, "urVirtualMemGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urVirtualMemGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urVirtualMemGetInfo\n"); ur_result_t result = pfnGetInfo(hContext, pStart, size, propName, propSize, pPropValue, pPropSizeRet); @@ -2530,7 +2530,7 @@ __urdlllocal ur_result_t UR_APICALL urVirtualMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_VIRTUAL_MEM_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urVirtualMemGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urVirtualMemGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2562,7 +2562,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemCreate( UR_FUNCTION_PHYSICAL_MEM_CREATE, "urPhysicalMemCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urPhysicalMemCreate\n"); + UR_LOG_L(logger, INFO, " ---> urPhysicalMemCreate\n"); ur_result_t result = pfnCreate(hContext, hDevice, size, pProperties, phPhysicalMem); @@ -2574,7 +2574,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_CREATE, ¶ms); - UR_LOG_L(logger, Info, " <--- urPhysicalMemCreate({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urPhysicalMemCreate({}) -> {};\n", args_str.str(), result); } @@ -2596,7 +2596,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain( UR_FUNCTION_PHYSICAL_MEM_RETAIN, "urPhysicalMemRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urPhysicalMemRetain\n"); + UR_LOG_L(logger, INFO, " ---> urPhysicalMemRetain\n"); ur_result_t result = pfnRetain(hPhysicalMem); @@ -2607,7 +2607,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_RETAIN, ¶ms); - UR_LOG_L(logger, Info, " <--- urPhysicalMemRetain({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urPhysicalMemRetain({}) -> {};\n", args_str.str(), result); } @@ -2629,7 +2629,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( UR_FUNCTION_PHYSICAL_MEM_RELEASE, "urPhysicalMemRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urPhysicalMemRelease\n"); + UR_LOG_L(logger, INFO, " ---> urPhysicalMemRelease\n"); ur_result_t result = pfnRelease(hPhysicalMem); @@ -2640,7 +2640,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_RELEASE, ¶ms); - UR_LOG_L(logger, Info, " <--- urPhysicalMemRelease({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urPhysicalMemRelease({}) -> {};\n", args_str.str(), result); } @@ -2675,7 +2675,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( UR_FUNCTION_PHYSICAL_MEM_GET_INFO, "urPhysicalMemGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urPhysicalMemGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urPhysicalMemGetInfo\n"); ur_result_t result = pfnGetInfo(hPhysicalMem, propName, propSize, pPropValue, pPropSizeRet); @@ -2687,7 +2687,7 @@ __urdlllocal ur_result_t UR_APICALL urPhysicalMemGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PHYSICAL_MEM_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urPhysicalMemGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urPhysicalMemGetInfo({}) -> {};\n", args_str.str(), result); } @@ -2718,7 +2718,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( UR_FUNCTION_PROGRAM_CREATE_WITH_IL, "urProgramCreateWithIL", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramCreateWithIL\n"); + UR_LOG_L(logger, INFO, " ---> urProgramCreateWithIL\n"); ur_result_t result = pfnCreateWithIL(hContext, pIL, length, pProperties, phProgram); @@ -2730,7 +2730,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithIL( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_IL, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramCreateWithIL({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramCreateWithIL({}) -> {};\n", args_str.str(), result); } @@ -2771,7 +2771,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( "urProgramCreateWithBinary", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramCreateWithBinary\n"); + UR_LOG_L(logger, INFO, " ---> urProgramCreateWithBinary\n"); ur_result_t result = pfnCreateWithBinary(hContext, numDevices, phDevices, pLengths, ppBinaries, @@ -2785,7 +2785,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithBinary( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_BINARY, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramCreateWithBinary({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramCreateWithBinary({}) -> {};\n", args_str.str(), result); } @@ -2811,7 +2811,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( "urProgramBuild", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramBuild\n"); + UR_LOG_L(logger, INFO, " ---> urProgramBuild\n"); ur_result_t result = pfnBuild(hContext, hProgram, pOptions); @@ -2822,7 +2822,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuild( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_BUILD, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramBuild({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramBuild({}) -> {};\n", args_str.str(), result); } @@ -2848,7 +2848,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompile( "urProgramCompile", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramCompile\n"); + UR_LOG_L(logger, INFO, " ---> urProgramCompile\n"); ur_result_t result = pfnCompile(hContext, hProgram, pOptions); @@ -2859,7 +2859,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompile( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_COMPILE, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramCompile({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramCompile({}) -> {};\n", args_str.str(), result); } @@ -2893,7 +2893,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( "urProgramLink", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramLink\n"); + UR_LOG_L(logger, INFO, " ---> urProgramLink\n"); ur_result_t result = pfnLink(hContext, count, phPrograms, pOptions, phProgram); @@ -2905,7 +2905,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLink( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_LINK, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramLink({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urProgramLink({}) -> {};\n", args_str.str(), result); } @@ -2927,7 +2927,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( "urProgramRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramRetain\n"); + UR_LOG_L(logger, INFO, " ---> urProgramRetain\n"); ur_result_t result = pfnRetain(hProgram); @@ -2938,7 +2938,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_RETAIN, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramRetain({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramRetain({}) -> {};\n", args_str.str(), result); } @@ -2960,7 +2960,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRelease( "urProgramRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramRelease\n"); + UR_LOG_L(logger, INFO, " ---> urProgramRelease\n"); ur_result_t result = pfnRelease(hProgram); @@ -2971,7 +2971,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_RELEASE, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramRelease({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramRelease({}) -> {};\n", args_str.str(), result); } @@ -3004,7 +3004,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetFunctionPointer( "urProgramGetFunctionPointer", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramGetFunctionPointer\n"); + UR_LOG_L(logger, INFO, " ---> urProgramGetFunctionPointer\n"); ur_result_t result = pfnGetFunctionPointer(hDevice, hProgram, pFunctionName, ppFunctionPointer); @@ -3017,7 +3017,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetFunctionPointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_FUNCTION_POINTER, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramGetFunctionPointer({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramGetFunctionPointer({}) -> {};\n", args_str.str(), result); } @@ -3053,7 +3053,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetGlobalVariablePointer( "urProgramGetGlobalVariablePointer", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramGetGlobalVariablePointer\n"); + UR_LOG_L(logger, INFO, " ---> urProgramGetGlobalVariablePointer\n"); ur_result_t result = pfnGetGlobalVariablePointer( hDevice, hProgram, pGlobalVariableName, pGlobalVariableSizeRet, @@ -3067,7 +3067,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetGlobalVariablePointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_GLOBAL_VARIABLE_POINTER, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urProgramGetGlobalVariablePointer({}) -> {};\n", args_str.str(), result); } @@ -3105,7 +3105,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetInfo( "urProgramGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urProgramGetInfo\n"); ur_result_t result = pfnGetInfo(hProgram, propName, propSize, pPropValue, pPropSizeRet); @@ -3117,7 +3117,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramGetInfo({}) -> {};\n", args_str.str(), result); } @@ -3155,7 +3155,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetBuildInfo( UR_FUNCTION_PROGRAM_GET_BUILD_INFO, "urProgramGetBuildInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramGetBuildInfo\n"); + UR_LOG_L(logger, INFO, " ---> urProgramGetBuildInfo\n"); ur_result_t result = pfnGetBuildInfo(hProgram, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3167,7 +3167,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetBuildInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_BUILD_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramGetBuildInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramGetBuildInfo({}) -> {};\n", args_str.str(), result); } @@ -3197,7 +3197,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramSetSpecializationConstants( "urProgramSetSpecializationConstants", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramSetSpecializationConstants\n"); + UR_LOG_L(logger, INFO, " ---> urProgramSetSpecializationConstants\n"); ur_result_t result = pfnSetSpecializationConstants(hProgram, count, pSpecConstants); @@ -3210,7 +3210,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramSetSpecializationConstants( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_SET_SPECIALIZATION_CONSTANTS, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urProgramSetSpecializationConstants({}) -> {};\n", args_str.str(), result); } @@ -3236,7 +3236,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetNativeHandle( "urProgramGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramGetNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urProgramGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hProgram, phNativeProgram); @@ -3248,7 +3248,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3279,7 +3279,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( "urProgramCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramCreateWithNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urProgramCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeProgram, hContext, pProperties, phProgram); @@ -3292,7 +3292,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_PROGRAM_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urProgramCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3319,7 +3319,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreate( "urKernelCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelCreate\n"); + UR_LOG_L(logger, INFO, " ---> urKernelCreate\n"); ur_result_t result = pfnCreate(hProgram, pKernelName, phKernel); @@ -3330,7 +3330,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_CREATE, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelCreate({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelCreate({}) -> {};\n", args_str.str(), result); } @@ -3363,7 +3363,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( UR_FUNCTION_KERNEL_SET_ARG_VALUE, "urKernelSetArgValue", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelSetArgValue\n"); + UR_LOG_L(logger, INFO, " ---> urKernelSetArgValue\n"); ur_result_t result = pfnSetArgValue(hKernel, argIndex, argSize, pProperties, pArgValue); @@ -3375,7 +3375,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgValue( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_ARG_VALUE, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelSetArgValue({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelSetArgValue({}) -> {};\n", args_str.str(), result); } @@ -3404,7 +3404,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( UR_FUNCTION_KERNEL_SET_ARG_LOCAL, "urKernelSetArgLocal", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelSetArgLocal\n"); + UR_LOG_L(logger, INFO, " ---> urKernelSetArgLocal\n"); ur_result_t result = pfnSetArgLocal(hKernel, argIndex, argSize, pProperties); @@ -3415,7 +3415,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgLocal( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_ARG_LOCAL, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelSetArgLocal({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelSetArgLocal({}) -> {};\n", args_str.str(), result); } @@ -3452,7 +3452,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetInfo( "urKernelGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urKernelGetInfo\n"); ur_result_t result = pfnGetInfo(hKernel, propName, propSize, pPropValue, pPropSizeRet); @@ -3464,7 +3464,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelGetInfo({}) -> {};\n", args_str.str(), result); } @@ -3499,7 +3499,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetGroupInfo( UR_FUNCTION_KERNEL_GET_GROUP_INFO, "urKernelGetGroupInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelGetGroupInfo\n"); + UR_LOG_L(logger, INFO, " ---> urKernelGetGroupInfo\n"); ur_result_t result = pfnGetGroupInfo(hKernel, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3511,7 +3511,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetGroupInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_GET_GROUP_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelGetGroupInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelGetGroupInfo({}) -> {};\n", args_str.str(), result); } @@ -3547,7 +3547,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSubGroupInfo( "urKernelGetSubGroupInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelGetSubGroupInfo\n"); + UR_LOG_L(logger, INFO, " ---> urKernelGetSubGroupInfo\n"); ur_result_t result = pfnGetSubGroupInfo(hKernel, hDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -3560,7 +3560,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSubGroupInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_SUB_GROUP_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelGetSubGroupInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelGetSubGroupInfo({}) -> {};\n", args_str.str(), result); } @@ -3582,7 +3582,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( "urKernelRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelRetain\n"); + UR_LOG_L(logger, INFO, " ---> urKernelRetain\n"); ur_result_t result = pfnRetain(hKernel); @@ -3593,7 +3593,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_RETAIN, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelRetain({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelRetain({}) -> {};\n", args_str.str(), result); } @@ -3615,7 +3615,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRelease( "urKernelRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelRelease\n"); + UR_LOG_L(logger, INFO, " ---> urKernelRelease\n"); ur_result_t result = pfnRelease(hKernel); @@ -3626,7 +3626,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_RELEASE, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelRelease({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelRelease({}) -> {};\n", args_str.str(), result); } @@ -3656,7 +3656,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( UR_FUNCTION_KERNEL_SET_ARG_POINTER, "urKernelSetArgPointer", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelSetArgPointer\n"); + UR_LOG_L(logger, INFO, " ---> urKernelSetArgPointer\n"); ur_result_t result = pfnSetArgPointer(hKernel, argIndex, pProperties, pArgValue); @@ -3668,7 +3668,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgPointer( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_POINTER, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelSetArgPointer({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelSetArgPointer({}) -> {};\n", args_str.str(), result); } @@ -3700,7 +3700,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetExecInfo( UR_FUNCTION_KERNEL_SET_EXEC_INFO, "urKernelSetExecInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelSetExecInfo\n"); + UR_LOG_L(logger, INFO, " ---> urKernelSetExecInfo\n"); ur_result_t result = pfnSetExecInfo(hKernel, propName, propSize, pProperties, pPropValue); @@ -3712,7 +3712,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetExecInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_KERNEL_SET_EXEC_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelSetExecInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelSetExecInfo({}) -> {};\n", args_str.str(), result); } @@ -3741,7 +3741,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( UR_FUNCTION_KERNEL_SET_ARG_SAMPLER, "urKernelSetArgSampler", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelSetArgSampler\n"); + UR_LOG_L(logger, INFO, " ---> urKernelSetArgSampler\n"); ur_result_t result = pfnSetArgSampler(hKernel, argIndex, pProperties, hArgValue); @@ -3753,7 +3753,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgSampler( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_SAMPLER, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelSetArgSampler({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelSetArgSampler({}) -> {};\n", args_str.str(), result); } @@ -3782,7 +3782,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, "urKernelSetArgMemObj", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelSetArgMemObj\n"); + UR_LOG_L(logger, INFO, " ---> urKernelSetArgMemObj\n"); ur_result_t result = pfnSetArgMemObj(hKernel, argIndex, pProperties, hArgValue); @@ -3794,7 +3794,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetArgMemObj( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_ARG_MEM_OBJ, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelSetArgMemObj({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelSetArgMemObj({}) -> {};\n", args_str.str(), result); } @@ -3823,7 +3823,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetSpecializationConstants( "urKernelSetSpecializationConstants", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelSetSpecializationConstants\n"); + UR_LOG_L(logger, INFO, " ---> urKernelSetSpecializationConstants\n"); ur_result_t result = pfnSetSpecializationConstants(hKernel, count, pSpecConstants); @@ -3836,7 +3836,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSetSpecializationConstants( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SET_SPECIALIZATION_CONSTANTS, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urKernelSetSpecializationConstants({}) -> {};\n", args_str.str(), result); } @@ -3861,7 +3861,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetNativeHandle( UR_FUNCTION_KERNEL_GET_NATIVE_HANDLE, "urKernelGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelGetNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urKernelGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hKernel, phNativeKernel); @@ -3873,7 +3873,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, " <--- urKernelGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urKernelGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3906,7 +3906,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreateWithNativeHandle( "urKernelCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelCreateWithNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urKernelCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle( hNativeKernel, hContext, hProgram, pProperties, phKernel); @@ -3919,7 +3919,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urKernelCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -3961,7 +3961,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize( "urKernelGetSuggestedLocalWorkSize", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urKernelGetSuggestedLocalWorkSize\n"); + UR_LOG_L(logger, INFO, " ---> urKernelGetSuggestedLocalWorkSize\n"); ur_result_t result = pfnGetSuggestedLocalWorkSize( hKernel, hQueue, numWorkDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -3975,7 +3975,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelGetSuggestedLocalWorkSize( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_GET_SUGGESTED_LOCAL_WORK_SIZE, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urKernelGetSuggestedLocalWorkSize({}) -> {};\n", args_str.str(), result); } @@ -4008,7 +4008,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetInfo( "urQueueGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urQueueGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urQueueGetInfo\n"); ur_result_t result = pfnGetInfo(hQueue, propName, propSize, pPropValue, pPropSizeRet); @@ -4020,7 +4020,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urQueueGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urQueueGetInfo({}) -> {};\n", args_str.str(), result); } @@ -4049,7 +4049,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreate( "urQueueCreate", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urQueueCreate\n"); + UR_LOG_L(logger, INFO, " ---> urQueueCreate\n"); ur_result_t result = pfnCreate(hContext, hDevice, pProperties, phQueue); @@ -4060,7 +4060,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreate( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_CREATE, ¶ms); - UR_LOG_L(logger, Info, " <--- urQueueCreate({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urQueueCreate({}) -> {};\n", args_str.str(), result); } @@ -4082,7 +4082,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain( "urQueueRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urQueueRetain\n"); + UR_LOG_L(logger, INFO, " ---> urQueueRetain\n"); ur_result_t result = pfnRetain(hQueue); @@ -4093,7 +4093,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_RETAIN, ¶ms); - UR_LOG_L(logger, Info, " <--- urQueueRetain({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urQueueRetain({}) -> {};\n", args_str.str(), result); } @@ -4115,7 +4115,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRelease( "urQueueRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urQueueRelease\n"); + UR_LOG_L(logger, INFO, " ---> urQueueRelease\n"); ur_result_t result = pfnRelease(hQueue); @@ -4126,7 +4126,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_RELEASE, ¶ms); - UR_LOG_L(logger, Info, " <--- urQueueRelease({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urQueueRelease({}) -> {};\n", args_str.str(), result); } @@ -4153,7 +4153,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetNativeHandle( UR_FUNCTION_QUEUE_GET_NATIVE_HANDLE, "urQueueGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urQueueGetNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urQueueGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hQueue, pDesc, phNativeQueue); @@ -4165,7 +4165,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_QUEUE_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, " <--- urQueueGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urQueueGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4198,7 +4198,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreateWithNativeHandle( "urQueueCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urQueueCreateWithNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urQueueCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeQueue, hContext, hDevice, pProperties, phQueue); @@ -4211,7 +4211,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_QUEUE_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, " <--- urQueueCreateWithNativeHandle({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urQueueCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4233,7 +4233,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFinish( "urQueueFinish", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urQueueFinish\n"); + UR_LOG_L(logger, INFO, " ---> urQueueFinish\n"); ur_result_t result = pfnFinish(hQueue); @@ -4244,7 +4244,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFinish( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_FINISH, ¶ms); - UR_LOG_L(logger, Info, " <--- urQueueFinish({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urQueueFinish({}) -> {};\n", args_str.str(), result); } @@ -4266,7 +4266,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFlush( "urQueueFlush", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urQueueFlush\n"); + UR_LOG_L(logger, INFO, " ---> urQueueFlush\n"); ur_result_t result = pfnFlush(hQueue); @@ -4276,7 +4276,7 @@ __urdlllocal ur_result_t UR_APICALL urQueueFlush( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_QUEUE_FLUSH, ¶ms); - UR_LOG_L(logger, Info, " <--- urQueueFlush({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urQueueFlush({}) -> {};\n", args_str.str(), result); } @@ -4308,7 +4308,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetInfo( "urEventGetInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEventGetInfo\n"); + UR_LOG_L(logger, INFO, " ---> urEventGetInfo\n"); ur_result_t result = pfnGetInfo(hEvent, propName, propSize, pPropValue, pPropSizeRet); @@ -4320,7 +4320,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetInfo( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_GET_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urEventGetInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEventGetInfo({}) -> {};\n", args_str.str(), result); } @@ -4353,7 +4353,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetProfilingInfo( UR_FUNCTION_EVENT_GET_PROFILING_INFO, "urEventGetProfilingInfo", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEventGetProfilingInfo\n"); + UR_LOG_L(logger, INFO, " ---> urEventGetProfilingInfo\n"); ur_result_t result = pfnGetProfilingInfo(hEvent, propName, propSize, pPropValue, pPropSizeRet); @@ -4366,7 +4366,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetProfilingInfo( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_GET_PROFILING_INFO, ¶ms); - UR_LOG_L(logger, Info, " <--- urEventGetProfilingInfo({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEventGetProfilingInfo({}) -> {};\n", args_str.str(), result); } @@ -4391,7 +4391,7 @@ __urdlllocal ur_result_t UR_APICALL urEventWait( "urEventWait", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEventWait\n"); + UR_LOG_L(logger, INFO, " ---> urEventWait\n"); ur_result_t result = pfnWait(numEvents, phEventWaitList); @@ -4401,7 +4401,7 @@ __urdlllocal ur_result_t UR_APICALL urEventWait( if (logger.getLevel() <= UR_LOGGER_LEVEL_INFO) { std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_WAIT, ¶ms); - UR_LOG_L(logger, Info, " <--- urEventWait({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urEventWait({}) -> {};\n", args_str.str(), result); } @@ -4423,7 +4423,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain( "urEventRetain", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEventRetain\n"); + UR_LOG_L(logger, INFO, " ---> urEventRetain\n"); ur_result_t result = pfnRetain(hEvent); @@ -4434,7 +4434,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRetain( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_RETAIN, ¶ms); - UR_LOG_L(logger, Info, " <--- urEventRetain({}) -> {};\n", args_str.str(), + UR_LOG_L(logger, INFO, " <--- urEventRetain({}) -> {};\n", args_str.str(), result); } @@ -4456,7 +4456,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRelease( "urEventRelease", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEventRelease\n"); + UR_LOG_L(logger, INFO, " ---> urEventRelease\n"); ur_result_t result = pfnRelease(hEvent); @@ -4467,7 +4467,7 @@ __urdlllocal ur_result_t UR_APICALL urEventRelease( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_RELEASE, ¶ms); - UR_LOG_L(logger, Info, " <--- urEventRelease({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEventRelease({}) -> {};\n", args_str.str(), result); } @@ -4491,7 +4491,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetNativeHandle( UR_FUNCTION_EVENT_GET_NATIVE_HANDLE, "urEventGetNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEventGetNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urEventGetNativeHandle\n"); ur_result_t result = pfnGetNativeHandle(hEvent, phNativeEvent); @@ -4503,7 +4503,7 @@ __urdlllocal ur_result_t UR_APICALL urEventGetNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_GET_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, " <--- urEventGetNativeHandle({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEventGetNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4534,7 +4534,7 @@ __urdlllocal ur_result_t UR_APICALL urEventCreateWithNativeHandle( "urEventCreateWithNativeHandle", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEventCreateWithNativeHandle\n"); + UR_LOG_L(logger, INFO, " ---> urEventCreateWithNativeHandle\n"); ur_result_t result = pfnCreateWithNativeHandle(hNativeEvent, hContext, pProperties, phEvent); @@ -4547,7 +4547,7 @@ __urdlllocal ur_result_t UR_APICALL urEventCreateWithNativeHandle( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_EVENT_CREATE_WITH_NATIVE_HANDLE, ¶ms); - UR_LOG_L(logger, Info, " <--- urEventCreateWithNativeHandle({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEventCreateWithNativeHandle({}) -> {};\n", args_str.str(), result); } @@ -4576,7 +4576,7 @@ __urdlllocal ur_result_t UR_APICALL urEventSetCallback( "urEventSetCallback", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEventSetCallback\n"); + UR_LOG_L(logger, INFO, " ---> urEventSetCallback\n"); ur_result_t result = pfnSetCallback(hEvent, execStatus, pfnNotify, pUserData); @@ -4587,7 +4587,7 @@ __urdlllocal ur_result_t UR_APICALL urEventSetCallback( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_EVENT_SET_CALLBACK, ¶ms); - UR_LOG_L(logger, Info, " <--- urEventSetCallback({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEventSetCallback({}) -> {};\n", args_str.str(), result); } @@ -4646,7 +4646,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH, "urEnqueueKernelLaunch", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueKernelLaunch\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueKernelLaunch\n"); ur_result_t result = pfnKernelLaunch( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -4659,7 +4659,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunch( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueKernelLaunch({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueKernelLaunch({}) -> {};\n", args_str.str(), result); } @@ -4694,7 +4694,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWait( UR_FUNCTION_ENQUEUE_EVENTS_WAIT, "urEnqueueEventsWait", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueEventsWait\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueEventsWait\n"); ur_result_t result = pfnEventsWait(hQueue, numEventsInWaitList, phEventWaitList, phEvent); @@ -4706,7 +4706,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWait( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueEventsWait({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueEventsWait({}) -> {};\n", args_str.str(), result); } @@ -4743,7 +4743,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( "urEnqueueEventsWaitWithBarrier", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueEventsWaitWithBarrier\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueEventsWaitWithBarrier\n"); ur_result_t result = pfnEventsWaitWithBarrier(hQueue, numEventsInWaitList, phEventWaitList, phEvent); @@ -4756,7 +4756,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrier( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urEnqueueEventsWaitWithBarrier({}) -> {};\n", args_str.str(), result); } @@ -4803,7 +4803,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ, "urEnqueueMemBufferRead", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferRead\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferRead\n"); ur_result_t result = pfnMemBufferRead(hQueue, hBuffer, blockingRead, offset, size, pDst, @@ -4817,7 +4817,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferRead({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferRead({}) -> {};\n", args_str.str(), result); } @@ -4863,7 +4863,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE, "urEnqueueMemBufferWrite", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferWrite\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferWrite\n"); ur_result_t result = pfnMemBufferWrite(hQueue, hBuffer, blockingWrite, offset, size, pSrc, @@ -4877,7 +4877,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferWrite({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferWrite({}) -> {};\n", args_str.str(), result); } @@ -4938,7 +4938,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( "urEnqueueMemBufferReadRect", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferReadRect\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferReadRect\n"); ur_result_t result = pfnMemBufferReadRect( hQueue, hBuffer, blockingRead, bufferOrigin, hostOrigin, region, @@ -4953,7 +4953,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferReadRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_READ_RECT, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferReadRect({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferReadRect({}) -> {};\n", args_str.str(), result); } @@ -5015,7 +5015,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( "urEnqueueMemBufferWriteRect", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferWriteRect\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferWriteRect\n"); ur_result_t result = pfnMemBufferWriteRect( hQueue, hBuffer, blockingWrite, bufferOrigin, hostOrigin, region, @@ -5030,7 +5030,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferWriteRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_WRITE_RECT, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferWriteRect({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferWriteRect({}) -> {};\n", args_str.str(), result); } @@ -5075,7 +5075,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY, "urEnqueueMemBufferCopy", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferCopy\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferCopy\n"); ur_result_t result = pfnMemBufferCopy(hQueue, hBufferSrc, hBufferDst, srcOffset, dstOffset, @@ -5089,7 +5089,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopy( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferCopy({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferCopy({}) -> {};\n", args_str.str(), result); } @@ -5146,7 +5146,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( "urEnqueueMemBufferCopyRect", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferCopyRect\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferCopyRect\n"); ur_result_t result = pfnMemBufferCopyRect( hQueue, hBufferSrc, hBufferDst, srcOrigin, dstOrigin, region, srcRowPitch, @@ -5161,7 +5161,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferCopyRect( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_COPY_RECT, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferCopyRect({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferCopyRect({}) -> {};\n", args_str.str(), result); } @@ -5212,7 +5212,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( UR_FUNCTION_ENQUEUE_MEM_BUFFER_FILL, "urEnqueueMemBufferFill", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferFill\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferFill\n"); ur_result_t result = pfnMemBufferFill(hQueue, hBuffer, pPattern, patternSize, offset, size, @@ -5226,7 +5226,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferFill( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_FILL, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferFill({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferFill({}) -> {};\n", args_str.str(), result); } @@ -5278,7 +5278,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageRead( UR_FUNCTION_ENQUEUE_MEM_IMAGE_READ, "urEnqueueMemImageRead", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemImageRead\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemImageRead\n"); ur_result_t result = pfnMemImageRead( hQueue, hImage, blockingRead, origin, region, rowPitch, slicePitch, pDst, @@ -5291,7 +5291,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_READ, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemImageRead({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemImageRead({}) -> {};\n", args_str.str(), result); } @@ -5343,7 +5343,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageWrite( UR_FUNCTION_ENQUEUE_MEM_IMAGE_WRITE, "urEnqueueMemImageWrite", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemImageWrite\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemImageWrite\n"); ur_result_t result = pfnMemImageWrite( hQueue, hImage, blockingWrite, origin, region, rowPitch, slicePitch, pSrc, @@ -5357,7 +5357,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_WRITE, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemImageWrite({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemImageWrite({}) -> {};\n", args_str.str(), result); } @@ -5405,7 +5405,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageCopy( UR_FUNCTION_ENQUEUE_MEM_IMAGE_COPY, "urEnqueueMemImageCopy", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemImageCopy\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemImageCopy\n"); ur_result_t result = pfnMemImageCopy(hQueue, hImageSrc, hImageDst, srcOrigin, dstOrigin, @@ -5418,7 +5418,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemImageCopy( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_IMAGE_COPY, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemImageCopy({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemImageCopy({}) -> {};\n", args_str.str(), result); } @@ -5467,7 +5467,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( UR_FUNCTION_ENQUEUE_MEM_BUFFER_MAP, "urEnqueueMemBufferMap", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemBufferMap\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemBufferMap\n"); ur_result_t result = pfnMemBufferMap(hQueue, hBuffer, blockingMap, mapFlags, offset, size, @@ -5480,7 +5480,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemBufferMap( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_MEM_BUFFER_MAP, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemBufferMap({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemBufferMap({}) -> {};\n", args_str.str(), result); } @@ -5519,7 +5519,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( "urEnqueueMemUnmap", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueMemUnmap\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueMemUnmap\n"); ur_result_t result = pfnMemUnmap( hQueue, hMem, pMappedPtr, numEventsInWaitList, phEventWaitList, phEvent); @@ -5531,7 +5531,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueMemUnmap( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_MEM_UNMAP, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueMemUnmap({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueMemUnmap({}) -> {};\n", args_str.str(), result); } @@ -5576,7 +5576,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill( "urEnqueueUSMFill", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueUSMFill\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueUSMFill\n"); ur_result_t result = pfnUSMFill(hQueue, pMem, patternSize, pPattern, size, numEventsInWaitList, @@ -5589,7 +5589,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FILL, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueUSMFill({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueUSMFill({}) -> {};\n", args_str.str(), result); } @@ -5632,7 +5632,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy( "urEnqueueUSMMemcpy", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueUSMMemcpy\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueUSMMemcpy\n"); ur_result_t result = pfnUSMMemcpy(hQueue, blocking, pDst, pSrc, size, numEventsInWaitList, @@ -5645,7 +5645,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_MEMCPY, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueUSMMemcpy({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueUSMMemcpy({}) -> {};\n", args_str.str(), result); } @@ -5686,7 +5686,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMPrefetch( UR_FUNCTION_ENQUEUE_USM_PREFETCH, "urEnqueueUSMPrefetch", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueUSMPrefetch\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueUSMPrefetch\n"); ur_result_t result = pfnUSMPrefetch( hQueue, pMem, size, flags, numEventsInWaitList, phEventWaitList, phEvent); @@ -5698,7 +5698,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMPrefetch( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_PREFETCH, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueUSMPrefetch({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueUSMPrefetch({}) -> {};\n", args_str.str(), result); } @@ -5730,7 +5730,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMAdvise( "urEnqueueUSMAdvise", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueUSMAdvise\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueUSMAdvise\n"); ur_result_t result = pfnUSMAdvise(hQueue, pMem, size, advice, phEvent); @@ -5741,7 +5741,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMAdvise( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_ADVISE, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueUSMAdvise({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueUSMAdvise({}) -> {};\n", args_str.str(), result); } @@ -5792,7 +5792,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill2D( UR_FUNCTION_ENQUEUE_USM_FILL_2D, "urEnqueueUSMFill2D", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueUSMFill2D\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueUSMFill2D\n"); ur_result_t result = pfnUSMFill2D(hQueue, pMem, pitch, patternSize, pPattern, width, height, @@ -5805,7 +5805,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFill2D( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FILL_2D, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueUSMFill2D({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueUSMFill2D({}) -> {};\n", args_str.str(), result); } @@ -5858,7 +5858,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( UR_FUNCTION_ENQUEUE_USM_MEMCPY_2D, "urEnqueueUSMMemcpy2D", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueUSMMemcpy2D\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueUSMMemcpy2D\n"); ur_result_t result = pfnUSMMemcpy2D(hQueue, blocking, pDst, dstPitch, pSrc, srcPitch, width, @@ -5871,7 +5871,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMMemcpy2D( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_MEMCPY_2D, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueUSMMemcpy2D({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueUSMMemcpy2D({}) -> {};\n", args_str.str(), result); } @@ -5922,7 +5922,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( "urEnqueueDeviceGlobalVariableWrite", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueDeviceGlobalVariableWrite\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueDeviceGlobalVariableWrite\n"); ur_result_t result = pfnDeviceGlobalVariableWrite( hQueue, hProgram, name, blockingWrite, count, offset, pSrc, @@ -5936,7 +5936,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableWrite( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_DEVICE_GLOBAL_VARIABLE_WRITE, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urEnqueueDeviceGlobalVariableWrite({}) -> {};\n", args_str.str(), result); } @@ -5988,7 +5988,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( "urEnqueueDeviceGlobalVariableRead", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueDeviceGlobalVariableRead\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueDeviceGlobalVariableRead\n"); ur_result_t result = pfnDeviceGlobalVariableRead( hQueue, hProgram, name, blockingRead, count, offset, pDst, @@ -6002,7 +6002,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueDeviceGlobalVariableRead( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_DEVICE_GLOBAL_VARIABLE_READ, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urEnqueueDeviceGlobalVariableRead({}) -> {};\n", args_str.str(), result); } @@ -6054,7 +6054,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueReadHostPipe( UR_FUNCTION_ENQUEUE_READ_HOST_PIPE, "urEnqueueReadHostPipe", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueReadHostPipe\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueReadHostPipe\n"); ur_result_t result = pfnReadHostPipe(hQueue, hProgram, pipe_symbol, blocking, pDst, size, @@ -6067,7 +6067,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueReadHostPipe( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_READ_HOST_PIPE, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueReadHostPipe({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueReadHostPipe({}) -> {};\n", args_str.str(), result); } @@ -6119,7 +6119,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueWriteHostPipe( UR_FUNCTION_ENQUEUE_WRITE_HOST_PIPE, "urEnqueueWriteHostPipe", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueWriteHostPipe\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueWriteHostPipe\n"); ur_result_t result = pfnWriteHostPipe(hQueue, hProgram, pipe_symbol, blocking, pSrc, size, @@ -6133,7 +6133,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueWriteHostPipe( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_WRITE_HOST_PIPE, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueWriteHostPipe({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueWriteHostPipe({}) -> {};\n", args_str.str(), result); } @@ -6176,7 +6176,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMDeviceAllocExp( "urEnqueueUSMDeviceAllocExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueUSMDeviceAllocExp\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueUSMDeviceAllocExp\n"); ur_result_t result = pfnUSMDeviceAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6190,7 +6190,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMDeviceAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_DEVICE_ALLOC_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueUSMDeviceAllocExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueUSMDeviceAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6233,7 +6233,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMSharedAllocExp( "urEnqueueUSMSharedAllocExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueUSMSharedAllocExp\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueUSMSharedAllocExp\n"); ur_result_t result = pfnUSMSharedAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6247,7 +6247,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMSharedAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_SHARED_ALLOC_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueUSMSharedAllocExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueUSMSharedAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6290,7 +6290,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMHostAllocExp( "urEnqueueUSMHostAllocExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueUSMHostAllocExp\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueUSMHostAllocExp\n"); ur_result_t result = pfnUSMHostAllocExp(hQueue, pPool, size, pProperties, numEventsInWaitList, @@ -6304,7 +6304,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMHostAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_USM_HOST_ALLOC_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueUSMHostAllocExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueUSMHostAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6340,7 +6340,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFreeExp( UR_FUNCTION_ENQUEUE_USM_FREE_EXP, "urEnqueueUSMFreeExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueUSMFreeExp\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueUSMFreeExp\n"); ur_result_t result = pfnUSMFreeExp(hQueue, pPool, pMem, numEventsInWaitList, phEventWaitList, phEvent); @@ -6352,7 +6352,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueUSMFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_ENQUEUE_USM_FREE_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueUSMFreeExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueUSMFreeExp({}) -> {};\n", args_str.str(), result); } @@ -6382,7 +6382,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreateExp( UR_FUNCTION_USM_POOL_CREATE_EXP, "urUSMPoolCreateExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolCreateExp\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolCreateExp\n"); ur_result_t result = pfnPoolCreateExp(hContext, hDevice, pPoolDesc, pPool); @@ -6393,7 +6393,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolCreateExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_CREATE_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPoolCreateExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPoolCreateExp({}) -> {};\n", args_str.str(), result); } @@ -6419,7 +6419,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( UR_FUNCTION_USM_POOL_DESTROY_EXP, "urUSMPoolDestroyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolDestroyExp\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolDestroyExp\n"); ur_result_t result = pfnPoolDestroyExp(hContext, hDevice, hPool); @@ -6430,7 +6430,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolDestroyExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_DESTROY_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPoolDestroyExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPoolDestroyExp({}) -> {};\n", args_str.str(), result); } @@ -6459,7 +6459,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( "urUSMPoolGetDefaultDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolGetDefaultDevicePoolExp\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolGetDefaultDevicePoolExp\n"); ur_result_t result = pfnPoolGetDefaultDevicePoolExp(hContext, hDevice, pPool); @@ -6471,7 +6471,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_GET_DEFAULT_DEVICE_POOL_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urUSMPoolGetDefaultDevicePoolExp({}) -> {};\n", args_str.str(), result); } @@ -6501,7 +6501,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( UR_FUNCTION_USM_POOL_GET_INFO_EXP, "urUSMPoolGetInfoExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolGetInfoExp\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolGetInfoExp\n"); ur_result_t result = pfnPoolGetInfoExp(hPool, propName, pPropValue, pPropSizeRet); @@ -6513,7 +6513,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_GET_INFO_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPoolGetInfoExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPoolGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -6542,7 +6542,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetInfoExp( UR_FUNCTION_USM_POOL_SET_INFO_EXP, "urUSMPoolSetInfoExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolSetInfoExp\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolSetInfoExp\n"); ur_result_t result = pfnPoolSetInfoExp(hPool, propName, pPropValue, propSize); @@ -6553,7 +6553,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_SET_INFO_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPoolSetInfoExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPoolSetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -6582,7 +6582,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( "urUSMPoolSetDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolSetDevicePoolExp\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolSetDevicePoolExp\n"); ur_result_t result = pfnPoolSetDevicePoolExp(hContext, hDevice, hPool); @@ -6594,7 +6594,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_SET_DEVICE_POOL_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPoolSetDevicePoolExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPoolSetDevicePoolExp({}) -> {};\n", args_str.str(), result); } @@ -6623,7 +6623,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp( "urUSMPoolGetDevicePoolExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolGetDevicePoolExp\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolGetDevicePoolExp\n"); ur_result_t result = pfnPoolGetDevicePoolExp(hContext, hDevice, pPool); @@ -6635,7 +6635,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_POOL_GET_DEVICE_POOL_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPoolGetDevicePoolExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPoolGetDevicePoolExp({}) -> {};\n", args_str.str(), result); } @@ -6664,7 +6664,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolTrimToExp( UR_FUNCTION_USM_POOL_TRIM_TO_EXP, "urUSMPoolTrimToExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPoolTrimToExp\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPoolTrimToExp\n"); ur_result_t result = pfnPoolTrimToExp(hContext, hDevice, hPool, minBytesToKeep); @@ -6676,7 +6676,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPoolTrimToExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_POOL_TRIM_TO_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPoolTrimToExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPoolTrimToExp({}) -> {};\n", args_str.str(), result); } @@ -6716,7 +6716,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( UR_FUNCTION_USM_PITCHED_ALLOC_EXP, "urUSMPitchedAllocExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMPitchedAllocExp\n"); + UR_LOG_L(logger, INFO, " ---> urUSMPitchedAllocExp\n"); ur_result_t result = pfnPitchedAllocExp(hContext, hDevice, pUSMDesc, pool, widthInBytes, @@ -6729,7 +6729,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMPitchedAllocExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_PITCHED_ALLOC_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMPitchedAllocExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMPitchedAllocExp({}) -> {};\n", args_str.str(), result); } @@ -6760,7 +6760,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp( "urBindlessImagesUnsampledImageHandleDestroyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " ---> urBindlessImagesUnsampledImageHandleDestroyExp\n"); ur_result_t result = @@ -6778,7 +6778,7 @@ urBindlessImagesUnsampledImageHandleDestroyExp( UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_HANDLE_DESTROY_EXP, ¶ms); UR_LOG_L( - logger, Info, + logger, INFO, " <--- urBindlessImagesUnsampledImageHandleDestroyExp({}) -> {};\n", args_str.str(), result); } @@ -6810,7 +6810,7 @@ urBindlessImagesSampledImageHandleDestroyExp( "urBindlessImagesSampledImageHandleDestroyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " ---> urBindlessImagesSampledImageHandleDestroyExp\n"); ur_result_t result = @@ -6827,7 +6827,7 @@ urBindlessImagesSampledImageHandleDestroyExp( args_str, UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_HANDLE_DESTROY_EXP, ¶ms); UR_LOG_L( - logger, Info, + logger, INFO, " <--- urBindlessImagesSampledImageHandleDestroyExp({}) -> {};\n", args_str.str(), result); } @@ -6861,7 +6861,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( "urBindlessImagesImageAllocateExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesImageAllocateExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesImageAllocateExp\n"); ur_result_t result = pfnImageAllocateExp(hContext, hDevice, pImageFormat, pImageDesc, phImageMem); @@ -6874,7 +6874,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageAllocateExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_ALLOCATE_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesImageAllocateExp({}) -> {};\n", args_str.str(), result); } @@ -6904,7 +6904,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( "urBindlessImagesImageFreeExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesImageFreeExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesImageFreeExp\n"); ur_result_t result = pfnImageFreeExp(hContext, hDevice, hImageMem); @@ -6916,7 +6916,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_FREE_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urBindlessImagesImageFreeExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urBindlessImagesImageFreeExp({}) -> {};\n", args_str.str(), result); } @@ -6951,7 +6951,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( "urBindlessImagesUnsampledImageCreateExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesUnsampledImageCreateExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesUnsampledImageCreateExp\n"); ur_result_t result = pfnUnsampledImageCreateExp( hContext, hDevice, hImageMem, pImageFormat, pImageDesc, phImage); @@ -6965,7 +6965,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_UNSAMPLED_IMAGE_CREATE_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesUnsampledImageCreateExp({}) -> {};\n", args_str.str(), result); } @@ -7004,7 +7004,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( "urBindlessImagesSampledImageCreateExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesSampledImageCreateExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesSampledImageCreateExp\n"); ur_result_t result = pfnSampledImageCreateExp(hContext, hDevice, hImageMem, pImageFormat, @@ -7019,7 +7019,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSampledImageCreateExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_SAMPLED_IMAGE_CREATE_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesSampledImageCreateExp({}) -> {};\n", args_str.str(), result); } @@ -7084,7 +7084,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( "urBindlessImagesImageCopyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesImageCopyExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesImageCopyExp\n"); ur_result_t result = pfnImageCopyExp( hQueue, pSrc, pDst, pSrcImageDesc, pDstImageDesc, pSrcImageFormat, @@ -7099,7 +7099,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageCopyExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_COPY_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urBindlessImagesImageCopyExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urBindlessImagesImageCopyExp({}) -> {};\n", args_str.str(), result); } @@ -7132,7 +7132,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( "urBindlessImagesImageGetInfoExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesImageGetInfoExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesImageGetInfoExp\n"); ur_result_t result = pfnImageGetInfoExp(hContext, hImageMem, propName, pPropValue, pPropSizeRet); @@ -7145,7 +7145,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImageGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMAGE_GET_INFO_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesImageGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -7179,7 +7179,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( "urBindlessImagesMipmapGetLevelExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesMipmapGetLevelExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesMipmapGetLevelExp\n"); ur_result_t result = pfnMipmapGetLevelExp(hContext, hDevice, hImageMem, mipmapLevel, phImageMem); @@ -7192,7 +7192,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapGetLevelExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_GET_LEVEL_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesMipmapGetLevelExp({}) -> {};\n", args_str.str(), result); } @@ -7222,7 +7222,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( "urBindlessImagesMipmapFreeExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesMipmapFreeExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesMipmapFreeExp\n"); ur_result_t result = pfnMipmapFreeExp(hContext, hDevice, hMem); @@ -7234,7 +7234,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMipmapFreeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MIPMAP_FREE_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urBindlessImagesMipmapFreeExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urBindlessImagesMipmapFreeExp({}) -> {};\n", args_str.str(), result); } @@ -7270,7 +7270,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalMemoryExp( "urBindlessImagesImportExternalMemoryExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesImportExternalMemoryExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesImportExternalMemoryExp\n"); ur_result_t result = pfnImportExternalMemoryExp( hContext, hDevice, size, memHandleType, pExternalMemDesc, phExternalMem); @@ -7284,7 +7284,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_MEMORY_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesImportExternalMemoryExp({}) -> {};\n", args_str.str(), result); } @@ -7321,7 +7321,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( "urBindlessImagesMapExternalArrayExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesMapExternalArrayExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesMapExternalArrayExp\n"); ur_result_t result = pfnMapExternalArrayExp( hContext, hDevice, pImageFormat, pImageDesc, hExternalMem, phImageMem); @@ -7334,7 +7334,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalArrayExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_ARRAY_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesMapExternalArrayExp({}) -> {};\n", args_str.str(), result); } @@ -7370,7 +7370,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalLinearMemoryExp( "urBindlessImagesMapExternalLinearMemoryExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " ---> urBindlessImagesMapExternalLinearMemoryExp\n"); ur_result_t result = pfnMapExternalLinearMemoryExp( @@ -7385,7 +7385,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesMapExternalLinearMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_MAP_EXTERNAL_LINEAR_MEMORY_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesMapExternalLinearMemoryExp({}) -> {};\n", args_str.str(), result); } @@ -7415,7 +7415,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalMemoryExp( "urBindlessImagesReleaseExternalMemoryExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesReleaseExternalMemoryExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesReleaseExternalMemoryExp\n"); ur_result_t result = pfnReleaseExternalMemoryExp(hContext, hDevice, hExternalMem); @@ -7429,7 +7429,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalMemoryExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_RELEASE_EXTERNAL_MEMORY_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesReleaseExternalMemoryExp({}) -> {};\n", args_str.str(), result); } @@ -7464,7 +7464,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreExp( "urBindlessImagesImportExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " ---> urBindlessImagesImportExternalSemaphoreExp\n"); ur_result_t result = pfnImportExternalSemaphoreExp( @@ -7480,7 +7480,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesImportExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_IMPORT_EXTERNAL_SEMAPHORE_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesImportExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7510,7 +7510,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalSemaphoreExp( "urBindlessImagesReleaseExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " ---> urBindlessImagesReleaseExternalSemaphoreExp\n"); ur_result_t result = @@ -7526,7 +7526,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesReleaseExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_RELEASE_EXTERNAL_SEMAPHORE_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesReleaseExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7575,7 +7575,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesWaitExternalSemaphoreExp( "urBindlessImagesWaitExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urBindlessImagesWaitExternalSemaphoreExp\n"); + UR_LOG_L(logger, INFO, " ---> urBindlessImagesWaitExternalSemaphoreExp\n"); ur_result_t result = pfnWaitExternalSemaphoreExp( hQueue, hSemaphore, hasWaitValue, waitValue, numEventsInWaitList, @@ -7590,7 +7590,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesWaitExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_WAIT_EXTERNAL_SEMAPHORE_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesWaitExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7639,7 +7639,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSignalExternalSemaphoreExp( "urBindlessImagesSignalExternalSemaphoreExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " ---> urBindlessImagesSignalExternalSemaphoreExp\n"); ur_result_t result = pfnSignalExternalSemaphoreExp( @@ -7655,7 +7655,7 @@ __urdlllocal ur_result_t UR_APICALL urBindlessImagesSignalExternalSemaphoreExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_BINDLESS_IMAGES_SIGNAL_EXTERNAL_SEMAPHORE_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urBindlessImagesSignalExternalSemaphoreExp({}) -> {};\n", args_str.str(), result); } @@ -7686,7 +7686,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferCreateExp( "urCommandBufferCreateExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferCreateExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferCreateExp\n"); ur_result_t result = pfnCreateExp(hContext, hDevice, pCommandBufferDesc, phCommandBuffer); @@ -7699,7 +7699,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferCreateExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_CREATE_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urCommandBufferCreateExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urCommandBufferCreateExp({}) -> {};\n", args_str.str(), result); } @@ -7722,7 +7722,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainExp( "urCommandBufferRetainExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferRetainExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferRetainExp\n"); ur_result_t result = pfnRetainExp(hCommandBuffer); @@ -7734,7 +7734,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferRetainExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_RETAIN_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urCommandBufferRetainExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urCommandBufferRetainExp({}) -> {};\n", args_str.str(), result); } @@ -7757,7 +7757,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferReleaseExp( "urCommandBufferReleaseExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferReleaseExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferReleaseExp\n"); ur_result_t result = pfnReleaseExp(hCommandBuffer); @@ -7769,7 +7769,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferReleaseExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_RELEASE_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urCommandBufferReleaseExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urCommandBufferReleaseExp({}) -> {};\n", args_str.str(), result); } @@ -7793,7 +7793,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferFinalizeExp( "urCommandBufferFinalizeExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferFinalizeExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferFinalizeExp\n"); ur_result_t result = pfnFinalizeExp(hCommandBuffer); @@ -7805,7 +7805,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferFinalizeExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_FINALIZE_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urCommandBufferFinalizeExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urCommandBufferFinalizeExp({}) -> {};\n", args_str.str(), result); } @@ -7885,7 +7885,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( "urCommandBufferAppendKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendKernelLaunchExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendKernelLaunchExp\n"); ur_result_t result = pfnAppendKernelLaunchExp( hCommandBuffer, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -7901,7 +7901,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_KERNEL_LAUNCH_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendKernelLaunchExp({}) -> {};\n", args_str.str(), result); } @@ -7962,7 +7962,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp( "urCommandBufferAppendUSMMemcpyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendUSMMemcpyExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendUSMMemcpyExp\n"); ur_result_t result = pfnAppendUSMMemcpyExp( hCommandBuffer, pDst, pSrc, size, numSyncPointsInWaitList, @@ -7977,7 +7977,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMMemcpyExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_MEMCPY_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendUSMMemcpyExp({}) -> {};\n", args_str.str(), result); } @@ -8041,7 +8041,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMFillExp( "urCommandBufferAppendUSMFillExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendUSMFillExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendUSMFillExp\n"); ur_result_t result = pfnAppendUSMFillExp( hCommandBuffer, pMemory, pPattern, patternSize, size, @@ -8056,7 +8056,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMFillExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_FILL_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendUSMFillExp({}) -> {};\n", args_str.str(), result); } @@ -8123,7 +8123,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp( "urCommandBufferAppendMemBufferCopyExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferCopyExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferCopyExp\n"); ur_result_t result = pfnAppendMemBufferCopyExp( hCommandBuffer, hSrcMem, hDstMem, srcOffset, dstOffset, size, @@ -8139,7 +8139,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_COPY_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendMemBufferCopyExp({}) -> {};\n", args_str.str(), result); } @@ -8203,7 +8203,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp( "urCommandBufferAppendMemBufferWriteExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferWriteExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferWriteExp\n"); ur_result_t result = pfnAppendMemBufferWriteExp( hCommandBuffer, hBuffer, offset, size, pSrc, numSyncPointsInWaitList, @@ -8219,7 +8219,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_WRITE_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendMemBufferWriteExp({}) -> {};\n", args_str.str(), result); } @@ -8283,7 +8283,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp( "urCommandBufferAppendMemBufferReadExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferReadExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferReadExp\n"); ur_result_t result = pfnAppendMemBufferReadExp( hCommandBuffer, hBuffer, offset, size, pDst, numSyncPointsInWaitList, @@ -8299,7 +8299,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_READ_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendMemBufferReadExp({}) -> {};\n", args_str.str(), result); } @@ -8378,7 +8378,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp( "urCommandBufferAppendMemBufferCopyRectExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferCopyRectExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferCopyRectExp\n"); ur_result_t result = pfnAppendMemBufferCopyRectExp( hCommandBuffer, hSrcMem, hDstMem, srcOrigin, dstOrigin, region, @@ -8395,7 +8395,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferCopyRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_COPY_RECT_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendMemBufferCopyRectExp({}) -> {};\n", args_str.str(), result); } @@ -8477,7 +8477,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp( "urCommandBufferAppendMemBufferWriteRectExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferWriteRectExp\n"); ur_result_t result = pfnAppendMemBufferWriteRectExp( @@ -8495,7 +8495,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferWriteRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_WRITE_RECT_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendMemBufferWriteRectExp({}) -> {};\n", args_str.str(), result); } @@ -8576,7 +8576,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp( "urCommandBufferAppendMemBufferReadRectExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferReadRectExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferReadRectExp\n"); ur_result_t result = pfnAppendMemBufferReadRectExp( hCommandBuffer, hBuffer, bufferOffset, hostOffset, region, bufferRowPitch, @@ -8593,7 +8593,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferReadRectExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_READ_RECT_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendMemBufferReadRectExp({}) -> {};\n", args_str.str(), result); } @@ -8660,7 +8660,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp( "urCommandBufferAppendMemBufferFillExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendMemBufferFillExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendMemBufferFillExp\n"); ur_result_t result = pfnAppendMemBufferFillExp( hCommandBuffer, hBuffer, pPattern, patternSize, offset, size, @@ -8676,7 +8676,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendMemBufferFillExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_FILL_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendMemBufferFillExp({}) -> {};\n", args_str.str(), result); } @@ -8737,7 +8737,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMPrefetchExp( "urCommandBufferAppendUSMPrefetchExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendUSMPrefetchExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendUSMPrefetchExp\n"); ur_result_t result = pfnAppendUSMPrefetchExp( hCommandBuffer, pMemory, size, flags, numSyncPointsInWaitList, @@ -8752,7 +8752,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMPrefetchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_PREFETCH_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendUSMPrefetchExp({}) -> {};\n", args_str.str(), result); } @@ -8813,7 +8813,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp( "urCommandBufferAppendUSMAdviseExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendUSMAdviseExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendUSMAdviseExp\n"); ur_result_t result = pfnAppendUSMAdviseExp( hCommandBuffer, pMemory, size, advice, numSyncPointsInWaitList, @@ -8828,7 +8828,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendUSMAdviseExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_ADVISE_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendUSMAdviseExp({}) -> {};\n", args_str.str(), result); } @@ -8874,7 +8874,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendNativeCommandExp( "urCommandBufferAppendNativeCommandExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferAppendNativeCommandExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferAppendNativeCommandExp\n"); ur_result_t result = pfnAppendNativeCommandExp( hCommandBuffer, pfnNativeCommand, pData, hChildCommandBuffer, @@ -8889,7 +8889,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferAppendNativeCommandExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_APPEND_NATIVE_COMMAND_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferAppendNativeCommandExp({}) -> {};\n", args_str.str(), result); } @@ -8930,7 +8930,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCommandBufferExp( "urEnqueueCommandBufferExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueCommandBufferExp\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueCommandBufferExp\n"); ur_result_t result = pfnCommandBufferExp( hQueue, hCommandBuffer, numEventsInWaitList, phEventWaitList, phEvent); @@ -8943,7 +8943,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCommandBufferExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_COMMAND_BUFFER_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueCommandBufferExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueCommandBufferExp({}) -> {};\n", args_str.str(), result); } @@ -8974,7 +8974,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp( "urCommandBufferUpdateKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferUpdateKernelLaunchExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferUpdateKernelLaunchExp\n"); ur_result_t result = pfnUpdateKernelLaunchExp( hCommandBuffer, numKernelUpdates, pUpdateKernelLaunch); @@ -8987,7 +8987,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_KERNEL_LAUNCH_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferUpdateKernelLaunchExp({}) -> {};\n", args_str.str(), result); } @@ -9015,7 +9015,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateSignalEventExp( "urCommandBufferUpdateSignalEventExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferUpdateSignalEventExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferUpdateSignalEventExp\n"); ur_result_t result = pfnUpdateSignalEventExp(hCommand, phSignalEvent); @@ -9027,7 +9027,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateSignalEventExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_SIGNAL_EVENT_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferUpdateSignalEventExp({}) -> {};\n", args_str.str(), result); } @@ -9059,7 +9059,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateWaitEventsExp( "urCommandBufferUpdateWaitEventsExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferUpdateWaitEventsExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferUpdateWaitEventsExp\n"); ur_result_t result = pfnUpdateWaitEventsExp(hCommand, numEventsInWaitList, phEventWaitList); @@ -9072,7 +9072,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferUpdateWaitEventsExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_UPDATE_WAIT_EVENTS_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferUpdateWaitEventsExp({}) -> {};\n", args_str.str(), result); } @@ -9106,7 +9106,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetInfoExp( "urCommandBufferGetInfoExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferGetInfoExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferGetInfoExp\n"); ur_result_t result = pfnGetInfoExp(hCommandBuffer, propName, propSize, pPropValue, pPropSizeRet); @@ -9119,7 +9119,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_GET_INFO_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urCommandBufferGetInfoExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urCommandBufferGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -9146,7 +9146,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetNativeHandleExp( "urCommandBufferGetNativeHandleExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urCommandBufferGetNativeHandleExp\n"); + UR_LOG_L(logger, INFO, " ---> urCommandBufferGetNativeHandleExp\n"); ur_result_t result = pfnGetNativeHandleExp(hCommandBuffer, phNativeCommandBuffer); @@ -9159,7 +9159,7 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferGetNativeHandleExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_COMMAND_BUFFER_GET_NATIVE_HANDLE_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urCommandBufferGetNativeHandleExp({}) -> {};\n", args_str.str(), result); } @@ -9222,7 +9222,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( "urEnqueueCooperativeKernelLaunchExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueCooperativeKernelLaunchExp\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueCooperativeKernelLaunchExp\n"); ur_result_t result = pfnCooperativeKernelLaunchExp( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -9236,7 +9236,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueCooperativeKernelLaunchExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_COOPERATIVE_KERNEL_LAUNCH_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urEnqueueCooperativeKernelLaunchExp({}) -> {};\n", args_str.str(), result); } @@ -9281,7 +9281,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp( "urKernelSuggestMaxCooperativeGroupCountExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " ---> urKernelSuggestMaxCooperativeGroupCountExp\n"); ur_result_t result = pfnSuggestMaxCooperativeGroupCountExp( @@ -9297,7 +9297,7 @@ __urdlllocal ur_result_t UR_APICALL urKernelSuggestMaxCooperativeGroupCountExp( ur::extras::printFunctionParams( args_str, UR_FUNCTION_KERNEL_SUGGEST_MAX_COOPERATIVE_GROUP_COUNT_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urKernelSuggestMaxCooperativeGroupCountExp({}) -> {};\n", args_str.str(), result); } @@ -9345,7 +9345,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp( "urEnqueueTimestampRecordingExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueTimestampRecordingExp\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueTimestampRecordingExp\n"); ur_result_t result = pfnTimestampRecordingExp( hQueue, blocking, numEventsInWaitList, phEventWaitList, phEvent); @@ -9358,7 +9358,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueTimestampRecordingExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_TIMESTAMP_RECORDING_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urEnqueueTimestampRecordingExp({}) -> {};\n", args_str.str(), result); } @@ -9427,7 +9427,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp( "urEnqueueKernelLaunchCustomExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueKernelLaunchCustomExp\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueKernelLaunchCustomExp\n"); ur_result_t result = pfnKernelLaunchCustomExp( hQueue, hKernel, workDim, pGlobalWorkOffset, pGlobalWorkSize, @@ -9442,7 +9442,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueKernelLaunchCustomExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_KERNEL_LAUNCH_CUSTOM_EXP, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urEnqueueKernelLaunchCustomExp({}) -> {};\n", args_str.str(), result); } @@ -9472,7 +9472,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( "urProgramBuildExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramBuildExp\n"); + UR_LOG_L(logger, INFO, " ---> urProgramBuildExp\n"); ur_result_t result = pfnBuildExp(hProgram, numDevices, phDevices, pOptions); @@ -9483,7 +9483,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramBuildExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_BUILD_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramBuildExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramBuildExp({}) -> {};\n", args_str.str(), result); } @@ -9512,7 +9512,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompileExp( UR_FUNCTION_PROGRAM_COMPILE_EXP, "urProgramCompileExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramCompileExp\n"); + UR_LOG_L(logger, INFO, " ---> urProgramCompileExp\n"); ur_result_t result = pfnCompileExp(hProgram, numDevices, phDevices, pOptions); @@ -9523,7 +9523,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramCompileExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_COMPILE_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramCompileExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramCompileExp({}) -> {};\n", args_str.str(), result); } @@ -9562,7 +9562,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLinkExp( "urProgramLinkExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urProgramLinkExp\n"); + UR_LOG_L(logger, INFO, " ---> urProgramLinkExp\n"); ur_result_t result = pfnLinkExp(hContext, numDevices, phDevices, count, phPrograms, pOptions, phProgram); @@ -9574,7 +9574,7 @@ __urdlllocal ur_result_t UR_APICALL urProgramLinkExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_PROGRAM_LINK_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urProgramLinkExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urProgramLinkExp({}) -> {};\n", args_str.str(), result); } @@ -9600,7 +9600,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( "urUSMImportExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMImportExp\n"); + UR_LOG_L(logger, INFO, " ---> urUSMImportExp\n"); ur_result_t result = pfnImportExp(hContext, pMem, size); @@ -9611,7 +9611,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_IMPORT_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMImportExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMImportExp({}) -> {};\n", args_str.str(), result); } @@ -9635,7 +9635,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( "urUSMReleaseExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUSMReleaseExp\n"); + UR_LOG_L(logger, INFO, " ---> urUSMReleaseExp\n"); ur_result_t result = pfnReleaseExp(hContext, pMem); @@ -9646,7 +9646,7 @@ __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( std::ostringstream args_str; ur::extras::printFunctionParams(args_str, UR_FUNCTION_USM_RELEASE_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUSMReleaseExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUSMReleaseExp({}) -> {};\n", args_str.str(), result); } @@ -9673,7 +9673,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp( "urUsmP2PEnablePeerAccessExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUsmP2PEnablePeerAccessExp\n"); + UR_LOG_L(logger, INFO, " ---> urUsmP2PEnablePeerAccessExp\n"); ur_result_t result = pfnEnablePeerAccessExp(commandDevice, peerDevice); @@ -9685,7 +9685,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PEnablePeerAccessExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_ENABLE_PEER_ACCESS_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUsmP2PEnablePeerAccessExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUsmP2PEnablePeerAccessExp({}) -> {};\n", args_str.str(), result); } @@ -9712,7 +9712,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( "urUsmP2PDisablePeerAccessExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUsmP2PDisablePeerAccessExp\n"); + UR_LOG_L(logger, INFO, " ---> urUsmP2PDisablePeerAccessExp\n"); ur_result_t result = pfnDisablePeerAccessExp(commandDevice, peerDevice); @@ -9724,7 +9724,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PDisablePeerAccessExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_DISABLE_PEER_ACCESS_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUsmP2PDisablePeerAccessExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUsmP2PDisablePeerAccessExp({}) -> {};\n", args_str.str(), result); } @@ -9766,7 +9766,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( "urUsmP2PPeerAccessGetInfoExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urUsmP2PPeerAccessGetInfoExp\n"); + UR_LOG_L(logger, INFO, " ---> urUsmP2PPeerAccessGetInfoExp\n"); ur_result_t result = pfnPeerAccessGetInfoExp( commandDevice, peerDevice, propName, propSize, pPropValue, pPropSizeRet); @@ -9779,7 +9779,7 @@ __urdlllocal ur_result_t UR_APICALL urUsmP2PPeerAccessGetInfoExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_USM_P2P_PEER_ACCESS_GET_INFO_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urUsmP2PPeerAccessGetInfoExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urUsmP2PPeerAccessGetInfoExp({}) -> {};\n", args_str.str(), result); } @@ -9818,7 +9818,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrierExt( "urEnqueueEventsWaitWithBarrierExt", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueEventsWaitWithBarrierExt\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueEventsWaitWithBarrierExt\n"); ur_result_t result = pfnEventsWaitWithBarrierExt( hQueue, pProperties, numEventsInWaitList, phEventWaitList, phEvent); @@ -9831,7 +9831,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueEventsWaitWithBarrierExt( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_EVENTS_WAIT_WITH_BARRIER_EXT, ¶ms); - UR_LOG_L(logger, Info, + UR_LOG_L(logger, INFO, " <--- urEnqueueEventsWaitWithBarrierExt({}) -> {};\n", args_str.str(), result); } @@ -9891,7 +9891,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( "urEnqueueNativeCommandExp", ¶ms); auto &logger = getContext()->logger; - UR_LOG_L(logger, Info, " ---> urEnqueueNativeCommandExp\n"); + UR_LOG_L(logger, INFO, " ---> urEnqueueNativeCommandExp\n"); ur_result_t result = pfnNativeCommandExp( hQueue, pfnNativeEnqueue, data, numMemsInMemList, phMemList, pProperties, @@ -9905,7 +9905,7 @@ __urdlllocal ur_result_t UR_APICALL urEnqueueNativeCommandExp( std::ostringstream args_str; ur::extras::printFunctionParams( args_str, UR_FUNCTION_ENQUEUE_NATIVE_COMMAND_EXP, ¶ms); - UR_LOG_L(logger, Info, " <--- urEnqueueNativeCommandExp({}) -> {};\n", + UR_LOG_L(logger, INFO, " <--- urEnqueueNativeCommandExp({}) -> {};\n", args_str.str(), result); } diff --git a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp index cec0cea6ba2b..355cd0596048 100644 --- a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp +++ b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp @@ -68,13 +68,13 @@ struct RefCountContext { ptr, RefRuntimeInfo{1, std::type_index(typeid(handle)), getCurrentBacktrace()}); } else { - UR_LOG_L(getContext()->logger, Error, "Handle {} already exists", ptr); + UR_LOG_L(getContext()->logger, ERROR, "Handle {} already exists", ptr); return; } break; case REFCOUNT_INCREASE: if (it == counts.end()) { - UR_LOG_L(getContext()->logger, Error, + UR_LOG_L(getContext()->logger, ERROR, "Attempting to retain nonexistent handle {}", ptr); return; } else { @@ -91,14 +91,14 @@ struct RefCountContext { } if (it->second.refCount < 0) { - UR_LOG(Error, "Attempting to release nonexistent handle {}", ptr); + UR_LOG(ERROR, "Attempting to release nonexistent handle {}", ptr); } else if (it->second.refCount == 0 && isAdapterHandle) { adapterCount--; } break; } - UR_LOG_L(getContext()->logger, Debug, + UR_LOG_L(getContext()->logger, DEBUG, "Reference count for handle {} changed to {}", ptr, it->second.refCount); diff --git a/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp b/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp index cc83f7d59f4a..98aab0d2aead 100644 --- a/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp +++ b/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp @@ -33,7 +33,7 @@ context_t::~context_t() {} result == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) \ return UR_RESULT_SUCCESS; \ if (result != UR_RESULT_SUCCESS) { \ - UR_LOG_L(getContext()->logger, Error, \ + UR_LOG_L(getContext()->logger, ERROR, \ "Unexpected non-success result code from {}", #result); \ assert(0); \ return result; \ diff --git a/unified-runtime/source/loader/ur_adapter_registry.hpp b/unified-runtime/source/loader/ur_adapter_registry.hpp index 6ce29ae82cc1..c005f24cb102 100644 --- a/unified-runtime/source/loader/ur_adapter_registry.hpp +++ b/unified-runtime/source/loader/ur_adapter_registry.hpp @@ -49,7 +49,7 @@ struct FilterTerm { auto backendIter = backendNameMap.find(backend); if (backendIter == backendNameMap.end()) { - UR_LOG(Debug, + UR_LOG(DEBUG, "ONEAPI_DEVICE_SELECTOR Pre-Filter with illegal backend '{}' ", backend); return false; @@ -74,7 +74,7 @@ struct FilterTerm { } auto deviceIter = deviceTypeMap.find(deviceString); if (deviceIter == deviceTypeMap.end()) { - UR_LOG(Debug, + UR_LOG(DEBUG, "ONEAPI_DEVICE_SELECTOR Pre-Filter with illegal device '{}' ", deviceString); continue; @@ -102,14 +102,14 @@ class AdapterRegistry { try { forceLoadedAdaptersOpt = getenv_to_vec("UR_ADAPTERS_FORCE_LOAD"); } catch (const std::invalid_argument &e) { - UR_LOG(Error, e.what()); + UR_LOG(ERROR, e.what()); } if (forceLoadedAdaptersOpt.has_value()) { for (const auto &s : forceLoadedAdaptersOpt.value()) { auto path = fs::path(s); if (path.filename().extension() == STATIC_LIBRARY_EXTENSION) { - UR_LOG(Warning, + UR_LOG(WARN, "UR_ADAPTERS_FORCE_LOAD contains a path to a static" "library {}, it will be skipped", s); @@ -120,14 +120,14 @@ class AdapterRegistry { try { exists = fs::exists(path); } catch (std::exception &e) { - UR_LOG(Error, e.what()); + UR_LOG(ERROR, e.what()); } if (exists) { forceLoaded = true; adaptersLoadPaths.emplace_back(std::vector{std::move(path)}); } else { - UR_LOG(Warning, + UR_LOG(WARN, "Detected nonexistent path {} in environment " "variable UR_ADAPTERS_FORCE_LOAD", s); @@ -205,7 +205,7 @@ class AdapterRegistry { try { pathStringsOpt = getenv_to_vec("UR_ADAPTERS_SEARCH_PATH"); } catch (const std::invalid_argument &e) { - UR_LOG(Error, e.what()); + UR_LOG(ERROR, e.what()); return std::nullopt; } @@ -216,7 +216,7 @@ class AdapterRegistry { if (fs::exists(path)) { paths.emplace_back(path); } else { - UR_LOG(Warning, + UR_LOG(WARN, "Detected nonexistent path {} in environmental " "variable UR_ADAPTERS_SEARCH_PATH", s); @@ -235,11 +235,11 @@ class AdapterRegistry { } catch (...) { // If the selector is malformed, then we ignore selector and return // success. - UR_LOG(Error, "ERROR: missing backend, format of filter = " + UR_LOG(ERROR, "ERROR: missing backend, format of filter = " "'[!]backend:filterStrings'"); return UR_RESULT_SUCCESS; } - UR_LOG(Debug, "getenv_to_map parsed env var and {} a map", + UR_LOG(DEBUG, "getenv_to_map parsed env var and {} a map", (odsEnvMap.has_value() ? "produced" : "failed to produce")); // if the ODS env var is not set at all, then pretend it was set to the @@ -257,22 +257,22 @@ class AdapterRegistry { // on the first error. if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case - // malformed term: missing backend -- output Error, then continue - UR_LOG(Error, "ERROR: missing backend, format of filter = " + // malformed term: missing backend -- output ERROR, then continue + UR_LOG(ERROR, "ERROR: missing backend, format of filter = " "'[!]backend:filterStrings'"); continue; } - UR_LOG(Debug, "ONEAPI_DEVICE_SELECTOR Pre-Filter with backend '{}' ", + UR_LOG(DEBUG, "ONEAPI_DEVICE_SELECTOR Pre-Filter with backend '{}' ", backend); bool PositiveFilter = backend.front() != '!'; - UR_LOG(Debug, "term is a {} filter", + UR_LOG(DEBUG, "term is a {} filter", (PositiveFilter ? "positive" : "negative")); if (!PositiveFilter) { - UR_LOG(Debug, "DEBUG: backend was '{}'", backend); + UR_LOG(DEBUG, "DEBUG: backend was '{}'", backend); // Trim off the "!" from the backend backend.erase(backend.cbegin()); - UR_LOG(Debug, "DEBUG: backend now '{}'", backend); + UR_LOG(DEBUG, "DEBUG: backend now '{}'", backend); } // Make sure the backend is lower case @@ -341,7 +341,7 @@ class AdapterRegistry { std::string(adapterName).find("v2") != std::string::npos; if (v2Requested != v2Adapter) { - UR_LOG(Info, "The adapter '{}' is skipped because {} {}.", + UR_LOG(INFO, "The adapter '{}' is skipped because {} {}.", adapterName, "UR_LOADER_USE_LEVEL_ZERO_V2 or SYCL_UR_USE_LEVEL_ZERO_V2", v2Requested ? "is set" : "is not set"); diff --git a/unified-runtime/source/loader/ur_lib.cpp b/unified-runtime/source/loader/ur_lib.cpp index 223a6930afa3..208030d6ca49 100644 --- a/unified-runtime/source/loader/ur_lib.cpp +++ b/unified-runtime/source/loader/ur_lib.cpp @@ -76,7 +76,7 @@ __urdlllocal ur_result_t context_t::Init( ur_result_t result; const char *logger_name = "loader"; logger::init(logger_name); - UR_LOG(Debug, "Logger {} initialized successfully!", logger_name); + UR_LOG(DEBUG, "Logger {} initialized successfully!", logger_name); result = ur_loader::getContext()->init(); @@ -215,7 +215,7 @@ ur_result_t urLoaderTearDown() { ur_result_t result = ret == 0 ? UR_RESULT_SUCCESS : UR_RESULT_ERROR_UNINITIALIZED; - UR_LOG(Info, "---> urLoaderTearDown() -> {}", result); + UR_LOG(INFO, "---> urLoaderTearDown() -> {}", result); return result; } @@ -333,7 +333,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, auto maybeEnvVarMap = getenv_to_map("ONEAPI_DEVICE_SELECTOR", /* reject_empty= */ false, /* allow_duplicate= */ false, /* lower= */ true); - UR_LOG(Debug, "getenv_to_map parsed env var and {} a map", + UR_LOG(DEBUG, "getenv_to_map parsed env var and {} a map", (maybeEnvVarMap.has_value() ? "produced" : "failed to produce")); // if the ODS env var is not set at all, then pretend it was set to the @@ -440,8 +440,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // on the first error. if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case - // malformed term: missing backend -- output Error, then continue - UR_LOG(Error, "ERROR: missing backend, format of filter = " + // malformed term: missing backend -- output ERROR, then continue + UR_LOG(ERROR, "ERROR: missing backend, format of filter = " "'[!]backend:filterStrings'"); continue; } @@ -449,14 +449,14 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, AcceptFilter, DiscardFilter, } termType = (backend.front() != '!') ? AcceptFilter : DiscardFilter; - UR_LOG(Debug, "termType is {}", + UR_LOG(DEBUG, "termType is {}", (termType != AcceptFilter ? "DiscardFilter" : "AcceptFilter")); auto &deviceList = (termType != AcceptFilter) ? discardDeviceList : acceptDeviceList; if (termType != AcceptFilter) { - UR_LOG(Debug, "DEBUG: backend was '{}'", backend); + UR_LOG(DEBUG, "DEBUG: backend was '{}'", backend); backend.erase(backend.cbegin()); - UR_LOG(Debug, "DEBUG: backend now '{}'", backend); + UR_LOG(DEBUG, "DEBUG: backend now '{}'", backend); } // Note the hPlatform -> platformBackend -> platformBackendName conversion // above guarantees minimal sanity for the comparison with backend from the @@ -467,7 +467,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, [&](auto &p) { return p.second == backend; }); if (found == cend) { // It's not a legal backend - UR_LOG(Error, "unrecognised backend '{}'", backend); + UR_LOG(ERROR, "unrecognised backend '{}'", backend); return UR_RESULT_ERROR_INVALID_VALUE; } else if (found->first != platformBackend) { // If it's a rule for a different backend, ignore it @@ -476,7 +476,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, } if (termPair.second.size() == 0) { // malformed term: missing filterStrings -- output ERROR - UR_LOG(Error, "missing filterStrings, format of filter = " + UR_LOG(ERROR, "missing filterStrings, format of filter = " "'[!]backend:filterStrings'"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -485,8 +485,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, termPair.second.cend()) { // FIXME: never true because getenv_to_map rejects this case // malformed term: missing filterString -- output warning, then continue - UR_LOG(Warning, "WARNING: empty filterString, format of filterStrings " - "= 'filterString[,filterString[,...]]'"); + UR_LOG(WARN, "WARNING: empty filterString, format of filterStrings " + "= 'filterString[,filterString[,...]]'"); continue; } if (std::find_if(termPair.second.cbegin(), termPair.second.cend(), @@ -494,7 +494,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return std::count(s.cbegin(), s.cend(), '.') > 2; }) != termPair.second.cend()) { // malformed term: too many dots in filterString - UR_LOG(Error, "too many dots in filterString, format of " + UR_LOG(ERROR, "too many dots in filterString, format of " "filterString = 'root[.sub[.subsub]]'"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -516,7 +516,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return false; // no BAD things, so must be okay }) != termPair.second.cend()) { // malformed term: star dot no-star in filterString - UR_LOG(Error, "invalid wildcard in filterString, '*.' => '*.*'"); + UR_LOG(ERROR, "invalid wildcard in filterString, '*.' => '*.*'"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -579,9 +579,9 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, 0, 0, nullptr}); } - UR_LOG(Debug, "DEBUG: size of acceptDeviceList = {}", + UR_LOG(DEBUG, "DEBUG: size of acceptDeviceList = {}", acceptDeviceList.size()); - UR_LOG(Debug, "DEBUG: size of discardDeviceList = {}", + UR_LOG(DEBUG, "DEBUG: size of discardDeviceList = {}", discardDeviceList.size()); std::vector rootDevices; @@ -742,18 +742,18 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // is a subsubdevice filter, then it must be '*.*.*' matches = (filter.hwType == device.hwType) || (filter.hwType == DeviceHardwareType::UR_DEVICE_TYPE_ALL); - UR_LOG(Debug, "DEBUG: In ApplyFilter, if block case 1, matches = {}", + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 1, matches = {}", matches); } else if (filter.rootId != device.rootId) { // root part in filter is a number but does not match the number in the // root part of device matches = false; - UR_LOG(Debug, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 2, matches = ", matches); } else if (filter.level == DevicePartLevel::ROOT) { // this is a root device filter with a number that matches matches = true; - UR_LOG(Debug, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 3, matches = ", matches); } else if (filter.subId == DeviceIdTypeALL) { // sub type of star always matches (when root part matches, which we @@ -761,30 +761,30 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // 'matches.*' if this is a subsubdevice filter, then it must be // 'matches.*.*' matches = true; - UR_LOG(Debug, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 4, matches = ", matches); } else if (filter.subId != device.subId) { // sub part in filter is a number but does not match the number in the sub // part of device matches = false; - UR_LOG(Debug, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 5, matches = ", matches); } else if (filter.level == DevicePartLevel::SUB) { // this is a sub device number filter, numbers match in both parts matches = true; - UR_LOG(Debug, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 6, matches = ", matches); } else if (filter.subsubId == DeviceIdTypeALL) { // subsub type of star always matches (when other parts match, which we // already know here) this is a subsub device filter, it must be // 'matches.matches.*' matches = true; - UR_LOG(Debug, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 7, matches = ", matches); } else { // this is a subsub device filter, numbers in all three parts match matches = (filter.subsubId == device.subsubId); - UR_LOG(Debug, + UR_LOG(DEBUG, "DEBUG: In ApplyFilter, if block case 8, matches = ", matches); } return matches; @@ -849,7 +849,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, subSubDevices.end()); } if (numAlreadySelected == selectedDevices.size()) { - UR_LOG(Warning, + UR_LOG(WARN, "WARNING: an accept term was ignored because it " "does not select any additional devices" "selectedDevices.size() = {}", diff --git a/unified-runtime/test/loader/platforms/platforms.cpp b/unified-runtime/test/loader/platforms/platforms.cpp index c9158aaa03bf..1b0c66165f8d 100644 --- a/unified-runtime/test/loader/platforms/platforms.cpp +++ b/unified-runtime/test/loader/platforms/platforms.cpp @@ -27,23 +27,23 @@ int main(int, char *[]) { // Initialize the platform status = urLoaderInit(0, nullptr); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, Error, "urLoaderInit failed with return code: {}", status); + UR_LOG_L(out, ERROR, "urLoaderInit failed with return code: {}", status); return 1; } - UR_LOG_L(out, Info, "urLoaderInit succeeded."); + UR_LOG_L(out, INFO, "urLoaderInit succeeded."); uint32_t adapterCount = 0; std::vector adapters; status = urAdapterGet(0, nullptr, &adapterCount); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, Error, "urAdapterGet failed with return code: {}", status); + UR_LOG_L(out, ERROR, "urAdapterGet failed with return code: {}", status); return 1; } adapters.resize(adapterCount); status = urAdapterGet(adapterCount, adapters.data(), nullptr); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, Error, "urAdapterGet failed with return code: {}", status); + UR_LOG_L(out, ERROR, "urAdapterGet failed with return code: {}", status); return 1; } @@ -53,17 +53,17 @@ int main(int, char *[]) { uint32_t adapterPlatformCount = 0; status = urPlatformGet(adapter, 0, nullptr, &adapterPlatformCount); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, Error, "urPlatformGet failed with return code: {}", status); + UR_LOG_L(out, ERROR, "urPlatformGet failed with return code: {}", status); goto out; } - UR_LOG_L(out, Info, "urPlatformGet found {} platforms", + UR_LOG_L(out, INFO, "urPlatformGet found {} platforms", adapterPlatformCount); platforms.resize(platformCount + adapterPlatformCount); status = urPlatformGet(adapter, adapterPlatformCount, &platforms[platformCount], &adapterPlatformCount); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, Error, "urPlatformGet failed with return code: {}", status); + UR_LOG_L(out, ERROR, "urPlatformGet failed with return code: {}", status); goto out; } platformCount += adapterPlatformCount; @@ -73,7 +73,7 @@ int main(int, char *[]) { size_t name_len; status = urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, 0, nullptr, &name_len); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, Error, "urPlatformGetInfo failed with return code: {}", + UR_LOG_L(out, ERROR, "urPlatformGetInfo failed with return code: {}", status); goto out; } @@ -84,12 +84,12 @@ int main(int, char *[]) { status = urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, name_len, name, nullptr); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, Error, "urPlatformGetInfo failed with return code: {}", + UR_LOG_L(out, ERROR, "urPlatformGetInfo failed with return code: {}", status); free(name); goto out; } - UR_LOG_L(out, Info, "Found {} ", name); + UR_LOG_L(out, INFO, "Found {} ", name); free(name); } diff --git a/unified-runtime/test/logger/env_var.cpp b/unified-runtime/test/logger/env_var.cpp index 200b7f7bbc76..763985299791 100644 --- a/unified-runtime/test/logger/env_var.cpp +++ b/unified-runtime/test/logger/env_var.cpp @@ -8,17 +8,17 @@ ////////////////////////////////////////////////////////////////////////////// TEST_F(LoggerFromEnvVar, DebugMessage) { - UR_LOG(Debug, "Test message: {}", "success"); + UR_LOG(DEBUG, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, InfoMessage) { - UR_LOG(Info, "Test message: {}", "success"); + UR_LOG(INFO, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, WarningMessage) { - UR_LOG(Warning, "Test message: {}", "success"); + UR_LOG(WARN, "Test message: {}", "success"); } TEST_F(LoggerFromEnvVar, ErrorMessage) { - UR_LOG(Error, "Test message: {}", "success"); + UR_LOG(ERROR, "Test message: {}", "success"); } diff --git a/unified-runtime/test/unit/logger.cpp b/unified-runtime/test/unit/logger.cpp index 675c144f6e5f..c275c2e3d5c6 100644 --- a/unified-runtime/test/unit/logger.cpp +++ b/unified-runtime/test/unit/logger.cpp @@ -14,41 +14,41 @@ ////////////////////////////////////////////////////////////////////////////// TEST_F(DefaultLoggerWithFileSink, DefaultLevelNoOutput) { - UR_LOG_L(*logger, Info, "This should not be printed: {}", 42); + UR_LOG_L(*logger, INFO, "This should not be printed: {}", 42); test_msg.clear(); } TEST_F(DefaultLoggerWithFileSink, MultipleLines) { - UR_LOG_L(*logger, Warning, "Test message: {}", "success"); - UR_LOG_L(*logger, Debug, "This should not be printed: {}", 42); - UR_LOG_L(*logger, Error, "Test message: {}", "success"); + UR_LOG_L(*logger, WARN, "Test message: {}", "success"); + UR_LOG_L(*logger, DEBUG, "This should not be printed: {}", 42); + UR_LOG_L(*logger, ERROR, "Test message: {}", "success"); test_msg << test_msg_prefix << "[WARNING]: Test message: success\n" << test_msg_prefix << "[ERROR]: Test message: success\n"; } TEST_F(DefaultLoggerWithFileSink, ThreeParams) { - UR_LOG_L(*logger, Error, "{} {}: {}", "Test", 42, 3.8); + UR_LOG_L(*logger, ERROR, "{} {}: {}", "Test", 42, 3.8); test_msg << test_msg_prefix << "[ERROR]: Test 42: 3.8\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces) { - UR_LOG_L(*logger, Error, "{{}} {}: {}", "Test", 42); + UR_LOG_L(*logger, ERROR, "{{}} {}: {}", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: {} Test: 42\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces2) { - UR_LOG_L(*logger, Error, "200 {{ {}: {{{}}} 3.8", "Test", 42); + UR_LOG_L(*logger, ERROR, "200 {{ {}: {{{}}} 3.8", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: 200 { Test: {42} 3.8\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces3) { - UR_LOG_L(*logger, Error, "{{ {}:}} {}}}", "Test", 42); + UR_LOG_L(*logger, ERROR, "{{ {}:}} {}}}", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: { Test:} 42}\n"; } TEST_F(DefaultLoggerWithFileSink, NoBraces) { - UR_LOG_L(*logger, Error, " Test: 42"); + UR_LOG_L(*logger, ERROR, " Test: 42"); test_msg << test_msg_prefix << "[ERROR]: Test: 42\n"; } @@ -56,7 +56,7 @@ TEST_F(DefaultLoggerWithFileSink, SetLevelDebug) { auto level = UR_LOGGER_LEVEL_DEBUG; logger->setLevel(level); logger->setFlushLevel(level); - UR_LOG_L(*logger, Debug, "Test message: {}", "success"); + UR_LOG_L(*logger, DEBUG, "Test message: {}", "success"); test_msg << test_msg_prefix << "[DEBUG]: Test message: success\n"; } @@ -65,8 +65,8 @@ TEST_F(DefaultLoggerWithFileSink, SetLevelInfo) { auto level = UR_LOGGER_LEVEL_INFO; logger->setLevel(level); logger->setFlushLevel(level); - UR_LOG_L(*logger, Info, "Test message: {}", "success"); - UR_LOG_L(*logger, Debug, "This should not be printed: {}", 42); + UR_LOG_L(*logger, INFO, "Test message: {}", "success"); + UR_LOG_L(*logger, DEBUG, "This should not be printed: {}", 42); test_msg << test_msg_prefix << "[INFO]: Test message: success\n"; } @@ -74,16 +74,16 @@ TEST_F(DefaultLoggerWithFileSink, SetLevelInfo) { TEST_F(DefaultLoggerWithFileSink, SetLevelWarning) { auto level = UR_LOGGER_LEVEL_WARN; logger->setLevel(level); - UR_LOG_L(*logger, Warning, "Test message: {}", "success"); - UR_LOG_L(*logger, Info, "This should not be printed: {}", 42); + UR_LOG_L(*logger, WARN, "Test message: {}", "success"); + UR_LOG_L(*logger, INFO, "This should not be printed: {}", 42); test_msg << test_msg_prefix << "[WARNING]: Test message: success\n"; } TEST_F(DefaultLoggerWithFileSink, SetLevelError) { logger->setLevel(UR_LOGGER_LEVEL_ERROR); - UR_LOG_L(*logger, Error, "Test message: {}", "success"); - UR_LOG_L(*logger, Warning, "This should not be printed: {}", 42); + UR_LOG_L(*logger, ERROR, "Test message: {}", "success"); + UR_LOG_L(*logger, WARN, "This should not be printed: {}", 42); test_msg << test_msg_prefix << "[ERROR]: Test message: success\n"; } @@ -94,7 +94,7 @@ TEST_F(UniquePtrLoggerWithFilesink, SetLogLevelAndFlushLevelDebugWithCtor) { logger = std::make_unique( level, std::make_unique(logger_name, file_path, level)); - UR_LOG_L(*logger, Debug, "Test message: {}", "success"); + UR_LOG_L(*logger, DEBUG, "Test message: {}", "success"); test_msg << test_msg_prefix << "[DEBUG]: Test message: success\n"; } @@ -110,13 +110,13 @@ TEST_F(UniquePtrLoggerWithFilesink, NestedFilePath) { UR_LOGGER_LEVEL_WARN, std::make_unique( logger_name, file_path, UR_LOGGER_LEVEL_WARN)); - UR_LOG_L(*logger, Warning, "Test message: {}", "success"); + UR_LOG_L(*logger, WARN, "Test message: {}", "success"); test_msg << test_msg_prefix << "[WARNING]: Test message: success\n"; } TEST_F(UniquePtrLoggerWithFilesinkFail, NullSink) { logger = std::make_unique(UR_LOGGER_LEVEL_INFO, nullptr); - UR_LOG_L(*logger, Info, "This should not be printed: {}", 42); + UR_LOG_L(*logger, INFO, "This should not be printed: {}", 42); test_msg.clear(); } @@ -137,7 +137,7 @@ TEST_P(FileSinkLoggerMultipleThreads, Multithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - UR_LOG_L(local_logger, Warning, "Test message: {}", "it's a success"); + UR_LOG_L(local_logger, WARN, "Test message: {}", "it's a success"); } }); } @@ -151,7 +151,7 @@ TEST_P(FileSinkLoggerMultipleThreads, Multithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - UR_LOG_L(local_logger, Error, "Flushed test message: {}", + UR_LOG_L(local_logger, ERROR, "Flushed test message: {}", "it's a success"); } }); @@ -183,7 +183,7 @@ TEST_P(CommonLoggerWithMultipleThreads, StdoutMultithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - UR_LOG_L(local_logger, Warning, "Test message: {}", "it's a success"); + UR_LOG_L(local_logger, WARN, "Test message: {}", "it's a success"); } }); } @@ -197,7 +197,7 @@ TEST_P(CommonLoggerWithMultipleThreads, StdoutMultithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - UR_LOG_L(local_logger, Error, "Flushed test message: {}", + UR_LOG_L(local_logger, ERROR, "Flushed test message: {}", "it's a success"); } }); diff --git a/unified-runtime/tools/urtrace/collector.cpp b/unified-runtime/tools/urtrace/collector.cpp index dc348cd9c160..613d47be996f 100644 --- a/unified-runtime/tools/urtrace/collector.cpp +++ b/unified-runtime/tools/urtrace/collector.cpp @@ -86,7 +86,7 @@ std::string time_to_str(std::chrono::nanoseconds dur, enum time_unit unit) { ostr << d.count() << "s"; } break; default: { - UR_LOG_L(out, Error, "invalid time unit {}", unit); + UR_LOG_L(out, ERROR, "invalid time unit {}", unit); break; } } @@ -123,8 +123,7 @@ static class cli_args { return std::nullopt; } if (arg_values.size() != 1) { - UR_LOG_L(out, Warning, "{} requires a single argument, skipping...", - name); + UR_LOG_L(out, WARN, "{} requires a single argument, skipping...", name); return std::nullopt; } return arg_values.at(0); @@ -162,15 +161,15 @@ static class cli_args { try { filter = filter_str; } catch (const std::regex_error &err) { - UR_LOG_L(out, Warning, "invalid filter regex {} {}", *filter_str, + UR_LOG_L(out, WARN, "invalid filter regex {} {}", *filter_str, err.what()); } } else { - UR_LOG_L(out, Warning, "unknown {} argument {}.", ARGS_ENV, arg_name); + UR_LOG_L(out, WARN, "unknown {} argument {}.", ARGS_ENV, arg_name); } } } - UR_LOG_L(out, Debug, + UR_LOG_L(out, DEBUG, "collector args (.print_begin = {}, .profiling = {}, " ".time_unit = {}, .filter = {}, .output_format = {})", print_begin, profiling, time_unit_str[time_unit], @@ -205,7 +204,7 @@ class TraceWriter { class HumanReadable : public TraceWriter { void begin(uint64_t id, const char *fname, std::string args) override { if (cli_args.print_begin) { - UR_LOG_L(out, Info, "begin({}) - {}({});", id, fname, args); + UR_LOG_L(out, INFO, "begin({}) - {}({});", id, fname, args); } } void end(uint64_t id, const char *fname, std::string args, Timepoint tp, @@ -221,7 +220,7 @@ class HumanReadable : public TraceWriter { std::chrono::duration_cast(tp - start_tp); profile_str << " (" << time_to_str(dur, cli_args.time_unit) << ")"; } - UR_LOG_L(out, Info, "{}{}({}) -> {};{}", prefix_str.str(), fname, args, + UR_LOG_L(out, INFO, "{}{}({}) -> {};{}", prefix_str.str(), fname, args, *resultp, profile_str.str()); } }; @@ -237,16 +236,16 @@ class JsonWriter : public TraceWriter { // not much we can do here... } } - void prologue() override { UR_LOG_L(out, Info, "{{\n \"traceEvents\": ["); } + void prologue() override { UR_LOG_L(out, INFO, "{{\n \"traceEvents\": ["); } void epilogue() override { // Empty trace to avoid ending in a comma // To prevent that last comma from being printed in the first place // we could synchronize the entire 'end' function, while reversing the // logic and printing commas at the front. Not worth it probably. - UR_LOG_L(out, Info, + UR_LOG_L(out, INFO, "{{\"name\": \"\", \"cat\": \"\", \"ph\": \"\", \"pid\": \"\", " "\"tid\": \"\", \"ts\": \"\"}}"); - UR_LOG_L(out, Info, "]\n}}"); + UR_LOG_L(out, INFO, "]\n}}"); } void begin(uint64_t, const char *, std::string) override {} @@ -258,7 +257,7 @@ class JsonWriter : public TraceWriter { .count(); auto dur_us = std::chrono::duration_cast(dur).count(); - UR_LOG_L(out, Info, "{{\ + UR_LOG_L(out, INFO, "{{\ \"cat\": \"UR\", \ \"ph\": \"X\",\ \"pid\": {},\ @@ -324,7 +323,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, if (auto regex = cli_args.filter) { if (!std::regex_match(args->function_name, *regex)) { - UR_LOG_L(out, Debug, + UR_LOG_L(out, DEBUG, "function {} does not match regex filter, skipping...", args->function_name); return; @@ -347,7 +346,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, } else if (trace_type == TRACE_FN_END) { auto ctx = pop_instance_data(instance); if (!ctx) { - UR_LOG_L(out, Error, + UR_LOG_L(out, ERROR, "Received TRACE_FN_END without corresponding " "TRACE_FN_BEGIN, instance {}. Skipping...", instance); @@ -358,7 +357,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, writer()->end(instance, args->function_name, args_str.str(), time_for_end, *ctx->start, resultp); } else { - UR_LOG_L(out, Warning, "unsupported trace type"); + UR_LOG_L(out, WARN, "unsupported trace type"); } } @@ -371,17 +370,17 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, unsigned int minor_version, const char *, const char *stream_name) { if (stream_name == nullptr) { - UR_LOG_L(out, Debug, "Found stream with null name. Skipping..."); + UR_LOG_L(out, DEBUG, "Found stream with null name. Skipping..."); return; } if (std::string_view(stream_name) != UR_STREAM_NAME) { - UR_LOG_L(out, Debug, "Found stream: {}. Expected: {}. Skipping...", + UR_LOG_L(out, DEBUG, "Found stream: {}. Expected: {}. Skipping...", stream_name, UR_STREAM_NAME); return; } if (UR_MAKE_VERSION(major_version, minor_version) != UR_API_VERSION_CURRENT) { - UR_LOG_L(out, Error, + UR_LOG_L(out, ERROR, "Invalid stream version: {}.{}. Expected: {}.{}. Skipping...", major_version, minor_version, UR_MAJOR_VERSION(UR_API_VERSION_CURRENT), @@ -391,7 +390,7 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, uint8_t stream_id = xptiRegisterStream(stream_name); - UR_LOG_L(out, Debug, "Registered stream {} ({}.{}).", stream_name, + UR_LOG_L(out, DEBUG, "Registered stream {} ({}.{}).", stream_name, major_version, minor_version); writer()->prologue(); @@ -404,11 +403,11 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, */ XPTI_CALLBACK_API void xptiTraceFinish(const char *stream_name) { if (stream_name == nullptr) { - UR_LOG_L(out, Debug, "Found stream with null name. Skipping..."); + UR_LOG_L(out, DEBUG, "Found stream with null name. Skipping..."); return; } if (std::string_view(stream_name) != UR_STREAM_NAME) { - UR_LOG_L(out, Debug, "Found stream: {}. Expected: {}. Skipping...", + UR_LOG_L(out, DEBUG, "Found stream: {}. Expected: {}. Skipping...", stream_name, UR_STREAM_NAME); return; } From e767c82376b57bb2b478f9587faaf0a1318d8c2f Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Tue, 22 Apr 2025 14:30:02 +0000 Subject: [PATCH 10/16] Windows workaround --- .../source/adapters/cuda/common.cpp | 6 +- .../source/adapters/cuda/image.cpp | 2 +- .../source/adapters/hip/common.cpp | 6 +- unified-runtime/source/adapters/hip/image.cpp | 2 +- .../source/adapters/level_zero/adapter.cpp | 10 ++-- .../adapters/level_zero/async_alloc.cpp | 2 +- .../adapters/level_zero/command_buffer.cpp | 6 +- .../source/adapters/level_zero/common.cpp | 2 +- .../source/adapters/level_zero/device.cpp | 18 +++--- .../source/adapters/level_zero/event.cpp | 20 +++---- .../level_zero/helpers/image_helpers.cpp | 40 ++++++------- .../level_zero/helpers/kernel_helpers.cpp | 18 +++--- .../source/adapters/level_zero/image.cpp | 18 +++--- .../source/adapters/level_zero/kernel.cpp | 16 +++-- .../source/adapters/level_zero/memory.cpp | 8 +-- .../source/adapters/level_zero/program.cpp | 4 +- .../source/adapters/level_zero/queue.cpp | 12 ++-- .../source/adapters/level_zero/sampler.cpp | 7 +-- .../source/adapters/level_zero/usm.cpp | 20 +++---- .../source/adapters/level_zero/v2/api.cpp | 60 +++++++++---------- .../adapters/level_zero/v2/command_buffer.cpp | 5 +- .../source/adapters/level_zero/v2/event.cpp | 6 +- .../source/adapters/level_zero/v2/kernel.cpp | 8 +-- .../source/adapters/level_zero/v2/memory.cpp | 8 +-- .../v2/queue_immediate_in_order.cpp | 4 +- .../source/adapters/level_zero/v2/usm.cpp | 6 +- .../adapters/level_zero/virtual_mem.cpp | 4 +- .../source/adapters/native_cpu/common.hpp | 4 +- .../source/adapters/native_cpu/device.cpp | 2 +- .../source/adapters/native_cpu/platform.cpp | 2 +- .../source/common/latency_tracker.hpp | 4 +- .../source/common/linux/ur_lib_loader.cpp | 3 +- .../common/logger/ur_logger_details.hpp | 40 ++++++++++--- unified-runtime/source/common/umf_helpers.hpp | 2 +- .../source/common/ur_pool_manager.hpp | 5 +- unified-runtime/source/common/ur_util.cpp | 6 +- .../source/common/windows/ur_lib_loader.cpp | 2 +- .../sanitizer/tsan/tsan_interceptor.cpp | 2 +- .../layers/validation/ur_leak_check.hpp | 2 +- .../source/loader/ur_adapter_registry.hpp | 14 ++--- unified-runtime/source/loader/ur_lib.cpp | 16 ++--- unified-runtime/test/logger/env_var.cpp | 2 +- 42 files changed, 219 insertions(+), 205 deletions(-) diff --git a/unified-runtime/source/adapters/cuda/common.cpp b/unified-runtime/source/adapters/cuda/common.cpp index a7180b4d1a90..bb95cdd0f397 100644 --- a/unified-runtime/source/adapters/cuda/common.cpp +++ b/unified-runtime/source/adapters/cuda/common.cpp @@ -71,7 +71,7 @@ void checkErrorUR(CUresult Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr || std::getenv("UR_CUDA_ABORT") != nullptr) { @@ -95,7 +95,7 @@ void checkErrorUR(nvmlReturn_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr || std::getenv("UR_CUDA_ABORT") != nullptr) { @@ -115,7 +115,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr) { std::abort(); diff --git a/unified-runtime/source/adapters/cuda/image.cpp b/unified-runtime/source/adapters/cuda/image.cpp index d7585933c391..14428f61c7bd 100644 --- a/unified-runtime/source/adapters/cuda/image.cpp +++ b/unified-runtime/source/adapters/cuda/image.cpp @@ -803,7 +803,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - UR_LOG(ERROR, + UR_LOG(ERR, "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/hip/common.cpp b/unified-runtime/source/adapters/hip/common.cpp index 7a5d81feddce..535693116cdf 100644 --- a/unified-runtime/source/adapters/hip/common.cpp +++ b/unified-runtime/source/adapters/hip/common.cpp @@ -86,7 +86,7 @@ void checkErrorUR(amd_comgr_status_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -113,7 +113,7 @@ void checkErrorUR(hipError_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -133,7 +133,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR HIP ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { diff --git a/unified-runtime/source/adapters/hip/image.cpp b/unified-runtime/source/adapters/hip/image.cpp index ed015748057c..2ce3e0e05792 100644 --- a/unified-runtime/source/adapters/hip/image.cpp +++ b/unified-runtime/source/adapters/hip/image.cpp @@ -822,7 +822,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - UR_LOG(ERROR, + UR_LOG(ERR, "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/adapter.cpp b/unified-runtime/source/adapters/level_zero/adapter.cpp index 06639503a047..e90cb45a8923 100644 --- a/unified-runtime/source/adapters/level_zero/adapter.cpp +++ b/unified-runtime/source/adapters/level_zero/adapter.cpp @@ -163,7 +163,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, ZE2UR_CALL(zeDriverGet, (&ZeDriverGetCount, ZeDriverGetHandles.data())); } if (ZeDriverGetCount == 0 && GlobalAdapter->ZeInitDriversCount == 0) { - UR_LOG(ERROR, "\nNo Valid L0 Drivers found.\n"); + UR_LOG(ERR, "\nNo Valid L0 Drivers found.\n"); return UR_RESULT_SUCCESS; } @@ -389,7 +389,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (GlobalAdapter->ZeInitResult != ZE_RESULT_SUCCESS) { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitResult, ErrorString); - UR_LOG(ERROR, "\nzeInit failed with {}\n", ErrorString); + UR_LOG(ERR, "\nzeInit failed with {}\n", ErrorString); } bool useInitDrivers = false; @@ -441,7 +441,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() } else { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitDriversResult, ErrorString); - UR_LOG(ERROR, "\nzeInitDrivers failed with {}\n", ErrorString); + UR_LOG(ERR, "\nzeInitDrivers failed with {}\n", ErrorString); } } } @@ -459,12 +459,12 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() // Absorb the ZE_RESULT_ERROR_UNINITIALIZED and just return 0 Platforms. if (*GlobalAdapter->ZeResult == ZE_RESULT_ERROR_UNINITIALIZED) { - UR_LOG(ERROR, "Level Zero Uninitialized\n"); + UR_LOG(ERR, "Level Zero Uninitialized\n"); result = std::move(platforms); return; } if (*GlobalAdapter->ZeResult != ZE_RESULT_SUCCESS) { - UR_LOG(ERROR, "Level Zero initialization failure\n"); + UR_LOG(ERR, "Level Zero initialization failure\n"); result = ze2urResult(*GlobalAdapter->ZeResult); return; diff --git a/unified-runtime/source/adapters/level_zero/async_alloc.cpp b/unified-runtime/source/adapters/level_zero/async_alloc.cpp index cd363c49504c..e8b29edccd42 100644 --- a/unified-runtime/source/adapters/level_zero/async_alloc.cpp +++ b/unified-runtime/source/adapters/level_zero/async_alloc.cpp @@ -92,7 +92,7 @@ static ur_result_t enqueueUSMAllocHelper( CommandType = UR_COMMAND_ENQUEUE_USM_SHARED_ALLOC_EXP; break; default: - UR_LOG(ERROR, "enqueueUSMAllocHelper: unsupported USM type"); + UR_LOG(ERR, "enqueueUSMAllocHelper: unsupported USM type"); throw UR_RESULT_ERROR_UNKNOWN; } UR_CALL(createEventAndAssociateQueue(Queue, Event, CommandType, CommandList, diff --git a/unified-runtime/source/adapters/level_zero/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/command_buffer.cpp index 2753827d1f95..c61a24565398 100644 --- a/unified-runtime/source/adapters/level_zero/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/command_buffer.cpp @@ -44,7 +44,7 @@ bool checkImmediateAppendSupport(ur_context_handle_t Context, const bool EnableAppendPath = std::atoi(UrRet) == 1; if (EnableAppendPath && !Device->ImmCommandListUsed) { - UR_LOG(ERROR, + UR_LOG(ERR, "{} is set but immediate command-lists are currently " "disabled. Immediate command-lists are " "required to use the immediate append path.", @@ -52,7 +52,7 @@ bool checkImmediateAppendSupport(ur_context_handle_t Context, std::abort(); } if (EnableAppendPath && !DriverSupportsImmediateAppend) { - UR_LOG(ERROR, + UR_LOG(ERR, "{} is set but the current driver does not support the " "zeCommandListImmediateAppendCommandListsExp entrypoint.", AppendEnvVarName); @@ -1876,7 +1876,7 @@ ur_result_t validateCommandDesc( if (NewGlobalWorkOffset) { if (!CommandBuffer->Context->getPlatform() ->ZeDriverGlobalOffsetExtensionFound) { - UR_LOG(ERROR, "No global offset extension found on this driver"); + UR_LOG(ERR, "No global offset extension found on this driver"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/common.cpp b/unified-runtime/source/adapters/level_zero/common.cpp index a0f150c142f1..dd4c27c0f67d 100644 --- a/unified-runtime/source/adapters/level_zero/common.cpp +++ b/unified-runtime/source/adapters/level_zero/common.cpp @@ -151,7 +151,7 @@ ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *ZeName, if (TraceError) { const char *ErrorString = "Unknown"; zeParseError(ZeResult, ErrorString); - UR_LOG(ERROR, "Error ({}) in {}", ErrorString, ZeName); + UR_LOG(ERR, "Error ({}) in {}", ErrorString, ZeName); } return ZeResult; } diff --git a/unified-runtime/source/adapters/level_zero/device.cpp b/unified-runtime/source/adapters/level_zero/device.cpp index 004828e9d4ec..65b84cd8ba8a 100644 --- a/unified-runtime/source/adapters/level_zero/device.cpp +++ b/unified-runtime/source/adapters/level_zero/device.cpp @@ -52,7 +52,7 @@ getRangeOfAllowedCopyEngines(const ur_device_handle_t &Device) { int UpperCopyEngineIndex = std::stoi(CopyEngineRange.substr(pos + 1)); if ((LowerCopyEngineIndex > UpperCopyEngineIndex) || (LowerCopyEngineIndex < -1) || (UpperCopyEngineIndex < -1)) { - UR_LOG(ERROR, "UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " + UR_LOG(ERR, "UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " "default set."); LowerCopyEngineIndex = 0; UpperCopyEngineIndex = INT_MAX; @@ -194,7 +194,7 @@ static std::tuple getZesDeviceData(ur_device_handle_t Device) { bool SysManEnv = getenv_tobool("ZES_ENABLE_SYSMAN", false); if ((Device->Platform->ZedeviceToZesDeviceMap.size() == 0) && !SysManEnv) { - UR_LOG(ERROR, "SysMan support is unavailable on this system. Please " + UR_LOG(ERR, "SysMan support is unavailable on this system. Please " "check your level zero driver installation."); return {nullptr, {}, UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION}; } @@ -250,7 +250,7 @@ ur_result_t urDeviceGetInfo( case ZE_DEVICE_TYPE_FPGA: return ReturnValue(UR_DEVICE_TYPE_FPGA); default: - UR_LOG(ERROR, "This device type is not supported"); + UR_LOG(ERR, "This device type is not supported"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1107,8 +1107,8 @@ ur_result_t urDeviceGetInfo( case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP: - UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(ERROR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + UR_LOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP: { // L0 does not support mipmaps. @@ -1119,8 +1119,8 @@ ur_result_t urDeviceGetInfo( return ReturnValue(false); } case UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP: - UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(ERROR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + UR_LOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP: { // L0 does not support creation of images from individual mipmap levels. @@ -1338,8 +1338,8 @@ ur_result_t urDeviceGetInfo( } } default: - UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(ERROR, "ParamNameParamName={}(0x{})", ParamName, + UR_LOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERR, "ParamNameParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; } diff --git a/unified-runtime/source/adapters/level_zero/event.cpp b/unified-runtime/source/adapters/level_zero/event.cpp index dda91b5d456b..30b5c0499a92 100644 --- a/unified-runtime/source/adapters/level_zero/event.cpp +++ b/unified-runtime/source/adapters/level_zero/event.cpp @@ -510,7 +510,7 @@ ur_result_t urEventGetInfo( return ReturnValue(Event->RefCount.load()); } default: - UR_LOG(ERROR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", PropName, logger::toHex(PropName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -596,11 +596,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(ERROR, "urEventGetProfilingInfo: " - "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); + UR_LOG(ERR, "urEventGetProfilingInfo: " + "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -663,11 +663,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(ERROR, "urEventGetProfilingInfo: " - "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); + UR_LOG(ERR, "urEventGetProfilingInfo: " + "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } else { @@ -710,11 +710,11 @@ ur_result_t urEventGetProfilingInfo( // return ReturnValue(uint64_t{0}); case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(ERROR, "urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " - "not supported"); + UR_LOG(ERR, "urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " + "not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp index 160627953166..a119c915caa0 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp @@ -35,7 +35,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormatTypeSize = 32; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unsupported image format layout: layout = {}", ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; @@ -54,8 +54,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_A; break; default: - UR_LOG(ERROR, - "ze2urImageFormat: unexpected image format channel x: x = {}", + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel x: x = {}", ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -64,8 +63,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, case ZE_IMAGE_FORMAT_LAYOUT_16_16: case ZE_IMAGE_FORMAT_LAYOUT_32_32: if (ZeImageFormat.x != ZE_IMAGE_FORMAT_SWIZZLE_R) { - UR_LOG(ERROR, - "ze2urImageFormat: unexpected image format channel x: x = {}", + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel x: x = {}", ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -80,7 +78,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RX; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel y: y = {}\n", ZeImageFormat.y); return UR_RESULT_ERROR_INVALID_VALUE; @@ -99,13 +97,13 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGX; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel z: z = {}\n", ZeImageFormat.z); return UR_RESULT_ERROR_INVALID_VALUE; } } else { - UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel"); + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -123,7 +121,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGBA; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel w: w = {}", ZeImageFormat.w); return UR_RESULT_ERROR_INVALID_VALUE; @@ -139,12 +137,12 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormat.w == ZE_IMAGE_FORMAT_SWIZZLE_A) { ChannelOrder = UR_IMAGE_CHANNEL_ORDER_BGRA; } else { - UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel"); + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unsupported image format layout: layout = {}", ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; @@ -164,7 +162,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -182,7 +180,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SIGNED_INT32; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -197,7 +195,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNORM_INT16; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -212,7 +210,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SNORM_INT16; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -227,14 +225,14 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_FLOAT; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - UR_LOG(ERROR, "ze2urImageFormat: unsupported image format type: type = {}", + UR_LOG(ERR, "ze2urImageFormat: unsupported image format type: type = {}", ZeImageFormat.type); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -281,13 +279,13 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDesc: unexpected data type Size\n"); + UR_LOG(ERR, "ur2zeImageDesc: unexpected data type Size\n"); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; } break; } default: - UR_LOG(ERROR, "format layout = {}", ImageFormat->channelOrder); + UR_LOG(ERR, "format layout = {}", ImageFormat->channelOrder); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; break; } @@ -316,7 +314,7 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - UR_LOG(ERROR, "ur2zeImageDesc: unsupported image type"); + UR_LOG(ERR, "ur2zeImageDesc: unsupported image type"); return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR; } @@ -513,7 +511,7 @@ getImageFormatTypeAndSize(const ur_image_format_t *ImageFormat) { break; } default: - UR_LOG(ERROR, "ur2zeImageDesc: unsupported image data type: data type = {}", + UR_LOG(ERR, "ur2zeImageDesc: unsupported image data type: data type = {}", ImageFormat->channelType); ZeImageFormatType = ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32; ZeImageFormatTypeSize = 0; diff --git a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp index e015d14477cd..97aac29a84fb 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp @@ -52,8 +52,8 @@ ur_result_t getSuggestedLocalWorkSize(ur_device_handle_t hDevice, --GroupSize[I]; } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - UR_LOG(ERROR, "getSuggestedLocalWorkSize: can't find a WG size " - "suitable for global work size > UINT32_MAX"); + UR_LOG(ERR, "getSuggestedLocalWorkSize: can't find a WG size " + "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } WG[I] = GroupSize[I]; @@ -130,27 +130,27 @@ ur_result_t calculateKernelWorkDimensions( break; default: - UR_LOG(ERROR, "calculateKernelWorkDimensions: unsupported work_dim"); + UR_LOG(ERR, "calculateKernelWorkDimensions: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " - "is not a multiple of the group size in the 1st dimension"); + UR_LOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + "is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " - "is not a multiple of the group size in the 2nd dimension"); + UR_LOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + "is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[2] != size_t(ZeThreadGroupDimensions.groupCountZ) * WG[2]) { - UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " - "is not a multiple of the group size in the 3rd dimension"); + UR_LOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + "is not a multiple of the group size in the 3rd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } diff --git a/unified-runtime/source/adapters/level_zero/image.cpp b/unified-runtime/source/adapters/level_zero/image.cpp index d72b7bc6bf62..e04a708fa197 100644 --- a/unified-runtime/source/adapters/level_zero/image.cpp +++ b/unified-runtime/source/adapters/level_zero/image.cpp @@ -56,7 +56,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -75,7 +75,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -95,7 +95,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -113,13 +113,13 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; } default: - UR_LOG(ERROR, "format channel order = {}", ImageFormat->channelOrder); + UR_LOG(ERR, "format channel order = {}", ImageFormat->channelOrder); die("ur2zeImageDescBindless: unsupported image channel order\n"); break; } @@ -148,7 +148,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unsupported image type"); + UR_LOG(ERR, "ur2zeImageDescBindless: unsupported image type"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -237,7 +237,7 @@ ur_result_t bindlessImagesCreateImpl(ur_context_handle_t hContext, DriverHandle, "zeImageGetDeviceOffsetExp", (void **)&zeImageGetDeviceOffsetExpFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - UR_LOG(ERROR, + UR_LOG(ERR, "zeDriverGetExtensionFunctionAddress zeImageGetDeviceOffsetExpv " "failed, err = {}", Result); @@ -281,7 +281,7 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, DriverHandle, "zeMemGetPitchFor2dImage", (void **)&zeMemGetPitchFor2dImageFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - UR_LOG(ERROR, + UR_LOG(ERR, "zeDriverGetExtensionFunctionAddress zeMemGetPitchFor2dImage " "failed, err = {}", Result); @@ -552,7 +552,7 @@ ur_result_t urBindlessImagesImageCopyExp( &DstRegion, &SrcRegion, ZeEvent, WaitList.Length, WaitList.ZeEventList)); } else { - UR_LOG(ERROR, "urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); + UR_LOG(ERR, "urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/kernel.cpp b/unified-runtime/source/adapters/level_zero/kernel.cpp index d139a6881115..bbfb00d5bf69 100644 --- a/unified-runtime/source/adapters/level_zero/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/kernel.cpp @@ -316,7 +316,7 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - UR_LOG(ERROR, + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: can't find a WG size " "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; @@ -355,21 +355,21 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( break; default: - UR_LOG(ERROR, "urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - UR_LOG(ERROR, + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - UR_LOG(ERROR, + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; @@ -788,8 +788,7 @@ ur_result_t urKernelGetInfo( return UR_RESULT_ERROR_UNKNOWN; } default: - UR_LOG(ERROR, - "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -877,8 +876,7 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - UR_LOG(ERROR, - "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -1019,7 +1017,7 @@ ur_result_t urKernelSetExecInfo( return UR_RESULT_ERROR_INVALID_VALUE; ZE2UR_CALL(zeKernelSetCacheConfig, (ZeKernel, ZeCacheConfig);); } else { - UR_LOG(ERROR, "urKernelSetExecInfo: unsupported ParamName"); + UR_LOG(ERR, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/memory.cpp b/unified-runtime/source/adapters/level_zero/memory.cpp index 98297451043d..b4f60c196a6b 100644 --- a/unified-runtime/source/adapters/level_zero/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/memory.cpp @@ -460,7 +460,7 @@ static ur_result_t enqueueMemImageCommandHelper( ur_cast(ZeHandleSrc), &ZeDstRegion, &ZeSrcRegion, ZeEvent, 0, nullptr)); } else { - UR_LOG(ERROR, "enqueueMemImageUpdate: unsupported image command type"); + UR_LOG(ERR, "enqueueMemImageUpdate: unsupported image command type"); return UR_RESULT_ERROR_INVALID_OPERATION; } @@ -1037,7 +1037,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - UR_LOG(ERROR, "urEnqueueMemBufferMap: duplicate mapping detected"); + UR_LOG(ERR, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -1098,7 +1098,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - UR_LOG(ERROR, "urEnqueueMemBufferMap: duplicate mapping detected"); + UR_LOG(ERR, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -1152,7 +1152,7 @@ ur_result_t urEnqueueMemUnmap( std::scoped_lock Guard(Buffer->Mutex); auto It = Buffer->Mappings.find(MappedPtr); if (It == Buffer->Mappings.end()) { - UR_LOG(ERROR, "urEnqueueMemUnmap: unknown memory mapping"); + UR_LOG(ERR, "urEnqueueMemUnmap: unknown memory mapping"); return UR_RESULT_ERROR_INVALID_VALUE; } MapInfo = It->second; diff --git a/unified-runtime/source/adapters/level_zero/program.cpp b/unified-runtime/source/adapters/level_zero/program.cpp index 30f8e90168ee..bdd42a123777 100644 --- a/unified-runtime/source/adapters/level_zero/program.cpp +++ b/unified-runtime/source/adapters/level_zero/program.cpp @@ -439,7 +439,7 @@ ur_result_t urProgramLinkExp( ZeModuleDesc.pInputModule = ZeExtModuleDesc.pInputModules[0]; ZeModuleDesc.pConstants = ZeExtModuleDesc.pConstants[0]; } else { - UR_LOG(ERROR, + UR_LOG(ERR, "urProgramLink: level_zero driver does not have static linking " "support."); return UR_RESULT_ERROR_INVALID_VALUE; @@ -893,7 +893,7 @@ ur_result_t urProgramGetBuildInfo( // program. return ReturnValue(""); } else { - UR_LOG(ERROR, "urProgramGetBuildInfo: unsupported ParamName"); + UR_LOG(ERR, "urProgramGetBuildInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/adapters/level_zero/queue.cpp b/unified-runtime/source/adapters/level_zero/queue.cpp index 2e081d0ed2c5..be103f74c2fe 100644 --- a/unified-runtime/source/adapters/level_zero/queue.cpp +++ b/unified-runtime/source/adapters/level_zero/queue.cpp @@ -925,7 +925,7 @@ ur_result_t urEnqueueKernelLaunchCustomExp( uint32_t /*numEventsInWaitList*/, const ur_event_handle_t * /*phEventWaitList*/, ur_event_handle_t * /*phEvent*/) { - UR_LOG(ERROR, "[UR][L0] {} function not implemented!", + UR_LOG(ERR, "[UR][L0] {} function not implemented!", "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1006,9 +1006,9 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { Val = std::stoi(BatchConfig.substr(Pos)); } catch (...) { if (IsCopy) - UR_LOG(ERROR, "UR_L0_COPY_BATCH_SIZE: failed to parse value") + UR_LOG(ERR, "UR_L0_COPY_BATCH_SIZE: failed to parse value") else - UR_LOG(ERROR, "UR_L0_BATCH_SIZE: failed to parse value") + UR_LOG(ERR, "UR_L0_BATCH_SIZE: failed to parse value") break; } switch (Ord) { @@ -1031,11 +1031,11 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { die("Unexpected batch config"); } if (IsCopy) - UR_LOG(ERROR, "UR_L0_COPY_BATCH_SIZE: dynamic batch param #{}: {}", + UR_LOG(ERR, "UR_L0_COPY_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, (int)Val) else - UR_LOG(ERROR, "UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", - (int)Ord, (int)Val) + UR_LOG(ERR, "UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, + (int)Val) }; } else { diff --git a/unified-runtime/source/adapters/level_zero/sampler.cpp b/unified-runtime/source/adapters/level_zero/sampler.cpp index 3f06020a5a5d..0c9bdef35301 100644 --- a/unified-runtime/source/adapters/level_zero/sampler.cpp +++ b/unified-runtime/source/adapters/level_zero/sampler.cpp @@ -83,8 +83,8 @@ ur_result_t urSamplerCreate( ZeSamplerDesc.addressMode = ZE_SAMPLER_ADDRESS_MODE_MIRROR; break; default: - UR_LOG(ERROR, "urSamplerCreate: unsupported " - "UR_SAMPLER_PROPERTIES_ADDRESSING_MODEE value"); + UR_LOG(ERR, "urSamplerCreate: unsupported " + "UR_SAMPLER_PROPERTIES_ADDRESSING_MODEE value"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -93,8 +93,7 @@ ur_result_t urSamplerCreate( else if (Props->filterMode == UR_SAMPLER_FILTER_MODE_LINEAR) ZeSamplerDesc.filterMode = ZE_SAMPLER_FILTER_MODE_LINEAR; else { - UR_LOG(ERROR, - "urSamplerCreate: unsupported UR_SAMPLER_FILTER_MODE value"); + UR_LOG(ERR, "urSamplerCreate: unsupported UR_SAMPLER_FILTER_MODE value"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/usm.cpp b/unified-runtime/source/adapters/level_zero/usm.cpp index db20c546b6ab..8502770fe19a 100644 --- a/unified-runtime/source/adapters/level_zero/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/usm.cpp @@ -448,7 +448,7 @@ ur_result_t urUSMGetMemAllocInfo( MemAllocaType = UR_USM_TYPE_SHARED; break; default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unexpected usm memory type"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(MemAllocaType); @@ -488,7 +488,7 @@ ur_result_t urUSMGetMemAllocInfo( return UR_RESULT_ERROR_INVALID_VALUE; } default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unsupported ParamName"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -846,7 +846,7 @@ umf_result_t L0MemoryProvider::open_ipc_handle(void *IpcData, void **Ptr) { memcpy(&fdRemote, &zeIpcData->zeHandle, sizeof(fdRemote)); fdLocal = ur_duplicate_fd(zeIpcData->pid, fdRemote); if (fdLocal == -1) { - UR_LOG(ERROR, "duplicating file descriptor from IPC handle failed"); + UR_LOG(ERR, "duplicating file descriptor from IPC handle failed"); return UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC; } @@ -953,12 +953,12 @@ MakeProvider(ProviderParams *Params = nullptr) { } break; default: - UR_LOG(ERROR, "urUSMPoolCreate: invalid USM type found"); + UR_LOG(ERR, "urUSMPoolCreate: invalid USM type found"); Ret = UMF_RESULT_ERROR_INVALID_ARGUMENT; } if (Ret != UMF_RESULT_SUCCESS) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to create UMF provider"); + UR_LOG(ERR, "urUSMPoolCreate: failed to create UMF provider"); throw UsmAllocationException(umf::umf2urResult(Ret)); } @@ -999,13 +999,13 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store USM pool tag"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store UMF pool"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1059,12 +1059,12 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store USM pool tag"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store UMF pool"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1176,7 +1176,7 @@ ur_result_t ur_usm_pool_handle_t_::allocate(ur_context_handle_t Context, } if (*RetMem == nullptr) { auto umfRet = umfPoolGetLastAllocationError(umfPool); - UR_LOG(ERROR, + UR_LOG(ERR, "enqueueUSMAllocHelper: allocation from the UMF pool {} failed", umfPool); return umf::umf2urResult(umfRet); diff --git a/unified-runtime/source/adapters/level_zero/v2/api.cpp b/unified-runtime/source/adapters/level_zero/v2/api.cpp index eeb70567910f..d58c14b6945a 100644 --- a/unified-runtime/source/adapters/level_zero/v2/api.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/api.cpp @@ -23,21 +23,21 @@ ur_result_t urContextSetExtendedDeleter(ur_context_handle_t hContext, ur_context_extended_deleter_t pfnDeleter, void *pUserData) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urKernelSetSpecializationConstants( ur_kernel_handle_t hKernel, uint32_t count, const ur_specialization_constant_info_t *pSpecConstants) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urEventSetCallback(ur_event_handle_t hEvent, ur_execution_info_t execStatus, ur_event_callback_t pfnNotify, void *pUserData) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -47,21 +47,21 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, ur_usm_pool_handle_t pool, size_t widthInBytes, size_t height, size_t elementSizeBytes, void **ppMem, size_t *pResultPitch) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -69,7 +69,7 @@ ur_result_t urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -77,7 +77,7 @@ ur_result_t urBindlessImagesImageFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -86,7 +86,7 @@ ur_result_t urBindlessImagesUnsampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_native_handle_t *phImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -95,14 +95,14 @@ ur_result_t urBindlessImagesSampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_sampler_handle_t hSampler, ur_exp_image_native_handle_t *phImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesImageGetInfoExp( ur_context_handle_t hContext, ur_exp_image_mem_native_handle_t hImageMem, ur_image_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -110,7 +110,7 @@ ur_result_t urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem, uint32_t mipmapLevel, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -118,7 +118,7 @@ ur_result_t urBindlessImagesMipmapFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -127,7 +127,7 @@ ur_result_t urBindlessImagesImportExternalMemoryExp( ur_exp_external_mem_type_t memHandleType, ur_exp_external_mem_desc_t *pExternalMemDesc, ur_exp_external_mem_handle_t *phExternalMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -136,21 +136,21 @@ ur_result_t urBindlessImagesMapExternalArrayExp( const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_external_mem_handle_t hExternalMem, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesMapExternalLinearMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, uint64_t offset, uint64_t size, ur_exp_external_mem_handle_t hExternalMem, void **ppRetMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_mem_handle_t hExternalMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -159,14 +159,14 @@ ur_result_t urBindlessImagesImportExternalSemaphoreExp( ur_exp_external_semaphore_type_t semHandleType, ur_exp_external_semaphore_desc_t *pExternalSemaphoreDesc, ur_exp_external_semaphore_handle_t *phExternalSemaphore) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalSemaphoreExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_semaphore_handle_t hExternalSemaphore) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -174,21 +174,21 @@ ur_result_t urCommandBufferUpdateKernelLaunchExp( ur_exp_command_buffer_handle_t hCommandBuffer, uint32_t numKernelUpdates, const ur_exp_command_buffer_update_kernel_launch_desc_t *pUpdateKernelLaunch) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateSignalEventExp( ur_exp_command_buffer_command_handle_t hCommand, ur_event_handle_t *phEvent) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateWaitEventsExp( ur_exp_command_buffer_command_handle_t hCommand, uint32_t NumEventsInWaitList, const ur_event_handle_t *phEventWaitList) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -196,28 +196,28 @@ ur_result_t UR_APICALL urUSMPoolCreateExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_desc_t *PoolDesc, ur_usm_pool_handle_t *pPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolSetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t propSize) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -225,21 +225,21 @@ ur_result_t UR_APICALL urUSMPoolGetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -247,7 +247,7 @@ ur_result_t UR_APICALL urUSMPoolTrimToExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool, size_t minBytesToKeep) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp index b6c472767c50..88295a23cbb0 100644 --- a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp @@ -20,9 +20,8 @@ namespace { // given context. void checkImmediateAppendSupport(ur_context_handle_t context) { if (!context->getPlatform()->ZeCommandListImmediateAppendExt.Supported) { - UR_LOG(ERROR, - "Adapter v2 is used but the current driver does not support " - "the zeCommandListImmediateAppendCommandListsExp entrypoint."); + UR_LOG(ERR, "Adapter v2 is used but the current driver does not support " + "the zeCommandListImmediateAppendCommandListsExp entrypoint."); throw UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } } diff --git a/unified-runtime/source/adapters/level_zero/v2/event.cpp b/unified-runtime/source/adapters/level_zero/v2/event.cpp index 36116d5ec35a..5086175d2cbf 100644 --- a/unified-runtime/source/adapters/level_zero/v2/event.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/event.cpp @@ -271,7 +271,7 @@ ur_result_t urEventGetInfo(ur_event_handle_t hEvent, ur_event_info_t propName, return returnValue(hEvent->getCommandType()); } default: - UR_LOG(ERROR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", propName, logger::toHex(propName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -317,7 +317,7 @@ ur_result_t urEventGetProfilingInfo( return returnValue(hEvent->getEventEndTimestamp()); } default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -367,7 +367,7 @@ ur_result_t urEventGetProfilingInfo( // return returnValue(uint64_t{0}); default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp index ae301eb36496..4fcdadf64ad8 100644 --- a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp @@ -264,7 +264,7 @@ ur_result_t ur_kernel_handle_t_::setExecInfo(ur_kernel_exec_info_t propName, ZE2UR_CALL(zeKernelSetCacheConfig, (kernel->hKernel.get(), zeCacheConfig);); } else { - UR_LOG(ERROR, "urKernelSetExecInfo: unsupported ParamName"); + UR_LOG(ERR, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -555,8 +555,7 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - UR_LOG(ERROR, - "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -640,8 +639,7 @@ ur_result_t urKernelGetInfo(ur_kernel_handle_t hKernel, return ReturnValue(static_cast(attributes.data())); } default: - UR_LOG(ERROR, - "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/memory.cpp b/unified-runtime/source/adapters/level_zero/v2/memory.cpp index 10e630eec28e..133ba9f6b93f 100644 --- a/unified-runtime/source/adapters/level_zero/v2/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/memory.cpp @@ -88,7 +88,7 @@ ur_integrated_buffer_handle_t::ur_integrated_buffer_handle_t( this->ptr = usm_unique_ptr_t(rawPtr, [hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to free host memory: {}", ret); + UR_LOG(ERR, "Failed to free host memory: {}", ret); } }); @@ -168,7 +168,7 @@ void *ur_discrete_buffer_handle_t::allocateOnDevice(ur_device_handle_t hDevice, usm_unique_ptr_t(ptr, [hContext = this->hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to free device memory: {}", ret); + UR_LOG(ERR, "Failed to free device memory: {}", ret); } }); @@ -298,7 +298,7 @@ void *ur_discrete_buffer_handle_t::mapHostPtr( if (ownsAlloc) { auto ret = hContext->getDefaultUSMPool()->free(p); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to mapped memory: {}", ret); + UR_LOG(ERR, "Failed to mapped memory: {}", ret); } } }); @@ -728,7 +728,7 @@ ur_result_t urMemImageGetInfo(ur_mem_handle_t /*hMemory*/, ur_image_info_t /*propName*/, size_t /*propSize*/, void * /*pPropValue*/, size_t * /*pPropSizeRet*/) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp index 01ba6dfc6d13..2f4dbda08e3d 100644 --- a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp @@ -129,7 +129,7 @@ ur_queue_immediate_in_order_t::queueGetInfo(ur_queue_info_t propName, } } default: - UR_LOG(ERROR, + UR_LOG(ERR, "Unsupported ParamName in urQueueGetInfo: " "ParamName=ParamName={}(0x{})", propName, logger::toHex(propName)); @@ -190,7 +190,7 @@ ur_queue_immediate_in_order_t::~ur_queue_immediate_in_order_t() { try { UR_CALL_THROWS(queueFinish()); } catch (...) { - UR_LOG(ERROR, "Failed to finish queue on destruction"); + UR_LOG(ERR, "Failed to finish queue on destruction"); } } diff --git a/unified-runtime/source/adapters/level_zero/v2/usm.cpp b/unified-runtime/source/adapters/level_zero/v2/usm.cpp index c3b60da231bf..80bd2f6c7cb5 100644 --- a/unified-runtime/source/adapters/level_zero/v2/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/usm.cpp @@ -236,7 +236,7 @@ ur_result_t ur_usm_pool_handle_t_::free(void *ptr) { if (umfPool) { return umf::umf2urResult(umfPoolFree(umfPool, ptr)); } else { - UR_LOG(ERROR, "Failed to find pool for pointer: {}", ptr); + UR_LOG(ERR, "Failed to find pool for pointer: {}", ptr); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -439,7 +439,7 @@ ur_result_t urUSMGetMemAllocInfo( memAllocType = UR_USM_TYPE_SHARED; break; default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unexpected usm memory type"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(memAllocType); @@ -468,7 +468,7 @@ ur_result_t urUSMGetMemAllocInfo( // TODO return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unsupported ParamName"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp index e07bf050345a..f61c8fd43fe2 100644 --- a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp +++ b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp @@ -38,7 +38,7 @@ ur_result_t urVirtualMemGranularityGetInfo( return ReturnValue(PageSize); } default: - UR_LOG(ERROR, "Unsupported propName in urQueueGetInfo: propName={}({})", + UR_LOG(ERR, "Unsupported propName in urQueueGetInfo: propName={}({})", propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -120,7 +120,7 @@ ur_result_t urVirtualMemGetInfo(ur_context_handle_t hContext, return ReturnValue(RetFlags); } default: - UR_LOG(ERROR, "Unsupported propName in urQueueGetInfo: propName={}({})", + UR_LOG(ERR, "Unsupported propName in urQueueGetInfo: propName={}({})", propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/native_cpu/common.hpp b/unified-runtime/source/adapters/native_cpu/common.hpp index b2396daeebc8..6ca32d93a241 100644 --- a/unified-runtime/source/adapters/native_cpu/common.hpp +++ b/unified-runtime/source/adapters/native_cpu/common.hpp @@ -21,7 +21,7 @@ extern thread_local char ErrorMessage[MaxMessageSize]; #define DIE_NO_IMPLEMENTATION \ do { \ - UR_LOG(ERROR, "Not Implemented : {}", __FUNCTION__) \ + UR_LOG(ERR, "Not Implemented : {}", __FUNCTION__) \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; \ } while (false) @@ -33,7 +33,7 @@ extern thread_local char ErrorMessage[MaxMessageSize]; #define CASE_UR_UNSUPPORTED(not_supported) \ case not_supported: \ - UR_LOG(ERROR, "Unsupported UR case : {} in {}", #not_supported, \ + UR_LOG(ERR, "Unsupported UR case : {} in {}", #not_supported, \ __FUNCTION__) \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/native_cpu/device.cpp b/unified-runtime/source/adapters/native_cpu/device.cpp index 186e8d61e30b..b220b227c6e3 100644 --- a/unified-runtime/source/adapters/native_cpu/device.cpp +++ b/unified-runtime/source/adapters/native_cpu/device.cpp @@ -99,7 +99,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGet(ur_platform_handle_t hPlatform, if (NumEntries == 0) { /// Runtime queries number of devices if (phDevices != nullptr) { - UR_LOG(ERROR, "Invalid Arguments for urDevicesGet"); + UR_LOG(ERR, "Invalid Arguments for urDevicesGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/adapters/native_cpu/platform.cpp b/unified-runtime/source/adapters/native_cpu/platform.cpp index 760c2ce2da8e..b8073a16eef4 100644 --- a/unified-runtime/source/adapters/native_cpu/platform.cpp +++ b/unified-runtime/source/adapters/native_cpu/platform.cpp @@ -29,7 +29,7 @@ urPlatformGet(ur_adapter_handle_t, uint32_t NumEntries, if (NumEntries == 0) { if (phPlatforms != nullptr) { - UR_LOG(ERROR, "Invalid argument combination for urPlatformsGet"); + UR_LOG(ERR, "Invalid argument combination for urPlatformsGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/common/latency_tracker.hpp b/unified-runtime/source/common/latency_tracker.hpp index f15790f20a64..539db936f61d 100644 --- a/unified-runtime/source/common/latency_tracker.hpp +++ b/unified-runtime/source/common/latency_tracker.hpp @@ -64,7 +64,7 @@ static inline latencyValues getValues(const struct hdr_histogram *histogram) { auto ret = hdr_value_at_percentiles(histogram, percentiles, values.percentileValues, numPercentiles); if (ret != 0) { - UR_LOG(ERROR, "Failed to get percentiles from latency histogram"); + UR_LOG(ERR, "Failed to get percentiles from latency histogram"); } return values; @@ -137,7 +137,7 @@ class latency_histogram { auto ret = hdr_init(lowestDiscernibleValue, highestTrackableValue, significantFigures, &cHistogram); if (ret != 0) { - UR_LOG(ERROR, "Failed to initialize latency histogram"); + UR_LOG(ERR, "Failed to initialize latency histogram"); } histogram = std::unique_ptr( cHistogram, &hdr_close); diff --git a/unified-runtime/source/common/linux/ur_lib_loader.cpp b/unified-runtime/source/common/linux/ur_lib_loader.cpp index 4c5e61a848d3..621e45bb8133 100644 --- a/unified-runtime/source/common/linux/ur_lib_loader.cpp +++ b/unified-runtime/source/common/linux/ur_lib_loader.cpp @@ -25,8 +25,7 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { int res = dlclose(handle); if (res) { - UR_LOG(ERROR, - "Failed to unload the library with the handle at address {}", + UR_LOG(ERR, "Failed to unload the library with the handle at address {}", handle); } else { UR_LOG(INFO, "unloaded adapter 0x{}", handle); diff --git a/unified-runtime/source/common/logger/ur_logger_details.hpp b/unified-runtime/source/common/logger/ur_logger_details.hpp index 1fbc43655565..7f52d078184b 100644 --- a/unified-runtime/source/common/logger/ur_logger_details.hpp +++ b/unified-runtime/source/common/logger/ur_logger_details.hpp @@ -118,18 +118,42 @@ class Logger { #define UR_STRIMPL_(x) #x #define UR_STR_(x) UR_STRIMPL_(x) -#define URLOG_(logger_instance, level, ...) \ +#define URLOG2_(_logger, level, ...) \ { \ - (logger_instance) \ - .log(UR_LOGGER_LEVEL_##level, SHORT_FILE, UR_STR_(__LINE__), \ - __VA_ARGS__); \ + (_logger).log(level, SHORT_FILE, UR_STR_(__LINE__), __VA_ARGS__); \ } -#define URLOG_LEGACY_(logger_instance, level, legacy_message, ...) \ +#define URLOG_L2_(_logger, level, legacy_message, ...) \ { \ - (logger_instance) \ - .log(legacy_message, UR_LOGGER_LEVEL_##level, SHORT_FILE, \ - UR_STR_(__LINE__), __VA_ARGS__); \ + (_logger).log(legacy_message, level, SHORT_FILE, UR_STR_(__LINE__), \ + __VA_ARGS__); \ } +// some symbols usefuls for log levels are predfined in some systems, +// eg. ERROR on Windows +#define URLOG_(_logger, level, ...) URLOG_##level##_(_logger, __VA_ARGS__) +#define URLOG_L_(_logger, level, ...) URLOG_L_##level##_(_logger, __VA_ARGS__) + +#define URLOG_ERR_(_logger, ...) \ + URLOG2_(_logger, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) +#define URLOG_WARN_(_logger, ...) \ + URLOG2_(_logger, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) +#define URLOG_DEBUG_(_logger, ...) \ + URLOG2_(_logger, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) +#define URLOG_INFO_(_logger, ...) \ + URLOG2_(_logger, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) +#define URLOG_QUIET_(_logger, ...) \ + URLOG2_(_logger, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) + +#define URLOG_L_ERR_(_logger, ...) \ + URLOG_L2_(_logger, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) +#define URLOG_L_WARN_(_logger, ...) \ + URLOG_L2_(_logger, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) +#define URLOG_L_DEBUG_(_logger, ...) \ + URLOG_L2_(_logger, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) +#define URLOG_L_INFO_(_logger, ...) \ + URLOG_L2_(_logger, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) +#define URLOG_L_QUIET_(_logger, ...) \ + URLOG_L2_(_logger, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) + #endif /* UR_LOGGER_DETAILS_HPP */ diff --git a/unified-runtime/source/common/umf_helpers.hpp b/unified-runtime/source/common/umf_helpers.hpp index 28003ea5bd6a..1a9d2e56a5ba 100644 --- a/unified-runtime/source/common/umf_helpers.hpp +++ b/unified-runtime/source/common/umf_helpers.hpp @@ -296,7 +296,7 @@ inline ur_result_t umf2urResult(umf_result_t umfResult) { umfMemoryProviderGetLastNativeError(hProvider, &Msg, &Err); if (Msg) { - UR_LOG(ERROR, "UMF failed with: {}", Msg); + UR_LOG(ERR, "UMF failed with: {}", Msg); } return getProviderNativeError(umfMemoryProviderGetName(hProvider), Err); diff --git a/unified-runtime/source/common/ur_pool_manager.hpp b/unified-runtime/source/common/ur_pool_manager.hpp index 3b7fdfda1f29..90751f478891 100644 --- a/unified-runtime/source/common/ur_pool_manager.hpp +++ b/unified-runtime/source/common/ur_pool_manager.hpp @@ -176,7 +176,7 @@ template struct pool_manager { ur_result_t addPool(const D &desc, unique_pool_handle_t &&hPool) { if (!descToPoolMap.try_emplace(desc, std::move(hPool)).second) { - UR_LOG(ERROR, "Pool for pool descriptor: {}, already exists", desc); + UR_LOG(ERR, "Pool for pool descriptor: {}, already exists", desc); return UR_RESULT_ERROR_INVALID_ARGUMENT; } @@ -186,8 +186,7 @@ template struct pool_manager { std::optional getPool(const D &desc) { auto it = descToPoolMap.find(desc); if (it == descToPoolMap.end()) { - UR_LOG(ERROR, "Pool descriptor doesn't match any existing pool: {}", - desc); + UR_LOG(ERR, "Pool descriptor doesn't match any existing pool: {}", desc); return std::nullopt; } diff --git a/unified-runtime/source/common/ur_util.cpp b/unified-runtime/source/common/ur_util.cpp index 74a8e8511949..6978a3958264 100644 --- a/unified-runtime/source/common/ur_util.cpp +++ b/unified-runtime/source/common/ur_util.cpp @@ -45,14 +45,14 @@ int ur_duplicate_fd(int pid, int fd_in) { errno = 0; int pid_fd = syscall(__NR_pidfd_open, pid, 0); if (pid_fd == -1) { - UR_LOG(ERROR, "__NR_pidfd_open"); + UR_LOG(ERR, "__NR_pidfd_open"); return -1; } int fd_dup = syscall(__NR_pidfd_getfd, pid_fd, fd_in, 0); close(pid_fd); if (fd_dup == -1) { - UR_LOG(ERROR, "__NR_pidfd_getfd"); + UR_LOG(ERR, "__NR_pidfd_getfd"); return -1; } @@ -63,7 +63,7 @@ int ur_duplicate_fd(int pid, int fd_in) { (void)pid; // unused (void)fd_in; // unused errno = ENOTSUP; // unsupported - UR_LOG(ERROR, "__NR_pidfd_open or __NR_pidfd_getfd not available"); + UR_LOG(ERR, "__NR_pidfd_open or __NR_pidfd_getfd not available"); return -1; #endif /* defined(__NR_pidfd_open) && defined(__NR_pidfd_getfd) */ } diff --git a/unified-runtime/source/common/windows/ur_lib_loader.cpp b/unified-runtime/source/common/windows/ur_lib_loader.cpp index c4981526de8e..1ceab4389aef 100644 --- a/unified-runtime/source/common/windows/ur_lib_loader.cpp +++ b/unified-runtime/source/common/windows/ur_lib_loader.cpp @@ -17,7 +17,7 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { BOOL res = FreeLibrary(handle); if (!res) { - UR_LOG(ERROR, + UR_LOG(ERR, "Failed to unload the library with the handle at address 0x{}", handle); } else { diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp index 9a9a13252859..a3383f14cc10 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp @@ -33,7 +33,7 @@ TsanRuntimeData *TsanRuntimeDataWrapper::getDevicePtr() { Context, Device, nullptr, nullptr, sizeof(TsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to alloc device usm for asan runtime data: {}", + UR_LOG(ERR, "Failed to alloc device usm for asan runtime data: {}", Result); } } diff --git a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp index 355cd0596048..84a2fc29e957 100644 --- a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp +++ b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp @@ -91,7 +91,7 @@ struct RefCountContext { } if (it->second.refCount < 0) { - UR_LOG(ERROR, "Attempting to release nonexistent handle {}", ptr); + UR_LOG(ERR, "Attempting to release nonexistent handle {}", ptr); } else if (it->second.refCount == 0 && isAdapterHandle) { adapterCount--; } diff --git a/unified-runtime/source/loader/ur_adapter_registry.hpp b/unified-runtime/source/loader/ur_adapter_registry.hpp index c005f24cb102..55e5cb6b4217 100644 --- a/unified-runtime/source/loader/ur_adapter_registry.hpp +++ b/unified-runtime/source/loader/ur_adapter_registry.hpp @@ -102,7 +102,7 @@ class AdapterRegistry { try { forceLoadedAdaptersOpt = getenv_to_vec("UR_ADAPTERS_FORCE_LOAD"); } catch (const std::invalid_argument &e) { - UR_LOG(ERROR, e.what()); + UR_LOG(ERR, e.what()); } if (forceLoadedAdaptersOpt.has_value()) { @@ -120,7 +120,7 @@ class AdapterRegistry { try { exists = fs::exists(path); } catch (std::exception &e) { - UR_LOG(ERROR, e.what()); + UR_LOG(ERR, e.what()); } if (exists) { @@ -205,7 +205,7 @@ class AdapterRegistry { try { pathStringsOpt = getenv_to_vec("UR_ADAPTERS_SEARCH_PATH"); } catch (const std::invalid_argument &e) { - UR_LOG(ERROR, e.what()); + UR_LOG(ERR, e.what()); return std::nullopt; } @@ -235,8 +235,8 @@ class AdapterRegistry { } catch (...) { // If the selector is malformed, then we ignore selector and return // success. - UR_LOG(ERROR, "ERROR: missing backend, format of filter = " - "'[!]backend:filterStrings'"); + UR_LOG(ERR, "ERROR: missing backend, format of filter = " + "'[!]backend:filterStrings'"); return UR_RESULT_SUCCESS; } UR_LOG(DEBUG, "getenv_to_map parsed env var and {} a map", @@ -258,8 +258,8 @@ class AdapterRegistry { if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case // malformed term: missing backend -- output ERROR, then continue - UR_LOG(ERROR, "ERROR: missing backend, format of filter = " - "'[!]backend:filterStrings'"); + UR_LOG(ERR, "ERROR: missing backend, format of filter = " + "'[!]backend:filterStrings'"); continue; } UR_LOG(DEBUG, "ONEAPI_DEVICE_SELECTOR Pre-Filter with backend '{}' ", diff --git a/unified-runtime/source/loader/ur_lib.cpp b/unified-runtime/source/loader/ur_lib.cpp index 208030d6ca49..0263fdd93741 100644 --- a/unified-runtime/source/loader/ur_lib.cpp +++ b/unified-runtime/source/loader/ur_lib.cpp @@ -441,8 +441,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case // malformed term: missing backend -- output ERROR, then continue - UR_LOG(ERROR, "ERROR: missing backend, format of filter = " - "'[!]backend:filterStrings'"); + UR_LOG(ERR, "ERROR: missing backend, format of filter = " + "'[!]backend:filterStrings'"); continue; } enum FilterType { @@ -467,7 +467,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, [&](auto &p) { return p.second == backend; }); if (found == cend) { // It's not a legal backend - UR_LOG(ERROR, "unrecognised backend '{}'", backend); + UR_LOG(ERR, "unrecognised backend '{}'", backend); return UR_RESULT_ERROR_INVALID_VALUE; } else if (found->first != platformBackend) { // If it's a rule for a different backend, ignore it @@ -476,8 +476,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, } if (termPair.second.size() == 0) { // malformed term: missing filterStrings -- output ERROR - UR_LOG(ERROR, "missing filterStrings, format of filter = " - "'[!]backend:filterStrings'"); + UR_LOG(ERR, "missing filterStrings, format of filter = " + "'[!]backend:filterStrings'"); return UR_RESULT_ERROR_INVALID_VALUE; } if (std::find_if(termPair.second.cbegin(), termPair.second.cend(), @@ -494,8 +494,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return std::count(s.cbegin(), s.cend(), '.') > 2; }) != termPair.second.cend()) { // malformed term: too many dots in filterString - UR_LOG(ERROR, "too many dots in filterString, format of " - "filterString = 'root[.sub[.subsub]]'"); + UR_LOG(ERR, "too many dots in filterString, format of " + "filterString = 'root[.sub[.subsub]]'"); return UR_RESULT_ERROR_INVALID_VALUE; } if (std::find_if(termPair.second.cbegin(), termPair.second.cend(), @@ -516,7 +516,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return false; // no BAD things, so must be okay }) != termPair.second.cend()) { // malformed term: star dot no-star in filterString - UR_LOG(ERROR, "invalid wildcard in filterString, '*.' => '*.*'"); + UR_LOG(ERR, "invalid wildcard in filterString, '*.' => '*.*'"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/test/logger/env_var.cpp b/unified-runtime/test/logger/env_var.cpp index 763985299791..e8f43e45889c 100644 --- a/unified-runtime/test/logger/env_var.cpp +++ b/unified-runtime/test/logger/env_var.cpp @@ -20,5 +20,5 @@ TEST_F(LoggerFromEnvVar, WarningMessage) { } TEST_F(LoggerFromEnvVar, ErrorMessage) { - UR_LOG(ERROR, "Test message: {}", "success"); + UR_LOG(ERR, "Test message: {}", "success"); } From ffcf873cbf1bef5431d101679ecf31146de2ff1b Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Tue, 22 Apr 2025 14:30:02 +0000 Subject: [PATCH 11/16] Windows workaround --- .../source/adapters/cuda/common.cpp | 6 +- .../source/adapters/cuda/image.cpp | 2 +- .../source/adapters/hip/common.cpp | 6 +- unified-runtime/source/adapters/hip/image.cpp | 2 +- .../source/adapters/level_zero/adapter.cpp | 10 ++-- .../adapters/level_zero/async_alloc.cpp | 2 +- .../adapters/level_zero/command_buffer.cpp | 6 +- .../source/adapters/level_zero/common.cpp | 2 +- .../source/adapters/level_zero/context.cpp | 2 +- .../source/adapters/level_zero/device.cpp | 22 +++---- .../source/adapters/level_zero/event.cpp | 22 +++---- .../level_zero/helpers/image_helpers.cpp | 40 ++++++------- .../level_zero/helpers/kernel_helpers.cpp | 18 +++--- .../source/adapters/level_zero/image.cpp | 28 ++++----- .../source/adapters/level_zero/kernel.cpp | 18 +++--- .../source/adapters/level_zero/memory.cpp | 16 ++--- .../source/adapters/level_zero/program.cpp | 6 +- .../source/adapters/level_zero/queue.cpp | 14 ++--- .../source/adapters/level_zero/sampler.cpp | 13 ++-- .../source/adapters/level_zero/usm.cpp | 20 +++---- .../source/adapters/level_zero/v2/api.cpp | 60 +++++++++---------- .../adapters/level_zero/v2/command_buffer.cpp | 5 +- .../source/adapters/level_zero/v2/event.cpp | 6 +- .../source/adapters/level_zero/v2/kernel.cpp | 8 +-- .../source/adapters/level_zero/v2/memory.cpp | 8 +-- .../v2/queue_immediate_in_order.cpp | 4 +- .../source/adapters/level_zero/v2/usm.cpp | 6 +- .../adapters/level_zero/virtual_mem.cpp | 4 +- .../source/adapters/native_cpu/common.hpp | 4 +- .../source/adapters/native_cpu/device.cpp | 2 +- .../source/adapters/native_cpu/platform.cpp | 2 +- .../source/common/latency_tracker.hpp | 4 +- .../source/common/linux/ur_lib_loader.cpp | 3 +- .../source/common/logger/ur_logger.hpp | 4 +- .../common/logger/ur_logger_details.hpp | 41 ++++++++++--- unified-runtime/source/common/umf_helpers.hpp | 2 +- .../source/common/ur_pool_manager.hpp | 5 +- unified-runtime/source/common/ur_util.cpp | 6 +- .../source/common/windows/ur_lib_loader.cpp | 2 +- .../layers/sanitizer/asan/asan_buffer.cpp | 12 ++-- .../loader/layers/sanitizer/asan/asan_ddi.cpp | 10 ++-- .../sanitizer/asan/asan_interceptor.cpp | 14 ++--- .../sanitizer/asan/asan_interceptor.hpp | 2 +- .../layers/sanitizer/asan/asan_shadow.cpp | 14 ++--- .../layers/sanitizer/msan/msan_buffer.cpp | 12 ++-- .../loader/layers/sanitizer/msan/msan_ddi.cpp | 6 +- .../sanitizer/msan/msan_interceptor.cpp | 10 ++-- .../sanitizer/msan/msan_interceptor.hpp | 2 +- .../layers/sanitizer/msan/msan_shadow.cpp | 11 ++-- .../linux/sanitizer_utils.cpp | 6 +- .../sanitizer_options_impl.hpp | 4 +- .../sanitizer_common/sanitizer_utils.cpp | 10 ++-- .../layers/sanitizer/tsan/tsan_buffer.cpp | 12 ++-- .../loader/layers/sanitizer/tsan/tsan_ddi.cpp | 10 ++-- .../sanitizer/tsan/tsan_interceptor.cpp | 8 +-- .../layers/sanitizer/tsan/tsan_shadow.cpp | 12 ++-- .../layers/validation/ur_leak_check.hpp | 20 ++++--- .../layers/validation/ur_validation_layer.cpp | 2 +- .../source/loader/ur_adapter_registry.hpp | 16 ++--- unified-runtime/source/loader/ur_lib.cpp | 18 +++--- .../test/loader/platforms/platforms.cpp | 14 ++--- unified-runtime/test/logger/env_var.cpp | 2 +- unified-runtime/test/unit/logger.cpp | 18 +++--- unified-runtime/tools/urtrace/collector.cpp | 13 ++-- 64 files changed, 354 insertions(+), 335 deletions(-) diff --git a/unified-runtime/source/adapters/cuda/common.cpp b/unified-runtime/source/adapters/cuda/common.cpp index a7180b4d1a90..bb95cdd0f397 100644 --- a/unified-runtime/source/adapters/cuda/common.cpp +++ b/unified-runtime/source/adapters/cuda/common.cpp @@ -71,7 +71,7 @@ void checkErrorUR(CUresult Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr || std::getenv("UR_CUDA_ABORT") != nullptr) { @@ -95,7 +95,7 @@ void checkErrorUR(nvmlReturn_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr || std::getenv("UR_CUDA_ABORT") != nullptr) { @@ -115,7 +115,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_CUDA_ABORT") != nullptr) { std::abort(); diff --git a/unified-runtime/source/adapters/cuda/image.cpp b/unified-runtime/source/adapters/cuda/image.cpp index d7585933c391..14428f61c7bd 100644 --- a/unified-runtime/source/adapters/cuda/image.cpp +++ b/unified-runtime/source/adapters/cuda/image.cpp @@ -803,7 +803,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - UR_LOG(ERROR, + UR_LOG(ERR, "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/hip/common.cpp b/unified-runtime/source/adapters/hip/common.cpp index 7a5d81feddce..535693116cdf 100644 --- a/unified-runtime/source/adapters/hip/common.cpp +++ b/unified-runtime/source/adapters/hip/common.cpp @@ -86,7 +86,7 @@ void checkErrorUR(amd_comgr_status_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -113,7 +113,7 @@ void checkErrorUR(hipError_t Result, const char *Function, int Line, << "\n\tDescription: " << ErrorString << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { @@ -133,7 +133,7 @@ void checkErrorUR(ur_result_t Result, const char *Function, int Line, SS << "\nUR HIP ERROR:" << "\n\tValue: " << Result << "\n\tFunction: " << Function << "\n\tSource Location: " << File << ":" << Line << "\n"; - UR_LOG(ERROR, "{}", SS.str()); + UR_LOG(ERR, "{}", SS.str()); if (std::getenv("PI_HIP_ABORT") != nullptr || std::getenv("UR_HIP_ABORT") != nullptr) { diff --git a/unified-runtime/source/adapters/hip/image.cpp b/unified-runtime/source/adapters/hip/image.cpp index ed015748057c..2ce3e0e05792 100644 --- a/unified-runtime/source/adapters/hip/image.cpp +++ b/unified-runtime/source/adapters/hip/image.cpp @@ -822,7 +822,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesImageCopyExp( // we don't support copying between different image types. if (pSrcImageDesc->type != pDstImageDesc->type) { - UR_LOG(ERROR, + UR_LOG(ERR, "Unsupported copy operation between different type of images"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/adapter.cpp b/unified-runtime/source/adapters/level_zero/adapter.cpp index 06639503a047..e90cb45a8923 100644 --- a/unified-runtime/source/adapters/level_zero/adapter.cpp +++ b/unified-runtime/source/adapters/level_zero/adapter.cpp @@ -163,7 +163,7 @@ ur_result_t initPlatforms(PlatformVec &platforms, ZE2UR_CALL(zeDriverGet, (&ZeDriverGetCount, ZeDriverGetHandles.data())); } if (ZeDriverGetCount == 0 && GlobalAdapter->ZeInitDriversCount == 0) { - UR_LOG(ERROR, "\nNo Valid L0 Drivers found.\n"); + UR_LOG(ERR, "\nNo Valid L0 Drivers found.\n"); return UR_RESULT_SUCCESS; } @@ -389,7 +389,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() if (GlobalAdapter->ZeInitResult != ZE_RESULT_SUCCESS) { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitResult, ErrorString); - UR_LOG(ERROR, "\nzeInit failed with {}\n", ErrorString); + UR_LOG(ERR, "\nzeInit failed with {}\n", ErrorString); } bool useInitDrivers = false; @@ -441,7 +441,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() } else { const char *ErrorString = "Unknown"; zeParseError(GlobalAdapter->ZeInitDriversResult, ErrorString); - UR_LOG(ERROR, "\nzeInitDrivers failed with {}\n", ErrorString); + UR_LOG(ERR, "\nzeInitDrivers failed with {}\n", ErrorString); } } } @@ -459,12 +459,12 @@ ur_adapter_handle_t_::ur_adapter_handle_t_() // Absorb the ZE_RESULT_ERROR_UNINITIALIZED and just return 0 Platforms. if (*GlobalAdapter->ZeResult == ZE_RESULT_ERROR_UNINITIALIZED) { - UR_LOG(ERROR, "Level Zero Uninitialized\n"); + UR_LOG(ERR, "Level Zero Uninitialized\n"); result = std::move(platforms); return; } if (*GlobalAdapter->ZeResult != ZE_RESULT_SUCCESS) { - UR_LOG(ERROR, "Level Zero initialization failure\n"); + UR_LOG(ERR, "Level Zero initialization failure\n"); result = ze2urResult(*GlobalAdapter->ZeResult); return; diff --git a/unified-runtime/source/adapters/level_zero/async_alloc.cpp b/unified-runtime/source/adapters/level_zero/async_alloc.cpp index cd363c49504c..e8b29edccd42 100644 --- a/unified-runtime/source/adapters/level_zero/async_alloc.cpp +++ b/unified-runtime/source/adapters/level_zero/async_alloc.cpp @@ -92,7 +92,7 @@ static ur_result_t enqueueUSMAllocHelper( CommandType = UR_COMMAND_ENQUEUE_USM_SHARED_ALLOC_EXP; break; default: - UR_LOG(ERROR, "enqueueUSMAllocHelper: unsupported USM type"); + UR_LOG(ERR, "enqueueUSMAllocHelper: unsupported USM type"); throw UR_RESULT_ERROR_UNKNOWN; } UR_CALL(createEventAndAssociateQueue(Queue, Event, CommandType, CommandList, diff --git a/unified-runtime/source/adapters/level_zero/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/command_buffer.cpp index 2753827d1f95..c61a24565398 100644 --- a/unified-runtime/source/adapters/level_zero/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/command_buffer.cpp @@ -44,7 +44,7 @@ bool checkImmediateAppendSupport(ur_context_handle_t Context, const bool EnableAppendPath = std::atoi(UrRet) == 1; if (EnableAppendPath && !Device->ImmCommandListUsed) { - UR_LOG(ERROR, + UR_LOG(ERR, "{} is set but immediate command-lists are currently " "disabled. Immediate command-lists are " "required to use the immediate append path.", @@ -52,7 +52,7 @@ bool checkImmediateAppendSupport(ur_context_handle_t Context, std::abort(); } if (EnableAppendPath && !DriverSupportsImmediateAppend) { - UR_LOG(ERROR, + UR_LOG(ERR, "{} is set but the current driver does not support the " "zeCommandListImmediateAppendCommandListsExp entrypoint.", AppendEnvVarName); @@ -1876,7 +1876,7 @@ ur_result_t validateCommandDesc( if (NewGlobalWorkOffset) { if (!CommandBuffer->Context->getPlatform() ->ZeDriverGlobalOffsetExtensionFound) { - UR_LOG(ERROR, "No global offset extension found on this driver"); + UR_LOG(ERR, "No global offset extension found on this driver"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/common.cpp b/unified-runtime/source/adapters/level_zero/common.cpp index a0f150c142f1..dd4c27c0f67d 100644 --- a/unified-runtime/source/adapters/level_zero/common.cpp +++ b/unified-runtime/source/adapters/level_zero/common.cpp @@ -151,7 +151,7 @@ ze_result_t ZeCall::doCall(ze_result_t ZeResult, const char *ZeName, if (TraceError) { const char *ErrorString = "Unknown"; zeParseError(ZeResult, ErrorString); - UR_LOG(ERROR, "Error ({}) in {}", ErrorString, ZeName); + UR_LOG(ERR, "Error ({}) in {}", ErrorString, ZeName); } return ZeResult; } diff --git a/unified-runtime/source/adapters/level_zero/context.cpp b/unified-runtime/source/adapters/level_zero/context.cpp index 3ea565f4a2f0..3209b8b78915 100644 --- a/unified-runtime/source/adapters/level_zero/context.cpp +++ b/unified-runtime/source/adapters/level_zero/context.cpp @@ -167,7 +167,7 @@ ur_result_t urContextSetExtendedDeleter( ur_context_extended_deleter_t /*Deleter*/, /// [in][out][optional] pointer to data to be passed to callback. void * /*UserData*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/device.cpp b/unified-runtime/source/adapters/level_zero/device.cpp index 004828e9d4ec..da7de39f0bc0 100644 --- a/unified-runtime/source/adapters/level_zero/device.cpp +++ b/unified-runtime/source/adapters/level_zero/device.cpp @@ -52,8 +52,8 @@ getRangeOfAllowedCopyEngines(const ur_device_handle_t &Device) { int UpperCopyEngineIndex = std::stoi(CopyEngineRange.substr(pos + 1)); if ((LowerCopyEngineIndex > UpperCopyEngineIndex) || (LowerCopyEngineIndex < -1) || (UpperCopyEngineIndex < -1)) { - UR_LOG(ERROR, "UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " - "default set."); + UR_LOG(ERR, "UR_L0_LEVEL_ZERO_USE_COPY_ENGINE: invalid value provided, " + "default set."); LowerCopyEngineIndex = 0; UpperCopyEngineIndex = INT_MAX; } @@ -194,8 +194,8 @@ static std::tuple getZesDeviceData(ur_device_handle_t Device) { bool SysManEnv = getenv_tobool("ZES_ENABLE_SYSMAN", false); if ((Device->Platform->ZedeviceToZesDeviceMap.size() == 0) && !SysManEnv) { - UR_LOG(ERROR, "SysMan support is unavailable on this system. Please " - "check your level zero driver installation."); + UR_LOG(ERR, "SysMan support is unavailable on this system. Please " + "check your level zero driver installation."); return {nullptr, {}, UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION}; } @@ -250,7 +250,7 @@ ur_result_t urDeviceGetInfo( case ZE_DEVICE_TYPE_FPGA: return ReturnValue(UR_DEVICE_TYPE_FPGA); default: - UR_LOG(ERROR, "This device type is not supported"); + UR_LOG(ERR, "This device type is not supported"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1107,8 +1107,8 @@ ur_result_t urDeviceGetInfo( case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_HEIGHT_EXP: case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_PITCH_EXP: - UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(ERROR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + UR_LOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_SUPPORT_EXP: { // L0 does not support mipmaps. @@ -1119,8 +1119,8 @@ ur_result_t urDeviceGetInfo( return ReturnValue(false); } case UR_DEVICE_INFO_MIPMAP_MAX_ANISOTROPY_EXP: - UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(ERROR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); + UR_LOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERR, "ParamName=%{}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; case UR_DEVICE_INFO_MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP: { // L0 does not support creation of images from individual mipmap levels. @@ -1338,8 +1338,8 @@ ur_result_t urDeviceGetInfo( } } default: - UR_LOG(ERROR, "Unsupported ParamName in urGetDeviceInfo"); - UR_LOG(ERROR, "ParamNameParamName={}(0x{})", ParamName, + UR_LOG(ERR, "Unsupported ParamName in urGetDeviceInfo"); + UR_LOG(ERR, "ParamNameParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; } diff --git a/unified-runtime/source/adapters/level_zero/event.cpp b/unified-runtime/source/adapters/level_zero/event.cpp index dda91b5d456b..3ef22bc53d2f 100644 --- a/unified-runtime/source/adapters/level_zero/event.cpp +++ b/unified-runtime/source/adapters/level_zero/event.cpp @@ -510,7 +510,7 @@ ur_result_t urEventGetInfo( return ReturnValue(Event->RefCount.load()); } default: - UR_LOG(ERROR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", PropName, logger::toHex(PropName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -596,11 +596,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(ERROR, "urEventGetProfilingInfo: " - "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); + UR_LOG(ERR, "urEventGetProfilingInfo: " + "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -663,11 +663,11 @@ ur_result_t urEventGetProfilingInfo( return ReturnValue(ContextEndTime); } case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(ERROR, "urEventGetProfilingInfo: " - "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); + UR_LOG(ERR, "urEventGetProfilingInfo: " + "UR_PROFILING_INFO_COMMAND_COMPLETE not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } else { @@ -710,11 +710,11 @@ ur_result_t urEventGetProfilingInfo( // return ReturnValue(uint64_t{0}); case UR_PROFILING_INFO_COMMAND_COMPLETE: - UR_LOG(ERROR, "urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " - "not supported"); + UR_LOG(ERR, "urEventGetProfilingInfo: UR_PROFILING_INFO_COMMAND_COMPLETE " + "not supported"); return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -1009,7 +1009,7 @@ ur_result_t urEventSetCallback( ur_event_callback_t /*Notify*/, /// [in][out][optional] pointer to data to be passed to callback. void * /*UserData*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp index 160627953166..a119c915caa0 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/image_helpers.cpp @@ -35,7 +35,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormatTypeSize = 32; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unsupported image format layout: layout = {}", ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; @@ -54,8 +54,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_A; break; default: - UR_LOG(ERROR, - "ze2urImageFormat: unexpected image format channel x: x = {}", + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel x: x = {}", ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -64,8 +63,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, case ZE_IMAGE_FORMAT_LAYOUT_16_16: case ZE_IMAGE_FORMAT_LAYOUT_32_32: if (ZeImageFormat.x != ZE_IMAGE_FORMAT_SWIZZLE_R) { - UR_LOG(ERROR, - "ze2urImageFormat: unexpected image format channel x: x = {}", + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel x: x = {}", ZeImageFormat.x); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -80,7 +78,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RX; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel y: y = {}\n", ZeImageFormat.y); return UR_RESULT_ERROR_INVALID_VALUE; @@ -99,13 +97,13 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGX; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel z: z = {}\n", ZeImageFormat.z); return UR_RESULT_ERROR_INVALID_VALUE; } } else { - UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel"); + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -123,7 +121,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelOrder = UR_IMAGE_CHANNEL_ORDER_RGBA; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel w: w = {}", ZeImageFormat.w); return UR_RESULT_ERROR_INVALID_VALUE; @@ -139,12 +137,12 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ZeImageFormat.w == ZE_IMAGE_FORMAT_SWIZZLE_A) { ChannelOrder = UR_IMAGE_CHANNEL_ORDER_BGRA; } else { - UR_LOG(ERROR, "ze2urImageFormat: unexpected image format channel"); + UR_LOG(ERR, "ze2urImageFormat: unexpected image format channel"); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unsupported image format layout: layout = {}", ZeImageFormat.layout); return UR_RESULT_ERROR_INVALID_VALUE; @@ -164,7 +162,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -182,7 +180,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SIGNED_INT32; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -197,7 +195,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_UNORM_INT16; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -212,7 +210,7 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_SNORM_INT16; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; @@ -227,14 +225,14 @@ ur_result_t ze2urImageFormat(const ze_image_desc_t *ZeImageDesc, ChannelType = UR_IMAGE_CHANNEL_TYPE_FLOAT; break; default: - UR_LOG(ERROR, + UR_LOG(ERR, "ze2urImageFormat: unexpected image format type size: size = {}", ZeImageFormatTypeSize); return UR_RESULT_ERROR_INVALID_VALUE; } break; default: - UR_LOG(ERROR, "ze2urImageFormat: unsupported image format type: type = {}", + UR_LOG(ERR, "ze2urImageFormat: unsupported image format type: type = {}", ZeImageFormat.type); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -281,13 +279,13 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDesc: unexpected data type Size\n"); + UR_LOG(ERR, "ur2zeImageDesc: unexpected data type Size\n"); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; } break; } default: - UR_LOG(ERROR, "format layout = {}", ImageFormat->channelOrder); + UR_LOG(ERR, "format layout = {}", ImageFormat->channelOrder); return UR_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT; break; } @@ -316,7 +314,7 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - UR_LOG(ERROR, "ur2zeImageDesc: unsupported image type"); + UR_LOG(ERR, "ur2zeImageDesc: unsupported image type"); return UR_RESULT_ERROR_INVALID_IMAGE_FORMAT_DESCRIPTOR; } @@ -513,7 +511,7 @@ getImageFormatTypeAndSize(const ur_image_format_t *ImageFormat) { break; } default: - UR_LOG(ERROR, "ur2zeImageDesc: unsupported image data type: data type = {}", + UR_LOG(ERR, "ur2zeImageDesc: unsupported image data type: data type = {}", ImageFormat->channelType); ZeImageFormatType = ZE_IMAGE_FORMAT_TYPE_FORCE_UINT32; ZeImageFormatTypeSize = 0; diff --git a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp index e015d14477cd..97aac29a84fb 100644 --- a/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp +++ b/unified-runtime/source/adapters/level_zero/helpers/kernel_helpers.cpp @@ -52,8 +52,8 @@ ur_result_t getSuggestedLocalWorkSize(ur_device_handle_t hDevice, --GroupSize[I]; } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - UR_LOG(ERROR, "getSuggestedLocalWorkSize: can't find a WG size " - "suitable for global work size > UINT32_MAX"); + UR_LOG(ERR, "getSuggestedLocalWorkSize: can't find a WG size " + "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } WG[I] = GroupSize[I]; @@ -130,27 +130,27 @@ ur_result_t calculateKernelWorkDimensions( break; default: - UR_LOG(ERROR, "calculateKernelWorkDimensions: unsupported work_dim"); + UR_LOG(ERR, "calculateKernelWorkDimensions: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " - "is not a multiple of the group size in the 1st dimension"); + UR_LOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + "is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " - "is not a multiple of the group size in the 2nd dimension"); + UR_LOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + "is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[2] != size_t(ZeThreadGroupDimensions.groupCountZ) * WG[2]) { - UR_LOG(ERROR, "calculateKernelWorkDimensions: invalid work_dim. The range " - "is not a multiple of the group size in the 3rd dimension"); + UR_LOG(ERR, "calculateKernelWorkDimensions: invalid work_dim. The range " + "is not a multiple of the group size in the 3rd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } diff --git a/unified-runtime/source/adapters/level_zero/image.cpp b/unified-runtime/source/adapters/level_zero/image.cpp index d72b7bc6bf62..28959fd3f09c 100644 --- a/unified-runtime/source/adapters/level_zero/image.cpp +++ b/unified-runtime/source/adapters/level_zero/image.cpp @@ -56,7 +56,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -75,7 +75,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -95,7 +95,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; @@ -113,13 +113,13 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageFormatLayout = ZE_IMAGE_FORMAT_LAYOUT_32_32_32; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unexpected data type size"); + UR_LOG(ERR, "ur2zeImageDescBindless: unexpected data type size"); return UR_RESULT_ERROR_INVALID_VALUE; } break; } default: - UR_LOG(ERROR, "format channel order = {}", ImageFormat->channelOrder); + UR_LOG(ERR, "format channel order = {}", ImageFormat->channelOrder); die("ur2zeImageDescBindless: unsupported image channel order\n"); break; } @@ -148,7 +148,7 @@ ur2zeImageDescBindless(const ur_image_format_t *ImageFormat, ZeImageType = ZE_IMAGE_TYPE_2DARRAY; break; default: - UR_LOG(ERROR, "ur2zeImageDescBindless: unsupported image type"); + UR_LOG(ERR, "ur2zeImageDescBindless: unsupported image type"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -237,7 +237,7 @@ ur_result_t bindlessImagesCreateImpl(ur_context_handle_t hContext, DriverHandle, "zeImageGetDeviceOffsetExp", (void **)&zeImageGetDeviceOffsetExpFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - UR_LOG(ERROR, + UR_LOG(ERR, "zeDriverGetExtensionFunctionAddress zeImageGetDeviceOffsetExpv " "failed, err = {}", Result); @@ -281,7 +281,7 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, DriverHandle, "zeMemGetPitchFor2dImage", (void **)&zeMemGetPitchFor2dImageFunctionPtr); if (Result != ZE_RESULT_SUCCESS) - UR_LOG(ERROR, + UR_LOG(ERR, "zeDriverGetExtensionFunctionAddress zeMemGetPitchFor2dImage " "failed, err = {}", Result); @@ -552,7 +552,7 @@ ur_result_t urBindlessImagesImageCopyExp( &DstRegion, &SrcRegion, ZeEvent, WaitList.Length, WaitList.ZeEventList)); } else { - UR_LOG(ERROR, "urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); + UR_LOG(ERR, "urBindlessImagesImageCopyExp: unexpected imageCopyFlags"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -615,7 +615,7 @@ ur_result_t urBindlessImagesMipmapGetLevelExp( ur_context_handle_t /*hContext*/, ur_device_handle_t /*hDevice*/, ur_exp_image_mem_native_handle_t /*hImageMem*/, uint32_t /*mipmapLevel*/, ur_exp_image_mem_native_handle_t * /*phImageMem*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -800,7 +800,7 @@ ur_result_t urBindlessImagesImportExternalSemaphoreExp( auto UrPlatform = hContext->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] "), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] "), " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -932,7 +932,7 @@ ur_result_t urBindlessImagesReleaseExternalSemaphoreExp( ur_exp_external_semaphore_handle_t hExternalSemaphore) { auto UrPlatform = hContext->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(ERROR, logger::LegacyMessage("[UR][L0] "), + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] "), " {} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -955,7 +955,7 @@ ur_result_t urBindlessImagesWaitExternalSemaphoreExp( const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { auto UrPlatform = hQueue->Context->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not supported!"), "{} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1040,7 +1040,7 @@ ur_result_t urBindlessImagesSignalExternalSemaphoreExp( const ur_event_handle_t *phEventWaitList, ur_event_handle_t *phEvent) { auto UrPlatform = hQueue->Context->getPlatform(); if (UrPlatform->ZeExternalSemaphoreExt.Supported == false) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not supported!"), "{} function not supported!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/kernel.cpp b/unified-runtime/source/adapters/level_zero/kernel.cpp index d139a6881115..16cbe73c6e18 100644 --- a/unified-runtime/source/adapters/level_zero/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/kernel.cpp @@ -316,7 +316,7 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( } if (GlobalWorkSize3D[I] / GroupSize[I] > UINT32_MAX) { - UR_LOG(ERROR, + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: can't find a WG size " "suitable for global work size > UINT32_MAX"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; @@ -355,21 +355,21 @@ ur_result_t urEnqueueCooperativeKernelLaunchExp( break; default: - UR_LOG(ERROR, "urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: unsupported work_dim"); return UR_RESULT_ERROR_INVALID_VALUE; } // Error handling for non-uniform group size case if (GlobalWorkSize3D[0] != size_t(ZeThreadGroupDimensions.groupCountX) * WG[0]) { - UR_LOG(ERROR, + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 1st dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; } if (GlobalWorkSize3D[1] != size_t(ZeThreadGroupDimensions.groupCountY) * WG[1]) { - UR_LOG(ERROR, + UR_LOG(ERR, "urEnqueueCooperativeKernelLaunchExp: invalid work_dim. The " "range is not a multiple of the group size in the 2nd dimension"); return UR_RESULT_ERROR_INVALID_WORK_GROUP_SIZE; @@ -788,8 +788,7 @@ ur_result_t urKernelGetInfo( return UR_RESULT_ERROR_UNKNOWN; } default: - UR_LOG(ERROR, - "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -877,8 +876,7 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - UR_LOG(ERROR, - "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -1019,7 +1017,7 @@ ur_result_t urKernelSetExecInfo( return UR_RESULT_ERROR_INVALID_VALUE; ZE2UR_CALL(zeKernelSetCacheConfig, (ZeKernel, ZeCacheConfig);); } else { - UR_LOG(ERROR, "urKernelSetExecInfo: unsupported ParamName"); + UR_LOG(ERR, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -1166,7 +1164,7 @@ ur_result_t urKernelSetSpecializationConstants( const ur_specialization_constant_info_t /// [in] array of specialization constant value descriptions * /*SpecConstants*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/memory.cpp b/unified-runtime/source/adapters/level_zero/memory.cpp index 98297451043d..b18b7dba2d7a 100644 --- a/unified-runtime/source/adapters/level_zero/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/memory.cpp @@ -460,7 +460,7 @@ static ur_result_t enqueueMemImageCommandHelper( ur_cast(ZeHandleSrc), &ZeDstRegion, &ZeSrcRegion, ZeEvent, 0, nullptr)); } else { - UR_LOG(ERROR, "enqueueMemImageUpdate: unsupported image command type"); + UR_LOG(ERR, "enqueueMemImageUpdate: unsupported image command type"); return UR_RESULT_ERROR_INVALID_OPERATION; } @@ -1037,7 +1037,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - UR_LOG(ERROR, "urEnqueueMemBufferMap: duplicate mapping detected"); + UR_LOG(ERR, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -1098,7 +1098,7 @@ ur_result_t urEnqueueMemBufferMap( // False as the second value in pair means that mapping was not inserted // because mapping already exists. if (!Res.second) { - UR_LOG(ERROR, "urEnqueueMemBufferMap: duplicate mapping detected"); + UR_LOG(ERR, "urEnqueueMemBufferMap: duplicate mapping detected"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -1152,7 +1152,7 @@ ur_result_t urEnqueueMemUnmap( std::scoped_lock Guard(Buffer->Mutex); auto It = Buffer->Mappings.find(MappedPtr); if (It == Buffer->Mappings.end()) { - UR_LOG(ERROR, "urEnqueueMemUnmap: unknown memory mapping"); + UR_LOG(ERR, "urEnqueueMemUnmap: unknown memory mapping"); return UR_RESULT_ERROR_INVALID_VALUE; } MapInfo = It->second; @@ -1424,7 +1424,7 @@ ur_result_t urEnqueueUSMFill2D( /// [in,out][optional] return an event object that identifies this /// particular kernel execution instance. ur_event_handle_t * /*OutEvent*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1868,7 +1868,7 @@ ur_result_t urMemImageGetInfo( /// [out][optional] pointer to the actual size in bytes of data queried by /// pImgInfo. size_t * /*PropSizeRet*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1915,7 +1915,7 @@ ur_result_t urEnqueueReadHostPipe(ur_queue_handle_t /*hQueue*/, uint32_t /*numEventsInWaitList*/, const ur_event_handle_t * /*phEventWaitList*/, ur_event_handle_t * /*phEvent*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -1927,7 +1927,7 @@ ur_result_t urEnqueueWriteHostPipe( size_t /*size*/, uint32_t /*numEventsInWaitList*/, const ur_event_handle_t * /*phEventWaitList*/, ur_event_handle_t * /*phEvent*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/program.cpp b/unified-runtime/source/adapters/level_zero/program.cpp index 30f8e90168ee..a39274ea9bc1 100644 --- a/unified-runtime/source/adapters/level_zero/program.cpp +++ b/unified-runtime/source/adapters/level_zero/program.cpp @@ -439,7 +439,7 @@ ur_result_t urProgramLinkExp( ZeModuleDesc.pInputModule = ZeExtModuleDesc.pInputModules[0]; ZeModuleDesc.pConstants = ZeExtModuleDesc.pConstants[0]; } else { - UR_LOG(ERROR, + UR_LOG(ERR, "urProgramLink: level_zero driver does not have static linking " "support."); return UR_RESULT_ERROR_INVALID_VALUE; @@ -893,7 +893,7 @@ ur_result_t urProgramGetBuildInfo( // program. return ReturnValue(""); } else { - UR_LOG(ERROR, "urProgramGetBuildInfo: unsupported ParamName"); + UR_LOG(ERR, "urProgramGetBuildInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -908,7 +908,7 @@ ur_result_t urProgramSetSpecializationConstant( size_t /*SpecSize*/, /// [in] pointer to the specialization value bytes const void * /*SpecValue*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!"); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/queue.cpp b/unified-runtime/source/adapters/level_zero/queue.cpp index 2e081d0ed2c5..0b8d8b3f8c48 100644 --- a/unified-runtime/source/adapters/level_zero/queue.cpp +++ b/unified-runtime/source/adapters/level_zero/queue.cpp @@ -456,7 +456,7 @@ ur_result_t urQueueGetInfo( } default: UR_LOG( - ERROR, + ERR, "Unsupported ParamName in urQueueGetInfo: ParamName=ParamName={}(0x{})", ParamName, logger::toHex(ParamName)); return UR_RESULT_ERROR_INVALID_ENUMERATION; @@ -925,7 +925,7 @@ ur_result_t urEnqueueKernelLaunchCustomExp( uint32_t /*numEventsInWaitList*/, const ur_event_handle_t * /*phEventWaitList*/, ur_event_handle_t * /*phEvent*/) { - UR_LOG(ERROR, "[UR][L0] {} function not implemented!", + UR_LOG(ERR, "[UR][L0] {} function not implemented!", "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -1006,9 +1006,9 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { Val = std::stoi(BatchConfig.substr(Pos)); } catch (...) { if (IsCopy) - UR_LOG(ERROR, "UR_L0_COPY_BATCH_SIZE: failed to parse value") + UR_LOG(ERR, "UR_L0_COPY_BATCH_SIZE: failed to parse value") else - UR_LOG(ERROR, "UR_L0_BATCH_SIZE: failed to parse value") + UR_LOG(ERR, "UR_L0_BATCH_SIZE: failed to parse value") break; } switch (Ord) { @@ -1031,11 +1031,11 @@ static const zeCommandListBatchConfig ZeCommandListBatchConfig(bool IsCopy) { die("Unexpected batch config"); } if (IsCopy) - UR_LOG(ERROR, "UR_L0_COPY_BATCH_SIZE: dynamic batch param #{}: {}", + UR_LOG(ERR, "UR_L0_COPY_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, (int)Val) else - UR_LOG(ERROR, "UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", - (int)Ord, (int)Val) + UR_LOG(ERR, "UR_L0_BATCH_SIZE: dynamic batch param #{}: {}", (int)Ord, + (int)Val) }; } else { diff --git a/unified-runtime/source/adapters/level_zero/sampler.cpp b/unified-runtime/source/adapters/level_zero/sampler.cpp index 3f06020a5a5d..37b242883c78 100644 --- a/unified-runtime/source/adapters/level_zero/sampler.cpp +++ b/unified-runtime/source/adapters/level_zero/sampler.cpp @@ -83,8 +83,8 @@ ur_result_t urSamplerCreate( ZeSamplerDesc.addressMode = ZE_SAMPLER_ADDRESS_MODE_MIRROR; break; default: - UR_LOG(ERROR, "urSamplerCreate: unsupported " - "UR_SAMPLER_PROPERTIES_ADDRESSING_MODEE value"); + UR_LOG(ERR, "urSamplerCreate: unsupported " + "UR_SAMPLER_PROPERTIES_ADDRESSING_MODEE value"); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -93,8 +93,7 @@ ur_result_t urSamplerCreate( else if (Props->filterMode == UR_SAMPLER_FILTER_MODE_LINEAR) ZeSamplerDesc.filterMode = ZE_SAMPLER_FILTER_MODE_LINEAR; else { - UR_LOG(ERROR, - "urSamplerCreate: unsupported UR_SAMPLER_FILTER_MODE value"); + UR_LOG(ERR, "urSamplerCreate: unsupported UR_SAMPLER_FILTER_MODE value"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -154,7 +153,7 @@ ur_result_t urSamplerGetInfo( void * /*PropValue*/, /// [out] size in bytes returned in sampler property value size_t * /*PropSizeRet*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -165,7 +164,7 @@ ur_result_t urSamplerGetNativeHandle( ur_sampler_handle_t /*Sampler*/, /// [out] a pointer to the native handle of the sampler. ur_native_handle_t * /*NativeSampler*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -180,7 +179,7 @@ ur_result_t urSamplerCreateWithNativeHandle( const ur_sampler_native_properties_t * /*Properties*/, /// [out] pointer to the handle of the sampler object created. ur_sampler_handle_t * /*Sampler*/) { - UR_LOG_LEGACY(ERROR, + UR_LOG_LEGACY(ERR, logger::LegacyMessage("[UR][L0] {} function not implemented!"), "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/level_zero/usm.cpp b/unified-runtime/source/adapters/level_zero/usm.cpp index db20c546b6ab..8502770fe19a 100644 --- a/unified-runtime/source/adapters/level_zero/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/usm.cpp @@ -448,7 +448,7 @@ ur_result_t urUSMGetMemAllocInfo( MemAllocaType = UR_USM_TYPE_SHARED; break; default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unexpected usm memory type"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(MemAllocaType); @@ -488,7 +488,7 @@ ur_result_t urUSMGetMemAllocInfo( return UR_RESULT_ERROR_INVALID_VALUE; } default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unsupported ParamName"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; @@ -846,7 +846,7 @@ umf_result_t L0MemoryProvider::open_ipc_handle(void *IpcData, void **Ptr) { memcpy(&fdRemote, &zeIpcData->zeHandle, sizeof(fdRemote)); fdLocal = ur_duplicate_fd(zeIpcData->pid, fdRemote); if (fdLocal == -1) { - UR_LOG(ERROR, "duplicating file descriptor from IPC handle failed"); + UR_LOG(ERR, "duplicating file descriptor from IPC handle failed"); return UMF_RESULT_ERROR_MEMORY_PROVIDER_SPECIFIC; } @@ -953,12 +953,12 @@ MakeProvider(ProviderParams *Params = nullptr) { } break; default: - UR_LOG(ERROR, "urUSMPoolCreate: invalid USM type found"); + UR_LOG(ERR, "urUSMPoolCreate: invalid USM type found"); Ret = UMF_RESULT_ERROR_INVALID_ARGUMENT; } if (Ret != UMF_RESULT_SUCCESS) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to create UMF provider"); + UR_LOG(ERR, "urUSMPoolCreate: failed to create UMF provider"); throw UsmAllocationException(umf::umf2urResult(Ret)); } @@ -999,13 +999,13 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store USM pool tag"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store UMF pool"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1059,12 +1059,12 @@ ur_usm_pool_handle_t_::ur_usm_pool_handle_t_(ur_context_handle_t Context, auto Ret = umf::umf2urResult( umfPoolSetTag(usmPool->UmfPool.get(), usmPool.get(), nullptr)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store USM pool tag"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store USM pool tag"); throw UsmAllocationException(Ret); } Ret = PoolManager.addPool(Desc, std::move(usmPool)); if (Ret) { - UR_LOG(ERROR, "urUSMPoolCreate: failed to store UMF pool"); + UR_LOG(ERR, "urUSMPoolCreate: failed to store UMF pool"); throw UsmAllocationException(Ret); } } @@ -1176,7 +1176,7 @@ ur_result_t ur_usm_pool_handle_t_::allocate(ur_context_handle_t Context, } if (*RetMem == nullptr) { auto umfRet = umfPoolGetLastAllocationError(umfPool); - UR_LOG(ERROR, + UR_LOG(ERR, "enqueueUSMAllocHelper: allocation from the UMF pool {} failed", umfPool); return umf::umf2urResult(umfRet); diff --git a/unified-runtime/source/adapters/level_zero/v2/api.cpp b/unified-runtime/source/adapters/level_zero/v2/api.cpp index eeb70567910f..d58c14b6945a 100644 --- a/unified-runtime/source/adapters/level_zero/v2/api.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/api.cpp @@ -23,21 +23,21 @@ ur_result_t urContextSetExtendedDeleter(ur_context_handle_t hContext, ur_context_extended_deleter_t pfnDeleter, void *pUserData) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urKernelSetSpecializationConstants( ur_kernel_handle_t hKernel, uint32_t count, const ur_specialization_constant_info_t *pSpecConstants) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urEventSetCallback(ur_event_handle_t hEvent, ur_execution_info_t execStatus, ur_event_callback_t pfnNotify, void *pUserData) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -47,21 +47,21 @@ ur_result_t urUSMPitchedAllocExp(ur_context_handle_t hContext, ur_usm_pool_handle_t pool, size_t widthInBytes, size_t height, size_t elementSizeBytes, void **ppMem, size_t *pResultPitch) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesUnsampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesSampledImageHandleDestroyExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_native_handle_t hImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -69,7 +69,7 @@ ur_result_t urBindlessImagesImageAllocateExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -77,7 +77,7 @@ ur_result_t urBindlessImagesImageFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -86,7 +86,7 @@ ur_result_t urBindlessImagesUnsampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_image_native_handle_t *phImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -95,14 +95,14 @@ ur_result_t urBindlessImagesSampledImageCreateExp( ur_exp_image_mem_native_handle_t hImageMem, const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_sampler_handle_t hSampler, ur_exp_image_native_handle_t *phImage) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesImageGetInfoExp( ur_context_handle_t hContext, ur_exp_image_mem_native_handle_t hImageMem, ur_image_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -110,7 +110,7 @@ ur_result_t urBindlessImagesMipmapGetLevelExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hImageMem, uint32_t mipmapLevel, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -118,7 +118,7 @@ ur_result_t urBindlessImagesMipmapFreeExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_image_mem_native_handle_t hMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -127,7 +127,7 @@ ur_result_t urBindlessImagesImportExternalMemoryExp( ur_exp_external_mem_type_t memHandleType, ur_exp_external_mem_desc_t *pExternalMemDesc, ur_exp_external_mem_handle_t *phExternalMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -136,21 +136,21 @@ ur_result_t urBindlessImagesMapExternalArrayExp( const ur_image_format_t *pImageFormat, const ur_image_desc_t *pImageDesc, ur_exp_external_mem_handle_t hExternalMem, ur_exp_image_mem_native_handle_t *phImageMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesMapExternalLinearMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, uint64_t offset, uint64_t size, ur_exp_external_mem_handle_t hExternalMem, void **ppRetMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalMemoryExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_mem_handle_t hExternalMem) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -159,14 +159,14 @@ ur_result_t urBindlessImagesImportExternalSemaphoreExp( ur_exp_external_semaphore_type_t semHandleType, ur_exp_external_semaphore_desc_t *pExternalSemaphoreDesc, ur_exp_external_semaphore_handle_t *phExternalSemaphore) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urBindlessImagesReleaseExternalSemaphoreExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_exp_external_semaphore_handle_t hExternalSemaphore) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -174,21 +174,21 @@ ur_result_t urCommandBufferUpdateKernelLaunchExp( ur_exp_command_buffer_handle_t hCommandBuffer, uint32_t numKernelUpdates, const ur_exp_command_buffer_update_kernel_launch_desc_t *pUpdateKernelLaunch) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateSignalEventExp( ur_exp_command_buffer_command_handle_t hCommand, ur_event_handle_t *phEvent) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t urCommandBufferUpdateWaitEventsExp( ur_exp_command_buffer_command_handle_t hCommand, uint32_t NumEventsInWaitList, const ur_event_handle_t *phEventWaitList) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -196,28 +196,28 @@ ur_result_t UR_APICALL urUSMPoolCreateExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_desc_t *PoolDesc, ur_usm_pool_handle_t *pPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolDestroyExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolSetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t propSize) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDefaultDevicePoolExp( ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -225,21 +225,21 @@ ur_result_t UR_APICALL urUSMPoolGetInfoExp(ur_usm_pool_handle_t hPool, ur_usm_pool_info_t propName, void *pPropValue, size_t *pPropSizeRet) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolGetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t *pPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } ur_result_t UR_APICALL urUSMPoolSetDevicePoolExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } @@ -247,7 +247,7 @@ ur_result_t UR_APICALL urUSMPoolTrimToExp(ur_context_handle_t hContext, ur_device_handle_t hDevice, ur_usm_pool_handle_t hPool, size_t minBytesToKeep) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp index b6c472767c50..88295a23cbb0 100644 --- a/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/command_buffer.cpp @@ -20,9 +20,8 @@ namespace { // given context. void checkImmediateAppendSupport(ur_context_handle_t context) { if (!context->getPlatform()->ZeCommandListImmediateAppendExt.Supported) { - UR_LOG(ERROR, - "Adapter v2 is used but the current driver does not support " - "the zeCommandListImmediateAppendCommandListsExp entrypoint."); + UR_LOG(ERR, "Adapter v2 is used but the current driver does not support " + "the zeCommandListImmediateAppendCommandListsExp entrypoint."); throw UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } } diff --git a/unified-runtime/source/adapters/level_zero/v2/event.cpp b/unified-runtime/source/adapters/level_zero/v2/event.cpp index 36116d5ec35a..5086175d2cbf 100644 --- a/unified-runtime/source/adapters/level_zero/v2/event.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/event.cpp @@ -271,7 +271,7 @@ ur_result_t urEventGetInfo(ur_event_handle_t hEvent, ur_event_info_t propName, return returnValue(hEvent->getCommandType()); } default: - UR_LOG(ERROR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urEventGetInfo: ParamName={}(0x{})", propName, logger::toHex(propName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -317,7 +317,7 @@ ur_result_t urEventGetProfilingInfo( return returnValue(hEvent->getEventEndTimestamp()); } default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -367,7 +367,7 @@ ur_result_t urEventGetProfilingInfo( // return returnValue(uint64_t{0}); default: - UR_LOG(ERROR, "urEventGetProfilingInfo: not supported ParamName"); + UR_LOG(ERR, "urEventGetProfilingInfo: not supported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp index ae301eb36496..4fcdadf64ad8 100644 --- a/unified-runtime/source/adapters/level_zero/v2/kernel.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/kernel.cpp @@ -264,7 +264,7 @@ ur_result_t ur_kernel_handle_t_::setExecInfo(ur_kernel_exec_info_t propName, ZE2UR_CALL(zeKernelSetCacheConfig, (kernel->hKernel.get(), zeCacheConfig);); } else { - UR_LOG(ERROR, "urKernelSetExecInfo: unsupported ParamName"); + UR_LOG(ERR, "urKernelSetExecInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -555,8 +555,7 @@ ur_result_t urKernelGetGroupInfo( // No corresponding enumeration in Level Zero return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION; default: { - UR_LOG(ERROR, - "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unknown ParamName in urKernelGetGroupInfo: ParamName={}(0x{})", paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -640,8 +639,7 @@ ur_result_t urKernelGetInfo(ur_kernel_handle_t hKernel, return ReturnValue(static_cast(attributes.data())); } default: - UR_LOG(ERROR, - "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", + UR_LOG(ERR, "Unsupported ParamName in urKernelGetInfo: ParamName={}(0x{})", paramName, logger::toHex(paramName)); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/memory.cpp b/unified-runtime/source/adapters/level_zero/v2/memory.cpp index 10e630eec28e..133ba9f6b93f 100644 --- a/unified-runtime/source/adapters/level_zero/v2/memory.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/memory.cpp @@ -88,7 +88,7 @@ ur_integrated_buffer_handle_t::ur_integrated_buffer_handle_t( this->ptr = usm_unique_ptr_t(rawPtr, [hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to free host memory: {}", ret); + UR_LOG(ERR, "Failed to free host memory: {}", ret); } }); @@ -168,7 +168,7 @@ void *ur_discrete_buffer_handle_t::allocateOnDevice(ur_device_handle_t hDevice, usm_unique_ptr_t(ptr, [hContext = this->hContext](void *ptr) { auto ret = hContext->getDefaultUSMPool()->free(ptr); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to free device memory: {}", ret); + UR_LOG(ERR, "Failed to free device memory: {}", ret); } }); @@ -298,7 +298,7 @@ void *ur_discrete_buffer_handle_t::mapHostPtr( if (ownsAlloc) { auto ret = hContext->getDefaultUSMPool()->free(p); if (ret != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to mapped memory: {}", ret); + UR_LOG(ERR, "Failed to mapped memory: {}", ret); } } }); @@ -728,7 +728,7 @@ ur_result_t urMemImageGetInfo(ur_mem_handle_t /*hMemory*/, ur_image_info_t /*propName*/, size_t /*propSize*/, void * /*pPropValue*/, size_t * /*pPropSizeRet*/) { - UR_LOG(ERROR, "{} function not implemented!", __FUNCTION__); + UR_LOG(ERR, "{} function not implemented!", __FUNCTION__); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } diff --git a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp index 01ba6dfc6d13..2f4dbda08e3d 100644 --- a/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/queue_immediate_in_order.cpp @@ -129,7 +129,7 @@ ur_queue_immediate_in_order_t::queueGetInfo(ur_queue_info_t propName, } } default: - UR_LOG(ERROR, + UR_LOG(ERR, "Unsupported ParamName in urQueueGetInfo: " "ParamName=ParamName={}(0x{})", propName, logger::toHex(propName)); @@ -190,7 +190,7 @@ ur_queue_immediate_in_order_t::~ur_queue_immediate_in_order_t() { try { UR_CALL_THROWS(queueFinish()); } catch (...) { - UR_LOG(ERROR, "Failed to finish queue on destruction"); + UR_LOG(ERR, "Failed to finish queue on destruction"); } } diff --git a/unified-runtime/source/adapters/level_zero/v2/usm.cpp b/unified-runtime/source/adapters/level_zero/v2/usm.cpp index c3b60da231bf..80bd2f6c7cb5 100644 --- a/unified-runtime/source/adapters/level_zero/v2/usm.cpp +++ b/unified-runtime/source/adapters/level_zero/v2/usm.cpp @@ -236,7 +236,7 @@ ur_result_t ur_usm_pool_handle_t_::free(void *ptr) { if (umfPool) { return umf::umf2urResult(umfPoolFree(umfPool, ptr)); } else { - UR_LOG(ERROR, "Failed to find pool for pointer: {}", ptr); + UR_LOG(ERR, "Failed to find pool for pointer: {}", ptr); return UR_RESULT_ERROR_INVALID_VALUE; } } @@ -439,7 +439,7 @@ ur_result_t urUSMGetMemAllocInfo( memAllocType = UR_USM_TYPE_SHARED; break; default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unexpected usm memory type"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unexpected usm memory type"); return UR_RESULT_ERROR_INVALID_VALUE; } return ReturnValue(memAllocType); @@ -468,7 +468,7 @@ ur_result_t urUSMGetMemAllocInfo( // TODO return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; default: - UR_LOG(ERROR, "urUSMGetMemAllocInfo: unsupported ParamName"); + UR_LOG(ERR, "urUSMGetMemAllocInfo: unsupported ParamName"); return UR_RESULT_ERROR_INVALID_VALUE; } } diff --git a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp index e07bf050345a..f61c8fd43fe2 100644 --- a/unified-runtime/source/adapters/level_zero/virtual_mem.cpp +++ b/unified-runtime/source/adapters/level_zero/virtual_mem.cpp @@ -38,7 +38,7 @@ ur_result_t urVirtualMemGranularityGetInfo( return ReturnValue(PageSize); } default: - UR_LOG(ERROR, "Unsupported propName in urQueueGetInfo: propName={}({})", + UR_LOG(ERR, "Unsupported propName in urQueueGetInfo: propName={}({})", propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } @@ -120,7 +120,7 @@ ur_result_t urVirtualMemGetInfo(ur_context_handle_t hContext, return ReturnValue(RetFlags); } default: - UR_LOG(ERROR, "Unsupported propName in urQueueGetInfo: propName={}({})", + UR_LOG(ERR, "Unsupported propName in urQueueGetInfo: propName={}({})", propName, propName); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/source/adapters/native_cpu/common.hpp b/unified-runtime/source/adapters/native_cpu/common.hpp index b2396daeebc8..6ca32d93a241 100644 --- a/unified-runtime/source/adapters/native_cpu/common.hpp +++ b/unified-runtime/source/adapters/native_cpu/common.hpp @@ -21,7 +21,7 @@ extern thread_local char ErrorMessage[MaxMessageSize]; #define DIE_NO_IMPLEMENTATION \ do { \ - UR_LOG(ERROR, "Not Implemented : {}", __FUNCTION__) \ + UR_LOG(ERR, "Not Implemented : {}", __FUNCTION__) \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; \ } while (false) @@ -33,7 +33,7 @@ extern thread_local char ErrorMessage[MaxMessageSize]; #define CASE_UR_UNSUPPORTED(not_supported) \ case not_supported: \ - UR_LOG(ERROR, "Unsupported UR case : {} in {}", #not_supported, \ + UR_LOG(ERR, "Unsupported UR case : {} in {}", #not_supported, \ __FUNCTION__) \ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; diff --git a/unified-runtime/source/adapters/native_cpu/device.cpp b/unified-runtime/source/adapters/native_cpu/device.cpp index 186e8d61e30b..b220b227c6e3 100644 --- a/unified-runtime/source/adapters/native_cpu/device.cpp +++ b/unified-runtime/source/adapters/native_cpu/device.cpp @@ -99,7 +99,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGet(ur_platform_handle_t hPlatform, if (NumEntries == 0) { /// Runtime queries number of devices if (phDevices != nullptr) { - UR_LOG(ERROR, "Invalid Arguments for urDevicesGet"); + UR_LOG(ERR, "Invalid Arguments for urDevicesGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/adapters/native_cpu/platform.cpp b/unified-runtime/source/adapters/native_cpu/platform.cpp index 760c2ce2da8e..b8073a16eef4 100644 --- a/unified-runtime/source/adapters/native_cpu/platform.cpp +++ b/unified-runtime/source/adapters/native_cpu/platform.cpp @@ -29,7 +29,7 @@ urPlatformGet(ur_adapter_handle_t, uint32_t NumEntries, if (NumEntries == 0) { if (phPlatforms != nullptr) { - UR_LOG(ERROR, "Invalid argument combination for urPlatformsGet"); + UR_LOG(ERR, "Invalid argument combination for urPlatformsGet"); return UR_RESULT_ERROR_INVALID_VALUE; } return UR_RESULT_SUCCESS; diff --git a/unified-runtime/source/common/latency_tracker.hpp b/unified-runtime/source/common/latency_tracker.hpp index f15790f20a64..539db936f61d 100644 --- a/unified-runtime/source/common/latency_tracker.hpp +++ b/unified-runtime/source/common/latency_tracker.hpp @@ -64,7 +64,7 @@ static inline latencyValues getValues(const struct hdr_histogram *histogram) { auto ret = hdr_value_at_percentiles(histogram, percentiles, values.percentileValues, numPercentiles); if (ret != 0) { - UR_LOG(ERROR, "Failed to get percentiles from latency histogram"); + UR_LOG(ERR, "Failed to get percentiles from latency histogram"); } return values; @@ -137,7 +137,7 @@ class latency_histogram { auto ret = hdr_init(lowestDiscernibleValue, highestTrackableValue, significantFigures, &cHistogram); if (ret != 0) { - UR_LOG(ERROR, "Failed to initialize latency histogram"); + UR_LOG(ERR, "Failed to initialize latency histogram"); } histogram = std::unique_ptr( cHistogram, &hdr_close); diff --git a/unified-runtime/source/common/linux/ur_lib_loader.cpp b/unified-runtime/source/common/linux/ur_lib_loader.cpp index 4c5e61a848d3..621e45bb8133 100644 --- a/unified-runtime/source/common/linux/ur_lib_loader.cpp +++ b/unified-runtime/source/common/linux/ur_lib_loader.cpp @@ -25,8 +25,7 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { int res = dlclose(handle); if (res) { - UR_LOG(ERROR, - "Failed to unload the library with the handle at address {}", + UR_LOG(ERR, "Failed to unload the library with the handle at address {}", handle); } else { UR_LOG(INFO, "unloaded adapter 0x{}", handle); diff --git a/unified-runtime/source/common/logger/ur_logger.hpp b/unified-runtime/source/common/logger/ur_logger.hpp index 7bfe4d94f015..ccbafe55ef4e 100644 --- a/unified-runtime/source/common/logger/ur_logger.hpp +++ b/unified-runtime/source/common/logger/ur_logger.hpp @@ -30,8 +30,10 @@ get_logger(std::string name = "common", inline void init(const std::string &name) { get_logger(name.c_str()); } +// use log level as a first parameter +// available levels: QUIET, ERR, WARN, INFO, DEBUG #define UR_LOG(...) URLOG_(::logger::get_logger(), __VA_ARGS__) -#define UR_LOG_LEGACY(...) URLOG_LEGACY_(::logger::get_logger(), __VA_ARGS__) +#define UR_LOG_LEGACY(...) URLOG_L_(::logger::get_logger(), __VA_ARGS__) // TODO: consider removing UR_LOG_L and maybe UR_LOG_LEGACY macros, using UR_LOG // instead diff --git a/unified-runtime/source/common/logger/ur_logger_details.hpp b/unified-runtime/source/common/logger/ur_logger_details.hpp index 1fbc43655565..3c282e249353 100644 --- a/unified-runtime/source/common/logger/ur_logger_details.hpp +++ b/unified-runtime/source/common/logger/ur_logger_details.hpp @@ -118,18 +118,41 @@ class Logger { #define UR_STRIMPL_(x) #x #define UR_STR_(x) UR_STRIMPL_(x) -#define URLOG_(logger_instance, level, ...) \ +#define URLOG2_(_logger, level, ...) \ { \ - (logger_instance) \ - .log(UR_LOGGER_LEVEL_##level, SHORT_FILE, UR_STR_(__LINE__), \ - __VA_ARGS__); \ + (_logger).log(level, SHORT_FILE, UR_STR_(__LINE__), __VA_ARGS__); \ } - -#define URLOG_LEGACY_(logger_instance, level, legacy_message, ...) \ +#define URLOG_L2_(_logger, level, legacy_message, ...) \ { \ - (logger_instance) \ - .log(legacy_message, UR_LOGGER_LEVEL_##level, SHORT_FILE, \ - UR_STR_(__LINE__), __VA_ARGS__); \ + (_logger).log(legacy_message, level, SHORT_FILE, UR_STR_(__LINE__), \ + __VA_ARGS__); \ } +// some symbols usefuls for log levels are predfined in some systems, +// eg. ERROR on Windows +#define URLOG_(_logger, level, ...) URLOG_##level##_(_logger, __VA_ARGS__) +#define URLOG_L_(_logger, level, ...) URLOG_L_##level##_(_logger, __VA_ARGS__) + +#define URLOG_ERR_(_logger, ...) \ + URLOG2_(_logger, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) +#define URLOG_WARN_(_logger, ...) \ + URLOG2_(_logger, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) +#define URLOG_DEBUG_(_logger, ...) \ + URLOG2_(_logger, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) +#define URLOG_INFO_(_logger, ...) \ + URLOG2_(_logger, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) +#define URLOG_QUIET_(_logger, ...) \ + URLOG2_(_logger, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) + +#define URLOG_L_ERR_(_logger, ...) \ + URLOG_L2_(_logger, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) +#define URLOG_L_WARN_(_logger, ...) \ + URLOG_L2_(_logger, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) +#define URLOG_L_DEBUG_(_logger, ...) \ + URLOG_L2_(_logger, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) +#define URLOG_L_INFO_(_logger, ...) \ + URLOG_L2_(_logger, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) +#define URLOG_L_QUIET_(_logger, ...) \ + URLOG_L2_(_logger, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) + #endif /* UR_LOGGER_DETAILS_HPP */ diff --git a/unified-runtime/source/common/umf_helpers.hpp b/unified-runtime/source/common/umf_helpers.hpp index 28003ea5bd6a..1a9d2e56a5ba 100644 --- a/unified-runtime/source/common/umf_helpers.hpp +++ b/unified-runtime/source/common/umf_helpers.hpp @@ -296,7 +296,7 @@ inline ur_result_t umf2urResult(umf_result_t umfResult) { umfMemoryProviderGetLastNativeError(hProvider, &Msg, &Err); if (Msg) { - UR_LOG(ERROR, "UMF failed with: {}", Msg); + UR_LOG(ERR, "UMF failed with: {}", Msg); } return getProviderNativeError(umfMemoryProviderGetName(hProvider), Err); diff --git a/unified-runtime/source/common/ur_pool_manager.hpp b/unified-runtime/source/common/ur_pool_manager.hpp index 3b7fdfda1f29..90751f478891 100644 --- a/unified-runtime/source/common/ur_pool_manager.hpp +++ b/unified-runtime/source/common/ur_pool_manager.hpp @@ -176,7 +176,7 @@ template struct pool_manager { ur_result_t addPool(const D &desc, unique_pool_handle_t &&hPool) { if (!descToPoolMap.try_emplace(desc, std::move(hPool)).second) { - UR_LOG(ERROR, "Pool for pool descriptor: {}, already exists", desc); + UR_LOG(ERR, "Pool for pool descriptor: {}, already exists", desc); return UR_RESULT_ERROR_INVALID_ARGUMENT; } @@ -186,8 +186,7 @@ template struct pool_manager { std::optional getPool(const D &desc) { auto it = descToPoolMap.find(desc); if (it == descToPoolMap.end()) { - UR_LOG(ERROR, "Pool descriptor doesn't match any existing pool: {}", - desc); + UR_LOG(ERR, "Pool descriptor doesn't match any existing pool: {}", desc); return std::nullopt; } diff --git a/unified-runtime/source/common/ur_util.cpp b/unified-runtime/source/common/ur_util.cpp index 74a8e8511949..6978a3958264 100644 --- a/unified-runtime/source/common/ur_util.cpp +++ b/unified-runtime/source/common/ur_util.cpp @@ -45,14 +45,14 @@ int ur_duplicate_fd(int pid, int fd_in) { errno = 0; int pid_fd = syscall(__NR_pidfd_open, pid, 0); if (pid_fd == -1) { - UR_LOG(ERROR, "__NR_pidfd_open"); + UR_LOG(ERR, "__NR_pidfd_open"); return -1; } int fd_dup = syscall(__NR_pidfd_getfd, pid_fd, fd_in, 0); close(pid_fd); if (fd_dup == -1) { - UR_LOG(ERROR, "__NR_pidfd_getfd"); + UR_LOG(ERR, "__NR_pidfd_getfd"); return -1; } @@ -63,7 +63,7 @@ int ur_duplicate_fd(int pid, int fd_in) { (void)pid; // unused (void)fd_in; // unused errno = ENOTSUP; // unsupported - UR_LOG(ERROR, "__NR_pidfd_open or __NR_pidfd_getfd not available"); + UR_LOG(ERR, "__NR_pidfd_open or __NR_pidfd_getfd not available"); return -1; #endif /* defined(__NR_pidfd_open) && defined(__NR_pidfd_getfd) */ } diff --git a/unified-runtime/source/common/windows/ur_lib_loader.cpp b/unified-runtime/source/common/windows/ur_lib_loader.cpp index c4981526de8e..1ceab4389aef 100644 --- a/unified-runtime/source/common/windows/ur_lib_loader.cpp +++ b/unified-runtime/source/common/windows/ur_lib_loader.cpp @@ -17,7 +17,7 @@ void LibLoader::freeAdapterLibrary(HMODULE handle) { if (handle) { BOOL res = FreeLibrary(handle); if (!res) { - UR_LOG(ERROR, + UR_LOG(ERR, "Failed to unload the library with the handle at address 0x{}", handle); } else { diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp index d83d10235b91..fae4e024d272 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_buffer.cpp @@ -97,7 +97,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::MEM_BUFFER, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -108,7 +108,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { UR_LOG_L( - getContext()->logger, ERROR, + getContext()->logger, ERR, "Failed to copy {} bytes data from host pointer {} to buffer {}", Size, HostPtr, this); return URes; @@ -135,7 +135,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Context, nullptr, &USMDesc, Pool, Size, AllocType::HOST_USM, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to allocate {} bytes host USM for buffer {} migration", Size, this); return URes; @@ -149,7 +149,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } @@ -161,7 +161,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } @@ -177,7 +177,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getAsanInterceptor()->releaseMemory(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to free buffer handle {}", + UR_LOG_L(getContext()->logger, ERR, "Failed to free buffer handle {}", Ptr); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp index 45f3d0963231..0b6a94cb5f9b 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_ddi.cpp @@ -40,11 +40,11 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getAsanInterceptor()->insertDevice(hDevice, DI)); DI->Type = GetDeviceType(Context, hDevice); if (DI->Type == DeviceType::UNKNOWN) { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport device"); + UR_LOG_L(getContext()->logger, ERR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } if (DI->Type != DeviceType) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Different device type in the same context"); return UR_RESULT_ERROR_INVALID_DEVICE; } @@ -1960,7 +1960,7 @@ template struct NotSupportedApi; template struct NotSupportedApi { R static ReportError(A...) { - UR_LOG_L(getContext()->logger, ERROR, MsgType::value); + UR_LOG_L(getContext()->logger, ERR, MsgType::value); return UR_RESULT_ERROR_UNSUPPORTED_FEATURE; } }; @@ -2151,8 +2151,8 @@ ur_result_t initAsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, - "Initialize ASAN DDI table failed: {}", result); + UR_LOG_L(getContext()->logger, ERR, "Initialize ASAN DDI table failed: {}", + result); } return result; diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp index 60709a60b413..4690b78e0c4d 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.cpp @@ -116,7 +116,7 @@ ur_result_t AsanInterceptor::allocateMemory(ur_context_handle_t Context, UR_CALL(getContext()->urDdiTable.USM.pfnDeviceAlloc( Context, Device, Properties, Pool, NeededSize, &Allocated)); } else { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport memory type"); + UR_LOG_L(getContext()->logger, ERR, "Unsupport memory type"); return UR_RESULT_ERROR_INVALID_ARGUMENT; } @@ -271,7 +271,7 @@ ur_result_t AsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(Context, Device); if (!InternalQueue) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to create internal queue"); + UR_LOG_L(getContext()->logger, ERR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -487,7 +487,7 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, &SKInfo[0], MetadataPtr, sizeof(SpirKernelInfo) * NumOfSpirKernel, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Can't read the value of <{}>: {}", + UR_LOG_L(getContext()->logger, ERR, "Can't read the value of <{}>: {}", kSPIR_AsanSpirKernelMetadata, Result); return Result; } @@ -503,7 +503,7 @@ ur_result_t AsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, KernelNameV.data(), (void *)SKI.KernelName, sizeof(char) * SKI.Size, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Can't read kernel name: {}", + UR_LOG_L(getContext()->logger, ERR, "Can't read kernel name: {}", Result); return Result; } @@ -553,7 +553,7 @@ AsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Device Global[{}] Read Failed: {}", + UR_LOG_L(getContext()->logger, ERR, "Device Global[{}] Read Failed: {}", kSPIR_AsanDeviceGlobalMetadata, Result); return Result; } @@ -751,7 +751,7 @@ ur_result_t AsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); @@ -772,7 +772,7 @@ ur_result_t AsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgNums - 1, nullptr, LaunchInfo.Data.getDevicePtr()); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to set launch info: {}", + UR_LOG_L(getContext()->logger, ERR, "Failed to set launch info: {}", URes); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp index 5d5df8bbbe72..b394be7ca9eb 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_interceptor.hpp @@ -185,7 +185,7 @@ struct AsanRuntimeDataWrapper { Context, Device, nullptr, nullptr, sizeof(AsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to alloc device usm for asan runtime data: {}", Result); } diff --git a/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp index 6108d2ac4bbb..3cf0f6a262fe 100644 --- a/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/asan/asan_shadow.cpp @@ -49,7 +49,7 @@ ur_result_t ShadowMemoryCPU::Setup() { auto URes = EnqueuePoisonShadow({}, 0, NullptrRedzoneSize, kNullPointerRedzoneMagic); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "EnqueuePoisonShadow(NullPointerRZ): {}", URes); return URes; } @@ -105,7 +105,7 @@ ur_result_t ShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; @@ -120,7 +120,7 @@ ur_result_t ShadowMemoryGPU::Setup() { Result = EnqueuePoisonShadow(Queue, 0, NullptrRedzoneSize, kNullPointerRedzoneMagic); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "EnqueuePoisonShadow(NullPointerRZ): {}", Result); return Result; } @@ -185,7 +185,7 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, &Desc, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urPhysicalMemCreate(): {}", + UR_LOG_L(getContext()->logger, ERR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -194,7 +194,7 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urVirtualMemMap({}, {}): {}", + UR_LOG_L(getContext()->logger, ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } @@ -205,7 +205,7 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, // Initialize to zero URes = EnqueueUSMBlockingSet(Queue, (void *)MappedPtr, 0, PageSize); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", + UR_LOG_L(getContext()->logger, ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } @@ -222,7 +222,7 @@ ur_result_t ShadowMemoryGPU::EnqueuePoisonShadow(ur_queue_handle_t Queue, (void *)ShadowBegin, ShadowEnd - ShadowBegin + 1, (void *)(size_t)Value, URes); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", URes); + UR_LOG_L(getContext()->logger, ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp index dffae3e834fe..f80e6777febd 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_buffer.cpp @@ -137,7 +137,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::DEVICE_USM, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -148,7 +148,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { UR_LOG_L( - getContext()->logger, ERROR, + getContext()->logger, ERR, "Failed to copy {} bytes data from host pointer {} to buffer {}", Size, HostPtr, this); return URes; @@ -180,7 +180,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.USM.pfnHostAlloc( Context, &USMDesc, Pool, Size, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to allocate {} bytes host " "USM for buffer {} migration", Size, this); @@ -195,7 +195,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } @@ -207,7 +207,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } @@ -223,7 +223,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getContext()->urDdiTable.USM.pfnFree(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to free buffer handle {}", + UR_LOG_L(getContext()->logger, ERR, "Failed to free buffer handle {}", Ptr); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp index 772af80d8222..f294f66a214d 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_ddi.cpp @@ -33,7 +33,7 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getMsanInterceptor()->insertDevice(hDevice, DI)); DI->Type = GetDeviceType(Context, hDevice); if (DI->Type == DeviceType::UNKNOWN) { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport device"); + UR_LOG_L(getContext()->logger, ERR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } UR_LOG_L(getContext()->logger, INFO, @@ -1948,8 +1948,8 @@ ur_result_t initMsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, - "Initialize MSAN DDI table failed: {}", result); + UR_LOG_L(getContext()->logger, ERR, "Initialize MSAN DDI table failed: {}", + result); } return result; diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp index 2ce7a27d83c9..73d2867a158a 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.cpp @@ -125,7 +125,7 @@ ur_result_t MsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(Context, Device); if (!InternalQueue) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to create internal queue"); + UR_LOG_L(getContext()->logger, ERR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -205,7 +205,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, &SKInfo[0], MetadataPtr, sizeof(SpirKernelInfo) * NumOfSpirKernel, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Can't read the value of <{}>: {}", + UR_LOG_L(getContext()->logger, ERR, "Can't read the value of <{}>: {}", kSPIR_MsanSpirKernelMetadata, Result); return Result; } @@ -220,7 +220,7 @@ ur_result_t MsanInterceptor::registerSpirKernels(ur_program_handle_t Program) { Queue, true, KernelNameV.data(), (void *)SKI.KernelName, sizeof(char) * SKI.Size, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Can't read kernel name: {}", + UR_LOG_L(getContext()->logger, ERR, "Can't read kernel name: {}", Result); return Result; } @@ -274,7 +274,7 @@ MsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Device Global[{}] Read Failed: {}", + UR_LOG_L(getContext()->logger, ERR, "Device Global[{}] Read Failed: {}", kSPIR_MsanDeviceGlobalMetadata, Result); return Result; } @@ -452,7 +452,7 @@ ur_result_t MsanInterceptor::prepareLaunch( ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.hpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.hpp index e057926aaccc..4c141b462268 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_interceptor.hpp @@ -168,7 +168,7 @@ struct MsanRuntimeDataWrapper { Context, Device, nullptr, nullptr, sizeof(MsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to alloc device usm for msan runtime data: {}", Result); } diff --git a/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp index 4f304021fbe1..b1dfff4505fe 100644 --- a/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/msan/msan_shadow.cpp @@ -45,7 +45,7 @@ GetMsanShadowMemory(ur_context_handle_t Context, ur_device_handle_t Device, std::make_shared(Context, Device); return ShadowDG2; } else { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport device type"); + UR_LOG_L(getContext()->logger, ERR, "Unsupport device type"); return nullptr; } } @@ -147,7 +147,7 @@ ur_result_t MsanShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; @@ -193,8 +193,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, nullptr, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urPhysicalMemCreate(): {}", - URes); + UR_LOG_L(getContext()->logger, ERR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -202,7 +201,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urVirtualMemMap({}, {}): {}", + UR_LOG_L(getContext()->logger, ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } @@ -215,7 +214,7 @@ ur_result_t MsanShadowMemoryGPU::EnqueueMapShadow( EventWaitList.size(), EventWaitList.data(), OutEvent); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMSet(): {}", URes); + UR_LOG_L(getContext()->logger, ERR, "EnqueueUSMSet(): {}", URes); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp index 2c1e55e202b2..a349f39a19a6 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/linux/sanitizer_utils.cpp @@ -67,13 +67,13 @@ bool DontCoredumpRange(uptr Addr, uptr Size) { void *GetMemFunctionPointer(const char *FuncName) { void *handle = dlopen(LIBC_SO, RTLD_LAZY | RTLD_NOLOAD); if (!handle) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to dlopen {}", LIBC_SO); + UR_LOG_L(getContext()->logger, ERR, "Failed to dlopen {}", LIBC_SO); return nullptr; } auto ptr = dlsym(handle, FuncName); if (!ptr) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to get '{}' from {}", - FuncName, LIBC_SO); + UR_LOG_L(getContext()->logger, ERR, "Failed to get '{}' from {}", FuncName, + LIBC_SO); } return ptr; } diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp index e7f712ead5b2..c144c8f71077 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_options_impl.hpp @@ -72,7 +72,7 @@ struct OptionParser { SS << " \"" << S << "\""; } SS << "."; - UR_LOG_L(Logger, ERROR, SS.str().c_str()); + UR_LOG_L(Logger, ERR, SS.str().c_str()); die("Sanitizer failed to parse options.\n"); } } @@ -108,7 +108,7 @@ struct OptionParser { Result = Value; } } catch (...) { - UR_LOG_L(Logger, ERROR, + UR_LOG_L(Logger, ERR, "The valid range of \"{}\" is [{}, {}]. Failed " "to parse the value \"{}\".", Name, Min, Max, ValueStr); diff --git a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp index d9ff5b89c107..93ff6542ad74 100644 --- a/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/sanitizer_common/sanitizer_utils.cpp @@ -31,7 +31,7 @@ ManagedQueue::~ManagedQueue() { [[maybe_unused]] ur_result_t Result; Result = getContext()->urDdiTable.Queue.pfnFinish(Handle); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to finish ManagedQueue: {}", + UR_LOG_L(getContext()->logger, ERR, "Failed to finish ManagedQueue: {}", Result); } assert(Result == UR_RESULT_SUCCESS && "Failed to finish ManagedQueue"); @@ -259,7 +259,7 @@ ur_result_t EnqueueUSMBlockingSet(ur_queue_handle_t Queue, void *Ptr, void PrintUrBuildLog(ur_program_handle_t hProgram, ur_device_handle_t *phDevices, size_t numDevices) { - UR_LOG_L(getContext()->logger, ERROR, "Printing build log for program {}", + UR_LOG_L(getContext()->logger, ERR, "Printing build log for program {}", (void *)hProgram); for (size_t i = 0; i < numDevices; i++) { std::vector LogBuf; @@ -269,7 +269,7 @@ void PrintUrBuildLog(ur_program_handle_t hProgram, auto UrRes = getContext()->urDdiTable.Program.pfnGetBuildInfo( hProgram, hDevice, UR_PROGRAM_BUILD_INFO_LOG, 0, nullptr, &LogSize); if (UrRes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "For device {}: failed to get build log size.", (void *)hDevice); continue; } @@ -279,12 +279,12 @@ void PrintUrBuildLog(ur_program_handle_t hProgram, hProgram, hDevice, UR_PROGRAM_BUILD_INFO_LOG, LogSize, LogBuf.data(), nullptr); if (UrRes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "For device {}: failed to get build log.", (void *)hDevice); continue; } - UR_LOG_L(getContext()->logger, ERROR, "For device {}:\n{}", (void *)hDevice, + UR_LOG_L(getContext()->logger, ERR, "For device {}:\n{}", (void *)hDevice, LogBuf.data()); } } diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp index 9b88941143b2..c043b1da7fc6 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_buffer.cpp @@ -105,7 +105,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Size, AllocType::DEVICE_USM, ur_cast(&Allocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to allocate {} bytes memory for buffer {}", Size, this); return URes; } @@ -115,7 +115,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostPtr, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to copy {} bytes data from host " "pointer {} to buffer {}", Size, HostPtr, this); @@ -142,7 +142,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.USM.pfnHostAlloc( Context, &USMDesc, Pool, Size, ur_cast(&HostAllocation)); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to allocate {} bytes host " "USM for buffer {} migration", Size, this); @@ -157,7 +157,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { Queue, true, HostAllocation, LastSyncedDevice.MemHandle, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } @@ -169,7 +169,7 @@ ur_result_t MemBuffer::getHandle(ur_device_handle_t Device, char *&Handle) { URes = getContext()->urDdiTable.Enqueue.pfnUSMMemcpy( Queue, true, Allocation, HostAllocation, Size, 0, nullptr, nullptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to migrate memory buffer data"); return URes; } @@ -185,7 +185,7 @@ ur_result_t MemBuffer::free() { for (const auto &[_, Ptr] : Allocations) { ur_result_t URes = getContext()->urDdiTable.USM.pfnFree(Context, Ptr); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to free buffer handle {}", + UR_LOG_L(getContext()->logger, ERR, "Failed to free buffer handle {}", Ptr); return URes; } diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp index 348d8304af49..e84f679e05eb 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_ddi.cpp @@ -31,7 +31,7 @@ ur_result_t setupContext(ur_context_handle_t Context, uint32_t numDevices, UR_CALL(getTsanInterceptor()->insertDevice(phDevices[i], DI)); DI->Type = GetDeviceType(Context, DI->Handle); if (DI->Type == DeviceType::UNKNOWN) { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport device"); + UR_LOG_L(getContext()->logger, ERR, "Unsupport device"); return UR_RESULT_ERROR_INVALID_DEVICE; } if (!DI->Shadow) @@ -100,7 +100,7 @@ ur_result_t urContextRetain( auto ContextInfo = getTsanInterceptor()->getContextInfo(hContext); if (!ContextInfo) { - UR_LOG_L(getContext()->logger, ERROR, "Invalid context"); + UR_LOG_L(getContext()->logger, ERR, "Invalid context"); return UR_RESULT_ERROR_INVALID_CONTEXT; } ContextInfo->RefCount++; @@ -119,7 +119,7 @@ ur_result_t urContextRelease( auto ContextInfo = getTsanInterceptor()->getContextInfo(hContext); if (!ContextInfo) { - UR_LOG_L(getContext()->logger, ERROR, "Invalid context"); + UR_LOG_L(getContext()->logger, ERR, "Invalid context"); return UR_RESULT_ERROR_INVALID_CONTEXT; } @@ -1454,8 +1454,8 @@ ur_result_t initTsanDDITable(ur_dditable_t *dditable) { } if (result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, - "Initialize TSAN DDI table failed: {}", result); + UR_LOG_L(getContext()->logger, ERR, "Initialize TSAN DDI table failed: {}", + result); } return result; diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp index 9a9a13252859..e40df91a9076 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_interceptor.cpp @@ -33,7 +33,7 @@ TsanRuntimeData *TsanRuntimeDataWrapper::getDevicePtr() { Context, Device, nullptr, nullptr, sizeof(TsanRuntimeData), (void **)&DevicePtr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG(ERROR, "Failed to alloc device usm for asan runtime data: {}", + UR_LOG(ERR, "Failed to alloc device usm for asan runtime data: {}", Result); } } @@ -143,7 +143,7 @@ TsanInterceptor::registerDeviceGlobals(ur_program_handle_t Program) { Queue, true, &GVInfos[0], MetadataPtr, sizeof(DeviceGlobalInfo) * NumOfDeviceGlobal, 0, nullptr, nullptr); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "Device Global[{}] Read Failed: {}", + UR_LOG_L(getContext()->logger, ERR, "Device Global[{}] Read Failed: {}", kSPIR_TsanDeviceGlobalMetadata, Result); return Result; } @@ -252,7 +252,7 @@ ur_result_t TsanInterceptor::preLaunchKernel(ur_kernel_handle_t Kernel, ManagedQueue InternalQueue(CI->Handle, DI->Handle); if (!InternalQueue) { - UR_LOG_L(getContext()->logger, ERROR, "Failed to create internal queue"); + UR_LOG_L(getContext()->logger, ERR, "Failed to create internal queue"); return UR_RESULT_ERROR_INVALID_QUEUE; } @@ -295,7 +295,7 @@ ur_result_t TsanInterceptor::prepareLaunch(std::shared_ptr &, ur_result_t URes = getContext()->urDdiTable.Kernel.pfnSetArgPointer( Kernel, ArgIndex, nullptr, ArgPointer); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Failed to set buffer {} as the {} arg to kernel {}: {}", ur_cast(MemBuffer.get()), ArgIndex, Kernel, URes); diff --git a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp index da0e1f8ad9cb..495de6bf48e6 100644 --- a/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp +++ b/unified-runtime/source/loader/layers/sanitizer/tsan/tsan_shadow.cpp @@ -29,7 +29,7 @@ std::shared_ptr GetShadowMemory(ur_context_handle_t Context, } else if (Type == DeviceType::GPU_PVC) { return std::make_shared(Context, Device); } else { - UR_LOG_L(getContext()->logger, ERROR, "Unsupport device type"); + UR_LOG_L(getContext()->logger, ERR, "Unsupport device type"); return nullptr; } } @@ -91,7 +91,7 @@ ur_result_t ShadowMemoryGPU::Setup() { auto Result = getContext()->urDdiTable.VirtualMem.pfnReserve( Context, StartAddress, ShadowSize, (void **)&ShadowBegin); if (Result != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, + UR_LOG_L(getContext()->logger, ERR, "Shadow memory reserved failed with size {}: {}", (void *)ShadowSize, Result); return Result; @@ -147,7 +147,7 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, auto URes = getContext()->urDdiTable.PhysicalMem.pfnCreate( Context, Device, PageSize, &Desc, &PhysicalMem); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urPhysicalMemCreate(): {}", + UR_LOG_L(getContext()->logger, ERR, "urPhysicalMemCreate(): {}", URes); return URes; } @@ -156,7 +156,7 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, Context, (void *)MappedPtr, PageSize, PhysicalMem, 0, UR_VIRTUAL_MEM_ACCESS_FLAG_READ_WRITE); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "urVirtualMemMap({}, {}): {}", + UR_LOG_L(getContext()->logger, ERR, "urVirtualMemMap({}, {}): {}", (void *)MappedPtr, PageSize, URes); return URes; } @@ -167,7 +167,7 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, // Initialize to zero URes = EnqueueUSMBlockingSet(Queue, (void *)MappedPtr, 0, PageSize); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", + UR_LOG_L(getContext()->logger, ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } @@ -180,7 +180,7 @@ ur_result_t ShadowMemoryGPU::CleanShadow(ur_queue_handle_t Queue, uptr Ptr, auto URes = EnqueueUSMBlockingSet( Queue, (void *)Begin, 0, Size / kShadowCell * kShadowCnt * kShadowSize); if (URes != UR_RESULT_SUCCESS) { - UR_LOG_L(getContext()->logger, ERROR, "EnqueueUSMBlockingSet(): {}", URes); + UR_LOG_L(getContext()->logger, ERR, "EnqueueUSMBlockingSet(): {}", URes); return URes; } diff --git a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp index 355cd0596048..b2d41f28e45c 100644 --- a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp +++ b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp @@ -68,14 +68,17 @@ struct RefCountContext { ptr, RefRuntimeInfo{1, std::type_index(typeid(handle)), getCurrentBacktrace()}); } else { - UR_LOG_L(getContext()->logger, ERROR, "Handle {} already exists", ptr); + getContext()->logger.log(UR_LOGGER_LEVEL_ERROR, SHORT_FILE, + UR_STR_(__LINE__), "Handle {} already exists", + ptr); return; } break; case REFCOUNT_INCREASE: if (it == counts.end()) { - UR_LOG_L(getContext()->logger, ERROR, - "Attempting to retain nonexistent handle {}", ptr); + getContext()->logger.log( + UR_LOGGER_LEVEL_ERROR, SHORT_FILE, UR_STR_(__LINE__), + "Attempting to retain nonexistent handle {}", ptr); return; } else { it->second.refCount++; @@ -91,16 +94,19 @@ struct RefCountContext { } if (it->second.refCount < 0) { - UR_LOG(ERROR, "Attempting to release nonexistent handle {}", ptr); + getContext()->logger.log( + UR_LOGGER_LEVEL_ERROR, SHORT_FILE, UR_STR_(__LINE__), + "Attempting to release nonexistent handle {}", ptr); } else if (it->second.refCount == 0 && isAdapterHandle) { adapterCount--; } break; } - UR_LOG_L(getContext()->logger, DEBUG, - "Reference count for handle {} changed to {}", ptr, - it->second.refCount); + getContext()->logger.log(UR_LOGGER_LEVEL_DEBUG, SHORT_FILE, + UR_STR_(__LINE__), + "Reference count for handle {} changed to {}", ptr, + it->second.refCount); if (it->second.refCount == 0) { counts.erase(ptr); diff --git a/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp b/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp index 98aab0d2aead..8d44badc74b3 100644 --- a/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp +++ b/unified-runtime/source/loader/layers/validation/ur_validation_layer.cpp @@ -33,7 +33,7 @@ context_t::~context_t() {} result == UR_RESULT_ERROR_UNSUPPORTED_FEATURE) \ return UR_RESULT_SUCCESS; \ if (result != UR_RESULT_SUCCESS) { \ - UR_LOG_L(getContext()->logger, ERROR, \ + UR_LOG_L(getContext()->logger, ERR, \ "Unexpected non-success result code from {}", #result); \ assert(0); \ return result; \ diff --git a/unified-runtime/source/loader/ur_adapter_registry.hpp b/unified-runtime/source/loader/ur_adapter_registry.hpp index c005f24cb102..3b8b89cf82c7 100644 --- a/unified-runtime/source/loader/ur_adapter_registry.hpp +++ b/unified-runtime/source/loader/ur_adapter_registry.hpp @@ -102,7 +102,7 @@ class AdapterRegistry { try { forceLoadedAdaptersOpt = getenv_to_vec("UR_ADAPTERS_FORCE_LOAD"); } catch (const std::invalid_argument &e) { - UR_LOG(ERROR, e.what()); + UR_LOG(ERR, e.what()); } if (forceLoadedAdaptersOpt.has_value()) { @@ -120,7 +120,7 @@ class AdapterRegistry { try { exists = fs::exists(path); } catch (std::exception &e) { - UR_LOG(ERROR, e.what()); + UR_LOG(ERR, e.what()); } if (exists) { @@ -205,7 +205,7 @@ class AdapterRegistry { try { pathStringsOpt = getenv_to_vec("UR_ADAPTERS_SEARCH_PATH"); } catch (const std::invalid_argument &e) { - UR_LOG(ERROR, e.what()); + UR_LOG(ERR, e.what()); return std::nullopt; } @@ -235,8 +235,8 @@ class AdapterRegistry { } catch (...) { // If the selector is malformed, then we ignore selector and return // success. - UR_LOG(ERROR, "ERROR: missing backend, format of filter = " - "'[!]backend:filterStrings'"); + UR_LOG(ERR, "ERROR: missing backend, format of filter = " + "'[!]backend:filterStrings'"); return UR_RESULT_SUCCESS; } UR_LOG(DEBUG, "getenv_to_map parsed env var and {} a map", @@ -257,9 +257,9 @@ class AdapterRegistry { // on the first error. if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case - // malformed term: missing backend -- output ERROR, then continue - UR_LOG(ERROR, "ERROR: missing backend, format of filter = " - "'[!]backend:filterStrings'"); + // malformed term: missing backend -- output ERR, then continue + UR_LOG(ERR, "ERROR: missing backend, format of filter = " + "'[!]backend:filterStrings'"); continue; } UR_LOG(DEBUG, "ONEAPI_DEVICE_SELECTOR Pre-Filter with backend '{}' ", diff --git a/unified-runtime/source/loader/ur_lib.cpp b/unified-runtime/source/loader/ur_lib.cpp index 208030d6ca49..c19e0355c379 100644 --- a/unified-runtime/source/loader/ur_lib.cpp +++ b/unified-runtime/source/loader/ur_lib.cpp @@ -440,9 +440,9 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, // on the first error. if (backend.empty()) { // FIXME: never true because getenv_to_map rejects this case - // malformed term: missing backend -- output ERROR, then continue - UR_LOG(ERROR, "ERROR: missing backend, format of filter = " - "'[!]backend:filterStrings'"); + // malformed term: missing backend -- output ERR, then continue + UR_LOG(ERR, "ERROR: missing backend, format of filter = " + "'[!]backend:filterStrings'"); continue; } enum FilterType { @@ -467,7 +467,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, [&](auto &p) { return p.second == backend; }); if (found == cend) { // It's not a legal backend - UR_LOG(ERROR, "unrecognised backend '{}'", backend); + UR_LOG(ERR, "unrecognised backend '{}'", backend); return UR_RESULT_ERROR_INVALID_VALUE; } else if (found->first != platformBackend) { // If it's a rule for a different backend, ignore it @@ -476,8 +476,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, } if (termPair.second.size() == 0) { // malformed term: missing filterStrings -- output ERROR - UR_LOG(ERROR, "missing filterStrings, format of filter = " - "'[!]backend:filterStrings'"); + UR_LOG(ERR, "missing filterStrings, format of filter = " + "'[!]backend:filterStrings'"); return UR_RESULT_ERROR_INVALID_VALUE; } if (std::find_if(termPair.second.cbegin(), termPair.second.cend(), @@ -494,8 +494,8 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return std::count(s.cbegin(), s.cend(), '.') > 2; }) != termPair.second.cend()) { // malformed term: too many dots in filterString - UR_LOG(ERROR, "too many dots in filterString, format of " - "filterString = 'root[.sub[.subsub]]'"); + UR_LOG(ERR, "too many dots in filterString, format of " + "filterString = 'root[.sub[.subsub]]'"); return UR_RESULT_ERROR_INVALID_VALUE; } if (std::find_if(termPair.second.cbegin(), termPair.second.cend(), @@ -516,7 +516,7 @@ ur_result_t urDeviceGetSelected(ur_platform_handle_t hPlatform, return false; // no BAD things, so must be okay }) != termPair.second.cend()) { // malformed term: star dot no-star in filterString - UR_LOG(ERROR, "invalid wildcard in filterString, '*.' => '*.*'"); + UR_LOG(ERR, "invalid wildcard in filterString, '*.' => '*.*'"); return UR_RESULT_ERROR_INVALID_VALUE; } diff --git a/unified-runtime/test/loader/platforms/platforms.cpp b/unified-runtime/test/loader/platforms/platforms.cpp index 1b0c66165f8d..b3b609d27520 100644 --- a/unified-runtime/test/loader/platforms/platforms.cpp +++ b/unified-runtime/test/loader/platforms/platforms.cpp @@ -27,7 +27,7 @@ int main(int, char *[]) { // Initialize the platform status = urLoaderInit(0, nullptr); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urLoaderInit failed with return code: {}", status); + UR_LOG_L(out, ERR, "urLoaderInit failed with return code: {}", status); return 1; } UR_LOG_L(out, INFO, "urLoaderInit succeeded."); @@ -36,14 +36,14 @@ int main(int, char *[]) { std::vector adapters; status = urAdapterGet(0, nullptr, &adapterCount); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urAdapterGet failed with return code: {}", status); + UR_LOG_L(out, ERR, "urAdapterGet failed with return code: {}", status); return 1; } adapters.resize(adapterCount); status = urAdapterGet(adapterCount, adapters.data(), nullptr); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urAdapterGet failed with return code: {}", status); + UR_LOG_L(out, ERR, "urAdapterGet failed with return code: {}", status); return 1; } @@ -53,7 +53,7 @@ int main(int, char *[]) { uint32_t adapterPlatformCount = 0; status = urPlatformGet(adapter, 0, nullptr, &adapterPlatformCount); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urPlatformGet failed with return code: {}", status); + UR_LOG_L(out, ERR, "urPlatformGet failed with return code: {}", status); goto out; } UR_LOG_L(out, INFO, "urPlatformGet found {} platforms", @@ -63,7 +63,7 @@ int main(int, char *[]) { status = urPlatformGet(adapter, adapterPlatformCount, &platforms[platformCount], &adapterPlatformCount); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urPlatformGet failed with return code: {}", status); + UR_LOG_L(out, ERR, "urPlatformGet failed with return code: {}", status); goto out; } platformCount += adapterPlatformCount; @@ -73,7 +73,7 @@ int main(int, char *[]) { size_t name_len; status = urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, 0, nullptr, &name_len); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urPlatformGetInfo failed with return code: {}", + UR_LOG_L(out, ERR, "urPlatformGetInfo failed with return code: {}", status); goto out; } @@ -84,7 +84,7 @@ int main(int, char *[]) { status = urPlatformGetInfo(p, UR_PLATFORM_INFO_NAME, name_len, name, nullptr); if (status != UR_RESULT_SUCCESS) { - UR_LOG_L(out, ERROR, "urPlatformGetInfo failed with return code: {}", + UR_LOG_L(out, ERR, "urPlatformGetInfo failed with return code: {}", status); free(name); goto out; diff --git a/unified-runtime/test/logger/env_var.cpp b/unified-runtime/test/logger/env_var.cpp index 763985299791..e8f43e45889c 100644 --- a/unified-runtime/test/logger/env_var.cpp +++ b/unified-runtime/test/logger/env_var.cpp @@ -20,5 +20,5 @@ TEST_F(LoggerFromEnvVar, WarningMessage) { } TEST_F(LoggerFromEnvVar, ErrorMessage) { - UR_LOG(ERROR, "Test message: {}", "success"); + UR_LOG(ERR, "Test message: {}", "success"); } diff --git a/unified-runtime/test/unit/logger.cpp b/unified-runtime/test/unit/logger.cpp index c275c2e3d5c6..7ac5fe8d756e 100644 --- a/unified-runtime/test/unit/logger.cpp +++ b/unified-runtime/test/unit/logger.cpp @@ -21,34 +21,34 @@ TEST_F(DefaultLoggerWithFileSink, DefaultLevelNoOutput) { TEST_F(DefaultLoggerWithFileSink, MultipleLines) { UR_LOG_L(*logger, WARN, "Test message: {}", "success"); UR_LOG_L(*logger, DEBUG, "This should not be printed: {}", 42); - UR_LOG_L(*logger, ERROR, "Test message: {}", "success"); + UR_LOG_L(*logger, ERR, "Test message: {}", "success"); test_msg << test_msg_prefix << "[WARNING]: Test message: success\n" << test_msg_prefix << "[ERROR]: Test message: success\n"; } TEST_F(DefaultLoggerWithFileSink, ThreeParams) { - UR_LOG_L(*logger, ERROR, "{} {}: {}", "Test", 42, 3.8); + UR_LOG_L(*logger, ERR, "{} {}: {}", "Test", 42, 3.8); test_msg << test_msg_prefix << "[ERROR]: Test 42: 3.8\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces) { - UR_LOG_L(*logger, ERROR, "{{}} {}: {}", "Test", 42); + UR_LOG_L(*logger, ERR, "{{}} {}: {}", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: {} Test: 42\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces2) { - UR_LOG_L(*logger, ERROR, "200 {{ {}: {{{}}} 3.8", "Test", 42); + UR_LOG_L(*logger, ERR, "200 {{ {}: {{{}}} 3.8", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: 200 { Test: {42} 3.8\n"; } TEST_F(DefaultLoggerWithFileSink, DoubleBraces3) { - UR_LOG_L(*logger, ERROR, "{{ {}:}} {}}}", "Test", 42); + UR_LOG_L(*logger, ERR, "{{ {}:}} {}}}", "Test", 42); test_msg << test_msg_prefix << "[ERROR]: { Test:} 42}\n"; } TEST_F(DefaultLoggerWithFileSink, NoBraces) { - UR_LOG_L(*logger, ERROR, " Test: 42"); + UR_LOG_L(*logger, ERR, " Test: 42"); test_msg << test_msg_prefix << "[ERROR]: Test: 42\n"; } @@ -82,7 +82,7 @@ TEST_F(DefaultLoggerWithFileSink, SetLevelWarning) { TEST_F(DefaultLoggerWithFileSink, SetLevelError) { logger->setLevel(UR_LOGGER_LEVEL_ERROR); - UR_LOG_L(*logger, ERROR, "Test message: {}", "success"); + UR_LOG_L(*logger, ERR, "Test message: {}", "success"); UR_LOG_L(*logger, WARN, "This should not be printed: {}", 42); test_msg << test_msg_prefix << "[ERROR]: Test message: success\n"; @@ -151,7 +151,7 @@ TEST_P(FileSinkLoggerMultipleThreads, Multithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - UR_LOG_L(local_logger, ERROR, "Flushed test message: {}", + UR_LOG_L(local_logger, ERR, "Flushed test message: {}", "it's a success"); } }); @@ -197,7 +197,7 @@ TEST_P(CommonLoggerWithMultipleThreads, StdoutMultithreaded) { for (int i = 0; i < thread_count; i++) { threads.emplace_back([&]() { for (int j = 0; j < message_count; ++j) { - UR_LOG_L(local_logger, ERROR, "Flushed test message: {}", + UR_LOG_L(local_logger, ERR, "Flushed test message: {}", "it's a success"); } }); diff --git a/unified-runtime/tools/urtrace/collector.cpp b/unified-runtime/tools/urtrace/collector.cpp index 613d47be996f..3e20ecf1ba44 100644 --- a/unified-runtime/tools/urtrace/collector.cpp +++ b/unified-runtime/tools/urtrace/collector.cpp @@ -86,7 +86,7 @@ std::string time_to_str(std::chrono::nanoseconds dur, enum time_unit unit) { ostr << d.count() << "s"; } break; default: { - UR_LOG_L(out, ERROR, "invalid time unit {}", unit); + UR_LOG_L(out, ERR, "invalid time unit {}", unit); break; } } @@ -346,7 +346,7 @@ XPTI_CALLBACK_API void trace_cb(uint16_t trace_type, xpti::trace_event_data_t *, } else if (trace_type == TRACE_FN_END) { auto ctx = pop_instance_data(instance); if (!ctx) { - UR_LOG_L(out, ERROR, + UR_LOG_L(out, ERR, "Received TRACE_FN_END without corresponding " "TRACE_FN_BEGIN, instance {}. Skipping...", instance); @@ -380,11 +380,10 @@ XPTI_CALLBACK_API void xptiTraceInit(unsigned int major_version, } if (UR_MAKE_VERSION(major_version, minor_version) != UR_API_VERSION_CURRENT) { - UR_LOG_L(out, ERROR, - "Invalid stream version: {}.{}. Expected: {}.{}. Skipping...", - major_version, minor_version, - UR_MAJOR_VERSION(UR_API_VERSION_CURRENT), - UR_MINOR_VERSION(UR_API_VERSION_CURRENT)); + UR_LOG_L( + out, ERR, "Invalid stream version: {}.{}. Expected: {}.{}. Skipping...", + major_version, minor_version, UR_MAJOR_VERSION(UR_API_VERSION_CURRENT), + UR_MINOR_VERSION(UR_API_VERSION_CURRENT)); return; } From db4c3498a59ebf147b4e13c6f0cc14caee50b6e1 Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Thu, 24 Apr 2025 11:56:29 +0200 Subject: [PATCH 12/16] Windows workaround --- .../common/logger/ur_logger_details.hpp | 61 ++++++++++--------- 1 file changed, 32 insertions(+), 29 deletions(-) diff --git a/unified-runtime/source/common/logger/ur_logger_details.hpp b/unified-runtime/source/common/logger/ur_logger_details.hpp index 3c282e249353..b64d47d17d49 100644 --- a/unified-runtime/source/common/logger/ur_logger_details.hpp +++ b/unified-runtime/source/common/logger/ur_logger_details.hpp @@ -118,41 +118,44 @@ class Logger { #define UR_STRIMPL_(x) #x #define UR_STR_(x) UR_STRIMPL_(x) -#define URLOG2_(_logger, level, ...) \ +#define URLOG2_(logger_instance, level, ...) \ { \ - (_logger).log(level, SHORT_FILE, UR_STR_(__LINE__), __VA_ARGS__); \ + (logger_instance).log(level, SHORT_FILE, UR_STR_(__LINE__), __VA_ARGS__); \ } -#define URLOG_L2_(_logger, level, legacy_message, ...) \ +#define URLOG_L2_(logger_instance, level, legacy_message, ...) \ { \ - (_logger).log(legacy_message, level, SHORT_FILE, UR_STR_(__LINE__), \ - __VA_ARGS__); \ + (logger_instance) \ + .log(legacy_message, level, SHORT_FILE, UR_STR_(__LINE__), \ + __VA_ARGS__); \ } // some symbols usefuls for log levels are predfined in some systems, // eg. ERROR on Windows -#define URLOG_(_logger, level, ...) URLOG_##level##_(_logger, __VA_ARGS__) -#define URLOG_L_(_logger, level, ...) URLOG_L_##level##_(_logger, __VA_ARGS__) - -#define URLOG_ERR_(_logger, ...) \ - URLOG2_(_logger, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) -#define URLOG_WARN_(_logger, ...) \ - URLOG2_(_logger, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) -#define URLOG_DEBUG_(_logger, ...) \ - URLOG2_(_logger, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) -#define URLOG_INFO_(_logger, ...) \ - URLOG2_(_logger, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) -#define URLOG_QUIET_(_logger, ...) \ - URLOG2_(_logger, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) - -#define URLOG_L_ERR_(_logger, ...) \ - URLOG_L2_(_logger, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) -#define URLOG_L_WARN_(_logger, ...) \ - URLOG_L2_(_logger, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) -#define URLOG_L_DEBUG_(_logger, ...) \ - URLOG_L2_(_logger, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) -#define URLOG_L_INFO_(_logger, ...) \ - URLOG_L2_(_logger, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) -#define URLOG_L_QUIET_(_logger, ...) \ - URLOG_L2_(_logger, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) +#define URLOG_(logger_instance, level, ...) \ + URLOG_##level(logger_instance, __VA_ARGS__) +#define URLOG_L_(logger_instance, level, ...) \ + URLOG_L_##level(logger_instance, __VA_ARGS__) + +#define URLOG_ERR(logger_instance, ...) \ + URLOG2_(logger_instance, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) +#define URLOG_WARN(logger_instance, ...) \ + URLOG2_(logger_instance, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) +#define URLOG_DEBUG(logger_instance, ...) \ + URLOG2_(logger_instance, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) +#define URLOG_INFO(logger_instance, ...) \ + URLOG2_(logger_instance, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) +#define URLOG_QUIET(logger_instance, ...) \ + URLOG2_(logger_instance, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) + +#define URLOG_L_ERR(logger_instance, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) +#define URLOG_L_WARN(logger_instance, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) +#define URLOG_L_DEBUG(logger_instance, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) +#define URLOG_L_INFO(logger_instance, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) +#define URLOG_L_QUIET(logger_instance, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) #endif /* UR_LOGGER_DETAILS_HPP */ From 6c16d89003d62126c858f39bcb0cf3673ad62b22 Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Thu, 24 Apr 2025 11:56:29 +0200 Subject: [PATCH 13/16] Windows workaround --- .../source/common/logger/ur_logger.hpp | 2 +- .../common/logger/ur_logger_details.hpp | 61 ++++++++++--------- 2 files changed, 33 insertions(+), 30 deletions(-) diff --git a/unified-runtime/source/common/logger/ur_logger.hpp b/unified-runtime/source/common/logger/ur_logger.hpp index ccbafe55ef4e..7984e9931de8 100644 --- a/unified-runtime/source/common/logger/ur_logger.hpp +++ b/unified-runtime/source/common/logger/ur_logger.hpp @@ -32,7 +32,7 @@ inline void init(const std::string &name) { get_logger(name.c_str()); } // use log level as a first parameter // available levels: QUIET, ERR, WARN, INFO, DEBUG -#define UR_LOG(...) URLOG_(::logger::get_logger(), __VA_ARGS__) +#define UR_LOG(level, ...) URLOG_(::logger::get_logger(), level, __VA_ARGS__) #define UR_LOG_LEGACY(...) URLOG_L_(::logger::get_logger(), __VA_ARGS__) // TODO: consider removing UR_LOG_L and maybe UR_LOG_LEGACY macros, using UR_LOG diff --git a/unified-runtime/source/common/logger/ur_logger_details.hpp b/unified-runtime/source/common/logger/ur_logger_details.hpp index 3c282e249353..03d7595c28b6 100644 --- a/unified-runtime/source/common/logger/ur_logger_details.hpp +++ b/unified-runtime/source/common/logger/ur_logger_details.hpp @@ -118,41 +118,44 @@ class Logger { #define UR_STRIMPL_(x) #x #define UR_STR_(x) UR_STRIMPL_(x) -#define URLOG2_(_logger, level, ...) \ +#define URLOG2_(logger_instance, level, ...) \ { \ - (_logger).log(level, SHORT_FILE, UR_STR_(__LINE__), __VA_ARGS__); \ + (logger_instance).log(level, SHORT_FILE, UR_STR_(__LINE__), __VA_ARGS__); \ } -#define URLOG_L2_(_logger, level, legacy_message, ...) \ +#define URLOG_L2_(logger_instance, level, legacy_message, ...) \ { \ - (_logger).log(legacy_message, level, SHORT_FILE, UR_STR_(__LINE__), \ - __VA_ARGS__); \ + (logger_instance) \ + .log(legacy_message, level, SHORT_FILE, UR_STR_(__LINE__), \ + __VA_ARGS__); \ } // some symbols usefuls for log levels are predfined in some systems, // eg. ERROR on Windows -#define URLOG_(_logger, level, ...) URLOG_##level##_(_logger, __VA_ARGS__) -#define URLOG_L_(_logger, level, ...) URLOG_L_##level##_(_logger, __VA_ARGS__) - -#define URLOG_ERR_(_logger, ...) \ - URLOG2_(_logger, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) -#define URLOG_WARN_(_logger, ...) \ - URLOG2_(_logger, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) -#define URLOG_DEBUG_(_logger, ...) \ - URLOG2_(_logger, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) -#define URLOG_INFO_(_logger, ...) \ - URLOG2_(_logger, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) -#define URLOG_QUIET_(_logger, ...) \ - URLOG2_(_logger, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) - -#define URLOG_L_ERR_(_logger, ...) \ - URLOG_L2_(_logger, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) -#define URLOG_L_WARN_(_logger, ...) \ - URLOG_L2_(_logger, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) -#define URLOG_L_DEBUG_(_logger, ...) \ - URLOG_L2_(_logger, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) -#define URLOG_L_INFO_(_logger, ...) \ - URLOG_L2_(_logger, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) -#define URLOG_L_QUIET_(_logger, ...) \ - URLOG_L2_(_logger, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) +#define URLOG_ERR(logger_instance, ...) \ + URLOG2_(logger_instance, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) +#define URLOG_WARN(logger_instance, ...) \ + URLOG2_(logger_instance, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) +#define URLOG_DEBUG(logger_instance, ...) \ + URLOG2_(logger_instance, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) +#define URLOG_INFO(logger_instance, ...) \ + URLOG2_(logger_instance, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) +#define URLOG_QUIET(logger_instance, ...) \ + URLOG2_(logger_instance, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) + +#define URLOG_L_ERR(logger_instance, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) +#define URLOG_L_WARN(logger_instance, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) +#define URLOG_L_DEBUG(logger_instance, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) +#define URLOG_L_INFO(logger_instance, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) +#define URLOG_L_QUIET(logger_instance, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) + +#define URLOG_(logger_instance, level, ...) \ + URLOG_##level(logger_instance, __VA_ARGS__) +#define URLOG_L_(logger_instance, level, ...) \ + URLOG_L_##level(logger_instance, __VA_ARGS__) #endif /* UR_LOGGER_DETAILS_HPP */ From 221c61cb18bfe11abc68723c913b184b5079773a Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Thu, 24 Apr 2025 14:04:39 +0200 Subject: [PATCH 14/16] Windows workaround --- unified-runtime/source/common/logger/ur_logger.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/unified-runtime/source/common/logger/ur_logger.hpp b/unified-runtime/source/common/logger/ur_logger.hpp index c4fe7a5ffb44..0bba596b71a8 100644 --- a/unified-runtime/source/common/logger/ur_logger.hpp +++ b/unified-runtime/source/common/logger/ur_logger.hpp @@ -33,11 +33,12 @@ inline void init(const std::string &name) { get_logger(name.c_str()); } // use log level as a first parameter // available levels: QUIET, ERR, WARN, INFO, DEBUG #define UR_LOG(level, ...) URLOG_(::logger::get_logger(), level, __VA_ARGS__) -#define UR_LOG_LEGACY(level, ...) URLOG_L_(::logger::get_logger(), level, __VA_ARGS__) // TODO: consider removing UR_LOG_L and maybe UR_LOG_LEGACY macros, using UR_LOG // instead -#define UR_LOG_L(...) URLOG_(__VA_ARGS__) +#define UR_LOG_LEGACY(level, ...) \ + URLOG_L_(::logger::get_logger(), level, __VA_ARGS__) +#define UR_LOG_L(logger, level, ...) URLOG_(logger, level, __VA_ARGS__) inline void setLevel(ur_logger_level_t level) { get_logger().setLevel(level); } From 57c4739219d46dbe4374f6ad1302ff7cfb64d7e8 Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Thu, 24 Apr 2025 14:04:39 +0200 Subject: [PATCH 15/16] Windows workaround --- .../source/common/logger/ur_logger.hpp | 5 +++-- .../common/logger/ur_logger_details.hpp | 20 +++++++++---------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/unified-runtime/source/common/logger/ur_logger.hpp b/unified-runtime/source/common/logger/ur_logger.hpp index c4fe7a5ffb44..b030fb63cc61 100644 --- a/unified-runtime/source/common/logger/ur_logger.hpp +++ b/unified-runtime/source/common/logger/ur_logger.hpp @@ -33,11 +33,12 @@ inline void init(const std::string &name) { get_logger(name.c_str()); } // use log level as a first parameter // available levels: QUIET, ERR, WARN, INFO, DEBUG #define UR_LOG(level, ...) URLOG_(::logger::get_logger(), level, __VA_ARGS__) -#define UR_LOG_LEGACY(level, ...) URLOG_L_(::logger::get_logger(), level, __VA_ARGS__) // TODO: consider removing UR_LOG_L and maybe UR_LOG_LEGACY macros, using UR_LOG // instead -#define UR_LOG_L(...) URLOG_(__VA_ARGS__) +#define UR_LOG_LEGACY(level, ...) \ + URLOG_L_(::logger::get_logger(), level, legacy_message, __VA_ARGS__) +#define UR_LOG_L(logger, level, ...) URLOG_(logger, level, __VA_ARGS__) inline void setLevel(ur_logger_level_t level) { get_logger().setLevel(level); } diff --git a/unified-runtime/source/common/logger/ur_logger_details.hpp b/unified-runtime/source/common/logger/ur_logger_details.hpp index 03d7595c28b6..0b3ba33bddbc 100644 --- a/unified-runtime/source/common/logger/ur_logger_details.hpp +++ b/unified-runtime/source/common/logger/ur_logger_details.hpp @@ -142,16 +142,16 @@ class Logger { #define URLOG_QUIET(logger_instance, ...) \ URLOG2_(logger_instance, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) -#define URLOG_L_ERR(logger_instance, ...) \ - URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_ERROR, __VA_ARGS__) -#define URLOG_L_WARN(logger_instance, ...) \ - URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_WARN, __VA_ARGS__) -#define URLOG_L_DEBUG(logger_instance, ...) \ - URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_DEBUG, __VA_ARGS__) -#define URLOG_L_INFO(logger_instance, ...) \ - URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_INFO, __VA_ARGS__) -#define URLOG_L_QUIET(logger_instance, ...) \ - URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_QUIET, __VA_ARGS__) +#define URLOG_L_ERR(logger_instance, legacy_message, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_ERROR, legacy_message, __VA_ARGS__) +#define URLOG_L_WARN(logger_instance, legacy_message, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_WARN, legacy_message, __VA_ARGS__) +#define URLOG_L_DEBUG(logger_instance, legacy_message, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_DEBUG, legacy_message, __VA_ARGS__) +#define URLOG_L_INFO(logger_instance, legacy_message, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_INFO, legacy_message, __VA_ARGS__) +#define URLOG_L_QUIET(logger_instance, legacy_message, ...) \ + URLOG_L2_(logger_instance, UR_LOGGER_LEVEL_QUIET, legacy_message, __VA_ARGS__) #define URLOG_(logger_instance, level, ...) \ URLOG_##level(logger_instance, __VA_ARGS__) From 16472ce8c012be4144b6ce45f780981f6278ea64 Mon Sep 17 00:00:00 2001 From: "Mateusz P. Nowak" Date: Tue, 29 Apr 2025 13:26:59 +0000 Subject: [PATCH 16/16] remove filename trimming - follow review --- unified-runtime/source/CMakeLists.txt | 3 --- .../source/common/logger/ur_logger_details.hpp | 15 +++------------ .../loader/layers/validation/ur_leak_check.hpp | 15 +++++++-------- 3 files changed, 10 insertions(+), 23 deletions(-) diff --git a/unified-runtime/source/CMakeLists.txt b/unified-runtime/source/CMakeLists.txt index 4a444dbc7c65..f0dd315313e7 100644 --- a/unified-runtime/source/CMakeLists.txt +++ b/unified-runtime/source/CMakeLists.txt @@ -6,9 +6,6 @@ add_definitions(-DUR_VERSION="${PROJECT_VERSION_MAJOR}") add_definitions(-DUR_VALIDATION_LAYER_SUPPORTED_VERSION="${PROJECT_VERSION_MAJOR}") -string(LENGTH "${CMAKE_SOURCE_DIR}/" SRC_PATH_SIZE) -add_definitions("-DSRC_PATH_SIZE=${SRC_PATH_SIZE}") # for nicer log messages - add_subdirectory(common) add_subdirectory(loader) add_subdirectory(mock) diff --git a/unified-runtime/source/common/logger/ur_logger_details.hpp b/unified-runtime/source/common/logger/ur_logger_details.hpp index abee28977d93..bfafa82e4476 100644 --- a/unified-runtime/source/common/logger/ur_logger_details.hpp +++ b/unified-runtime/source/common/logger/ur_logger_details.hpp @@ -106,27 +106,18 @@ class Logger { } // namespace logger -#ifdef SRC_PATH_SIZE -#define SHORT_FILE \ - ((SRC_PATH_SIZE < sizeof(__FILE__)) \ - ? ((const char *)__FILE__ + SRC_PATH_SIZE) \ - : __FILE__) -#else -#define SHORT_FILE __FILE__ -#endif - #define UR_STRIMPL_(x) #x #define UR_STR_(x) UR_STRIMPL_(x) #define URLOG2_(logger_instance, level, ...) \ { \ - (logger_instance).log(level, SHORT_FILE, UR_STR_(__LINE__), __VA_ARGS__); \ + (logger_instance).log(level, __FILE__, UR_STR_(__LINE__), __VA_ARGS__); \ } + #define URLOG_L2_(logger_instance, level, legacy_message, ...) \ { \ (logger_instance) \ - .log(legacy_message, level, SHORT_FILE, UR_STR_(__LINE__), \ - __VA_ARGS__); \ + .log(legacy_message, level, __FILE__, UR_STR_(__LINE__), __VA_ARGS__); \ } // some symbols usefuls for log levels are predfined in some systems, diff --git a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp index b2d41f28e45c..79b3125da291 100644 --- a/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp +++ b/unified-runtime/source/loader/layers/validation/ur_leak_check.hpp @@ -68,7 +68,7 @@ struct RefCountContext { ptr, RefRuntimeInfo{1, std::type_index(typeid(handle)), getCurrentBacktrace()}); } else { - getContext()->logger.log(UR_LOGGER_LEVEL_ERROR, SHORT_FILE, + getContext()->logger.log(UR_LOGGER_LEVEL_ERROR, __FILE__, UR_STR_(__LINE__), "Handle {} already exists", ptr); return; @@ -77,7 +77,7 @@ struct RefCountContext { case REFCOUNT_INCREASE: if (it == counts.end()) { getContext()->logger.log( - UR_LOGGER_LEVEL_ERROR, SHORT_FILE, UR_STR_(__LINE__), + UR_LOGGER_LEVEL_ERROR, __FILE__, UR_STR_(__LINE__), "Attempting to retain nonexistent handle {}", ptr); return; } else { @@ -95,7 +95,7 @@ struct RefCountContext { if (it->second.refCount < 0) { getContext()->logger.log( - UR_LOGGER_LEVEL_ERROR, SHORT_FILE, UR_STR_(__LINE__), + UR_LOGGER_LEVEL_ERROR, __FILE__, UR_STR_(__LINE__), "Attempting to release nonexistent handle {}", ptr); } else if (it->second.refCount == 0 && isAdapterHandle) { adapterCount--; @@ -103,8 +103,7 @@ struct RefCountContext { break; } - getContext()->logger.log(UR_LOGGER_LEVEL_DEBUG, SHORT_FILE, - UR_STR_(__LINE__), + getContext()->logger.log(UR_LOGGER_LEVEL_DEBUG, __FILE__, UR_STR_(__LINE__), "Reference count for handle {} changed to {}", ptr, it->second.refCount); @@ -114,7 +113,7 @@ struct RefCountContext { // No more active adapters, so any references still held are leaked if (adapterCount == 0) { - logInvalidReferences(SHORT_FILE, UR_STR_(__LINE__)); + logInvalidReferences(__FILE__, UR_STR_(__LINE__)); counts.clear(); } } @@ -175,10 +174,10 @@ struct RefCountContext { } // namespace ur_validation_layer #define URLOG_CTX_INVALID_REFERENCE(ptr) \ - getContext()->refCountContext->logInvalidReference(SHORT_FILE, \ + getContext()->refCountContext->logInvalidReference(__FILE__, \ UR_STR_(__LINE__), ptr); #define URLOG_CTX_INVALID_REFERENCES() \ - getContext()->refCountContext->logInvalidReferences(SHORT_FILE, \ + getContext()->refCountContext->logInvalidReferences(__FILE__, \ UR_STR_(__LINE__)); #endif /* UR_LEAK_CHECK_H */