NVIDIA NvNeural SDK  2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
CoreTypes.h
Go to the documentation of this file.
1 /*
2 * SPDX-FileCopyrightText: Copyright (c) 2020-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3 * SPDX-License-Identifier: MIT
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
22 */
23 
25 
26 #ifndef NVNEURAL_CORETYPES_H
27 #define NVNEURAL_CORETYPES_H
28 
29 #include <cstddef>
30 #include <cstdint>
31 #include <tuple>
32 #include <type_traits>
33 #include <vector>
34 #include <initializer_list>
35 
36 
37 namespace nvneural {
38  class IImage;
39  class ILayer;
40  class INetwork;
41  class INetworkBackend;
42  class INetworkRuntime;
43  class IPlugin;
44  class IPluginLoader;
45  class IStringList;
46 
52  const std::uint32_t ApiVersion = 1338;
53 
59  enum class TensorDataType : std::uint16_t
60  {
61  Invalid = 0,
62  TestOnly = 1,
63  Float = 2,
64  Half = 3,
65  CompressedPng = 7,
66  UncompressedRgb = 8,
67 
68  CustomBase = 0x4000u,
69  };
70 
76  enum class TensorDataLayout : std::uint16_t
77  {
78  Invalid = 0,
79  TestOnly = 1,
80  Nchw = 2,
81  Nhwc = 3,
82 
83  CustomBase = 0x4000u,
84  };
85 
87  struct TensorFormat
88  {
91 
93  inline TensorFormat()
96  {
97  }
98 
100  inline TensorFormat(TensorDataType elementType_, TensorDataLayout layout_)
101  : elementType{elementType_}
102  , layout{layout_}
103  {
104  }
105 
107  inline bool operator !=(const TensorFormat& other) const noexcept
108  {
109  return elementType != other.elementType
110  || layout != other.layout;
111  }
112 
114  inline bool operator ==(const TensorFormat& other) const noexcept
115  {
116  return !(*this != other);
117  }
118 
122  inline bool operator <(const TensorFormat& other) const noexcept
123  {
124  return std::tie(elementType, layout) < std::tie(other.elementType, other.layout);
125  }
126  };
127 
128  // The Neural plugin ABI assumes a TensorFormat can fit in a single 32-bit register
129  static_assert(sizeof(TensorFormat) == sizeof(std::uint32_t), "TensorFormat structure packing not as expected");
130 
136  {
137  size_t n = 0;
138  size_t c = 0;
139  size_t h = 0;
140  size_t w = 0;
141 
143  inline TensorDimension() = default;
144 
146  inline TensorDimension(size_t N, size_t C, size_t H, size_t W)
147  : n{N}
148  , c{C}
149  , h{H}
150  , w{W}
151  {
152  }
153 
155  ~TensorDimension() = default;
156 
158  inline TensorDimension(const TensorDimension& copyFrom)
159  : n{copyFrom.n}
160  , c{copyFrom.c}
161  , h{copyFrom.h}
162  , w{copyFrom.w}
163  {
164  }
165 
167  inline TensorDimension& operator =(const TensorDimension& copyFrom)
168  {
169  n = copyFrom.n;
170  c = copyFrom.c;
171  h = copyFrom.h;
172  w = copyFrom.w;
173  return *this;
174  }
175 
177  inline bool operator ==(const TensorDimension& other) const
178  {
179  return (n == other.n) && (c == other.c) && (h == other.h) && (w == other.w);
180  }
181 
183  inline bool operator !=(const TensorDimension& other) const
184  {
185  return !(*this == other);
186  }
187 
190  inline std::size_t elementCount() const
191  {
192  return n * c * h *w;
193  }
194  };
195 
196  // The Neural plugin ABI assumes a TensorDimension remains a POD type.
197  static_assert(std::is_standard_layout<TensorDimension>::value, "TensorDimension must be standard layout");
198 
200  class Float16
201  {
202  public:
204  std::uint16_t data = 0u;
205 
207  Float16() = default;
208 
210  Float16(const Float16& copyFrom);
211 
213  explicit Float16(float value);
214 
216  inline Float16& operator=(double value)
217  {
218  *this = Float16(static_cast<float>(value));
219  return *this;
220  }
221 
223  inline Float16& operator =(const Float16& copyFrom)
224  {
225  data = copyFrom.data;
226  return *this;
227  }
228 
230  operator float() const;
231  };
232 
238  enum class NetworkBackendId : std::uint32_t
239  {
241  Invalid = 0,
242 
243  TestOnly = 1,
244  Cpu = 2,
245  Cuda = 3,
246 
247  CustomBase = 0x4000u,
248  };
249 
258  enum class ActivationFunctionId : std::uint32_t
259  {
260  None = 0,
261  ReLU = 1,
262  LeakyReLU = 2,
263  LeakySigmoid = 3,
264  LeakyTanh = 4,
265  Tanh = 5,
266  Sigmoid = 6,
267  Softmax = 7,
268  Sine = 8,
269 
270  CustomBase = 0x4000u,
271  };
272 
274  enum class NeuralResult : std::int32_t
275  {
276  // *If* we need them, additional success codes will go here (e.g., S_FALSE = -1)
277  Success = 0,
278  Failure = 1,
279  Unsupported = 2,
280  // *If* we need them, additional failure codes will go here (e.g., E_POINTER = 3)
281  };
282 
284  inline constexpr bool succeeded(NeuralResult result) noexcept
285  {
286  return result <= NeuralResult::Success;
287  }
289  inline constexpr bool failed(NeuralResult result) noexcept
290  {
291  return result >= NeuralResult::Failure;
292  }
293 
299  enum class ImageSpace : std::uint32_t
300  {
301  Invalid = 0,
302  RgbNormalized = 1,
303  RgbCentered = 2,
304 
305  CustomBase = 0x4000u,
306  };
307 
343  {
344  public:
346  using RefCount = std::uint32_t;
347 
349  using TypeId = std::uint64_t;
350 
352  static const TypeId typeID = 0x14ecc3f9de638e1dul;
353 
357  virtual RefCount addRef() const noexcept = 0;
358 
363  virtual RefCount release() const noexcept = 0;
364 
384  virtual void* queryInterface(TypeId interface) noexcept = 0;
385 
387  virtual const void* queryInterface(TypeId interface) const noexcept = 0;
388 
389  protected:
392  virtual ~IRefObject() = default;
393  };
394 
401  template<typename TInterface>
402  struct InterfaceOf
403  {
405  static constexpr IRefObject::TypeId value = TInterface::typeID;
406  };
407 
413  class ILogger : public IRefObject
414  {
415  public:
417  static const IRefObject::TypeId typeID = 0xd74335d06aa1ba61ul;
418 
424  using VerbosityLevel = std::int32_t;
425 
433  virtual VerbosityLevel verbosity() const noexcept = 0;
434 
442  virtual NeuralResult log(VerbosityLevel verbosity, const char* format, ...) noexcept = 0;
443 
456  virtual NeuralResult logWarning(VerbosityLevel verbosity, const char* format, ...) noexcept = 0;
457 
474  virtual NeuralResult logError(VerbosityLevel verbosity, const char* format, ...) noexcept = 0;
475  };
476 
483  {
484  public:
486  static const IRefObject::TypeId typeID = 0x310ca743db44232dul;
487 
489  virtual std::uint32_t apiVersion() const noexcept = 0;
490  };
491 
493  class IWeightsData : public IRefObject
494  {
495  public:
497  static const IRefObject::TypeId typeID = 0xba912359795313f3ul;
498 
500  virtual NetworkBackendId backendId() const noexcept = 0;
501 
503  virtual TensorFormat tensorFormat() const noexcept = 0;
504 
506  virtual TensorDimension dimension() const noexcept = 0;
507 
510  virtual bool memManagedExternally() const noexcept = 0;
511 
517  virtual const void* data() const noexcept = 0;
518  };
519 
524  class IWeightsLoader : public IRefObject
525  {
526  public:
528  static const IRefObject::TypeId typeID = 0x5bac8f6ca68c52b6ul;
529 
536  virtual NeuralResult getWeightsForLayer(IWeightsData** ppWeightsDataOut, const INetworkRuntime* pNetwork, const ILayer* pLayer, const char* pName) const noexcept = 0;
537  };
538 
544  {
545  public:
547  static const IRefObject::TypeId typeID = 0x9874b8d21b0c9697ul;
548 
553  virtual NeuralResult optionsRefreshed(const ILayer* pLayer) noexcept = 0;
554  };
555 
571  {
572  public:
574  static const IRefObject::TypeId typeID = 0x1ec1c40bfc1e45a4ul;
575 
577  using LibraryId = std::uint64_t;
578 
580  virtual LibraryId libraryId() const noexcept = 0;
581 
587  virtual NeuralResult synchronize(INetworkBackend* pBackend) noexcept = 0;
588 
594  virtual NeuralResult bindCurrentThread(INetworkBackend* pBackend) noexcept = 0;
595  };
596 
603  {
604  public:
606  static const IRefObject::TypeId typeID = 0xf78683bf5a3d24a9ul;
607 
612  virtual NeuralResult getDeviceIdentifiers(std::uint64_t* pUuidLow, std::uint64_t* pUuidHigh) const noexcept = 0;
613 
619  virtual const char* getDeviceName() const noexcept = 0;
620  };
621 
623  class MemoryHandle__type;
624 
626  using MemoryHandle = MemoryHandle__type*;
627 
630  enum class MemorySemantic : std::uint32_t
631  {
632  Unspecified = 0u,
633  Tensor = 1u,
634  Weights = 2u,
635  Ephemeral = 3u,
636 
637  CustomBase = 0x4000u
638  };
639 
643  {
644  public:
646  static const IRefObject::TypeId typeID = 0xacd7828da90108ddul;
647 
660 
662  enum class OptimizationCapability : std::uint64_t
663  {
669  SkipConcatenation = 0xdd13d58fbabb2f5bul,
670 
677  FuseBatchNormAndConvolution = 0xeaffe6d9a4acfdc9ul,
678  };
679 
686  virtual bool supportsOptimization(OptimizationCapability optimization) const noexcept = 0;
687 
689 
692 
702  virtual NeuralResult initializeFromDeviceOrdinal(std::uint32_t deviceOrdinal) noexcept = 0;
703 
714  virtual NeuralResult initializeFromDeviceIdentifier(const IBackendDeviceIdentifier* pDeviceIdentifier) noexcept = 0;
715 
720  virtual const IBackendDeviceIdentifier* deviceIdentifier() const noexcept = 0;
721 
723 
725  virtual NetworkBackendId id() const noexcept = 0;
726 
728  virtual NeuralResult synchronize() noexcept = 0;
729 
731  virtual NeuralResult bindCurrentThread() noexcept = 0;
732 
734  virtual NeuralResult transformTensor(
735  void* pDeviceDestination,
736  TensorFormat destinationFormat,
737  TensorDimension destinationSize,
738  const void* pDeviceSource,
739  TensorFormat sourceFormat,
740  TensorDimension sourceSize) noexcept = 0;
741 
744 
746  virtual NeuralResult setDeviceMemory(void* pDeviceDestination, std::uint8_t value, std::size_t byteCount) noexcept = 0;
747 
749  virtual NeuralResult copyMemoryD2D(void* pDeviceDestination, const void* pDeviceSource, std::size_t byteCount) noexcept = 0;
750 
752  virtual NeuralResult copyMemoryH2D(void* pDeviceDestination, const void* pHostSource, std::size_t byteCount) noexcept = 0;
753 
755  virtual NeuralResult copyMemoryD2H(void* pHostDestination, const void* pDeviceSource, std::size_t byteCount) noexcept = 0;
756 
758 
771 
779  virtual NeuralResult registerLibraryContext(ILibraryContext* pLibraryContext) noexcept = 0;
780 
785  virtual ILibraryContext* getLibraryContext(ILibraryContext::LibraryId libraryId) noexcept = 0;
786 
788  virtual const ILibraryContext* getLibraryContext(ILibraryContext::LibraryId libraryId) const noexcept = 0;
789 
791 
794 
803  virtual NeuralResult allocateMemoryBlock(MemoryHandle* pHandle, size_t byteCount) noexcept = 0;
804 
810  virtual NeuralResult freeMemoryBlock(MemoryHandle handle) noexcept = 0;
811 
819  virtual void* getAddressForMemoryBlock(MemoryHandle handle) noexcept = 0;
820 
828  virtual size_t getSizeForMemoryBlock(MemoryHandle handle) noexcept = 0;
829 
835  virtual NeuralResult lockMemoryBlock(MemoryHandle handle) noexcept = 0;
836 
842  virtual NeuralResult unlockMemoryBlock(MemoryHandle handle) noexcept = 0;
843 
845  virtual MemoryHandle updateTensor(
846  const ILayer* pLayer,
847  INetworkRuntime* pNetwork,
848  TensorFormat format,
849  MemoryHandle hOriginal,
850  TensorDimension stepping,
851  TensorDimension internalDimensions) noexcept = 0;
852 
854 
857 
859  virtual NeuralResult clearLoadedWeights() noexcept = 0;
860 
872  virtual NeuralResult uploadWeights(
873  const void** ppUploadedWeightsOut,
874  const ILayer* pLayer,
875  const IWeightsLoader* pOriginWeightLoader,
876  const char* pName,
877  const void* pWeightsData,
878  std::size_t weightsDataSize,
879  TensorDimension weightsDim,
880  TensorFormat format,
881  bool memManagedExternally) noexcept = 0;
882 
894  virtual const void* getAddressForWeightsData(const ILayer* pLayer, const IWeightsLoader* pOriginWeightLoader, const char* pName, TensorFormat format) const noexcept = 0;
895 
906  virtual NeuralResult getDimensionsForWeightsData(TensorDimension* pDimensionOut, const ILayer* pLayer, const IWeightsLoader* pOriginWeightLoader, const char* pName, TensorFormat format) const noexcept = 0;
907 
913  virtual NeuralResult getWeightsNamesForLayer(IStringList** ppListOut, const ILayer* pLayer, const IWeightsLoader* pOriginWeightLoader) const noexcept = 0;
914 
916 
924  virtual NeuralResult saveImage(const ILayer* pLayer, const INetworkRuntime* pNetwork, IImage* pImage, ImageSpace imageSpace, size_t channels) noexcept = 0;
925  };
926 
931  {
936  std::size_t structSize;
937 
939  std::size_t peakCommittedMemory;
940 
943  std::size_t peakRequestedMemory;
944 
948 
953  };
954 
958  {
959  public:
961  static const IRefObject::TypeId typeID = 0x02793dfd8bfde737ul;
962 
964 
972 
990  virtual NeuralResult allocateMemoryBlock(MemoryHandle* pHandle, size_t byteCount, const char* pTrackingKey) noexcept = 0;
991 
1001  virtual const MemoryTrackingData* getMemoryTrackingData(const char* pTrackingKey, const char* pTrackingSubkey) const noexcept = 0;
1002 
1016  virtual NeuralResult getMemoryTrackingKeys(IStringList** ppKeysOut) noexcept = 0;
1017 
1031  virtual NeuralResult getMemoryTrackingSubkeys(const char* pTrackingKey, IStringList** ppKeysOut) noexcept = 0;
1032 
1045  virtual NeuralResult setMemoryTrackingKey(const char* pTrackingKey, const char* pTrackingSubkey) noexcept = 0;
1046 
1048 
1049  };
1050 
1059  class ILayerList : public IRefObject
1060  {
1061  public:
1063  static const IRefObject::TypeId typeID = 0x28d94b933a3b0dabul;
1064 
1066  virtual size_t layerCount() const noexcept = 0;
1067 
1072  virtual ILayer* getLayerByIndex(size_t layerIndex) const noexcept = 0;
1073  };
1074 
1078  class IStringList : public IRefObject
1079  {
1080  public:
1082  static const IRefObject::TypeId typeID = 0x5952141d72c5cda0ul;
1083 
1085  virtual size_t stringCount() const noexcept = 0;
1086 
1096  virtual const char* getStringByIndex(size_t stringIndex) const noexcept = 0;
1097 
1104  virtual size_t getStringSizeByIndex(size_t stringIndex) const noexcept = 0;
1105  };
1106 
1107  class INetworkDebugger; // forward reference
1108 
1111  {
1112  public:
1114  static const IRefObject::TypeId typeID = 0xde9c8f7c71a9dcbaul;
1115 
1117  virtual size_t debuggerCount() const noexcept = 0;
1118 
1123  virtual INetworkDebugger* getNetworkDebuggerByIndex(size_t index) const noexcept = 0;
1124  };
1125 
1129  {
1130  public:
1132  static const IRefObject::TypeId typeID = 0x53191c073f990992ul;
1133 
1135  virtual const char* networkName() const noexcept = 0;
1136 
1141  virtual INetworkBackend* getBackend(NetworkBackendId backendId) noexcept = 0;
1142 
1144  virtual const INetworkBackend* getBackend(NetworkBackendId backendId) const noexcept = 0;
1145 
1150  virtual NeuralResult defaultForwardActivation(ILayer* pLayer) const noexcept = 0;
1151 
1153  virtual IWeightsLoader* weightsLoader() const noexcept = 0;
1154 
1156  virtual NetworkBackendId defaultBackendId() const noexcept = 0;
1157 
1159  virtual TensorFormat defaultTensorFormat() const noexcept = 0;
1160 
1164  virtual NeuralResult reshapeLater(ILayer* pLayer) noexcept = 0;
1165 
1168 
1170  virtual size_t layerCount() const noexcept = 0;
1171 
1176  virtual ILayer* getLayerByName(const char* pLayerName) const noexcept = 0;
1177 
1183  virtual NeuralResult getAllLayers(ILayerList** ppListOut) const noexcept = 0;
1184 
1192  virtual NeuralResult getInputLayers(ILayerList** ppListOut) const noexcept = 0;
1193 
1200  virtual NeuralResult getOutputLayers(ILayerList** ppListOut) const noexcept = 0;
1201 
1206  virtual NeuralResult getDependentLayers(ILayerList** ppListOut, const ILayer* pLayer) const noexcept = 0;
1207 
1213  virtual NeuralResult getAcceptorLayers(ILayerList** ppListOut, const ILayer* pLayer) const noexcept = 0;
1214 
1219  virtual NeuralResult getInfluenceLayers(ILayerList** ppListOut, const ILayer* pLayer) const noexcept = 0;
1220 
1222 
1229  virtual NeuralResult setAffectedForward(ILayer* pLayer) noexcept = 0;
1230 
1239  virtual void* getTensor(const ILayer* pDataLayer, const ILayer* pRequestingLayer, TensorFormat format) noexcept = 0;
1240 
1250  virtual void* getInternalTensor(const ILayer* pLayer, NetworkBackendId backendId) noexcept = 0;
1251 
1263  virtual NeuralResult mapLayerAsWeightsData(const ILayer* pDataLayer, const ILayer* pWeightsLayer, const char* pWeightsName) noexcept = 0;
1264 
1276  virtual const void* getWeightsForLayer(const ILayer* pLayer, const char* pWeightsName, NetworkBackendId backendId, TensorFormat format) noexcept = 0;
1277 
1285  virtual NeuralResult getWeightsDimensionForLayer(
1286  TensorDimension* pDimensionsOut,
1287  const ILayer* pLayer,
1288  const char* pWeightsName,
1289  NetworkBackendId backendId,
1290  TensorFormat format) noexcept = 0;
1291 
1299  virtual TensorDimension getLayerInternalDimensions(const ILayer* pLayer) const noexcept = 0;
1300  };
1301 
1310  enum class ParamType : std::uint16_t
1311  {
1312  String = 0,
1313  SizeT = 1,
1314  Float = 2,
1315  Enumeration = 3,
1316  Dimension = 4,
1317  Bool = 5,
1318  MaxParam,
1319  CustomBase = 0x4000u,
1320  };
1321 
1326  {
1329  std::size_t structSize;
1330 
1333  };
1334 
1337  {
1339  const char* pParamName;
1340 
1342  const char* pParamValue;
1343  };
1344 
1356  {
1359 
1361  std::size_t maxDimensions;
1362 
1364  std::size_t minDimensions;
1365 
1368 
1378  };
1379 
1391  {
1394 
1396  std::size_t optionCount;
1397 
1402  const char* const* pOptions;
1403 
1406 
1416  };
1417 
1423  {
1426 
1430 
1433 
1443  };
1444 
1448  struct ParamDesc
1449  {
1451  std::size_t structSize;
1452 
1457  const char* pName;
1458 
1463  const char* pDefault;
1464 
1469 
1474  const char* pDocumentation;
1475 
1481  };
1482 
1489  namespace common_categories
1490  {
1491  const char* const General = "General";
1492  const char* const InputOutput = "Input/Output";
1493  const char* const Training = "Training";
1494  const char* const FormatConversion = "Format Conversion";
1495  const char* const Shape = "Shape";
1496  const char* const Upsampling = "Upsampling";
1497  const char* const Fused = "Fused";
1498  const char* const Examples = "Examples";
1499  const char* const DataImageProcessing = "Data/Image Processing";
1500  const char* const DomainSpecific = "Domain Specific";
1501  const char* const DevelopmentAids = "Development Aids";
1502  const char* const Analysis = "Analysis";
1503  const char* const DefaultHidden = "Hidden";
1504  const char* const NoActivation = "No Activation";
1505  } // namespace nvneural::common_categories
1506 
1517  enum class LayerInputType : std::uint16_t
1518  {
1519  Primary = 0,
1520  PrimaryInfinite = 1,
1521  Secondary = 2,
1522  CustomBase = 0x4000u
1523  };
1524 
1527  {
1529  std::size_t structSize;
1530 
1535  const char* pName;
1536 
1541  const char* pDocumentation;
1542 
1547  };
1548 
1549 
1553  struct LayerDesc
1554  {
1558  std::size_t structSize;
1559 
1566  const char* pObjectClass;
1567 
1572  const char* pSerializedName;
1573 
1578  const char* pDocumentation;
1579 
1583  const char* pDisplayName;
1584 
1587  std::size_t numCategories;
1588 
1592  const char* const* ppCategories;
1593 
1598 
1603 
1606  std::size_t numInputs;
1607 
1612 
1615 
1620  std::size_t numParameters;
1621 
1627  };
1628 
1634  {
1638  std::size_t structSize;
1639 
1644  const char* pObjectClass;
1645 
1649  const char* pSerializedName;
1650 
1653  const char* pDocumentation;
1654 
1660  const char* pDisplayName;
1661 
1664 
1671 
1675 
1678  std::size_t numParameters;
1679 
1684  };
1685 
1687  enum class CompilationLevel : std::uint16_t
1688  {
1689  CompiledBinary = 0,
1690  JitIntermediate = 1,
1691  JitSource = 2,
1692  };
1693 
1697  {
1701  std::size_t structSize;
1702 
1707  const char* pObjectClass;
1708 
1713  const char* pSerializedName;
1714 
1718  const char* pDisplayName;
1719 
1724 
1727 
1730  };
1731 
1737  typedef bool (*PrototypeRuntimeValidatorFunction)(const INetwork* pNetwork);
1738 
1780  struct FusingRule
1781  {
1784  std::uint32_t syntaxVersion;
1785 
1788  const char* pFusingRule;
1789  };
1790 
1801  {
1802  public:
1804  static const IRefObject::TypeId typeID = 0x261ae312ee3c4979ul;
1805 
1810  virtual NeuralResult importPlugin(IPlugin* pPlugin) = 0;
1811 
1818  virtual NeuralResult importPluginLoader(IPluginLoader* pPluginLoader) = 0;
1819 
1821  virtual std::size_t exportedActivationsCount() const noexcept = 0;
1822 
1828  virtual const ActivationDesc* exportedActivationByIndex(std::size_t index) const noexcept = 0;
1829 
1831  virtual std::size_t exportedLayersCount() const noexcept = 0;
1832 
1838  virtual const LayerDesc* exportedLayerByIndex(std::size_t index) const noexcept = 0;
1839 
1841  virtual std::size_t exportedFusingRulesCount() const noexcept = 0;
1842 
1848  virtual const FusingRule* exportedFusingRuleByIndex(std::size_t index) const noexcept = 0;
1849 
1851  virtual std::size_t exportedPrototypesCount() const noexcept = 0;
1852 
1858  virtual const PrototypeDesc* exportedPrototypeByIndex(std::size_t index) const noexcept = 0;
1859 
1865  virtual PrototypeRuntimeValidatorFunction exportedPrototypeRuntimeValidatorByIndex(std::size_t index) const noexcept = 0;
1866 
1873  virtual NeuralResult createObject(IRefObject** ppOut, const char* pObjectClass) const noexcept = 0;
1874 
1880  virtual bool isPrototypeRuntimeCompatible(const char* pPrototypeObjectClass, const INetwork* pNetwork) const = 0;
1881  };
1882 
1889  {
1890  public:
1892  static const IRefObject::TypeId typeID = 0x4f0ffb1d41d49fcul;
1893 
1896 
1901  virtual NeuralResult getInteger(const char* pParameterName, std::int32_t* pIntOut) const noexcept = 0;
1902 
1907  virtual NeuralResult getSize(const char* pParameterName, std::size_t* pSizeOut) const noexcept = 0;
1908 
1913  virtual NeuralResult getFloat(const char* pParameterName, float* pFloatOut) const noexcept = 0;
1914 
1919  virtual NeuralResult getString(const char* pParameterName, const char** pStringOut) const noexcept = 0;
1920 
1930  virtual NeuralResult getDimension(const char* pParameterName, TensorDimension* pDimOut) const noexcept = 0;
1931 
1933 
1936 
1941  virtual NeuralResult setInteger(const char* pParameterName, std::int32_t value) noexcept = 0;
1942 
1947  virtual NeuralResult setSize(const char* pParameterName, std::size_t value) noexcept = 0;
1948 
1953  virtual NeuralResult setFloat(const char* pParameterName, float value) noexcept = 0;
1954 
1959  virtual NeuralResult setString(const char* pParameterName, const char* pString) noexcept = 0;
1960 
1965  virtual NeuralResult setDimension(const char* pParameterName, TensorDimension value) noexcept = 0;
1966 
1968  };
1969 
1971  class IImage : public IRefObject
1972  {
1973  public:
1975  static const IRefObject::TypeId typeID = 0x2a21f61fbfee3221ul;
1976 
1980  virtual NeuralResult resize(std::size_t height, std::size_t width, std::size_t channels) noexcept = 0;
1981 
1983  virtual std::size_t height() const noexcept = 0;
1984 
1986  virtual std::size_t width() const noexcept = 0;
1987 
1989  virtual std::size_t channels() const noexcept = 0;
1990 
1994  virtual std::size_t elements() const noexcept = 0;
1995 
1999  virtual std::uint8_t* data() noexcept = 0;
2000 
2002  virtual const std::uint8_t* data() const noexcept = 0;
2003  };
2004 
2015  {
2016  public:
2018  static const IRefObject::TypeId typeID = 0x66e36120ed8745d8ul;
2019 
2021  virtual NeuralResult setNetworkRuntime(INetworkRuntime* pNetwork) noexcept = 0;
2022 
2024  virtual NeuralResult invoke(ILayer* pLayer) noexcept = 0;
2025 
2031  virtual const char* serializedType() const noexcept = 0;
2032  };
2033 
2034 } // namespace nvneural
2035 
2036 #endif // NVNEURAL_CORETYPES_H
@ Tensor
This order is used for parameters that typically describe tensor dimensions.
MemorySemantic
Describes the intended purpose of allocated GPU memory.
Definition: CoreTypes.h:631
@ Ephemeral
Memory used for short-lived scratch computations.
@ Unspecified
Generic allocation type, not tagged for any specific use.
@ Weights
Memory used for weights data; typically long-lived.
constexpr bool failed(NeuralResult result) noexcept
Helper function akin to COM's FAILED() macro.
Definition: CoreTypes.h:289
const std::uint32_t ApiVersion
API version set.
Definition: CoreTypes.h:52
TensorDataType
Enumeration describing common tensor element types.
Definition: CoreTypes.h:60
@ Float
32-bit floating point elements (float)
@ CompressedPng
NV Internal: Used to transit png like tensor between host and inference target.
@ CustomBase
Custom entries in this enum should use IDs numerically higher than this value.
@ Invalid
Invalid value used to guard against uninitialized variables.
@ UncompressedRgb
NV Internal: Used to send uncompressed R8G8B8 data between tools.
@ TestOnly
Only used in a testing environment.
@ Half
16-bit floating point elements (__half)
ImageSpace
ImageSpace values refer to specific tensor representations of image data.
Definition: CoreTypes.h:300
@ RgbNormalized
RGB normalized to unit range; range is [0, 1].
@ RgbCentered
RGB centered around 0; range is [-1, 1].
TensorDataLayout
Enumeration describing common tensor data layouts.
Definition: CoreTypes.h:77
LayerInputType
This enum describes what type a particular input is for the layer.
Definition: CoreTypes.h:1518
@ Primary
Most inputs are "primary" inputs.
@ Secondary
Represents an input that is typically provided by the weights system.
@ PrimaryInfinite
Layers like concat and element_wise can take arbitrary numbers of inputs. Define one of these.
MemoryHandle__type * MemoryHandle
Opaque typedef used to represent INetworkBackend memory handles.
Definition: CoreTypes.h:626
constexpr bool succeeded(NeuralResult result) noexcept
Helper function akin to COM's SUCCEEDED() macro.
Definition: CoreTypes.h:284
NetworkBackendId
Enumeration describing common network backends.
Definition: CoreTypes.h:239
@ Cpu
Pure CPU code, no GPU involvement (largely unused)
@ Cuda
CUDA/cuDNN backend.
ParamType
This enum describes what type a particular parameter.
Definition: CoreTypes.h:1311
@ MaxParam
Should also be the next number for new non-custom types.
CompilationLevel
This enum represent kernel type contained by a prototype layer.
Definition: CoreTypes.h:1688
@ JitIntermediate
Examples: PTX, SPIR-V, or a compiled HLSL shader.
@ CompiledBinary
Example: SASS.
@ JitSource
Examples: CUDA C++, GLSL, or HLSL.
ActivationFunctionId
Enumeration describing common activation functions.
Definition: CoreTypes.h:259
@ LeakySigmoid
Leaky sigmoid ([0] = negative slope, [1] = positive slope)
@ Sine
Sine (also known as SIREN)
@ LeakyTanh
Leaky tanh ([0] = negative slope, [1] = positive slope)
@ LeakyReLU
Leaky ReLU ([0] = slope)
@ Tanh
Hyperbolic tangent.
@ ReLU
ReLU ([0] = minimum value to return)
NeuralResult
NeuralResult is a generic success/failure result type similar to COM HRESULT.
Definition: CoreTypes.h:275
@ Success
Operation succeeded. Generic result.
@ Unsupported
Operation failed and will not pass on a retry (not implemented or logic error).
@ Failure
Operation failed. Generic result.
Float16 is a CPU-side implementation of half-precision floating point (aka FP16).
Definition: CoreTypes.h:201
Float16()=default
Default constructor, initializes to zero.
Float16 & operator=(double value)
Assignment operator from float/double.
Definition: CoreTypes.h:216
std::uint16_t data
Sized integer containing the float16 value.
Definition: CoreTypes.h:204
IActivationFunction represents a functor that can perform a specific activation function.
Definition: CoreTypes.h:2015
virtual const char * serializedType() const noexcept=0
Retrieves the type of the activation function.
virtual NeuralResult setNetworkRuntime(INetworkRuntime *pNetwork) noexcept=0
Sets the owning network runtime. Will be called before any call to invoke.
virtual NeuralResult invoke(ILayer *pLayer) noexcept=0
Performs activation for a layer.
The IApiVersionQuery interface provides this object's compiled-in ApiVersion.
Definition: CoreTypes.h:483
virtual std::uint32_t apiVersion() const noexcept=0
Returns the value of ApiVersion used to build this object.
IBackendDeviceIdentifier is an opaque identifier for an active GPU.
Definition: CoreTypes.h:603
virtual const char * getDeviceName() const noexcept=0
Retrieves the name of this GPU.
virtual NeuralResult getDeviceIdentifiers(std::uint64_t *pUuidLow, std::uint64_t *pUuidHigh) const noexcept=0
Retrieves a pair of values that uniquely identify this GPU on the local system.
Common class registry for instantiating objects and collecting plugin-provided descriptors.
Definition: CoreTypes.h:1801
virtual NeuralResult importPluginLoader(IPluginLoader *pPluginLoader)=0
Imports all plugins loaded by a plugin loader.
virtual NeuralResult importPlugin(IPlugin *pPlugin)=0
Imports everything (layer, activation, fusing rules, and prototypes) registered with a single plugin.
virtual std::size_t exportedActivationsCount() const noexcept=0
Returns the count of registered activation functions.
IImage represents a bitmap image in system memory.
Definition: CoreTypes.h:1972
virtual std::size_t height() const noexcept=0
Returns the height of the image in pixels.
virtual NeuralResult resize(std::size_t height, std::size_t width, std::size_t channels) noexcept=0
Clears the image and reserves storage.
ILayer is the base class for neural network layers.
Definition: LayerTypes.h:59
ILayerList represents an immutable collection of ILayer pointers.
Definition: CoreTypes.h:1060
virtual size_t layerCount() const noexcept=0
Returns the number of layers in this collection.
ILibraryContext is a generic library handle wrapper.
Definition: CoreTypes.h:571
std::uint64_t LibraryId
Library IDs should be generated randomly similar to interface IDs.
Definition: CoreTypes.h:577
virtual LibraryId libraryId() const noexcept=0
Retrieves a stable identifier for the library being tracked in this object.
Logger interface class.
Definition: CoreTypes.h:414
virtual VerbosityLevel verbosity() const noexcept=0
Retrieves the current verbosity level.
std::int32_t VerbosityLevel
Typedef for verbosity levels.
Definition: CoreTypes.h:424
INetworkBackend2 is a revision of INetworkBackend.
Definition: CoreTypes.h:958
virtual NeuralResult allocateMemoryBlock(MemoryHandle *pHandle, size_t byteCount, const char *pTrackingKey) noexcept=0
Allocates a memory block of the requested size and allows tracking of the memory block using a user-d...
virtual NeuralResult setMemoryTrackingKey(const char *pTrackingKey, const char *pTrackingSubkey) noexcept=0
Sets a potential tracking key.
virtual NeuralResult getMemoryTrackingKeys(IStringList **ppKeysOut) noexcept=0
Returns an IStringList of the currently tracked keys.
virtual const MemoryTrackingData * getMemoryTrackingData(const char *pTrackingKey, const char *pTrackingSubkey) const noexcept=0
Compiles and returns memory data for the given key.
virtual NeuralResult getMemoryTrackingSubkeys(const char *pTrackingKey, IStringList **ppKeysOut) noexcept=0
Returns an IStringList of the subkeys of given tracking key.
INetworkBackend is a runtime-specific interface for CUDA, DirectX, or other system- specific operatio...
Definition: CoreTypes.h:643
virtual bool supportsOptimization(OptimizationCapability optimization) const noexcept=0
Returns true if the indicated optimization is applicable to this backend.
virtual const IBackendDeviceIdentifier * deviceIdentifier() const noexcept=0
Retrieves an opaque device identifier object corresponding to the device associated with this backend...
virtual NeuralResult allocateMemoryBlock(MemoryHandle *pHandle, size_t byteCount) noexcept=0
Allocates a memory block of the requested size.
virtual NeuralResult initializeFromDeviceIdentifier(const IBackendDeviceIdentifier *pDeviceIdentifier) noexcept=0
Initializes the backend to point to a specific device identifier.
OptimizationCapability
List of optional optimizations supported by backends.
Definition: CoreTypes.h:663
virtual NeuralResult initializeFromDeviceOrdinal(std::uint32_t deviceOrdinal) noexcept=0
Initializes the backend to point to a specific device ordinal.
INetworkDebugger defines a callback interface for network inference.
Definition: NetworkTypes.h:51
INetworkDebuggerList represents an immutable collection of INetworkDebugger pointers.
Definition: CoreTypes.h:1111
virtual size_t debuggerCount() const noexcept=0
INetwork is the public interface to Network.
Definition: NetworkTypes.h:119
INetworkRuntime is a subset of the basic network interface that is accessible from layer classes duri...
Definition: CoreTypes.h:1129
virtual const char * networkName() const noexcept=0
Retrieves the name of this network as a UTF-8 string.
Represents a serialized parameter block in a model definition.
Definition: CoreTypes.h:1889
virtual NeuralResult setInteger(const char *pParameterName, std::int32_t value) noexcept=0
Saves an integer.
virtual NeuralResult getString(const char *pParameterName, const char **pStringOut) const noexcept=0
Retrieves a UTF-8 string value.
virtual NeuralResult setString(const char *pParameterName, const char *pString) noexcept=0
Saves a UTF-8 string value.
virtual NeuralResult getSize(const char *pParameterName, std::size_t *pSizeOut) const noexcept=0
Retrieves an unsigned integer value that can represent the result of sizeof().
virtual NeuralResult setFloat(const char *pParameterName, float value) noexcept=0
Saves a floating-point value.
virtual NeuralResult getFloat(const char *pParameterName, float *pFloatOut) const noexcept=0
Retrieves a floating-point value.
virtual NeuralResult getDimension(const char *pParameterName, TensorDimension *pDimOut) const noexcept=0
Retrieves a tensor dimension.
virtual NeuralResult setSize(const char *pParameterName, std::size_t value) noexcept=0
Saves an unsigned integer that can represent the result of sizeof().
virtual NeuralResult setDimension(const char *pParameterName, TensorDimension value) noexcept=0
Saves a tensor dimension.
virtual NeuralResult getInteger(const char *pParameterName, std::int32_t *pIntOut) const noexcept=0
Retrieves a signed integer value.
IPlugin is the general factory interface used by NvNeural's plugin system.
Definition: PluginTypes.h:41
Platform-agnostic plugin loader interface.
Definition: PluginTypes.h:200
Base class for all objects, similar to COM's IUnknown.
Definition: CoreTypes.h:343
virtual void * queryInterface(TypeId interface) noexcept=0
Retrieves a new object interface pointer.
static const TypeId typeID
Interface TypeId for InterfaceOf purposes.
Definition: CoreTypes.h:352
std::uint64_t TypeId
Every interface must define a unique TypeId. This should be randomized.
Definition: CoreTypes.h:349
std::uint32_t RefCount
Typedef used to track the number of active references to an object.
Definition: CoreTypes.h:346
virtual RefCount addRef() const noexcept=0
Increments the object's reference count.
virtual RefCount release() const noexcept=0
Decrements the object's reference count and destroy the object if the reference count reaches zero.
IRuntimeOptionsHost is an interface that provides runtime option communication from the layer to the ...
Definition: CoreTypes.h:544
virtual NeuralResult optionsRefreshed(const ILayer *pLayer) noexcept=0
Layers should call this when the options have changed, but not when the value for the option has chan...
IStringList represents an immutable collection of strings.
Definition: CoreTypes.h:1079
virtual size_t stringCount() const noexcept=0
IWeightsData represents a binary buffer provided by IWeightsLoader.
Definition: CoreTypes.h:494
virtual NetworkBackendId backendId() const noexcept=0
Returns the backend for which this weights data is relevant.
IWeightsLoader is an interface that provides weights to layers.
Definition: CoreTypes.h:525
virtual NeuralResult getWeightsForLayer(IWeightsData **ppWeightsDataOut, const INetworkRuntime *pNetwork, const ILayer *pLayer, const char *pName) const noexcept=0
Retrieves a weights data buffer in a canonical format.
const char *const Analysis
Category for visualization and analysis layers.
Definition: CoreTypes.h:1502
const char *const Examples
Category for demonstration layers.
Definition: CoreTypes.h:1498
const char *const DataImageProcessing
Category for layers that do image processing.
Definition: CoreTypes.h:1499
const char *const Fused
Category for layers that fuse multiple operations.
Definition: CoreTypes.h:1497
const char *const Training
Category for layers that represent training-only concepts.
Definition: CoreTypes.h:1493
const char *const Shape
Category for layers that adjust tensor shape.
Definition: CoreTypes.h:1495
const char *const InputOutput
Category for layers that interact with their host application.
Definition: CoreTypes.h:1492
const char *const DevelopmentAids
Category for layers that aid framework development.
Definition: CoreTypes.h:1501
const char *const DefaultHidden
Category for layers that should be hidden in the editor by default.
Definition: CoreTypes.h:1503
const char *const General
Category for layers that don't fit other categories.
Definition: CoreTypes.h:1491
const char *const Upsampling
Category for layers that upscale their input.
Definition: CoreTypes.h:1496
const char *const NoActivation
Category for layers that do not support activation.
Definition: CoreTypes.h:1504
const char *const DomainSpecific
Category for layers that implement specialized operations.
Definition: CoreTypes.h:1500
const char *const FormatConversion
Category for layers that permute and shuffle data.
Definition: CoreTypes.h:1494
Structure describing an activation function (IActivationFunction) for tool interfaces and network bui...
Definition: CoreTypes.h:1634
std::size_t structSize
This is the sizeof() this struct.
Definition: CoreTypes.h:1638
ActivationFunctionId activationFunction
This is the activation function ID implemented by this activation function.
Definition: CoreTypes.h:1663
std::size_t numParameters
This is the number of parameters supported for this activation.
Definition: CoreTypes.h:1678
TensorFormat tensorFormat
This is the tensor format supported by this activation function.
Definition: CoreTypes.h:1674
NetworkBackendId backend
This is the backend identifier supported by this instance of the activation function.
Definition: CoreTypes.h:1670
const char * pDocumentation
An optional human-readable descriptive text.
Definition: CoreTypes.h:1653
const ParamDesc * pParameters
This is the pointer to the contiguous memory of ParamDesc structs.
Definition: CoreTypes.h:1683
const char * pSerializedName
This is the name used to represent the activation function in serialized form.
Definition: CoreTypes.h:1649
const char * pObjectClass
This is the programmatic class name used to instantiate the activation object through the IPlugin::cr...
Definition: CoreTypes.h:1644
const char * pDisplayName
An optional human-readable layer name.
Definition: CoreTypes.h:1660
For implementers, this struct needs to be replicated in each xParamTypeDesc right now.
Definition: CoreTypes.h:1326
ParamType paramType
This for additional safety and reference. Should replicate the xParamDesc::paramType.
Definition: CoreTypes.h:1332
std::size_t structSize
This is the sizeof() the xParamTypeDesc struct that contains this struct.
Definition: CoreTypes.h:1329
The DimensionParamTypeDesc further describes a parameter for the plugin and is pointed to from the hi...
Definition: CoreTypes.h:1356
const ParamDependencyDesc * pParamDependencies
This is the array of parameter dependency with paramDependenciesCount members.
Definition: CoreTypes.h:1377
std::size_t paramDependenciesCount
This is the amount of parameter dependencies contained in the memory block.
Definition: CoreTypes.h:1367
std::size_t minDimensions
This is the minimum amount of dimensions that are needed.
Definition: CoreTypes.h:1364
BaseParamTypeDesc baseDesc
This is the base param desc struct which all xParamTypeDesc must have.
Definition: CoreTypes.h:1358
std::size_t maxDimensions
This is the maximum amount of dimensions that are valid.
Definition: CoreTypes.h:1361
The EnumParamTypeDesc further describes a parameter for the plugin and is pointed to from the higher ...
Definition: CoreTypes.h:1391
BaseParamTypeDesc baseDesc
This is the base param desc struct which all xParamTypeDesc must have.
Definition: CoreTypes.h:1393
const char *const * pOptions
This is the array of the enums with optionCount members.
Definition: CoreTypes.h:1402
const ParamDependencyDesc * pParamDependencies
This is the array of parameter dependency with paramDependenciesCount members.
Definition: CoreTypes.h:1415
std::size_t optionCount
This is the amount of enum options contained in the memory block.
Definition: CoreTypes.h:1396
std::size_t paramDependenciesCount
This is the amount of parameter dependencies contained in the memory block.
Definition: CoreTypes.h:1405
Defines a fusing rule that can be applied during model loading.
Definition: CoreTypes.h:1781
std::uint32_t syntaxVersion
This is the version number of the fusing rule grammar.
Definition: CoreTypes.h:1784
const char * pFusingRule
This is the fusing rule text, encoded in UTF-8.
Definition: CoreTypes.h:1788
Helper template to aid retrieval of interface IDs.
Definition: CoreTypes.h:403
This structure describes an ILayer for tools and network builders.
Definition: CoreTypes.h:1554
NetworkBackendId backend
This is the backend identifier supported by this instance of the layer type.
Definition: CoreTypes.h:1597
const char * pObjectClass
This is the programmatic class name used to instantiate the layer object through the IPlugin::createO...
Definition: CoreTypes.h:1566
std::size_t numCategories
This is the number of categories.
Definition: CoreTypes.h:1587
bool generatesOutput
Describes whether the primary output from this layer generates output.
Definition: CoreTypes.h:1614
const ParamDesc * pParameters
This is the pointer to the array of ParamDesc structs.
Definition: CoreTypes.h:1626
const char * pDisplayName
An optional human-readable layer name.
Definition: CoreTypes.h:1583
std::size_t numInputs
This is the number of inputs supported by this layer.
Definition: CoreTypes.h:1606
const LayerInputDesc * pInputs
This is a pointer to the array of LayerInputDesc structs which define the inputs to this layer.
Definition: CoreTypes.h:1611
TensorFormat tensorFormat
This is a tensor format supported by this instance of the layer type.
Definition: CoreTypes.h:1602
const char * pDocumentation
An optional human-readable descriptive text.
Definition: CoreTypes.h:1578
const char * pSerializedName
This is the name used to represent the layer type in serialized form.
Definition: CoreTypes.h:1572
const char *const * ppCategories
An optional array of strings which denote categories that the host can use to organize this layer.
Definition: CoreTypes.h:1592
std::size_t numParameters
This is the number of parameters supported for this layer.
Definition: CoreTypes.h:1620
std::size_t structSize
This is the sizeof() this struct.
Definition: CoreTypes.h:1558
Describes a single input terminal for a layer. LayerDesc objects contain arrays of this structure.
Definition: CoreTypes.h:1527
const char * pDocumentation
An optional human-readable descriptive text.
Definition: CoreTypes.h:1541
std::size_t structSize
This is the sizeof() this struct. It is used for versioning.
Definition: CoreTypes.h:1529
LayerInputType inputType
This is a enum that describes this input.
Definition: CoreTypes.h:1546
const char * pName
This is the optional name of the parameter, usually a friendly name.
Definition: CoreTypes.h:1535
Structure describing details of an object's memory allocation behavior.
Definition: CoreTypes.h:931
std::size_t structSize
This is the sizeof() this struct.
Definition: CoreTypes.h:936
std::size_t peakCommittedMemory
This is the high water mark of on device memory (committed memory).
Definition: CoreTypes.h:939
std::size_t persistingCommittedMemory
This is the high water mark of on device memory (committed memory) that persists after a network is l...
Definition: CoreTypes.h:947
std::size_t peakRequestedMemory
This is the high water mark of requested memory.
Definition: CoreTypes.h:943
std::size_t persistingRequestedMemory
This is the high water mark of requested memory that persists after a network finishes an inference r...
Definition: CoreTypes.h:952
The ParamDependencyDesc describe a parameter dependency on parameter named pParamName with value pPar...
Definition: CoreTypes.h:1337
const char * pParamValue
The parameter value, as an UTF-8 string, associated with the dependency.
Definition: CoreTypes.h:1342
const char * pParamName
The parameter name, pName from ParamDesc, associated with the dependency.
Definition: CoreTypes.h:1339
ParamDesc describes a parameter for the plugin, giving it a name, default value, type,...
Definition: CoreTypes.h:1449
ParamType paramType
This is a enum that describes this parameter.
Definition: CoreTypes.h:1468
const BaseParamTypeDesc * pParamTypeDetails
This is an optional struct that give greater detail to the paramType if needed, for instance,...
Definition: CoreTypes.h:1480
std::size_t structSize
This is the sizeof() this struct. It is used for versioning.
Definition: CoreTypes.h:1451
const char * pName
This is the name of the parameter, usually a friendly name.
Definition: CoreTypes.h:1457
const char * pDefault
This is the default value of the parameter.
Definition: CoreTypes.h:1463
const char * pDocumentation
An optional human-readable descriptive text.
Definition: CoreTypes.h:1474
This structure represent a prototype layer version (backend, tensor format and kernel type),...
Definition: CoreTypes.h:1697
TensorFormat tensorFormat
This is the tensor format supported by this prototype layer.
Definition: CoreTypes.h:1726
const char * pSerializedName
This is the name used to represent the prototype type in serialized form.
Definition: CoreTypes.h:1713
NetworkBackendId backend
This is the backend identifier supported by this instance of the prototype layer.
Definition: CoreTypes.h:1723
std::size_t structSize
This is the sizeof() this struct.
Definition: CoreTypes.h:1701
CompilationLevel compilationLevel
This is the compilation level of the contained kernel.
Definition: CoreTypes.h:1729
const char * pObjectClass
This is the programmatic class name used to instantiate the prototype object through the IPlugin::cre...
Definition: CoreTypes.h:1707
const char * pDisplayName
An optional human-readable prototype name.
Definition: CoreTypes.h:1718
The StringParamTypeDesc further describes a parameter for the plugin and is pointed to from the highe...
Definition: CoreTypes.h:1423
bool supportsMultilineTextbox
This is a UI hint for the size of the text box of the string.
Definition: CoreTypes.h:1429
const ParamDependencyDesc * pParamDependencies
This is the array of parameter dependency with paramDependenciesCount members.
Definition: CoreTypes.h:1442
BaseParamTypeDesc baseDesc
This is the base param desc struct which all xParamTypeDesc must have.
Definition: CoreTypes.h:1425
std::size_t paramDependenciesCount
This is the amount of parameter dependencies contained in the memory block.
Definition: CoreTypes.h:1432
TensorDimension describes the dimensions of a four-dimensional image tensor.
Definition: CoreTypes.h:136
size_t c
C dimension (channel)
Definition: CoreTypes.h:138
TensorDimension & operator=(const TensorDimension &copyFrom)
Copy assignment operator.
Definition: CoreTypes.h:167
bool operator!=(const TensorDimension &other) const
Inequality operator.
Definition: CoreTypes.h:183
size_t h
H dimension (height)
Definition: CoreTypes.h:139
~TensorDimension()=default
Trivial destructor.
TensorDimension()=default
Default constructor. Initializes all members to zero.
TensorDimension(size_t N, size_t C, size_t H, size_t W)
Direct constructor, specifying all members at once.
Definition: CoreTypes.h:146
size_t w
W dimension (width)
Definition: CoreTypes.h:140
bool operator==(const TensorDimension &other) const
Equality operator.
Definition: CoreTypes.h:177
TensorDimension(const TensorDimension &copyFrom)
Copy constructor.
Definition: CoreTypes.h:158
std::size_t elementCount() const
Returns the number of elements in a tensor with these dimensions.
Definition: CoreTypes.h:190
size_t n
N dimension (batch)
Definition: CoreTypes.h:137
TensorFormat describes a specific tensor shape (element type and layout).
Definition: CoreTypes.h:88
TensorDataLayout layout
Element layout (e.g., NCHW)
Definition: CoreTypes.h:90
bool operator<(const TensorFormat &other) const noexcept
Less-than operator for convenience.
Definition: CoreTypes.h:122
TensorFormat(TensorDataType elementType_, TensorDataLayout layout_)
Convenience constructor.
Definition: CoreTypes.h:100
bool operator!=(const TensorFormat &other) const noexcept
Inequality operator for convenience.
Definition: CoreTypes.h:107
bool operator==(const TensorFormat &other) const noexcept
Equality operator for convenience.
Definition: CoreTypes.h:114
TensorFormat()
Convenience default constructor. Sets everything to "invalid.".
Definition: CoreTypes.h:93
TensorDataType elementType
Element type (e.g., Float)
Definition: CoreTypes.h:89