7 #ifndef CUDA_API_WRAPPERS_PCI_ID_HPP_ 8 #define CUDA_API_WRAPPERS_PCI_ID_HPP_ 31 operator ::std::string()
const;
36 static constexpr
const int unused { -1 };
50 ::std::string as_string { pci_id };
52 auto result = cuDeviceGetByPCIBusId(&cuda_device_id, as_string.c_str());
53 throw_if_error_lazy(result,
54 "Failed obtaining a CUDA device ID corresponding to PCI id " + as_string);
55 return cuda_device_id;
64 #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:752
Definition: kernel_launch.hpp:77
Location "coordinates" for a CUDA device on a PCIe bus.
Definition: pci_id.hpp:24
Facilities for exception-based handling of Runtime and Driver API errors, including a basic exception...
Fundamental CUDA-related type definitions.