27#if GPU_PLATFORM == NVIDIA
28 #include <c10/cuda/CUDACachingAllocator.h>
29 using c10::cuda::CUDACachingAllocator::emptyCache;
30#elif GPU_PLATFORM == AMD
31 #include <c10/hip/HIPCachingAllocator.h>
32 using c10::hip::HIPCachingAllocator::emptyCache;
39typedef std::map<std::string, base::BlobPtr<float>>
BlobMap;
47 virtual bool Init(
const std::map<std::string, std::vector<int>> &shapes) = 0;
60 const std::vector<std::string> &net_input_names,
61 const std::vector<std::string> &net_output_names);
std::vector< std::string > net_input_names_
virtual void SetStream(cudaStream_t stream)
std::vector< std::string > net_output_names_
virtual bool Init(const std::map< std::string, std::vector< int > > &shapes)=0
virtual ~Inference()=default
virtual base::BlobPtr< float > get_blob(const std::string &name)=0
void set_model_info(const std::string &proto_file, const std::vector< std::string > &net_input_names, const std::vector< std::string > &net_output_names)
void set_max_batch_size(const int &batch_size)
void set_gpu_id(const int &gpu_id)
std::shared_ptr< Blob< Dtype > > BlobPtr
std::map< std::string, base::BlobPtr< float > > BlobMap