CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
TritonData< IO > Class Template Reference

#include <TritonData.h>

Classes

class  TritonDataEntry
 

Public Types

using Result = triton::client::InferResult
 
using ShapeType = std::vector< int64_t >
 
using ShapeView = edm::Span< ShapeType::const_iterator >
 
using TensorMetadata = inference::ModelMetadataResponse_TensorMetadata
 

Public Member Functions

template<typename DT >
TritonInputContainer< DT > allocate (bool reserve=true)
 
int64_t byteSize () const
 
const std::string & dname () const
 
template<typename DT >
TritonOutput< DT > fromServer () const
 
void prepare ()
 
void setShape (const ShapeType &newShape, unsigned entry=0)
 
void setShape (unsigned loc, int64_t val, unsigned entry=0)
 
const ShapeViewshape (unsigned entry=0) const
 
int64_t sizeDims () const
 
int64_t sizeShape (unsigned entry=0) const
 
template<typename DT >
void toServer (TritonInputContainer< DT > ptr)
 
 TritonData (const std::string &name, const TensorMetadata &model_info, TritonClient *client, const std::string &pid)
 
bool variableDims () const
 

Private Member Functions

void addEntry (unsigned entry)
 
void addEntryImpl (unsigned entry)
 
bool anyNeg (const ShapeView &vec) const
 
void checkShm ()
 
template<typename DT >
void checkType () const
 
triton::client::InferenceServerGrpcClient * client ()
 
void computeSizes ()
 
IO * data (unsigned entry=0)
 
int64_t dimProduct (const ShapeView &vec) const
 
unsigned fullLoc (unsigned loc) const
 
void reset ()
 
void setResult (std::shared_ptr< Result > result, unsigned entry=0)
 
unsigned uid () const
 
void updateMem (size_t size)
 
std::string xput () const
 

Private Attributes

int64_t byteSize_
 
TritonClientclient_
 
const ShapeType dims_
 
std::string dname_
 
bool done_ {}
 
inference::DataType dtype_
 
std::vector< TritonDataEntryentries_
 
std::shared_ptr< void > holder_
 
std::shared_ptr< TritonMemResource< IO > > memResource_
 
std::string name_
 
int64_t productDims_
 
std::string shmName_
 
size_t totalByteSize_
 
bool useShm_
 
bool variableDims_
 

Friends

class TritonClient
 
class TritonCpuShmResource< IO >
 
class TritonHeapResource< IO >
 
class TritonMemResource< IO >
 

Detailed Description

template<typename IO>
class TritonData< IO >

Definition at line 47 of file TritonData.h.

Member Typedef Documentation

◆ Result

template<typename IO>
using TritonData< IO >::Result = triton::client::InferResult

Definition at line 49 of file TritonData.h.

◆ ShapeType

template<typename IO>
using TritonData< IO >::ShapeType = std::vector<int64_t>

Definition at line 51 of file TritonData.h.

◆ ShapeView

template<typename IO>
using TritonData< IO >::ShapeView = edm::Span<ShapeType::const_iterator>

Definition at line 52 of file TritonData.h.

◆ TensorMetadata

template<typename IO>
using TritonData< IO >::TensorMetadata = inference::ModelMetadataResponse_TensorMetadata

Definition at line 50 of file TritonData.h.

Constructor & Destructor Documentation

◆ TritonData()

template<typename IO>
TritonData< IO >::TritonData ( const std::string &  name,
const TensorMetadata model_info,
TritonClient client,
const std::string &  pid 
)

Definition at line 18 of file TritonData.cc.

References TritonData< IO >::addEntryImpl(), TritonData< IO >::anyNeg(), TritonData< IO >::checkShm(), TritonData< IO >::dimProduct(), TritonData< IO >::entries_, TritonData< IO >::productDims_, and TritonData< IO >::variableDims_.

