SWDEV-450735 - Add compiler option for using clock64
Change-Id: I9efed88d691ee1b2b4465286b3340b820f7bf627
[ROCm/hip-tests commit: 5b67a2a4a0]
This commit is contained in:
@@ -126,11 +126,11 @@ __global__ void kernel500ms_gfx11(float* hostRes, int clkRate) {
|
||||
hostRes[tid] = tid + 1;
|
||||
__threadfence_system();
|
||||
// expecting that the data is getting flushed to host here!
|
||||
uint64_t start = wall_clock64()/clkRate, cur;
|
||||
uint64_t start = clock_function()/clkRate, cur;
|
||||
if (clkRate > 1) {
|
||||
do { cur = wall_clock64()/clkRate-start;}while (cur < wait_ms);
|
||||
do { cur = clock_function()/clkRate-start;}while (cur < wait_ms);
|
||||
} else {
|
||||
do { cur = wall_clock64()/start;}while (cur < wait_ms);
|
||||
do { cur = clock_function()/start;}while (cur < wait_ms);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -47,11 +47,11 @@ __global__ void Kernel_gfx11(float* hostRes, int clkRate) {
|
||||
hostRes[tid] = tid + 1;
|
||||
__threadfence_system();
|
||||
// expecting that the data is getting flushed to host here!
|
||||
uint64_t start = wall_clock64()/clkRate, cur;
|
||||
uint64_t start = clock_function()/clkRate, cur;
|
||||
if (clkRate > 1) {
|
||||
do { cur = wall_clock64()/clkRate-start;}while (cur < wait_sec);
|
||||
do { cur = clock_function()/clkRate-start;}while (cur < wait_sec);
|
||||
} else {
|
||||
do { cur = wall_clock64()/start;}while (cur < wait_sec);
|
||||
do { cur = clock_function()/start;}while (cur < wait_sec);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -81,14 +81,14 @@ template <typename T> __global__ void kernel_500ms_gfx11(T* host_res, int clk_ra
|
||||
host_res[tid] = tid + 1;
|
||||
__threadfence_system();
|
||||
// expecting that the data is getting flushed to host here!
|
||||
uint64_t start = wall_clock64() / clk_rate, cur;
|
||||
uint64_t start = clock_function() / clk_rate, cur;
|
||||
if (clk_rate > 1) {
|
||||
do {
|
||||
cur = wall_clock64() / clk_rate - start;
|
||||
cur = clock_function() / clk_rate - start;
|
||||
} while (cur < wait_ms);
|
||||
} else {
|
||||
do {
|
||||
cur = wall_clock64() / start;
|
||||
cur = clock_function() / start;
|
||||
} while (cur < wait_ms);
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user