[SWDEV-513658] Force HSA_AMD_MEMORY_POOL_EXECUTABLE_FLAG value to be used with HSA calls (#192)

* Force HSA_AMD_MEMORY_POOL_EXECUTABLE_FLAG  value to be used with HSA calls

Fix for CI

* More tweaks

* Increase reproducible-runtime kernel sleep granularity

* Fix data race in synchronous device counter collection sample

* Update device counting service

- add get_active_context function

---------

Co-authored-by: Benjamin Welton <bewelton@amd.com>
Co-authored-by: Jonathan R. Madsen <jonathanrmadsen@gmail.com>
This commit is contained in:
Welton, Benjamin
2025-02-10 09:34:26 -08:00
committed by GitHub
parent e67a4451d8
commit 080b2ba451
9 changed files with 115 additions and 42 deletions
@@ -19,6 +19,10 @@ endif()
project(rocprofiler-tests-bin-reproducible-runtime LANGUAGES CXX HIP)
if(NOT CMAKE_BUILD_TYPE MATCHES "(Release|RelWithDebInfo)")
set(CMAKE_BUILD_TYPE "RelWithDebInfo")
endif()
foreach(_TYPE DEBUG MINSIZEREL RELEASE RELWITHDEBINFO)
if("${CMAKE_HIP_FLAGS_${_TYPE}}" STREQUAL "")
set(CMAKE_HIP_FLAGS_${_TYPE} "${CMAKE_CXX_FLAGS_${_TYPE}}")
@@ -58,7 +58,7 @@ namespace
using auto_lock_t = std::unique_lock<std::mutex>;
auto print_lock = std::mutex{};
double nruntime = 500.0; // ms
uint32_t nspin = 256 * 10000;
uint32_t nspin = 128 * 10000;
size_t nthreads = 2;
void
@@ -144,7 +144,7 @@ run(int tid, int devid)
do
{
roctxMark("iteration");
uint32_t cyclesleft = 2000 * 1000 * (nruntime - static_cast<double>(time));
uint32_t cyclesleft = 1000 * 1000 * (nruntime - static_cast<double>(time));
HIP_API_CALL(hipEventRecord(start, stream));
reproducible_runtime<<<grid, block, 0, stream>>>(std::min<uint32_t>(nspin, cyclesleft));
HIP_API_CALL(hipEventRecord(stop, stream));