cuda-api-wrappers
Thin C++-flavored wrappers for the CUDA Runtime API
cuda::device::pci_location_t Struct Reference

Location "coordinates" for a CUDA device on a PCIe bus. More...

#include <pci_id.hpp>

Public Member Functions

 operator::std::string () const
 

Static Public Member Functions

static pci_location_t parse (const ::std::string &id_str)
 Parse a string representation of a device's PCI location. More...
 
static pci_location_t parse (const char *id_str)
 Parse a string representation of a device's PCI location. More...
 

Public Attributes

optional< int > domain
 The four fields of the PCI configuration space. More...
 
int bus
 
int device
 
optional< int > function
 

Detailed Description

Location "coordinates" for a CUDA device on a PCIe bus.

Note
can be compiled from individual values from a device's properties; see {properties_t}.

Member Function Documentation

◆ parse() [1/2]

static pci_location_t cuda::device::pci_location_t::parse ( const ::std::string &  id_str)
static

Parse a string representation of a device's PCI location.

Note
This is not a ctor so as to maintain the PODness.
There are multiple notations for PCI IDs:
   domain::bus::device.function
domain::bus::device
bus::device.function

and any of them can be used.

◆ parse() [2/2]

static pci_location_t cuda::device::pci_location_t::parse ( const char *  id_str)
static

Parse a string representation of a device's PCI location.

Note
This is not a ctor so as to maintain the PODness.
There are multiple notations for PCI IDs:
   domain::bus::device.function
domain::bus::device
bus::device.function

and any of them can be used.

Member Data Documentation

◆ domain

optional<int> cuda::device::pci_location_t::domain

The four fields of the PCI configuration space.

Note
Only the first three are actually used/recognized by the CUDA driver, and when querying a CUDA device for its PCI ID, function will be unused. However - we have it be able to parse the different common string notations of PCI IDs; see https://wiki.xenproject.org/wiki/Bus:Device.Function_(BDF)_Notation .

The documentation for this struct was generated from the following file: