Skip to content

Commit

Permalink
common: initialize members in initializer list
Browse files Browse the repository at this point in the history
  • Loading branch information
atkassen committed Feb 11, 2025
1 parent 4b6f34c commit 179ec18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
7 changes: 3 additions & 4 deletions src/common/logging.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,14 @@
namespace dnnl {
namespace impl {

log_manager_t::log_manager_t() {

log_manager_t::log_manager_t()
: logfile_path_(getenv_string_user("VERBOSE_LOGFILE"))
// enables logging as well as printing to stdout
console_flag_ = getenv_int_user("VERBOSE_LOG_WITH_CONSOLE", 0);
, console_flag_(getenv_int_user("VERBOSE_LOG_WITH_CONSOLE", 0)) {

// logging is automatically disabled when no filepath is provided by
// DNNL_VERBOSE_LOGFILE
// in this case, we fall back to printing to stdout
logfile_path_ = getenv_string_user("VERBOSE_LOGFILE");
if (logfile_path_.empty()) {
console_flag_ = true;
return;
Expand Down
9 changes: 5 additions & 4 deletions src/common/memory.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright 2016-2024 Intel Corporation
* Copyright 2016-2025 Intel Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -100,9 +100,10 @@ dnnl_memory::dnnl_memory(dnnl::impl::engine_t *engine,
const dnnl::impl::memory_desc_t *md,
std::vector<std::unique_ptr<dnnl::impl::memory_storage_t>>
&&memory_storages)
: engine_(engine), md_(*md), counter_(1) {
memory_storages_ = std::move(memory_storages);
}
: engine_(engine)
, md_(*md)
, memory_storages_(std::move(memory_storages))
, counter_(1) {}
#endif

status_t dnnl_memory::set_data_handle(void *handle, int index) const {
Expand Down

0 comments on commit 179ec18

Please sign in to comment.