22  : name_(name),
23  client_(client),
25  //ensure unique name for shared memory region
26  shmName_(useShm_ ? pid + "_" + xput() + std::to_string(uid()) : ""),
27  dims_(model_info.shape().begin(), model_info.shape().end()),
28  dname_(model_info.datatype()),
29  dtype_(tco::ProtocolStringToDataType(dname_)),
30  byteSize_(tco::GetDataTypeByteSize(dtype_)),
31  totalByteSize_(0) {
32  //initialize first shape entry
33  addEntryImpl(0);
34  //one-time computation of some shape info
35  variableDims_ = anyNeg(entries_.front().shape_);
36  productDims_ = variableDims_ ? -1 : dimProduct(entries_.front().shape_);
37  checkShm();
38 }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188
unsigned uid() const
Definition: TritonData.h:169
void addEntryImpl(unsigned entry)
Definition: TritonData.cc:53
size_t totalByteSize_
Definition: TritonData.h:189
const ShapeType dims_
Definition: TritonData.h:182
bool useShm_
Definition: TritonData.h:180
static std::string to_string(const XMLCh *ch)
void checkShm()
Definition: TritonData.h:144
const ShapeView & shape(unsigned entry=0) const
Definition: TritonData.h:71
int64_t productDims_
Definition: TritonData.h:184
int64_t byteSize_
Definition: TritonData.h:187
TritonClient * client_
Definition: TritonData.h:179
bool anyNeg(const ShapeView &vec) const
Definition: TritonData.h:160
inference::DataType dtype_
Definition: TritonData.h:186
int64_t dimProduct(const ShapeView &vec) const
Definition: TritonData.h:163
std::string xput() const
Definition: TritonData.cc:77
std::string dname_
Definition: TritonData.h:185
bool useSharedMemory() const
Definition: TritonClient.h:44
std::string name_
Definition: TritonData.h:178
std::string shmName_
Definition: TritonData.h:181
bool variableDims_
Definition: TritonData.h:183

Member Function Documentation

◆ addEntry()

template<typename IO >
void TritonData< IO >::addEntry ( unsigned  entry)
private

Definition at line 47 of file TritonData.cc.

References mps_splice::entry.

Referenced by TritonData< IO >::setShape().

47  {
48  //ensures consistency among all inputs
50 }
void addEntry(unsigned entry)
TritonClient * client_
Definition: TritonData.h:179

◆ addEntryImpl()

template<typename IO >
void TritonData< IO >::addEntryImpl ( unsigned  entry)
private

Definition at line 53 of file TritonData.cc.

References mps_splice::entry, and mps_fire::i.

Referenced by TritonData< IO >::reset(), and TritonData< IO >::TritonData().

53  {
54  if (entry >= entries_.size()) {
55  entries_.reserve(entry + 1);
56  for (unsigned i = entries_.size(); i < entry + 1; ++i) {
57  entries_.emplace_back(dims_, client_->noOuterDim(), name_, dname_);
58  }
59  }
60 }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188
bool noOuterDim() const
Definition: TritonClient.h:58
const ShapeType dims_
Definition: TritonData.h:182
TritonClient * client_
Definition: TritonData.h:179
std::string dname_
Definition: TritonData.h:185
std::string name_
Definition: TritonData.h:178

◆ allocate()

template<typename DT >
TritonInputContainer< DT > TritonInputData::allocate ( bool  reserve = true)

Definition at line 170 of file TritonData.cc.

References TritonData< IO >::anyNeg(), TritonClient::batchSize(), TritonData< IO >::client_, TritonData< IO >::computeSizes(), TritonData< IO >::entries_, and mps_splice::entry.

170  {
171  //automatically creates a vector for each item (if batch size known)
172  auto ptr = std::make_shared<TritonInput<DT>>(client_->batchSize());
173  if (reserve) {
174  computeSizes();
175  for (auto& entry : entries_) {
176  if (anyNeg(entry.shape_))
177  continue;
178  for (auto& vec : *ptr) {
179  vec.reserve(entry.sizeShape_);
180  }
181  }
182  }
183  return ptr;
184 }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188
void computeSizes()
Definition: TritonData.cc:128
TritonClient * client_
Definition: TritonData.h:179
bool anyNeg(const ShapeView &vec) const
Definition: TritonData.h:160
unsigned batchSize() const

◆ anyNeg()

