MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / second

Function second

cpp/4_CUDA_Libraries/batchCUBLAS/batchCUBLAS.h:134–154  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132#endif
133#include <windows.h>
134static __inline__ double second(void)
135{
136 LARGE_INTEGER t;
137 static double oofreq;
138 static int checkedForHighResTimer;
139 static BOOL hasHighResTimer;
140
141 if (!checkedForHighResTimer) {
142 hasHighResTimer = QueryPerformanceFrequency(&t);
143 oofreq = 1.0 / (double)t.QuadPart;
144 checkedForHighResTimer = 1;
145 }
146
147 if (hasHighResTimer) {
148 QueryPerformanceCounter(&t);
149 return (double)t.QuadPart * oofreq;
150 }
151 else {
152 return (double)GetTickCount() / 1000.0;
153 }
154}
155#elif defined(__linux__) || defined(__QNX__)
156#include <stddef.h>
157#include <sys/resource.h>

Callers 6

test_gemm_loopFunction · 0.70
linearSolverCHOLFunction · 0.50
linearSolverLUFunction · 0.50
linearSolverQRFunction · 0.50
mainFunction · 0.50
mainFunction · 0.50

Calls

no outgoing calls

Tested by 1

test_gemm_loopFunction · 0.56