MCPcopy Create free account
hub / github.com/AnswerDotAI/gpu.cpp / ~TensorPool

Method ~TensorPool

gpu.hpp:721–732  ·  view source on GitHub ↗

* @brief Destructor for TensorPool which frees all tensors in the pool. */

Source from the content-addressed store, hash-verified

719 * @brief Destructor for TensorPool which frees all tensors in the pool.
720 */
721inline TensorPool::~TensorPool() {
722 // Need to get keys in a separate iteration, otherwise iterator is getting
723 // invalidated during erase.
724 std::vector<WGPUBuffer> keys;
725 for (auto &pair : data) {
726 keys.push_back(pair.first);
727 }
728 for (auto &key : keys) {
729 FreeTensor(*this, data[key]);
730 LOG(kDefLog, kTrace, "Freed tensor");
731 }
732}
733
734/**
735 * @brief Checks a condition and logs an error message if the condition is

Callers

nothing calls this directly

Calls 2

FreeTensorFunction · 0.85
LOGFunction · 0.85

Tested by

no test coverage detected