template<typename IO>
bool TritonData< IO >::anyNeg ( const ShapeView vec) const
inlineprivate

Definition at line 160 of file TritonData.h.

References edm::Span< T >::begin(), edm::Span< T >::end(), and mps_fire::i.

Referenced by TritonData< IO >::allocate(), and TritonData< IO >::TritonData().

160  {
161  return std::any_of(vec.begin(), vec.end(), [](int64_t i) { return i < 0; });
162  }

◆ byteSize()

template<typename IO>
int64_t TritonData< IO >::byteSize ( ) const
inline

Definition at line 72 of file TritonData.h.

References TritonData< IO >::byteSize_.

Referenced by TritonData< IO >::TritonDataEntry::computeSizes().

72 { return byteSize_; }
int64_t byteSize_
Definition: TritonData.h:187

◆ checkShm()

void TritonOutputData::checkShm ( )
inlineprivate

Definition at line 144 of file TritonData.h.

Referenced by TritonData< IO >::TritonData().

144 {}

◆ checkType()

template<typename IO>
template<typename DT >
void TritonData< IO >::checkType ( ) const
inlineprivate

Definition at line 153 of file TritonData.h.

References TritonData< IO >::dname_, GeomDetEnumerators::DT, TritonData< IO >::dtype_, Exception, Skims_PA_cff::name, and TritonData< IO >::name_.

153  {
154  if (!triton_utils::checkType<DT>(dtype_))
155  throw cms::Exception("TritonDataError")
156  << name_ << ": inconsistent data type " << typeid(DT).name() << " for " << dname_;
157  }
inference::DataType dtype_
Definition: TritonData.h:186
std::string dname_
Definition: TritonData.h:185
std::string name_
Definition: TritonData.h:178

◆ client()

template<typename IO >
tc::InferenceServerGrpcClient * TritonData< IO >::client ( )
private

Definition at line 87 of file TritonData.cc.

References TritonClient::client(), and TritonData< IO >::client_.

87  {
88  return client_->client();
89 }
auto client()
Definition: TritonClient.h:95
TritonClient * client_
Definition: TritonData.h:179

◆ computeSizes()

template<typename IO >
void TritonData< IO >::computeSizes ( )
private

Definition at line 128 of file TritonData.cc.

References TritonData< IO >::byteSize_, TritonData< IO >::client_, TritonData< IO >::entries_, mps_fire::i, TritonClient::outerDim(), TritonData< IO >::sizeShape(), and TritonData< IO >::totalByteSize_.

Referenced by TritonData< IO >::allocate(), TritonData< IO >::prepare(), and TritonData< IO >::toServer().

128  {
129  totalByteSize_ = 0;
130  unsigned outerDim = client_->outerDim();
131  for (unsigned i = 0; i < entries_.size(); ++i) {
132  entries_[i].computeSizes(sizeShape(i), byteSize_, outerDim);
133  entries_[i].offset_ = totalByteSize_;
134  totalByteSize_ += entries_[i].totalByteSize_;
135  }
136 }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188
int64_t sizeShape(unsigned entry=0) const
Definition: TritonData.h:79
size_t totalByteSize_
Definition: TritonData.h:189
int64_t byteSize_
Definition: TritonData.h:187
TritonClient * client_
Definition: TritonData.h:179
unsigned outerDim() const
Definition: TritonClient.h:59

◆ data()

template<typename IO>
IO* TritonData< IO >::data ( unsigned  entry = 0)
inlineprivate

Definition at line 148 of file TritonData.h.

References TritonData< IO >::entries_, and mps_splice::entry.

Referenced by TritonData< IO >::toServer().

148 { return entries_[entry].data_.get(); }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188

◆ dimProduct()

template<typename IO>
int64_t TritonData< IO >::dimProduct ( const ShapeView vec) const
inlineprivate

Definition at line 163 of file TritonData.h.

References edm::Span< T >::begin(), edm::Span< T >::end(), MainPageGenerator::l, and SiStripPI::max.

Referenced by TritonData< IO >::sizeShape(), and TritonData< IO >::TritonData().

