From 9ff3a03c3b262a34108588eeb85014fd6d3da18d Mon Sep 17 00:00:00 2001 From: NikitaEdin Date: Fri, 19 Sep 2025 10:46:31 +0100 Subject: [PATCH] Update clock rate retrieval to new CUDA API Replaces deprecated deviceProp.clockRate with cudaDeviceGetAttribute for clock rate retrieval, ensuring compatibility with CUDA 13.0 and newer. Clock rate is now displayed in MHz. --- labs/unit2/info.cu | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/labs/unit2/info.cu b/labs/unit2/info.cu index 3c4f7dd..59b2949 100644 --- a/labs/unit2/info.cu +++ b/labs/unit2/info.cu @@ -25,7 +25,12 @@ int main(int argc, char **argv) cout << "Revision " << deviceProp.major << "." << deviceProp.minor << endl; cout << "Memory " << deviceProp.totalGlobalMem / 1024 / 1024 << "MB" << endl; cout << "Warp Size " << deviceProp.warpSize << endl; - cout << "Clock " << deviceProp.clockRate << endl; + + // Get clock rates using the new API (CUDA 13.0+) + int clockRateKHz; + cudaDeviceGetAttribute(&clockRateKHz, cudaDevAttrClockRate, 0); + cout << "Clock " << clockRateKHz / 1e3f << " Mhz" << endl; + cout << "Multiprocessors " << deviceProp.multiProcessorCount << endl; } return 0;