Add CAN-driven lazy inference with resident TensorRT engines

This commit is contained in:
zmv
2026-09-23 20:25:34 +08:00
parent 26c5bfb88d
commit 647e5b5f79
31 changed files with 1234 additions and 129 deletions
+9
View File
@@ -18,6 +18,15 @@ public:
if(closed_)return false;
items_.push_back(std::move(item));changed_.notify_all();return true;
}
bool pushLatest(T item) {
std::lock_guard<std::mutex> lock(mutex_);
if(closed_)return false;
if(items_.size()==capacity_)items_.pop_front();
items_.push_back(std::move(item));changed_.notify_all();return true;
}
void clear() {
std::lock_guard<std::mutex> lock(mutex_);items_.clear();changed_.notify_all();
}
std::optional<T> pop() {
std::unique_lock<std::mutex> lock(mutex_);
changed_.wait(lock,[&]{return closed_||!items_.empty();});