#pragma once #include #include #include #include #include #include #include #include "NvInfer.h" #include "cuda_runtime_api.h" #include "fastrt/struct.h" #define CHECK(status) \ do \ { \ auto ret = (status); \ if (ret != 0) \ { \ std::cout << "Cuda failure: " << ret; \ abort(); \ } \ } while (0) #define TRTASSERT assert using Time = std::chrono::high_resolution_clock; using TimePoint = std::chrono::time_point; template std::unique_ptr make_unique(Args&&... args) { return std::unique_ptr(new T(std::forward(args)...)); } namespace io { std::vector fileGlob(const std::string& pattern); } namespace trt { /* * Load weights from files shared with TensorRT samples. * TensorRT weight files have a simple space delimited format: * [type] [size] */ std::map loadWeights(const std::string file); std::ostream& operator<<(std::ostream& os, const ModelConfig& modelCfg); } namespace fastrt { std::ostream& operator<<(std::ostream& os, const FastreidConfig& fastreidCfg); }