163  {
164  //lambda treats negative dimensions as 0 to avoid overflows
165  return std::accumulate(
166  vec.begin(), vec.end(), 1, [](int64_t dim1, int64_t dim2) { return dim1 * std::max(0l, dim2); });
167  }

◆ dname()

template<typename IO>
const std::string& TritonData< IO >::dname ( ) const
inline

Definition at line 73 of file TritonData.h.

References TritonData< IO >::dname_.

Referenced by TritonData< IO >::TritonDataEntry::TritonDataEntry().

73 { return dname_; }
std::string dname_
Definition: TritonData.h:185

◆ fromServer()

template<typename DT >
TritonOutput< DT > TritonOutputData::fromServer ( ) const

Definition at line 244 of file TritonData.cc.

References TritonClient::batchSize(), TritonData< IO >::client_, TritonData< IO >::done_, GeomDetEnumerators::DT, TritonData< IO >::entries_, mps_splice::entry, Exception, mps_fire::i, TritonData< IO >::memResource_, TritonData< IO >::name_, hltrates_dqm_sourceclient-live_cfg::offset, TritonClient::outerDim(), and diffTwoXMLs::r1.

244  {
245  //shouldn't be called twice
246  if (done_)
247  throw cms::Exception("TritonDataError") << name_ << " fromServer() was already called for this event";
248 
249  //check type
250  checkType<DT>();
251 
252  memResource_->copyOutput();
253 
254  unsigned outerDim = client_->outerDim();
255  TritonOutput<DT> dataOut;
256  dataOut.reserve(client_->batchSize());
257  for (unsigned i = 0; i < entries_.size(); ++i) {
258  const auto& entry = entries_[i];
259  const DT* r1 = reinterpret_cast<const DT*>(entry.output_);
260 
261  if (entry.totalByteSize_ > 0 and !entry.result_) {
262  throw cms::Exception("TritonDataError") << name_ << " fromServer(): missing result";
263  }
264 
265  for (unsigned i0 = 0; i0 < outerDim; ++i0) {
266  auto offset = i0 * entry.sizeShape_;
267  dataOut.emplace_back(r1 + offset, r1 + offset + entry.sizeShape_);
268  }
269  }
270 
271  done_ = true;
272  return dataOut;
273 }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188
bool done_
Definition: TritonData.h:196
std::vector< edm::Span< const DT * > > TritonOutput
Definition: TritonData.h:37
TritonClient * client_
Definition: TritonData.h:179
unsigned batchSize() const
unsigned outerDim() const
Definition: TritonClient.h:59
std::shared_ptr< TritonMemResource< IO > > memResource_
Definition: TritonData.h:194
std::string name_
Definition: TritonData.h:178

◆ fullLoc()

template<typename IO >
unsigned TritonData< IO >::fullLoc ( unsigned  loc) const
private

Definition at line 286 of file TritonData.cc.

References TritonData< IO >::client_, and TritonClient::noOuterDim().

Referenced by TritonData< IO >::setShape().

286  {
287  return loc + (client_->noOuterDim() ? 0 : 1);
288 }
bool noOuterDim() const
Definition: TritonClient.h:58
TritonClient * client_
Definition: TritonData.h:179

◆ prepare()

void TritonOutputData::prepare ( )

Definition at line 236 of file TritonData.cc.

References TritonData< IO >::computeSizes(), TritonData< IO >::memResource_, TritonData< IO >::totalByteSize_, and TritonData< IO >::updateMem().

236  {
237  computeSizes();
239  memResource_->set();
240 }
size_t totalByteSize_
Definition: TritonData.h:189
void computeSizes()
Definition: TritonData.cc:128
void updateMem(size_t size)
Definition: TritonData.cc:141
std::shared_ptr< TritonMemResource< IO > > memResource_
Definition: TritonData.h:194

◆ reset()

template<typename IO >
void TritonData< IO >::reset ( void  )
private

Definition at line 276 of file TritonData.cc.

References TritonData< IO >::addEntryImpl(), TritonData< IO >::done_, TritonData< IO >::entries_, TritonData< IO >::holder_, and TritonData< IO >::totalByteSize_.

