Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Candidate for the v0.10.6 release tag #2107

Merged
merged 3 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

cmake_minimum_required(VERSION 3.20.0 FATAL_ERROR)
project(unified-runtime VERSION 0.10.5)
project(unified-runtime VERSION 0.10.6)

# Check if unified runtime is built as a standalone project.
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR OR UR_STANDALONE_BUILD)
Expand Down
12 changes: 8 additions & 4 deletions scripts/templates/trcddi.cpp.mako
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,19 @@ namespace ur_tracing_layer
${th.make_pfncb_param_type(n, tags, obj)} params = { &${",&".join(th.make_param_lines(n, tags, obj, format=["name"]))} };
uint64_t instance = getContext()->notify_begin(${th.make_func_etor(n, tags, obj)}, "${th.make_func_name(n, tags, obj)}", &params);

getContext()->logger.info("---> ${th.make_func_name(n, tags, obj)}");
auto &logger = getContext()->logger;

logger.info("---> ${th.make_func_name(n, tags, obj)}");

${x}_result_t result = ${th.make_pfn_name(n, tags, obj)}( ${", ".join(th.make_param_lines(n, tags, obj, format=["name"]))} );

getContext()->notify_end(${th.make_func_etor(n, tags, obj)}, "${th.make_func_name(n, tags, obj)}", &params, &result, instance);

std::ostringstream args_str;
ur::extras::printFunctionParams(args_str, ${th.make_func_etor(n, tags, obj)}, &params);
getContext()->logger.info("({}) -> {};\n", args_str.str(), result);
if (logger.getLevel() <= logger::Level::INFO) {
std::ostringstream args_str;
ur::extras::printFunctionParams(args_str, ${th.make_func_etor(n, tags, obj)}, &params);
logger.info("({}) -> {};\n", args_str.str(), result);
}

return result;
}
Expand Down
10 changes: 9 additions & 1 deletion source/adapters/level_zero/kernel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -661,11 +661,19 @@ ur_result_t ur_queue_handle_legacy_t_::enqueueDeviceGlobalVariableRead(

std::scoped_lock<ur_shared_mutex> lock(Queue->Mutex);

ze_module_handle_t ZeModule{};
auto It = Program->ZeModuleMap.find(Queue->Device->ZeDevice);
if (It != Program->ZeModuleMap.end()) {
ZeModule = It->second;
} else {
ZeModule = Program->ZeModule;
}

// Find global variable pointer
size_t GlobalVarSize = 0;
void *GlobalVarPtr = nullptr;
ZE2UR_CALL(zeModuleGetGlobalPointer,
(Program->ZeModule, Name, &GlobalVarSize, &GlobalVarPtr));
(ZeModule, Name, &GlobalVarSize, &GlobalVarPtr));
if (GlobalVarSize < Offset + Count) {
setErrorMessage("Read from device global variable is out of range.",
UR_RESULT_ERROR_INVALID_VALUE,
Expand Down
2 changes: 2 additions & 0 deletions source/common/logger/ur_logger_details.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class Logger {

void setLevel(logger::Level level) { this->level = level; }

logger::Level getLevel() { return this->level; }

void setFlushLevel(logger::Level level) {
if (sink) {
this->sink->setFlushLevel(level);
Expand Down
Loading
Loading