| /* |
| * SPDX-FileCopyrightText: Copyright OpenBMC Authors |
| * SPDX-License-Identifier: Apache-2.0 |
| */ |
| |
| #pragma once |
| |
| #include "NvidiaGpuMctpVdm.hpp" |
| |
| #include <optional> |
| #include <string> |
| |
| namespace nvidia_sensor_utils |
| { |
| |
| inline std::optional<std::string> deviceTypeToPhysicalContext( |
| gpu::DeviceIdentification deviceType) |
| { |
| switch (deviceType) |
| { |
| case gpu::DeviceIdentification::DEVICE_GPU: |
| return "xyz.openbmc_project.Common.PhysicalContext." |
| "PhysicalContextType.Accelerator"; |
| |
| case gpu::DeviceIdentification::DEVICE_SMA: |
| case gpu::DeviceIdentification::DEVICE_PCIE: |
| default: |
| // TODO: Define appropriate PhysicalContext for SMA and PCIe devices |
| // if needed in the future |
| return std::nullopt; |
| } |
| } |
| |
| } // namespace nvidia_sensor_utils |