276  {
277  done_ = false;
278  holder_.reset();
279  entries_.clear();
280  totalByteSize_ = 0;
281  //re-initialize first shape entry
282  addEntryImpl(0);
283 }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188
void addEntryImpl(unsigned entry)
Definition: TritonData.cc:53
std::shared_ptr< void > holder_
Definition: TritonData.h:193
bool done_
Definition: TritonData.h:196
size_t totalByteSize_
Definition: TritonData.h:189

◆ setResult()

template<typename IO>
void TritonData< IO >::setResult ( std::shared_ptr< Result result,
unsigned  entry = 0 
)
inlineprivate

Definition at line 147 of file TritonData.h.

References TritonData< IO >::entries_, mps_splice::entry, and mps_fire::result.

147 { entries_[entry].result_ = result; }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188

◆ setShape() [1/2]

template<typename IO>
void TritonData< IO >::setShape ( const ShapeType newShape,
unsigned  entry = 0 
)

◆ setShape() [2/2]

template<typename IO >
void TritonData< IO >::setShape ( unsigned  loc,
int64_t  val,
unsigned  entry = 0 
)

Definition at line 101 of file TritonData.cc.

References TritonData< IO >::addEntry(), TritonData< IO >::dims_, TritonData< IO >::entries_, mps_splice::entry, Exception, TritonData< IO >::fullLoc(), TritonData< IO >::name_, and heppy_batch::val.

101  {
102  addEntry(entry);
103 
104  unsigned locFull = fullLoc(loc);
105 
106  //check boundary
107  if (locFull >= entries_[entry].fullShape_.size())
108  throw cms::Exception("TritonDataError") << name_ << " setShape(): dimension " << locFull << " out of bounds ("
109  << entries_[entry].fullShape_.size() << ")";
110 
111  if (val != entries_[entry].fullShape_[locFull]) {
112  if (dims_[locFull] == -1)
113  entries_[entry].fullShape_[locFull] = val;
114  else
115  throw cms::Exception("TritonDataError")
116  << name_ << " setShape(): attempt to change value of non-variable shape dimension " << loc;
117  }
118 }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188
unsigned fullLoc(unsigned loc) const
Definition: TritonData.cc:286
const ShapeType dims_
Definition: TritonData.h:182
std::string name_
Definition: TritonData.h:178
void addEntry(unsigned entry)
Definition: TritonData.cc:47

◆ shape()

template<typename IO>
const ShapeView& TritonData< IO >::shape ( unsigned  entry = 0) const
inline

Definition at line 71 of file TritonData.h.

References TritonData< IO >::entries_, and mps_splice::entry.

71 { return entries_.at(entry).shape_; }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188

◆ sizeDims()

template<typename IO>
int64_t TritonData< IO >::sizeDims ( ) const
inline

Definition at line 77 of file TritonData.h.

References TritonData< IO >::productDims_.

Referenced by TritonData< IO >::sizeShape().

77 { return productDims_; }
int64_t productDims_
Definition: TritonData.h:184

◆ sizeShape()

template<typename IO>
int64_t TritonData< IO >::sizeShape ( unsigned  entry = 0) const
inline

Definition at line 79 of file TritonData.h.

References TritonData< IO >::dimProduct(), TritonData< IO >::entries_, mps_splice::entry, TritonData< IO >::sizeDims(), and TritonData< IO >::variableDims_.

Referenced by TritonData< IO >::computeSizes().

79  {
80  return variableDims_ ? dimProduct(entries_.at(entry).shape_) : sizeDims();
81  }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188
int64_t sizeDims() const
Definition: TritonData.h:77
int64_t dimProduct(const ShapeView &vec) const
Definition: TritonData.h:163
bool variableDims_
Definition: TritonData.h:183

◆ toServer()

template<typename DT >
void TritonInputData::toServer ( TritonInputContainer< DT >  ptr)

Definition at line 188 of file TritonData.cc.

