17 cudaGetDevice(&deviceID);
20 cudaGetDeviceProperties(&properties, deviceID);
27 cudaGetDeviceCount(&ret);
32 return static_cast<unsigned int>(ret);
39 return static_cast<unsigned int>(properties.pciDomainID);
46 return static_cast<unsigned int>(properties.pciBusID);
53 return static_cast<unsigned int>(properties.pciDeviceID);
59 ss << std::hex << std::setfill(
'0');
70 if(cudaDeviceGetLimit(&ret, cudaLimitStackSize) != cudaSuccess)
79 if(cudaDeviceSetLimit(cudaLimitStackSize, value) != cudaSuccess)
#define OPENMPCD_CUDA_THROW_ON_ERROR
Throws if the last CUDA call was not successful.
unsigned int getPCIBusID() const
Returns the PCI Bus ID of this Device.
void setStackSizePerThread(const std::size_t value) const
Sets the stack size, in bytes, per Device thread.
#define OPENMPCD_THROW(ExceptionType, message)
Throws the given ExceptionType, passing the given message along with file and line number information...
#define OPENMPCD_DEBUG_ASSERT(assertion)
Asserts that the given expression evaluates to true, but only if OPENMPCD_DEBUG is defined.
const std::string getPCIAddressString() const
Returns a string representing the PCI address.
Device()
Represents the CUDA Device active at the moment of this instance's construction on the current thread...
std::size_t getStackSizePerThread() const
Returns the stack size, in bytes, per Device thread.
#define OPENMPCD_DEBUG_ASSERT_EXCEPTIONTYPE(assertion, ExceptionType)
unsigned int getPCIDomainID() const
Returns the PCI Domain ID of this Device.
static unsigned int getDeviceCount()
Returns the number of CUDA Devices available.
unsigned int getPCISlotID() const
Returns the PCI Slot ID (also known as PCI Device ID) of this Device.
Invalid argument exception.