SWDEV-450735 - Add compiler option for using clock64

Change-Id: I9efed88d691ee1b2b4465286b3340b820f7bf627
This commit is contained in:
Vladana Stojiljkovic
2024-03-15 17:54:34 +01:00
parent dc656c5dda
commit 5b67a2a4a0
11 changed files with 41 additions and 29 deletions
+6
View File
@@ -35,6 +35,12 @@ THE SOFTWARE.
#include <cstdlib>
#include <thread>
#ifdef TEST_CLOCK_CYCLE
#define clock_function() clock64()
#else
#define clock_function() wall_clock64()
#endif
#define HIP_PRINT_STATUS(status) INFO(hipGetErrorName(status) << " at line: " << __LINE__);
// Not thread-safe
+2 -2
View File
@@ -140,8 +140,8 @@ template <typename T> __global__ void VectorSet(T* const vec, const T value, siz
static __global__ void Delay(uint32_t interval, const uint32_t ticks_per_ms) {
while (interval--) {
#if HT_AMD
uint64_t start = wall_clock64();
while (wall_clock64() - start < ticks_per_ms) {
uint64_t start = clock_function();
while (clock_function() - start < ticks_per_ms) {
__builtin_amdgcn_s_sleep(10);
}
#endif