References TritonClient::batchSize(), HLT_FULL_cff::batchSize, TritonData< IO >::client_, TritonData< IO >::computeSizes(), counter, TritonData< IO >::data(), TritonData< IO >::done_, TritonData< IO >::entries_, mps_splice::entry, Exception, TritonData< IO >::holder_, mps_fire::i, TritonData< IO >::memResource_, TritonData< IO >::name_, TritonClient::noOuterDim(), hltrates_dqm_sourceclient-live_cfg::offset, TritonClient::outerDim(), TritonData< IO >::totalByteSize_, and TritonData< IO >::updateMem().

188  {
189  //shouldn't be called twice
190  if (done_)
191  throw cms::Exception("TritonDataError") << name_ << " toServer() was already called for this event";
192 
193  const auto& data_in = *ptr;
194 
195  //check batch size
196  unsigned batchSize = client_->batchSize();
197  unsigned outerDim = client_->outerDim();
198  if (data_in.size() != batchSize) {
199  throw cms::Exception("TritonDataError") << name_ << " toServer(): input vector has size " << data_in.size()
200  << " but specified batch size is " << batchSize;
201  }
202 
203  //check type
204  checkType<DT>();
205 
206  computeSizes();
208 
209  unsigned offset = 0;
210  unsigned counter = 0;
211  for (unsigned i = 0; i < entries_.size(); ++i) {
212  auto& entry = entries_[i];
213 
214  //shape must be specified for variable dims or if batch size changes
215  if (!client_->noOuterDim())
216  entry.fullShape_[0] = outerDim;
217  entry.data_->SetShape(entry.fullShape_);
218 
219  for (unsigned i0 = 0; i0 < outerDim; ++i0) {
220  //avoid copying empty input
221  if (entry.byteSizePerBatch_ > 0)
222  memResource_->copyInput(data_in[counter].data(), offset, i);
223  offset += entry.byteSizePerBatch_;
224  ++counter;
225  }
226  }
227  memResource_->set();
228 
229  //keep input data in scope
230  holder_ = ptr;
231  done_ = true;
232 }
std::vector< TritonDataEntry > entries_
Definition: TritonData.h:188
bool noOuterDim() const
Definition: TritonClient.h:58
std::shared_ptr< void > holder_
Definition: TritonData.h:193
bool done_
Definition: TritonData.h:196
size_t totalByteSize_
Definition: TritonData.h:189
void computeSizes()
Definition: TritonData.cc:128
void updateMem(size_t size)
Definition: TritonData.cc:141
IO * data(unsigned entry=0)
Definition: TritonData.h:148
TritonClient * client_
Definition: TritonData.h:179
unsigned batchSize() const
unsigned outerDim() const
Definition: TritonClient.h:59
std::shared_ptr< TritonMemResource< IO > > memResource_
Definition: TritonData.h:194
static std::atomic< unsigned int > counter
std::string name_
Definition: TritonData.h:178

◆ uid()

template<typename IO>
unsigned TritonData< IO >::uid ( ) const
inlineprivate

Definition at line 169 of file TritonData.h.

169  {
170  static std::atomic<unsigned> uid{0};
171  return ++uid;
172  }
unsigned uid() const
Definition: TritonData.h:169

◆ updateMem()

template<typename IO >
void TritonData< IO >::updateMem ( size_t  size)
private

Definition at line 141 of file TritonData.cc.

References TritonData< IO >::client_, LocalCPU, LocalGPU, TritonData< IO >::memResource_, or, TritonClient::serverType(), TritonData< IO >::shmName_, findQualityFiles::size, and TritonData< IO >::useShm_.

Referenced by TritonData< IO >::prepare(), and TritonData< IO >::toServer().

