1 #ifndef HeterogeneousCore_SonicTriton_TritonData 2 #define HeterogeneousCore_SonicTriton_TritonData 10 #include <unordered_map> 17 #include "grpc_client.h" 18 #include "grpc_service.pb.h" 22 template <
typename IO>
24 template <
typename IO>
26 template <
typename IO>
28 #ifdef TRITON_ENABLE_GPU 29 template <
typename IO>
30 class TritonGpuShmResource;
34 template <
typename DT>
36 template <
typename DT>
40 template <
typename DT>
46 template <
typename IO>
49 using Result = triton::client::InferResult;
62 template <
typename DT>
64 template <
typename DT>
67 template <
typename DT>
87 #ifdef TRITON_ENABLE_GPU 88 friend class TritonGpuShmResource<IO>;
100 triton::client::InferenceServerGrpcClient*
client();
101 template <
typename DT>
103 if (!triton_utils::checkType<DT>(
dtype_))
105 <<
name_ <<
": inconsistent data type " <<
typeid(
DT).
name() <<
" for " <<
dname_;
110 return std::any_of(vec.
begin(), vec.
end(), [](int64_t
i) {
return i < 0; });
113 return std::accumulate(vec.
begin(), vec.
end(), 1, std::multiplies<int64_t>());
118 static std::atomic<unsigned>
uid{0};
163 template <
typename DT>
166 template <
typename DT>
171 template <
typename DT>
std::vector< std::vector< DT > > TritonInput
std::shared_ptr< IO > data_
void setBatchSize(unsigned bsize)
std::shared_ptr< void > holder_
unsigned fullLoc(unsigned loc) const
const ShapeView & shape() const
void setResult(std::shared_ptr< Result > result)
const std::string & dname() const
void updateMem(size_t size)
TritonInputContainer< DT > allocate(bool reserve=true)
std::shared_ptr< Result > result_
std::vector< edm::Span< const DT * > > TritonOutput
triton::client::InferResult Result
unsigned batchSize() const
bool anyNeg(const ShapeView &vec) const
TritonData(const std::string &name, const TensorMetadata &model_info, TritonClient *client, const std::string &pid)
int64_t sizeShape() const
std::unordered_map< std::string, TritonInputData > TritonInputMap
void setShape(const ShapeType &newShape)
inference::ModelMetadataResponse_TensorMetadata TensorMetadata
void createObject(IO **ioptr)
std::shared_ptr< TritonInput< DT > > TritonInputContainer
TritonOutput< DT > fromServer() const
triton::client::InferenceServerGrpcClient * client()
inference::DataType dtype_
std::shared_ptr< TritonMemResource< IO > > memResource_
int64_t dimProduct(const ShapeView &vec) const
std::vector< int64_t > ShapeType
bool variableDims() const
void toServer(TritonInputContainer< DT > ptr)
std::unordered_map< std::string, TritonOutputData > TritonOutputMap