Skip to content

Commit 902a454

Browse files
authored
Update device.cpp
1 parent ace3fc3 commit 902a454

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

source/module_base/module_device/device.cpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
#if defined(__CUDA)
1414
#include <cuda_runtime.h>
15+
#include <cuda.h>
1516
#endif
1617

1718
#if defined(__ROCM)
@@ -299,6 +300,7 @@ void print_device_info<base_device::DEVICE_GPU>(
299300
sprintf(msg, " CUDA Capability Major/Minor version number: %d.%d\n",
300301
deviceProp.major, deviceProp.minor);
301302
ofs_device << msg << std::endl;
303+
#if defined(CUDA_VERSION) && CUDA_VERSION < 13000
302304
sprintf(msg,
303305
" GPU Max Clock rate: %.0f MHz (%0.2f "
304306
"GHz)\n",
@@ -312,6 +314,7 @@ void print_device_info<base_device::DEVICE_GPU>(
312314
sprintf(msg, " Memory Bus Width: %d-bit\n",
313315
deviceProp.memoryBusWidth);
314316
ofs_device << msg << std::endl;
317+
#endif
315318
sprintf(msg,
316319
" Maximum Texture Dimension Size (x,y,z) 1D=(%d), 2D=(%d, "
317320
"%d), 3D=(%d, %d, %d)\n",
@@ -366,6 +369,7 @@ void print_device_info<base_device::DEVICE_GPU>(
366369
sprintf(msg, " Texture alignment: %zu bytes\n",
367370
deviceProp.textureAlignment);
368371
ofs_device << msg << std::endl;
372+
#if defined(CUDA_VERSION) && CUDA_VERSION < 13000
369373
sprintf(msg,
370374
" Concurrent copy and kernel execution: %s with %d copy "
371375
"engine(s)\n",
@@ -375,6 +379,7 @@ void print_device_info<base_device::DEVICE_GPU>(
375379
sprintf(msg, " Run time limit on kernels: %s\n",
376380
deviceProp.kernelExecTimeoutEnabled ? "Yes" : "No");
377381
ofs_device << msg << std::endl;
382+
#endif
378383
sprintf(msg, " Integrated GPU sharing Host Memory: %s\n",
379384
deviceProp.integrated ? "Yes" : "No");
380385
ofs_device << msg << std::endl;
@@ -399,13 +404,15 @@ void print_device_info<base_device::DEVICE_GPU>(
399404
sprintf(msg, " Supports Cooperative Kernel Launch: %s\n",
400405
deviceProp.cooperativeLaunch ? "Yes" : "No");
401406
ofs_device << msg << std::endl;
402-
sprintf(msg, " Supports MultiDevice Co-op Kernel Launch: %s\n",
403-
deviceProp.cooperativeMultiDeviceLaunch ? "Yes" : "No");
404-
ofs_device << msg << std::endl;
405407
sprintf(msg,
406408
" Device PCI Domain ID / Bus ID / location ID: %d / %d / %d\n",
407409
deviceProp.pciDomainID, deviceProp.pciBusID, deviceProp.pciDeviceID);
408410
ofs_device << msg << std::endl;
411+
#if defined(CUDA_VERSION) && CUDA_VERSION < 13000
412+
sprintf(msg, " Supports MultiDevice Co-op Kernel Launch: %s\n",
413+
deviceProp.cooperativeMultiDeviceLaunch ? "Yes" : "No");
414+
ofs_device << msg << std::endl;
415+
409416
const char *sComputeMode[] = {
410417
"Default (multiple host threads can use ::cudaSetDevice() with device "
411418
"simultaneously)",
@@ -421,7 +428,7 @@ void print_device_info<base_device::DEVICE_GPU>(
421428
ofs_device << msg << std::endl;
422429
ofs_device << " " << sComputeMode[deviceProp.computeMode] << std::endl
423430
<< std::endl;
424-
431+
#endif
425432
// If there are 2 or more GPUs, query to determine whether RDMA is supported
426433
if (deviceCount >= 2) {
427434
cudaDeviceProp prop[64];
@@ -711,4 +718,4 @@ void record_device_memory<base_device::DEVICE_GPU>(
711718
#endif
712719

713720
} // end of namespace information
714-
} // end of namespace base_device
721+
} // end of namespace base_device

0 commit comments

Comments
 (0)