NVIDIA NvNeural SDK  2021.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
PrototypeDescHostContainer.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 #ifndef NVNEURAL_PROTOTYPEDESCHOSTCONTAINER_H
26 #define NVNEURAL_PROTOTYPEDESCHOSTCONTAINER_H
27 
28 #include <nvneural/CoreTypes.h>
29 #include <string>
30 
31 namespace nvneural {
32 
36 {
37 private:
38  bool m_validPrototypeDesc;
39  PrototypeDesc m_prototypeDesc;
40 
41  void PrototypeDescWarning(const std::string& warningText) const;
42  bool SanityCheckPrototypeDesc() const;
43  bool ValidateAndLoadPrototypeDesc(const PrototypeDesc* pInputLayerDesc);
44 
45 public:
46  PrototypeDescHostContainer() = delete;
47 
51  explicit PrototypeDescHostContainer(const PrototypeDesc* pInputLayerDesc);
52 
53  ~PrototypeDescHostContainer() = default;
54 
56  bool isValid() const
57  {
58  return m_validPrototypeDesc;
59  }
60 
62  const PrototypeDesc& get() const
63  {
64  return m_prototypeDesc;
65  }
66 };
67 
68 } // namespace nvneural
69 
70 #endif // !NVNEURAL_PROTOTYPEDESCHOSTCONTAINER_H
Fundamental NvNeural data types are declared here.
This class is the host side container for the PrototypeDesc structure (see CoreTypes....
Definition: PrototypeDescHostContainer.h:36
bool isValid() const
Returns true if the imported descriptor was valid.
Definition: PrototypeDescHostContainer.h:56
const PrototypeDesc & get() const
Returns a reference to the converted/upgraded descriptor.
Definition: PrototypeDescHostContainer.h:62
This structure represent a prototype layer version (backend, tensor format and kernel type),...
Definition: CoreTypes.h:1646