1 #ifndef HeterogeneousCore_SonicTriton_TritonData
2 #define HeterogeneousCore_SonicTriton_TritonData
9 #include <unordered_map>
15 #include "grpc_client.h"
16 #include "grpc_service.pb.h"
20 template <
typename IO>
22 template <
typename IO>
24 template <
typename IO>
26 #ifdef TRITON_ENABLE_GPU
27 template <
typename IO>
28 class TritonGpuShmResource;
32 template <
typename DT>
34 template <
typename DT>
38 template <
typename DT>
44 template <
typename IO>
47 using Result = triton::client::InferResult;
60 template <
typename DT>
62 template <
typename DT>
65 template <
typename DT>
85 #ifdef TRITON_ENABLE_GPU
86 friend class TritonGpuShmResource<IO>;
98 triton::client::InferenceServerGrpcClient*
client();
102 return std::any_of(vec.
begin(), vec.
end(), [](int64_t
i) {
return i < 0; });
105 return std::accumulate(vec.
begin(), vec.
end(), 1, std::multiplies<int64_t>());
110 static std::atomic<unsigned>
uid{0};
155 template <
typename DT>
158 template <
typename DT>
163 template <
typename DT>
std::shared_ptr< IO > data_
void setBatchSize(unsigned bsize)
std::shared_ptr< TritonInput< DT >> TritonInputContainer
int64_t dimProduct(const ShapeView &vec) const
std::shared_ptr< void > holder_
TritonInputContainer< DT > allocate(bool reserve=true)
unsigned fullLoc(unsigned loc) const
void setResult(std::shared_ptr< Result > result)
int64_t sizeShape() const
void updateMem(size_t size)
bool variableDims() const
bool anyNeg(const ShapeView &vec) const
const ShapeView & shape() const
std::shared_ptr< Result > result_
unsigned batchSize() const
triton::client::InferResult Result
TritonData(const std::string &name, const TensorMetadata &model_info, TritonClient *client, const std::string &pid)
std::unordered_map< std::string, TritonInputData > TritonInputMap
void setShape(const ShapeType &newShape)
std::vector< std::vector< DT >> TritonInput
inference::ModelMetadataResponse_TensorMetadata TensorMetadata
void createObject(IO **ioptr)
TritonOutput< DT > fromServer() const
triton::client::InferenceServerGrpcClient * client()
inference::DataType dtype_
std::vector< edm::Span< const DT * >> TritonOutput
std::shared_ptr< TritonMemResource< IO > > memResource_
std::vector< int64_t > ShapeType
const std::string & dname() const
void toServer(TritonInputContainer< DT > ptr)
std::unordered_map< std::string, TritonOutputData > TritonOutputMap
tuple size
Write out results.