2
0

Fix clock check for reproducible runtime (#281)

* Fix clock check for reproducible runtime

* source formatting (clang-format v11) (#282)

Co-authored-by: bwelton <bwelton@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: bwelton <bwelton@users.noreply.github.com>

[ROCm/rocprofiler-sdk commit: efbb154515]
Este cometimento está contido em:
Benjamin Welton
2023-12-08 01:25:23 -08:00
cometido por GitHub
ascendente c1c939deaf
cometimento c19e054225
@@ -134,14 +134,8 @@ main(int argc, char** argv)
__global__ void __global__ void
reproducible_runtime(int64_t nspin_v) reproducible_runtime(int64_t nspin_v)
{ {
int64_t start = clock64(); for(int i = 0; i < nspin_v / 64; i++)
int64_t diff = 0; asm volatile("s_sleep 1"); // ~64 cycles
do
{
__syncthreads();
diff = (clock64() - start);
} while(diff < nspin_v);
} }
void void