Update in clock function

Change-Id: I5819aa62693dc3b9b5d7e39944d1e58aadc72027
This commit is contained in:
Rahul Garg
2016-05-20 11:12:32 +05:30
parent 0e0c4250de
commit d46b3446de
2 changed files with 3 additions and 13 deletions
+1 -11
View File
@@ -420,17 +420,7 @@ HIP provides the following built-in functions for reading a high-resolution time
clock_t clock()
long long int clock64()
```
AMD devices employ a per-GPU timer that increments at a constant time interval regardless of any dynamic frequency changes. All compute units in the system share the timer.
Nvidia devices implement the timer as a per-compute-unit clock that increments on every clock cycle.
To obtain the clock frequency, use the hipDeviceProp_t.clockInstructionRate field:
```
hipGetDeviceProperties(&deviceProps, deviceId);
// Compute time in ms--device_ticks is based on values reported from clock() device function
float time = device_ticks / (float)deviceProps.clockInstructionRate;
```
Returns the value of counter that is incremented every clock cycle on device. Difference in values returned provides the cycles used.
## Atomic Functions