NVIDIA NvNeural SDK  2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
BackendDeviceIdentifier.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_BACKENDDEVICEIDENTIFIER_H
26 #define NVNEURAL_BACKENDDEVICEIDENTIFIER_H
27 
28 #include <nvneural/CoreTypes.h>
29 #include <nvneural/CoreHelpers.h>
30 #include <string>
31 
32 namespace nvneural {
33 
35 class BackendDeviceIdentifier : public refobj::RefObjectBase<refobj::Implements<IBackendDeviceIdentifier>>
36 {
37 public:
43  BackendDeviceIdentifier(std::uint64_t uuidLow, std::uint64_t uuidHigh, const std::string& deviceName);
44 
46  NeuralResult getDeviceIdentifiers(std::uint64_t* pUuidLow, std::uint64_t* pUuidHigh) const noexcept override;
47 
49  const char* getDeviceName() const noexcept override;
50 
51 private:
52  std::uint64_t m_uuidLow;
53  std::uint64_t m_uuidHigh;
54  std::string m_deviceName;
55 };
56 
57 } // namespace nvneural
58 
59 #endif // NVNEURAL_BACKENDDEVICEIDENTIFIER_H
Common helper classes and template function implementations.
Fundamental NvNeural data types are declared here.
NeuralResult
NeuralResult is a generic success/failure result type similar to COM HRESULT.
Definition: CoreTypes.h:275
Standard implementation of IBackendDeviceIdentifier.
Definition: BackendDeviceIdentifier.h:36
NeuralResult getDeviceIdentifiers(std::uint64_t *pUuidLow, std::uint64_t *pUuidHigh) const noexcept
Retrieves a pair of values that uniquely identify this GPU on the local system.
Definition: BackendDeviceIdentifier.cpp:46
BackendDeviceIdentifier(std::uint64_t uuidLow, std::uint64_t uuidHigh, const std::string &deviceName)
Creates a BackendDeviceIdentifier that reports the provided UUID and device name.
Definition: BackendDeviceIdentifier.cpp:39
const char * getDeviceName() const noexcept
Retrieves the name of this GPU.
Definition: BackendDeviceIdentifier.cpp:59
Parameterized base class implementing common IRefObject operations.
Definition: RefObject.h:336