141  {
142  if (!memResource_ or size > memResource_->size()) {
144  //avoid unnecessarily throwing in destructor
145  if (memResource_)
146  memResource_->close();
147  //need to destroy before constructing new instance because shared memory key will be reused
148  memResource_.reset();
149  memResource_ = std::make_shared<TritonCpuShmResource<IO>>(this, shmName_, size);
150  }
151 #ifdef TRITON_ENABLE_GPU
153  //avoid unnecessarily throwing in destructor
154  if (memResource_)
155  memResource_->close();
156  //need to destroy before constructing new instance because shared memory key will be reused
157  memResource_.reset();
158  memResource_ = std::make_shared<TritonGpuShmResource<IO>>(this, shmName_, size);
159  }
160 #endif
161  //for remote/heap, size increases don't matter
162  else if (!memResource_)
163  memResource_ = std::make_shared<TritonHeapResource<IO>>(this, shmName_, size);
164  }
165 }
size
Write out results.
bool useShm_
Definition: TritonData.h:180
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
TritonServerType serverType() const
Definition: TritonClient.h:50
TritonClient * client_
Definition: TritonData.h:179
std::shared_ptr< TritonMemResource< IO > > memResource_
Definition: TritonData.h:194
std::string shmName_
Definition: TritonData.h:181

◆ variableDims()

template<typename IO>
bool TritonData< IO >::variableDims ( ) const
inline

Definition at line 76 of file TritonData.h.

References TritonData< IO >::variableDims_.

76 { return variableDims_; }
bool variableDims_
Definition: TritonData.h:183

◆ xput()

std::string TritonOutputData::xput ( ) const
private

Definition at line 77 of file TritonData.cc.

77  {
78  return "input";
79 }

Friends And Related Function Documentation

◆ TritonClient

template<typename IO>
friend class TritonClient
friend

Definition at line 84 of file TritonData.h.

◆ TritonCpuShmResource< IO >

template<typename IO>
friend class TritonCpuShmResource< IO >
friend

Definition at line 87 of file TritonData.h.

◆ TritonHeapResource< IO >

template<typename IO>
friend class TritonHeapResource< IO >
friend

Definition at line 86 of file TritonData.h.

◆ TritonMemResource< IO >

template<typename IO>
friend class TritonMemResource< IO >
friend

Definition at line 85 of file TritonData.h.

Member Data Documentation

◆ byteSize_

template<typename IO>
int64_t TritonData< IO >::byteSize_
private

Definition at line 187 of file TritonData.h.

Referenced by TritonData< IO >::byteSize(), and TritonData< IO >::computeSizes().

◆ client_

template<typename IO>
TritonClient* TritonData< IO >::client_
private

◆ dims_

template<typename IO>
const ShapeType TritonData< IO >::dims_
private

Definition at line 182 of file TritonData.h.

Referenced by TritonData< IO >::setShape().

◆ dname_

template<typename IO>
std::string TritonData< IO >::dname_
private

Definition at line 185 of file TritonData.h.

Referenced by TritonData< IO >::checkType(), and TritonData< IO >::dname().

◆ done_

template<typename IO>
bool TritonData< IO >::done_ {}
mutableprivate

◆ dtype_

template<typename IO>
inference::DataType TritonData< IO >::dtype_
private

Definition at line 186 of file TritonData.h.

Referenced by TritonData< IO >::checkType().

◆ entries_

template<typename IO>
std::vector<TritonDataEntry> TritonData< IO >::entries_
private

◆ holder_

template<typename IO>
std::shared_ptr<void> TritonData< IO >::holder_
private

Definition at line 193 of file TritonData.h.

Referenced by TritonData< IO >::reset(), and TritonData< IO >::toServer().

◆ memResource_

template<typename IO>
std::shared_ptr<TritonMemResource<IO> > TritonData< IO >::memResource_
private

◆ name_

template<typename IO>
std::string TritonData< IO >::name_
private

◆ productDims_

template<typename IO>
int64_t TritonData< IO >::productDims_
private

Definition at line 184 of file TritonData.h.

Referenced by TritonData< IO >::sizeDims(), and TritonData< IO >::TritonData().

◆ shmName_

template<typename IO>
std::string TritonData< IO >::shmName_
private

Definition at line 181 of file TritonData.h.

Referenced by TritonData< IO >::updateMem().

◆ totalByteSize_

template<typename IO>
size_t TritonData< IO >::totalByteSize_
private

◆ useShm_

template<typename IO>
bool TritonData< IO >::useShm_
private

Definition at line 180 of file TritonData.h.

Referenced by TritonData< IO >::updateMem().

◆ variableDims_

template<typename IO>
bool TritonData< IO >::variableDims_
private