Skip to content

Commit

Permalink
graph: backend: dnnl: delete copy ctor and assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
TaoLv committed Sep 29, 2024
1 parent f5c5007 commit 7042378
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/graph/backend/dnnl/scratchpad.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,9 @@ class temporary_scratchpad_t : public scratchpad_t {
size_ = 0;
}

temporary_scratchpad_t(temporary_scratchpad_t &&other) noexcept
: buffer_(nullptr), size_(0) {
buffer_ = other.buffer_;
size_ = other.size_;
eng_ = other.eng_;
alloc_ = other.alloc_;
other.buffer_ = nullptr;
other.size_ = 0;
}
// Disable assignment and copy
temporary_scratchpad_t(const temporary_scratchpad_t &) = delete;
temporary_scratchpad_t &operator=(const temporary_scratchpad_t &) = delete;

char *get_buffer() const override { return buffer_; }

Expand Down
3 changes: 3 additions & 0 deletions src/graph/backend/dnnl/thread_local_cache.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ class thread_local_cache_t {
global_cache_ref_.release();
}

cache_type_t(const cache_type_t &) = delete;
cache_type_t &operator=(const cache_type_t &) = delete;

std::unordered_map<size_t, std::weak_ptr<T>> &data() { return data_; }

global_cache_type_t &global_cache_ref_;
Expand Down

0 comments on commit 7042378

Please sign in to comment.