Display CUDA driver version in output header
This mimics the OpenCL change in issue #4.
This commit is contained in:
parent
e608ec2909
commit
70330c7b9b
@ -46,6 +46,7 @@
|
||||
#include "common.h"
|
||||
|
||||
std::string getDeviceName(int device);
|
||||
int getDriver(void);
|
||||
|
||||
// Code to check CUDA errors
|
||||
void check_cuda_error(void)
|
||||
@ -162,6 +163,9 @@ int main(int argc, char *argv[])
|
||||
// Print out device name
|
||||
std::cout << "Using CUDA device " << getDeviceName(deviceIndex) << std::endl;
|
||||
|
||||
// Print out device CUDA driver version
|
||||
std::cout << "Driver: " << getDriver() << std::endl;
|
||||
|
||||
// Check buffers fit on the device
|
||||
cudaDeviceProp props;
|
||||
cudaGetDeviceProperties(&props, deviceIndex);
|
||||
@ -358,6 +362,14 @@ std::string getDeviceName(int device)
|
||||
return std::string(prop.name);
|
||||
}
|
||||
|
||||
int getDriver(void)
|
||||
{
|
||||
int driver;
|
||||
cudaDriverGetVersion(&driver);
|
||||
check_cuda_error();
|
||||
return driver;
|
||||
}
|
||||
|
||||
void listDevices(void)
|
||||
{
|
||||
// Get number of devices
|
||||
|
||||
Loading…
Reference in New Issue
Block a user