Skip to content

Commit 01756e7

Browse files
committed
no_discard
1 parent d881207 commit 01756e7

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

include/graph/runtime_options.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ struct RuntimeOptions {
1414
int threads{0};
1515
bool parallel{false};
1616

17-
ParBackend getEffectiveParBackend() const {
17+
[[nodiscard]] ParBackend getEffectiveParBackend() const {
1818
return parallel ? par_backend : ParBackend::kSeq;
1919
}
2020

@@ -23,7 +23,7 @@ struct RuntimeOptions {
2323
parallel = (p != ParBackend::kSeq);
2424
}
2525

26-
bool isParallel() const {
26+
[[nodiscard]] bool isParallel() const {
2727
return parallel && (par_backend != ParBackend::kSeq);
2828
}
2929
};

include/layers/Layer.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class Layer {
5555
PostOperations postops;
5656
[[nodiscard]] int getID() const { return id_; }
5757
void setID(int id) { id_ = id; }
58-
LayerType getName() const { return type_; }
58+
[[nodiscard]] LayerType getName() const { return type_; }
5959
virtual void run(const std::vector<Tensor>& input,
6060
std::vector<Tensor>& output) = 0;
6161
virtual void run(const std::vector<Tensor>& input,

src/layers_oneDNN/EWLayer.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ void EwLayerOneDnn::run(const std::vector<Tensor>& input,
5959
}
6060

6161
} catch (const std::exception& e) {
62-
std::cerr << "oneDNN execution failed: " << e.what() << std::endl;
62+
std::cerr << "oneDNN execution failed: " << e.what() << '\n';
6363
throw;
6464
}
6565
}
@@ -143,7 +143,7 @@ void EwLayerOneDnn::initialize_onednn(const Shape& shape, Type data_type) {
143143

144144
} catch (const std::exception& e) {
145145
std::cerr << "oneDNN initialization failed for function '" << func_
146-
<< "': " << e.what() << std::endl;
146+
<< "': " << e.what() << '\n';
147147
throw;
148148
}
149149
}

0 commit comments

Comments
 (0)