examples: fixed clang-tidy warnings

This commit is contained in:
Pirogov, Vadim
2025-03-06 15:21:42 -08:00
committed by Vadim Pirogov
parent c35db141d1
commit 777a1c85b7
2 changed files with 5 additions and 4 deletions

View File

@ -79,7 +79,7 @@ inline void finalize() {
#endif
}
dnnl::engine::kind validate_engine_kind(dnnl::engine::kind akind) {
inline dnnl::engine::kind validate_engine_kind(dnnl::engine::kind akind) {
// Checking if a GPU exists on the machine
if (akind == dnnl::engine::kind::gpu) {
if (dnnl::engine::get_count(dnnl::engine::kind::gpu) == 0) {
@ -94,6 +94,7 @@ dnnl::engine::kind validate_engine_kind(dnnl::engine::kind akind) {
// Exception class to indicate that the example uses a feature that is not
// available on the current systems. It is not treated as an error then, but
// just notifies a user.
// NOLINTNEXTLINE(readability-identifier-naming)
struct example_allows_unimplemented : public std::exception {
example_allows_unimplemented(const char *message) noexcept
: message(message) {}
@ -107,7 +108,7 @@ inline const char *engine_kind2str_upper(dnnl::engine::kind kind);
// Returns `0` on success, `1` or oneDNN error, and `2` on example error.
inline int handle_example_errors(
std::initializer_list<dnnl::engine::kind> engine_kinds,
std::function<void()> example) {
const std::function<void()> &example) {
int exit_code = 0;
try {

View File

@ -535,7 +535,7 @@ public:
#endif
ptr = sh_ptr.get();
// record the map of mm size and its ptr for reuse
map_size_ptr_.emplace(std::make_pair(size, sh_ptr));
map_size_ptr_.emplace(size, sh_ptr);
is_free_ptr_[ptr] = false;
}
return ptr;
@ -566,7 +566,7 @@ public:
= std::shared_ptr<void> {malloc(size), cpu_deletor_t {}};
ptr = sh_ptr.get();
// record the map of mm size and its ptr for reuse
map_size_ptr_.emplace(std::make_pair(size, sh_ptr));
map_size_ptr_.emplace(size, sh_ptr);
is_free_ptr_[ptr] = false;
}
return ptr;