8 #ifndef CUDA_API_WRAPPERS_PCI_ID_CUH_ 9 #define CUDA_API_WRAPPERS_PCI_ID_CUH_ 14 #include <cuda_runtime_api.h> 34 operator ::std::string()
const;
39 static constexpr
const int unused { -1 };
53 ::std::string as_string { pci_id };
55 auto result = cuDeviceGetByPCIBusId(&cuda_device_id, as_string.c_str());
57 "Failed obtaining a CUDA device ID corresponding to PCI id " + as_string);
58 return cuda_device_id;
67 #endif // CUDA_API_WRAPPERS_PCI_ID_HPP_ All definitions and functionality wrapping the CUDA Runtime API.
Definition: array.hpp:22
CUdevice id_t
Numeric ID of a CUDA device used by the CUDA Runtime API.
Definition: types.hpp:715
void throw_if_error(status_t status, const ::std::string &message) noexcept(false)
Do nothing...
Definition: error.hpp:313
Location "coordinates" for a CUDA device on a PCIe bus.
Definition: pci_id.hpp:27
Facilities for exception-based handling of Runtime and Driver API errors, including a basic exception...
Fundamental CUDA-related type definitions.