17 #include "alsutils/config.hpp" 18 #ifdef ALSVINN_HAVE_CUDA 19 #include <cuda_runtime.h> 21 #include <boost/property_tree/ptree.hpp> 22 #include <boost/algorithm/string/join.hpp> 32 boost::property_tree::ptree propertiesTree;
33 int currentDevice = -1;
34 #ifdef ALSVINN_HAVE_CUDA 40 cudaDeviceProp properties;
43 propertiesTree.add(
"name", properties.name);
44 propertiesTree.add(
"totalGlobalMem", properties.totalGlobalMem);
45 propertiesTree.add(
"sharedMemPerBlock", properties.sharedMemPerBlock);
46 propertiesTree.add(
"regsPerBlock", properties.regsPerBlock);
47 propertiesTree.add(
"warpSize", properties.warpSize);
48 propertiesTree.add(
"memPitch", properties.memPitch);
49 propertiesTree.add(
"maxThreadsPerBlock", properties.maxThreadsPerBlock);
50 propertiesTree.add(
"maxThreadsDim",
51 boost::algorithm::join(
52 std::vector<std::string>({std::to_string(properties.maxThreadsDim[0]),
53 std::to_string(properties.maxThreadsDim[1]),
54 std::to_string(properties.maxThreadsDim[2])}),
56 propertiesTree.add(
"maxGridSize",
57 boost::algorithm::join(
58 std::vector<std::string>({std::to_string(properties.maxGridSize[0]),
59 std::to_string(properties.maxGridSize[1]),
60 std::to_string(properties.maxGridSize[2])}),
62 propertiesTree.add(
"totalConstMem", properties.totalConstMem);
63 propertiesTree.add(
"major", properties.major);
64 propertiesTree.add(
"minor", properties.minor);
65 propertiesTree.add(
"clockRate", properties.clockRate);
66 propertiesTree.add(
"textureAlignment", properties.textureAlignment);
67 propertiesTree.add(
"deviceOverlap", properties.deviceOverlap);
68 propertiesTree.add(
"multiProcessorCount", properties.multiProcessorCount);
69 propertiesTree.add(
"kernelExecTimeoutEnabled",
70 properties.kernelExecTimeoutEnabled);
71 propertiesTree.add(
"integrated", properties.integrated);
72 propertiesTree.add(
"canMapHostMemory", properties.canMapHostMemory);
73 propertiesTree.add(
"computeMode", properties.computeMode);
74 propertiesTree.add(
"concurrentKernels", properties.concurrentKernels);
75 propertiesTree.add(
"ECCEnabled", properties.ECCEnabled);
76 propertiesTree.add(
"pciBusID", properties.pciBusID);
77 propertiesTree.add(
"pciDeviceID", properties.pciDeviceID);
78 propertiesTree.add(
"tccDriver", properties.tccDriver);
83 }
catch (std::runtime_error& e) {
85 "(Ignore this if you are not running with CUDA). Failed getting CUDA GPU properties: " 92 return propertiesTree;
boost::property_tree::ptree getDeviceProperties()
Definition: get_device_properties.hpp:30
#define CUDA_SAFE_CALL_SILENT(x)
Does the same as CUDA_SAFE_CALL, but doesn't print an error message.
Definition: cuda_safe_call.hpp:31
Various utilities for mpi and cuda.
Definition: Factory.hpp:3
#define WARNING
Definition: log.hpp:30
#define ALSVINN_LOG(severity, message)
Definition: log.hpp:36