Skip to content

Commit

Permalink
Refactor opencl adapter to new logger
Browse files Browse the repository at this point in the history
This commit refactors the Opencl adapter to adopt the new logger
introduced in d9cd223 (Integrate logger with library, 2023-02-03).

Signed-off-by: Łukasz Plewa <lukasz.plewa@intel.com>
  • Loading branch information
lplewa authored and kbenzie committed Apr 3, 2024
1 parent a0f3c51 commit 4a06ecb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions source/adapters/opencl/adapter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@
//===----------------------------------------------------------------------===//

#include "common.hpp"
#include "logger/ur_logger.hpp"

struct ur_adapter_handle_t_ {
std::atomic<uint32_t> RefCount = 0;
std::mutex Mutex;
logger::Logger &log = logger::get_logger("opencl");
};

static ur_adapter_handle_t_ *adapter = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions source/adapters/opencl/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
//===----------------------------------------------------------------------===//

#include "common.hpp"

#include "logger/ur_logger.hpp"
namespace cl_adapter {

/* Global variables for urPlatformGetLastError() */
Expand Down Expand Up @@ -91,7 +91,7 @@ ur_result_t mapCLErrorToUR(cl_int Result) {
}

void cl_adapter::die(const char *Message) {
std::cerr << "ur_die: " << Message << "\n";
logger::always("ur_die: {}", Message);
std::terminate();
}

Expand Down

0 comments on commit 4a06ecb

Please sign in to comment.