Rename Omnitrace to ROCm Systems Profiler (#4)

The Omnitrace program is being renamed. 

Full name: "ROCm Systems Profiler"
Package name: "rocprofiler-systems"
Binary / Library names: "rocprof-sys-*"

---------
Co-authored-by: Xuan Chen <xuchen@amd.com>
Signed-off-by: David Galiffi <David.Galiffi@amd.com>

[ROCm/rocprofiler-systems commit: d07bf508a9]
This commit is contained in:
David Galiffi
2024-10-15 11:20:40 -04:00
committed by GitHub
orang tua c444ba6131
melakukan 489eda995d
420 mengubah file dengan 10418 tambahan dan 9914 penghapusan
@@ -40,36 +40,40 @@ set(core_headers
${CMAKE_CURRENT_LIST_DIR}/timemory.hpp
${CMAKE_CURRENT_LIST_DIR}/utility.hpp)
add_library(omnitrace-core-library STATIC)
add_library(omnitrace::omnitrace-core ALIAS omnitrace-core-library)
add_library(rocprofiler-systems-core-library STATIC)
add_library(rocprofiler-systems::rocprofiler-systems-core ALIAS
rocprofiler-systems-core-library)
target_sources(omnitrace-core-library PRIVATE ${core_sources} ${core_headers}
${CMAKE_CURRENT_BINARY_DIR}/defines.hpp)
target_sources(
rocprofiler-systems-core-library PRIVATE ${core_sources} ${core_headers}
${CMAKE_CURRENT_BINARY_DIR}/defines.hpp)
add_subdirectory(binary)
add_subdirectory(components)
add_subdirectory(containers)
target_include_directories(omnitrace-core-library BEFORE
target_include_directories(rocprofiler-systems-core-library BEFORE
PRIVATE ${CMAKE_CURRENT_LIST_DIR})
target_link_libraries(omnitrace-core-library
PRIVATE omnitrace::omnitrace-interface-library)
target_link_libraries(rocprofiler-systems-core-library
PRIVATE rocprofiler-systems::rocprofiler-systems-interface-library)
target_link_libraries(
omnitrace-core-library
rocprofiler-systems-core-library
PRIVATE
$<BUILD_INTERFACE:omnitrace::omnitrace-headers>
$<BUILD_INTERFACE:omnitrace::omnitrace-threading>
$<BUILD_INTERFACE:omnitrace::omnitrace-common-library>
$<BUILD_INTERFACE:omnitrace::omnitrace-compile-definitions>
$<BUILD_INTERFACE:omnitrace::omnitrace-compile-options>
$<BUILD_INTERFACE:omnitrace::omnitrace-perfetto>
$<BUILD_INTERFACE:omnitrace::omnitrace-timemory>
$<BUILD_INTERFACE:omnitrace::omnitrace-mpi>
$<BUILD_INTERFACE:omnitrace::omnitrace-hip>
$<BUILD_INTERFACE:omnitrace::omnitrace-rocm-smi>
$<BUILD_INTERFACE:omnitrace::omnitrace-static-libgcc-optional>
$<BUILD_INTERFACE:omnitrace::omnitrace-static-libstdcxx-optional>
$<BUILD_INTERFACE:omnitrace::omnitrace-sanitizer>
$<BUILD_INTERFACE:$<IF:$<BOOL:${OMNITRACE_BUILD_LTO}>,omnitrace::omnitrace-lto,>>)
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-headers>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-threading>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-common-library>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-compile-definitions>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-compile-options>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-perfetto>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-timemory>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-mpi>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-hip>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-rocm-smi>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-static-libgcc-optional>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-static-libstdcxx-optional>
$<BUILD_INTERFACE:rocprofiler-systems::rocprofiler-systems-sanitizer>
$<BUILD_INTERFACE:$<IF:$<BOOL:${ROCPROFSYS_BUILD_LTO}>,rocprofiler-systems::rocprofiler-systems-lto,>>
)
set_target_properties(omnitrace-core-library PROPERTIES OUTPUT_NAME omnitrace-core)
set_target_properties(rocprofiler-systems-core-library
PROPERTIES OUTPUT_NAME ${BINARY_NAME_PREFIX}-core)
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@
#include <timemory/utility/filepath.hpp>
#include <timemory/utility/join.hpp>
namespace omnitrace
namespace rocprofsys
{
namespace argparse
{
@@ -56,25 +56,25 @@ get_clock_id_choices()
return _v;
};
#define OMNITRACE_CLOCK_IDENTIFIER(VAL) \
#define ROCPROFSYS_CLOCK_IDENTIFIER(VAL) \
std::make_tuple(clock_name(#VAL), VAL, std::string_view{ #VAL })
auto _choices = strvec_t{};
auto _aliases = std::map<std::string, strvec_t>{};
for(auto itr : { OMNITRACE_CLOCK_IDENTIFIER(CLOCK_REALTIME),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_MONOTONIC),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_PROCESS_CPUTIME_ID),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_MONOTONIC_RAW),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_REALTIME_COARSE),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_MONOTONIC_COARSE),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_BOOTTIME) })
for(auto itr : { ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_REALTIME),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_MONOTONIC),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_PROCESS_CPUTIME_ID),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_MONOTONIC_RAW),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_REALTIME_COARSE),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_MONOTONIC_COARSE),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_BOOTTIME) })
{
auto _choice = std::to_string(std::get<1>(itr));
_choices.emplace_back(_choice);
_aliases[_choice] = { std::get<0>(itr), std::string{ std::get<2>(itr) } };
}
#undef OMNITRACE_CLOCK_IDENTIFIER
#undef ROCPROFSYS_CLOCK_IDENTIFIER
return std::make_pair(_choices, _aliases);
}
@@ -137,13 +137,13 @@ update_env(parser_data& _data, std::string_view _env_var, Tp&& _env_val,
else
{
free(itr);
itr = strdup(omnitrace::common::join('=', _env_var, _env_val).c_str());
itr = strdup(rocprofsys::common::join('=', _env_var, _env_val).c_str());
}
return;
}
}
_data.current.emplace_back(
strdup(omnitrace::common::join('=', _env_var, _env_val).c_str()));
strdup(rocprofsys::common::join('=', _env_var, _env_val).c_str()));
}
void
@@ -171,7 +171,7 @@ get_internal_libpath(const std::string& _lib)
auto _pos = _exe.find_last_of('/');
auto _dir = filepath::get_cwd();
if(_pos != std::string_view::npos) _dir = _exe.substr(0, _pos);
return filepath::realpath(omnitrace::common::join("/", _dir, "..", "lib", _lib),
return filepath::realpath(rocprofsys::common::join("/", _dir, "..", "lib", _lib),
nullptr, false);
}
} // namespace
@@ -219,21 +219,21 @@ init_parser(parser_data& _data)
}
}
_data.dl_libpath = get_realpath(get_internal_libpath("libomnitrace-dl.so").c_str());
_data.omni_libpath = get_realpath(get_internal_libpath("libomnitrace.so").c_str());
_data.dl_libpath = get_realpath(get_internal_libpath("librocprof-sys-dl.so").c_str());
_data.omni_libpath = get_realpath(get_internal_libpath("librocprof-sys.so").c_str());
#if defined(OMNITRACE_USE_ROCTRACER) || defined(OMNITRACE_USE_ROCPROFILER)
#if defined(ROCPROFSYS_USE_ROCTRACER) || defined(ROCPROFSYS_USE_ROCPROFILER)
update_env(_data, "HSA_TOOLS_LIB", _data.dl_libpath);
if(!getenv("HSA_TOOLS_REPORT_LOAD_FAILURE"))
update_env(_data, "HSA_TOOLS_REPORT_LOAD_FAILURE", "1");
#endif
#if defined(OMNITRACE_USE_ROCPROFILER)
#if defined(ROCPROFSYS_USE_ROCPROFILER)
update_env(_data, "ROCP_TOOL_LIB", _data.omni_libpath);
if(!getenv("ROCP_HSA_INTERCEPT")) update_env(_data, "ROCP_HSA_INTERCEPT", "1");
#endif
#if defined(OMNITRACE_USE_OMPT)
#if defined(ROCPROFSYS_USE_OMPT)
if(!getenv("OMP_TOOL_LIBRARIES"))
update_env(_data, "OMP_TOOL_LIBRARIES", _data.dl_libpath, UPD_PREPEND);
#endif
@@ -305,7 +305,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
? strvec_t{ "hsa-interrupt" }
: strvec_t{};
#if OMNITRACE_USE_ROCTRACER == 0 && OMNITRACE_USE_ROCPROFILER == 0
#if ROCPROFSYS_USE_ROCTRACER == 0 && ROCPROFSYS_USE_ROCPROFILER == 0
_realtime_reqs.clear();
#endif
@@ -325,7 +325,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
auto _monochrome = p.get<bool>("monochrome");
_data.monochrome = _monochrome;
p.set_use_color(!_monochrome);
update_env(_data, "OMNITRACE_MONOCHROME", (_monochrome) ? "1" : "0");
update_env(_data, "ROCPROFSYS_MONOCHROME", (_monochrome) ? "1" : "0");
update_env(_data, "MONOCHROME", (_monochrome) ? "1" : "0");
});
@@ -337,7 +337,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
_parser.add_argument({ "--debug" }, "Debug output")
.max_count(1)
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_DEBUG", p.get<bool>("debug"));
update_env(_data, "ROCPROFSYS_DEBUG", p.get<bool>("debug"));
});
_data.processed_environs.emplace("debug");
@@ -351,7 +351,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.action([&](parser_t& p) {
auto _v = p.get<int>("verbose");
_data.verbose = _v;
update_env(_data, "OMNITRACE_VERBOSE", _v);
update_env(_data, "ROCPROFSYS_VERBOSE", _v);
});
_data.processed_environs.emplace("verbose");
@@ -369,7 +369,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.min_count(1)
.dtype("filepath")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_CONFIG_FILE",
update_env(_data, "ROCPROFSYS_CONFIG_FILE",
join(array_config_t{ ":" }, p.get<strvec_t>("config")));
});
@@ -389,8 +389,8 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.dtype("path [prefix]")
.action([&](parser_t& p) {
auto _v = p.get<strvec_t>("output");
update_env(_data, "OMNITRACE_OUTPUT_PATH", _v.at(0));
if(_v.size() > 1) update_env(_data, "OMNITRACE_OUTPUT_PREFIX", _v.at(1));
update_env(_data, "ROCPROFSYS_OUTPUT_PATH", _v.at(0));
if(_v.size() > 1) update_env(_data, "ROCPROFSYS_OUTPUT_PREFIX", _v.at(1));
});
_data.processed_environs.emplace("output");
@@ -405,7 +405,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
"Generate a detailed trace (perfetto output)")
.max_count(1)
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_TRACE", p.get<bool>("trace"));
update_env(_data, "ROCPROFSYS_TRACE", p.get<bool>("trace"));
});
_data.processed_environs.emplace("trace");
@@ -420,7 +420,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.max_count(1)
.conflicts({ "flat-profile" })
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_PROFILE", p.get<bool>("profile"));
update_env(_data, "ROCPROFSYS_PROFILE", p.get<bool>("profile"));
});
_data.processed_environs.emplace("profile");
@@ -434,8 +434,8 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.max_count(1)
.conflicts({ "profile" })
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_PROFILE", p.get<bool>("flat-profile"));
update_env(_data, "OMNITRACE_FLAT_PROFILE", p.get<bool>("flat-profile"));
update_env(_data, "ROCPROFSYS_PROFILE", p.get<bool>("flat-profile"));
update_env(_data, "ROCPROFSYS_FLAT_PROFILE", p.get<bool>("flat-profile"));
});
_data.processed_environs.emplace("flat_profile");
@@ -451,13 +451,13 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.dtype("timer-type")
.choices({ "cputime", "realtime" })
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_USE_SAMPLING", true);
update_env(_data, "ROCPROFSYS_USE_SAMPLING", true);
auto _modes = p.get<strset_t>("sample");
if(!_modes.empty())
{
update_env(_data, "OMNITRACE_SAMPLING_CPUTIME",
update_env(_data, "ROCPROFSYS_SAMPLING_CPUTIME",
_modes.count("cputime") > 0, UPD_WEAK);
update_env(_data, "OMNITRACE_SAMPLING_REALTIME",
update_env(_data, "ROCPROFSYS_SAMPLING_REALTIME",
_modes.count("realtime") > 0, UPD_WEAK);
}
});
@@ -475,8 +475,8 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.action([&](parser_t& p) {
auto _h = p.get<bool>("host");
auto _d = p.get<bool>("device");
update_env(_data, "OMNITRACE_USE_PROCESS_SAMPLING", _h || _d);
update_env(_data, "OMNITRACE_CPU_FREQ_ENABLED", _h);
update_env(_data, "ROCPROFSYS_USE_PROCESS_SAMPLING", _h || _d);
update_env(_data, "ROCPROFSYS_CPU_FREQ_ENABLED", _h);
});
_data.processed_environs.emplace("host");
@@ -494,8 +494,8 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.action([&](parser_t& p) {
auto _h = p.get<bool>("host");
auto _d = p.get<bool>("device");
update_env(_data, "OMNITRACE_USE_PROCESS_SAMPLING", _h || _d);
update_env(_data, "OMNITRACE_USE_ROCM_SMI", _d);
update_env(_data, "ROCPROFSYS_USE_PROCESS_SAMPLING", _h || _d);
update_env(_data, "ROCPROFSYS_USE_ROCM_SMI", _d);
});
_data.processed_environs.emplace("device");
@@ -512,11 +512,11 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("seconds")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_TRACE_DELAY", p.get<double>("wait"),
update_env(_data, "ROCPROFSYS_TRACE_DELAY", p.get<double>("wait"),
UPD_WEAK);
update_env(_data, "OMNITRACE_SAMPLING_DELAY", p.get<double>("wait"),
update_env(_data, "ROCPROFSYS_SAMPLING_DELAY", p.get<double>("wait"),
UPD_WEAK);
update_env(_data, "OMNITRACE_CAUSAL_DELAY", p.get<double>("wait"),
update_env(_data, "ROCPROFSYS_CAUSAL_DELAY", p.get<double>("wait"),
UPD_WEAK);
});
@@ -533,11 +533,11 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("seconds")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_TRACE_DURATION", p.get<double>("duration"),
update_env(_data, "ROCPROFSYS_TRACE_DURATION", p.get<double>("duration"),
UPD_WEAK);
update_env(_data, "OMNITRACE_SAMPLING_DURATION",
update_env(_data, "ROCPROFSYS_SAMPLING_DURATION",
p.get<double>("duration"), UPD_WEAK);
update_env(_data, "OMNITRACE_CAUSAL_DURATION", p.get<double>("duration"),
update_env(_data, "ROCPROFSYS_CAUSAL_DURATION", p.get<double>("duration"),
UPD_WEAK);
});
@@ -555,7 +555,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.dtype("period-spec(s)")
.action([&](parser_t& p) {
update_env(
_data, "OMNITRACE_TRACE_PERIODS",
_data, "ROCPROFSYS_TRACE_PERIODS",
join(array_config_t{ " ", "", "" }, p.get<strvec_t>("periods")),
UPD_WEAK);
});
@@ -567,28 +567,28 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
"rcclp", "rocm-smi", "roctracer", "rocprofiler",
"roctx", "mutex-locks", "spin-locks", "rw-locks" };
#if !defined(OMNITRACE_USE_MPI) && !defined(OMNITRACE_USE_MPI_HEADERS)
#if !defined(ROCPROFSYS_USE_MPI) && !defined(ROCPROFSYS_USE_MPI_HEADERS)
_backend_choices.erase("mpip");
#endif
#if !defined(OMNITRACE_USE_OMPT)
#if !defined(ROCPROFSYS_USE_OMPT)
_backend_choices.erase("ompt");
#endif
#if !defined(OMNITRACE_USE_RCCL)
#if !defined(ROCPROFSYS_USE_RCCL)
_backend_choices.erase("rcclp");
#endif
#if !defined(OMNITRACE_USE_ROCM_SMI)
#if !defined(ROCPROFSYS_USE_ROCM_SMI)
_backend_choices.erase("rocm-smi");
#endif
#if !defined(OMNITRACE_USE_ROCTRACER)
#if !defined(ROCPROFSYS_USE_ROCTRACER)
_backend_choices.erase("roctracer");
_backend_choices.erase("roctx");
#endif
#if !defined(OMNITRACE_USE_ROCPROFILER)
#if !defined(ROCPROFSYS_USE_ROCPROFILER)
_backend_choices.erase("rocprofiler");
#endif
@@ -599,25 +599,25 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
_backend_choices.erase("roctracer");
_backend_choices.erase("rocprofiler");
#if defined(OMNITRACE_USE_RCCL)
update_env(_data, "OMNITRACE_USE_RCCLP", false);
#if defined(ROCPROFSYS_USE_RCCL)
update_env(_data, "ROCPROFSYS_USE_RCCLP", false);
#endif
#if defined(OMNITRACE_USE_ROCM_SMI)
update_env(_data, "OMNITRACE_USE_ROCM_SMI", false);
#if defined(ROCPROFSYS_USE_ROCM_SMI)
update_env(_data, "ROCPROFSYS_USE_ROCM_SMI", false);
#endif
#if defined(OMNITRACE_USE_ROCTRACER)
update_env(_data, "OMNITRACE_USE_ROCTRACER", false);
update_env(_data, "OMNITRACE_USE_ROCTX", false);
update_env(_data, "OMNITRACE_ROCTRACER_HSA_ACTIVITY", false);
update_env(_data, "OMNITRACE_ROCTRACER_HIP_ACTIVITY", false);
#if defined(ROCPROFSYS_USE_ROCTRACER)
update_env(_data, "ROCPROFSYS_USE_ROCTRACER", false);
update_env(_data, "ROCPROFSYS_USE_ROCTX", false);
update_env(_data, "ROCPROFSYS_ROCTRACER_HSA_ACTIVITY", false);
update_env(_data, "ROCPROFSYS_ROCTRACER_HIP_ACTIVITY", false);
_backend_choices.erase("roctracer");
_backend_choices.erase("roctx");
#endif
#if defined(OMNITRACE_USE_ROCPROFILER)
update_env(_data, "OMNITRACE_USE_ROCPROFILER", false);
#if defined(ROCPROFSYS_USE_ROCPROFILER)
update_env(_data, "ROCPROFSYS_USE_ROCPROFILER", false);
#endif
}
@@ -637,17 +637,17 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
auto _update = [&](const auto& _opt, bool _cond) {
if(_cond || _v.count("all") > 0) update_env(_data, _opt, true);
};
_update("OMNITRACE_USE_KOKKOSP", _v.count("kokkosp") > 0);
_update("OMNITRACE_USE_MPIP", _v.count("mpip") > 0);
_update("OMNITRACE_USE_OMPT", _v.count("ompt") > 0);
_update("OMNITRACE_USE_RCCLP", _v.count("rcclp") > 0);
_update("OMNITRACE_USE_ROCTX", _v.count("roctx") > 0);
_update("OMNITRACE_USE_ROCM_SMI", _v.count("rocm-smi") > 0);
_update("OMNITRACE_USE_ROCTRACER", _v.count("roctracer") > 0);
_update("OMNITRACE_USE_ROCPROFILER", _v.count("rocprofiler") > 0);
_update("OMNITRACE_TRACE_THREAD_LOCKS", _v.count("mutex-locks") > 0);
_update("OMNITRACE_TRACE_THREAD_RW_LOCKS", _v.count("rw-locks") > 0);
_update("OMNITRACE_TRACE_THREAD_SPIN_LOCKS", _v.count("spin-locks") > 0);
_update("ROCPROFSYS_USE_KOKKOSP", _v.count("kokkosp") > 0);
_update("ROCPROFSYS_USE_MPIP", _v.count("mpip") > 0);
_update("ROCPROFSYS_USE_OMPT", _v.count("ompt") > 0);
_update("ROCPROFSYS_USE_RCCLP", _v.count("rcclp") > 0);
_update("ROCPROFSYS_USE_ROCTX", _v.count("roctx") > 0);
_update("ROCPROFSYS_USE_ROCM_SMI", _v.count("rocm-smi") > 0);
_update("ROCPROFSYS_USE_ROCTRACER", _v.count("roctracer") > 0);
_update("ROCPROFSYS_USE_ROCPROFILER", _v.count("rocprofiler") > 0);
_update("ROCPROFSYS_TRACE_THREAD_LOCKS", _v.count("mutex-locks") > 0);
_update("ROCPROFSYS_TRACE_THREAD_RW_LOCKS", _v.count("rw-locks") > 0);
_update("ROCPROFSYS_TRACE_THREAD_SPIN_LOCKS", _v.count("spin-locks") > 0);
if(_v.count("all") > 0 || _v.count("ompt") > 0)
update_env(_data, "OMP_TOOL_LIBRARIES", _data.dl_libpath,
@@ -673,17 +673,17 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
auto _update = [&](const auto& _opt, bool _cond) {
if(_cond || _v.count("all") > 0) update_env(_data, _opt, false);
};
_update("OMNITRACE_USE_KOKKOSP", _v.count("kokkosp") > 0);
_update("OMNITRACE_USE_MPIP", _v.count("mpip") > 0);
_update("OMNITRACE_USE_OMPT", _v.count("ompt") > 0);
_update("OMNITRACE_USE_RCCLP", _v.count("rcclp") > 0);
_update("OMNITRACE_USE_ROCTX", _v.count("roctx") > 0);
_update("OMNITRACE_USE_ROCM_SMI", _v.count("rocm-smi") > 0);
_update("OMNITRACE_USE_ROCTRACER", _v.count("roctracer") > 0);
_update("OMNITRACE_USE_ROCPROFILER", _v.count("rocprofiler") > 0);
_update("OMNITRACE_TRACE_THREAD_LOCKS", _v.count("mutex-locks") > 0);
_update("OMNITRACE_TRACE_THREAD_RW_LOCKS", _v.count("rw-locks") > 0);
_update("OMNITRACE_TRACE_THREAD_SPIN_LOCKS", _v.count("spin-locks") > 0);
_update("ROCPROFSYS_USE_KOKKOSP", _v.count("kokkosp") > 0);
_update("ROCPROFSYS_USE_MPIP", _v.count("mpip") > 0);
_update("ROCPROFSYS_USE_OMPT", _v.count("ompt") > 0);
_update("ROCPROFSYS_USE_RCCLP", _v.count("rcclp") > 0);
_update("ROCPROFSYS_USE_ROCTX", _v.count("roctx") > 0);
_update("ROCPROFSYS_USE_ROCM_SMI", _v.count("rocm-smi") > 0);
_update("ROCPROFSYS_USE_ROCTRACER", _v.count("roctracer") > 0);
_update("ROCPROFSYS_USE_ROCPROFILER", _v.count("rocprofiler") > 0);
_update("ROCPROFSYS_TRACE_THREAD_LOCKS", _v.count("mutex-locks") > 0);
_update("ROCPROFSYS_TRACE_THREAD_RW_LOCKS", _v.count("rw-locks") > 0);
_update("ROCPROFSYS_TRACE_THREAD_SPIN_LOCKS", _v.count("spin-locks") > 0);
if(_v.count("all") > 0 ||
(_v.count("roctracer") > 0 && _v.count("rocprofiler") > 0))
@@ -746,7 +746,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("filepath")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_PERFETTO_FILE",
update_env(_data, "ROCPROFSYS_PERFETTO_FILE",
p.get<std::string>("trace-file"));
});
@@ -762,7 +762,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("KB")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_PERFETTO_BUFFER_SIZE_KB",
update_env(_data, "ROCPROFSYS_PERFETTO_BUFFER_SIZE_KB",
p.get<int64_t>("trace-buffer-size"));
});
@@ -777,7 +777,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.dtype("policy")
.choices({ "discard", "ring_buffer" })
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_PERFETTO_FILL_POLICY",
update_env(_data, "ROCPROFSYS_PERFETTO_FILL_POLICY",
p.get<std::string>("trace-fill-policy"));
});
@@ -797,7 +797,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("seconds")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_TRACE_DELAY", p.get<double>("trace-wait"));
update_env(_data, "ROCPROFSYS_TRACE_DELAY", p.get<double>("trace-wait"));
});
_data.processed_environs.emplace("trace_delay");
@@ -814,7 +814,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("seconds")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_TRACE_DURATION",
update_env(_data, "ROCPROFSYS_TRACE_DURATION",
p.get<double>("trace-duration"));
});
@@ -833,7 +833,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.min_count(1)
.dtype("period-spec(s)")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_TRACE_PERIODS",
update_env(_data, "ROCPROFSYS_TRACE_PERIODS",
join(array_config_t{ ",", "", "" },
p.get<strvec_t>("trace-periods")));
});
@@ -855,11 +855,11 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
"active "
"threads would equate to ~1 second of realtime. If this proves to be "
"difficult to handle in practice, please file a feature request for "
"omnitrace to auto-scale based on the number of threads.")
"rocprof-sys to auto-scale based on the number of threads.")
.count(1)
.dtype("clock-id")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_TRACE_PERIOD_CLOCK_ID",
update_env(_data, "ROCPROFSYS_TRACE_PERIOD_CLOCK_ID",
p.get<double>("trace-clock-id"));
})
.choices(_clock_id_choices.first)
@@ -883,12 +883,12 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.choices({ "text", "json", "console" })
.action([&](parser_t& p) {
auto _v = p.get<strset_t>("profile-format");
update_env(_data, "OMNITRACE_PROFILE", true);
update_env(_data, "ROCPROFSYS_PROFILE", true);
if(!_v.empty())
{
update_env(_data, "OMNITRACE_TEXT_OUTPUT", _v.count("text") != 0);
update_env(_data, "OMNITRACE_JSON_OUTPUT", _v.count("json") != 0);
update_env(_data, "OMNITRACE_COUT_OUTPUT", _v.count("console") != 0);
update_env(_data, "ROCPROFSYS_TEXT_OUTPUT", _v.count("text") != 0);
update_env(_data, "ROCPROFSYS_JSON_OUTPUT", _v.count("json") != 0);
update_env(_data, "ROCPROFSYS_COUT_OUTPUT", _v.count("console") != 0);
}
});
@@ -911,9 +911,9 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.dtype("path [prefix]")
.action([&](parser_t& p) {
auto _v = p.get<strvec_t>("profile-diff");
update_env(_data, "OMNITRACE_DIFF_OUTPUT", true);
update_env(_data, "OMNITRACE_INPUT_PATH", _v.at(0));
if(_v.size() > 1) update_env(_data, "OMNITRACE_INPUT_PREFIX", _v.at(1));
update_env(_data, "ROCPROFSYS_DIFF_OUTPUT", true);
update_env(_data, "ROCPROFSYS_INPUT_PATH", _v.at(0));
if(_v.size() > 1) update_env(_data, "ROCPROFSYS_INPUT_PREFIX", _v.at(1));
});
_data.processed_environs.emplace("profile_diff");
@@ -936,7 +936,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("floating-point")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_PROCESS_SAMPLING_FREQ",
update_env(_data, "ROCPROFSYS_PROCESS_SAMPLING_FREQ",
p.get<double>("process-freq"));
});
@@ -953,7 +953,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("seconds")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_PROCESS_SAMPLING_DELAY",
update_env(_data, "ROCPROFSYS_PROCESS_SAMPLING_DELAY",
p.get<double>("process-wait"));
});
@@ -970,7 +970,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("seconds")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_SAMPLING_PROCESS_DURATION",
update_env(_data, "ROCPROFSYS_SAMPLING_PROCESS_DURATION",
p.get<double>("process-duration"));
});
@@ -987,7 +987,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.dtype("int and/or range")
.required({ "host" })
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_SAMPLING_CPUS",
update_env(_data, "ROCPROFSYS_SAMPLING_CPUS",
join(array_config_t{ "," }, p.get<strvec_t>("cpus")));
});
@@ -1003,7 +1003,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.dtype("int and/or range")
.required({ "device" })
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_SAMPLING_GPUS",
update_env(_data, "ROCPROFSYS_SAMPLING_GPUS",
join(array_config_t{ "," }, p.get<strvec_t>("gpus")));
});
@@ -1023,7 +1023,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("floating-point")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_SAMPLING_FREQ",
update_env(_data, "ROCPROFSYS_SAMPLING_FREQ",
p.get<double>("sampling-freq"));
});
@@ -1042,7 +1042,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.dtype("int and/or range")
.action([&](parser_t& p) {
update_env(
_data, "OMNITRACE_SAMPLING_TIDS",
_data, "ROCPROFSYS_SAMPLING_TIDS",
join(array_config_t{ ", " }, p.get<std::vector<int64_t>>("tids")));
});
@@ -1063,7 +1063,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("seconds")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_SAMPLING_DELAY",
update_env(_data, "ROCPROFSYS_SAMPLING_DELAY",
p.get<double>("sampling-wait"));
});
@@ -1082,7 +1082,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.count(1)
.dtype("seconds")
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_SAMPLING_DURATION",
update_env(_data, "ROCPROFSYS_SAMPLING_DURATION",
p.get<double>("sampling-duration"));
});
@@ -1100,20 +1100,20 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.dtype("[freq] [delay] [tids...]")
.action([&](parser_t& p) {
auto _v = p.get<std::deque<std::string>>("sample-cputime");
update_env(_data, "OMNITRACE_SAMPLING_CPUTIME", true);
update_env(_data, "ROCPROFSYS_SAMPLING_CPUTIME", true);
if(!_v.empty())
{
update_env(_data, "OMNITRACE_SAMPLING_CPUTIME_FREQ", _v.front());
update_env(_data, "ROCPROFSYS_SAMPLING_CPUTIME_FREQ", _v.front());
_v.pop_front();
}
if(!_v.empty())
{
update_env(_data, "OMNITRACE_SAMPLING_CPUTIME_DELAY", _v.front());
update_env(_data, "ROCPROFSYS_SAMPLING_CPUTIME_DELAY", _v.front());
_v.pop_front();
}
if(!_v.empty())
{
update_env(_data, "OMNITRACE_SAMPLING_CPUTIME_TIDS",
update_env(_data, "ROCPROFSYS_SAMPLING_CPUTIME_TIDS",
join(array_config_t{ "," }, _v));
}
});
@@ -1129,20 +1129,20 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.required(std::move(_realtime_reqs))
.action([&](parser_t& p) {
auto _v = p.get<std::deque<std::string>>("sample-realtime");
update_env(_data, "OMNITRACE_SAMPLING_REALTIME", true);
update_env(_data, "ROCPROFSYS_SAMPLING_REALTIME", true);
if(!_v.empty())
{
update_env(_data, "OMNITRACE_SAMPLING_REALTIME_FREQ", _v.front());
update_env(_data, "ROCPROFSYS_SAMPLING_REALTIME_FREQ", _v.front());
_v.pop_front();
}
if(!_v.empty())
{
update_env(_data, "OMNITRACE_SAMPLING_REALTIME_DELAY", _v.front());
update_env(_data, "ROCPROFSYS_SAMPLING_REALTIME_DELAY", _v.front());
_v.pop_front();
}
if(!_v.empty())
{
update_env(_data, "OMNITRACE_SAMPLING_REALTIME_TIDS",
update_env(_data, "ROCPROFSYS_SAMPLING_REALTIME_TIDS",
join(array_config_t{ "," }, _v));
}
});
@@ -1157,7 +1157,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
.dtype("[event] [freq] [tids...]")
.action([&](parser_t& p) {
auto _v = p.get<std::deque<std::string>>("sample-overflow");
update_env(_data, "OMNITRACE_SAMPLING_OVERFLOW", true);
update_env(_data, "ROCPROFSYS_SAMPLING_OVERFLOW", true);
if(!_v.empty())
{
@@ -1167,17 +1167,17 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
"", "'--sample-overflow ", _v.front(),
" ...' conflicts with '--sampling-overflow-event ",
p.get<std::string>("sampling-overflow-event"), "' option"));
update_env(_data, "OMNITRACE_SAMPLING_OVERFLOW_EVENT", _v.front());
update_env(_data, "ROCPROFSYS_SAMPLING_OVERFLOW_EVENT", _v.front());
_v.pop_front();
}
if(!_v.empty())
{
update_env(_data, "OMNITRACE_SAMPLING_OVERFLOW_FREQ", _v.front());
update_env(_data, "ROCPROFSYS_SAMPLING_OVERFLOW_FREQ", _v.front());
_v.pop_front();
}
if(!_v.empty())
{
update_env(_data, "OMNITRACE_SAMPLING_OVERFLOW_TIDS",
update_env(_data, "ROCPROFSYS_SAMPLING_OVERFLOW_TIDS",
join(array_config_t{ "," }, _v));
}
});
@@ -1191,37 +1191,37 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
add_group_arguments(_parser, "sampling", _data);
_parser.start_group("HARDWARE COUNTER OPTIONS", "See also: omnitrace-avail -H");
_parser.start_group("HARDWARE COUNTER OPTIONS", "See also: rocprof-sys-avail -H");
if(_data.environ_filter("cpu_events", _data))
{
_parser
.add_argument({ "-C", "--cpu-events" },
"Set the CPU hardware counter events to record (ref: "
"`omnitrace-avail -H -c CPU`)")
"`rocprof-sys-avail -H -c CPU`)")
.min_count(1)
.dtype("[EVENT ...]")
.action([&](parser_t& p) {
auto _events = join(array_config_t{ "," }, p.get<strvec_t>("cpu-events"));
update_env(_data, "OMNITRACE_PAPI_EVENTS", _events);
update_env(_data, "ROCPROFSYS_PAPI_EVENTS", _events);
});
_data.processed_environs.emplace("cpu_events");
_data.processed_environs.emplace("papi_events");
}
#if defined(OMNITRACE_USE_ROCPROFILER)
#if defined(ROCPROFSYS_USE_ROCPROFILER)
if(_data.environ_filter("gpu_events", _data))
{
_parser
.add_argument({ "-G", "--gpu-events" },
"Set the GPU hardware counter events to record (ref: "
"`omnitrace-avail -H -c GPU`)")
"`rocprof-sys-avail -H -c GPU`)")
.min_count(1)
.dtype("[EVENT ...]")
.action([&](parser_t& p) {
auto _events = join(array_config_t{ "," }, p.get<strvec_t>("gpu-events"));
update_env(_data, "OMNITRACE_ROCM_EVENTS", _events);
update_env(_data, "ROCPROFSYS_ROCM_EVENTS", _events);
});
_data.processed_environs.emplace("gpu_events");
@@ -1244,7 +1244,7 @@ add_core_arguments(parser_t& _parser, parser_data& _data)
"Include inline info in output when available")
.max_count(1)
.action([&](parser_t& p) {
update_env(_data, "OMNITRACE_SAMPLING_INCLUDE_INLINES",
update_env(_data, "ROCPROFSYS_SAMPLING_INCLUDE_INLINES",
p.get<bool>("inlines"));
});
@@ -1328,9 +1328,9 @@ add_group_arguments(parser_t& _parser, const std::string& _group_name, parser_da
};
auto _settings = std::vector<std::shared_ptr<tim::vsettings>>{};
for(auto& itr : *omnitrace::settings::instance())
for(auto& itr : *rocprofsys::settings::instance())
{
if(itr.second->get_categories().count("omnitrace") == 0) continue;
if(itr.second->get_categories().count("rocprofsys") == 0) continue;
if(itr.second->get_categories().count("deprecated") > 0) continue;
if(itr.second->get_hidden()) continue;
if(!_data.setting_filter(itr.second.get(), _data)) continue;
@@ -1353,7 +1353,7 @@ add_group_arguments(parser_t& _parser, const std::string& _group_name, parser_da
}),
_choices.end());
_choices.emplace_back(
"... run `omnitrace-avail -H -c CPU` for full list ...");
"... run `rocprof-sys-avail -H -c CPU` for full list ...");
itr.second->set_choices(_choices);
}
}
@@ -1390,9 +1390,9 @@ add_extended_arguments(parser_t& _parser, parser_data& _data)
{
auto _category_count_map = std::unordered_map<std::string, uint32_t>{};
auto _settings = std::vector<std::shared_ptr<tim::vsettings>>{};
for(auto& itr : *omnitrace::settings::instance())
for(auto& itr : *rocprofsys::settings::instance())
{
if(itr.second->get_categories().count("omnitrace") == 0) continue;
if(itr.second->get_categories().count("rocprofsys") == 0) continue;
if(itr.second->get_categories().count("deprecated") > 0) continue;
if(itr.second->get_hidden()) continue;
if(!_data.setting_filter(itr.second.get(), _data)) continue;
@@ -1414,15 +1414,14 @@ add_extended_arguments(parser_t& _parser, parser_data& _data)
}),
_choices.end());
_choices.emplace_back(
"... run `omnitrace-avail -H -c CPU` for full list ...");
"... run `rocprof-sys-avail -H -c CPU` for full list ...");
itr.second->set_choices(_choices);
}
for(const auto& citr : itr.second->get_categories())
{
if(std::regex_search(
citr, std::regex{
"omnitrace|timemory|^(native|custom|advanced|analysis)$" }))
if(std::regex_search(citr, std::regex{ "rocprofsys|timemory|^("
"native|custom|advanced|analysis)$" }))
continue;
_category_count_map[citr] += 1;
}
@@ -1467,4 +1466,4 @@ add_extended_arguments(parser_t& _parser, parser_data& _data)
return _data;
}
} // namespace argparse
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -31,7 +31,7 @@
#include <set>
#include <vector>
namespace omnitrace
namespace rocprofsys
{
namespace argparse
{
@@ -93,4 +93,4 @@ add_group_arguments(parser_t&, const std::string&, parser_data&, bool _add_group
parser_data&
add_extended_arguments(parser_t&, parser_data&);
} // namespace argparse
} // namespace omnitrace
} // namespace rocprofsys
@@ -4,4 +4,5 @@ set(binary_sources ${CMAKE_CURRENT_LIST_DIR}/address_range.cpp)
set(binary_headers ${CMAKE_CURRENT_LIST_DIR}/address_range.hpp
${CMAKE_CURRENT_LIST_DIR}/fwd.hpp)
target_sources(omnitrace-core-library PRIVATE ${binary_sources} ${binary_headers})
target_sources(rocprofiler-systems-core-library PRIVATE ${binary_sources}
${binary_headers})
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,7 @@
#include "binary/address_range.hpp"
#include "debug.hpp"
namespace omnitrace
namespace rocprofsys
{
namespace binary
{
@@ -187,4 +187,4 @@ address_range::hash() const
: hash_value_t{ low };
}
} // namespace binary
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@
#include <cstdint>
#include <limits>
namespace omnitrace
namespace rocprofsys
{
namespace binary
{
@@ -43,7 +43,7 @@ struct address_range
uintptr_t low = std::numeric_limits<uintptr_t>::max();
uintptr_t high = std::numeric_limits<uintptr_t>::min();
OMNITRACE_DEFAULT_OBJECT(address_range)
ROCPROFSYS_DEFAULT_OBJECT(address_range)
explicit address_range(uintptr_t _v);
address_range(uintptr_t _low, uintptr_t _high);
@@ -89,14 +89,14 @@ operator+(uintptr_t _v, binary::address_range _lhs)
{
return (_lhs += _v);
}
} // namespace omnitrace
} // namespace rocprofsys
namespace std
{
template <>
struct hash<::omnitrace::binary::address_range>
struct hash<::rocprofsys::binary::address_range>
{
using address_range_t = ::omnitrace::binary::address_range;
using address_range_t = ::rocprofsys::binary::address_range;
auto operator()(const address_range_t& _v) const { return _v.hash(); }
auto operator()(address_range_t&& _v) const { return _v.hash(); }
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -43,7 +43,7 @@
#include <tuple>
#include <variant>
namespace omnitrace
namespace rocprofsys
{
namespace binary
{
@@ -59,4 +59,4 @@ struct symbol;
struct dwarf_entry;
struct binary_info;
} // namespace binary
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -31,7 +31,7 @@
#include <set>
#include <string>
namespace omnitrace
namespace rocprofsys
{
namespace categories
{
@@ -44,8 +44,8 @@ configure_categories(bool _enable, const std::set<std::string>& _categories)
auto _name = trait::name<Tp>::value;
if(_categories.count(_name) > 0)
{
OMNITRACE_VERBOSE_F(3, "%s category: %s\n", (_enable) ? "Enabling" : "Disabling",
_name);
ROCPROFSYS_VERBOSE_F(3, "%s category: %s\n", (_enable) ? "Enabling" : "Disabling",
_name);
trait::runtime_enabled<Tp>::set(_enable);
}
}
@@ -61,11 +61,11 @@ configure_categories(bool _enable, const std::set<std::string>& _categories,
void
configure_categories(bool _enable, const std::set<std::string>& _categories)
{
OMNITRACE_VERBOSE_F(1, "%s categories...\n", (_enable) ? "Enabling" : "Disabling");
ROCPROFSYS_VERBOSE_F(1, "%s categories...\n", (_enable) ? "Enabling" : "Disabling");
configure_categories(
_enable, _categories,
utility::make_index_sequence_range<1, OMNITRACE_CATEGORY_LAST>{});
utility::make_index_sequence_range<1, ROCPROFSYS_CATEGORY_LAST>{});
}
} // namespace
@@ -74,7 +74,7 @@ enable_categories(const std::set<std::string>& _categories)
{
configure_categories(
true, _categories,
utility::make_index_sequence_range<1, OMNITRACE_CATEGORY_LAST>{});
utility::make_index_sequence_range<1, ROCPROFSYS_CATEGORY_LAST>{});
}
void
@@ -82,7 +82,7 @@ disable_categories(const std::set<std::string>& _categories)
{
configure_categories(
false, _categories,
utility::make_index_sequence_range<1, OMNITRACE_CATEGORY_LAST>{});
utility::make_index_sequence_range<1, ROCPROFSYS_CATEGORY_LAST>{});
}
void
@@ -138,4 +138,4 @@ shutdown()
disable_categories(config::get_enabled_categories());
}
} // namespace categories
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
#include "common/join.hpp"
#include "defines.hpp"
#include "omnitrace/categories.h" // in omnitrace-user
#include "rocprofiler-systems/categories.h" // in rocprof-sys-user
#if defined(TIMEMORY_PERFETTO_CATEGORIES)
# error "TIMEMORY_PERFETTO_CATEGORIES is already defined. Please include \"" __FILE__ "\" before including any timemory files"
@@ -35,7 +35,7 @@
#include <timemory/mpl/macros.hpp>
#include <timemory/mpl/types.hpp>
#define OMNITRACE_DEFINE_NAME_TRAIT(NAME, DESC, ...) \
#define ROCPROFSYS_DEFINE_NAME_TRAIT(NAME, DESC, ...) \
namespace tim \
{ \
namespace trait \
@@ -49,7 +49,7 @@
} \
}
namespace omnitrace
namespace rocprofsys
{
template <size_t>
struct category_type_id;
@@ -59,10 +59,10 @@ struct category_enum_id;
template <size_t Idx>
using category_type_id_t = typename category_type_id<Idx>::type;
} // namespace omnitrace
} // namespace rocprofsys
#define OMNITRACE_DEFINE_CATEGORY_TRAIT(TYPE, ENUM) \
namespace omnitrace \
#define ROCPROFSYS_DEFINE_CATEGORY_TRAIT(TYPE, ENUM) \
namespace rocprofsys \
{ \
template <> \
struct category_type_id<ENUM> \
@@ -76,61 +76,61 @@ using category_type_id_t = typename category_type_id<Idx>::type;
}; \
}
#define OMNITRACE_DECLARE_CATEGORY(NS, VALUE, ENUM, NAME, DESC) \
#define ROCPROFSYS_DECLARE_CATEGORY(NS, VALUE, ENUM, NAME, DESC) \
TIMEMORY_DECLARE_NS_API(NS, VALUE) \
OMNITRACE_DEFINE_NAME_TRAIT(NAME, DESC, NS::VALUE) \
OMNITRACE_DEFINE_CATEGORY_TRAIT(::tim::NS::VALUE, ENUM)
#define OMNITRACE_DEFINE_CATEGORY(NS, VALUE, ENUM, NAME, DESC) \
ROCPROFSYS_DEFINE_NAME_TRAIT(NAME, DESC, NS::VALUE) \
ROCPROFSYS_DEFINE_CATEGORY_TRAIT(::tim::NS::VALUE, ENUM)
#define ROCPROFSYS_DEFINE_CATEGORY(NS, VALUE, ENUM, NAME, DESC) \
TIMEMORY_DEFINE_NS_API(NS, VALUE) \
OMNITRACE_DEFINE_NAME_TRAIT(NAME, DESC, NS::VALUE) \
OMNITRACE_DEFINE_CATEGORY_TRAIT(::tim::NS::VALUE, ENUM)
ROCPROFSYS_DEFINE_NAME_TRAIT(NAME, DESC, NS::VALUE) \
ROCPROFSYS_DEFINE_CATEGORY_TRAIT(::tim::NS::VALUE, ENUM)
// clang-format off
// these are defined by omnitrace
OMNITRACE_DEFINE_CATEGORY(project, omnitrace, OMNITRACE_CATEGORY_NONE, "omnitrace", "Omnitrace project")
OMNITRACE_DEFINE_CATEGORY(category, host, OMNITRACE_CATEGORY_HOST, "host", "Host-side function tracing")
OMNITRACE_DEFINE_CATEGORY(category, user, OMNITRACE_CATEGORY_USER, "user", "User-defined regions")
OMNITRACE_DEFINE_CATEGORY(category, python, OMNITRACE_CATEGORY_PYTHON, "python", "Python regions")
OMNITRACE_DEFINE_CATEGORY(category, device_hip, OMNITRACE_CATEGORY_DEVICE_HIP, "device_hip", "Device-side functions submitted via HIP API")
OMNITRACE_DEFINE_CATEGORY(category, device_hsa, OMNITRACE_CATEGORY_DEVICE_HSA, "device_hsa", "Device-side functions submitted via HSA API")
OMNITRACE_DEFINE_CATEGORY(category, rocm_hip, OMNITRACE_CATEGORY_ROCM_HIP, "rocm_hip", "Host-side HIP functions")
OMNITRACE_DEFINE_CATEGORY(category, rocm_hsa, OMNITRACE_CATEGORY_ROCM_HSA, "rocm_hsa", "Host-side HSA functions")
OMNITRACE_DEFINE_CATEGORY(category, rocm_roctx, OMNITRACE_CATEGORY_ROCM_ROCTX, "rocm_roctx", "ROCTx labels")
OMNITRACE_DEFINE_CATEGORY(category, rocm_smi, OMNITRACE_CATEGORY_ROCM_SMI, "rocm_smi", "rocm-smi data")
OMNITRACE_DEFINE_CATEGORY(category, rocm_smi_busy, OMNITRACE_CATEGORY_ROCM_SMI_BUSY, "device_busy", "Busy percentage of a GPU device")
OMNITRACE_DEFINE_CATEGORY(category, rocm_smi_temp, OMNITRACE_CATEGORY_ROCM_SMI_TEMP, "device_temp", "Temperature of a GPU device")
OMNITRACE_DEFINE_CATEGORY(category, rocm_smi_power, OMNITRACE_CATEGORY_ROCM_SMI_POWER, "device_power", "Power consumption of a GPU device")
OMNITRACE_DEFINE_CATEGORY(category, rocm_smi_memory_usage, OMNITRACE_CATEGORY_ROCM_SMI_MEMORY_USAGE, "device_memory_usage", "Memory usage of a GPU device")
OMNITRACE_DEFINE_CATEGORY(category, rocm_rccl, OMNITRACE_CATEGORY_ROCM_RCCL, "rccl", "ROCm Communication Collectives Library (RCCL) regions")
OMNITRACE_DEFINE_CATEGORY(category, roctracer, OMNITRACE_CATEGORY_ROCTRACER, "roctracer", "Kernel tracing provided by roctracer")
OMNITRACE_DEFINE_CATEGORY(category, rocprofiler, OMNITRACE_CATEGORY_ROCPROFILER, "rocprofiler", "HW counter data provided by rocprofiler")
OMNITRACE_DEFINE_CATEGORY(category, pthread, OMNITRACE_CATEGORY_PTHREAD, "pthread", "POSIX threading functions")
OMNITRACE_DEFINE_CATEGORY(category, kokkos, OMNITRACE_CATEGORY_KOKKOS, "kokkos", "KokkosTools regions")
OMNITRACE_DEFINE_CATEGORY(category, mpi, OMNITRACE_CATEGORY_MPI, "mpi", "MPI regions")
OMNITRACE_DEFINE_CATEGORY(category, ompt, OMNITRACE_CATEGORY_OMPT, "ompt", "OpenMP tools regions")
OMNITRACE_DEFINE_CATEGORY(category, process_sampling, OMNITRACE_CATEGORY_PROCESS_SAMPLING, "process_sampling", "Process-level data")
OMNITRACE_DEFINE_CATEGORY(category, comm_data, OMNITRACE_CATEGORY_COMM_DATA, "comm_data", "MPI/RCCL counters for tracking amount of data sent or received")
OMNITRACE_DEFINE_CATEGORY(category, causal, OMNITRACE_CATEGORY_CAUSAL, "causal", "Causal profiling data")
OMNITRACE_DEFINE_CATEGORY(category, cpu_freq, OMNITRACE_CATEGORY_CPU_FREQ, "cpu_frequency", "CPU frequency (collected in background thread)")
OMNITRACE_DEFINE_CATEGORY(category, process_page, OMNITRACE_CATEGORY_PROCESS_PAGE, "process_page_fault", "Memory page faults in process (collected in background thread)")
OMNITRACE_DEFINE_CATEGORY(category, process_virt, OMNITRACE_CATEGORY_PROCESS_VIRT, "process_virtual_memory", "Virtual memory usage in process in MB (collected in background thread)")
OMNITRACE_DEFINE_CATEGORY(category, process_peak, OMNITRACE_CATEGORY_PROCESS_PEAK, "process_memory_hwm", "Memory High-Water Mark i.e. peak memory usage (collected in background thread)")
OMNITRACE_DEFINE_CATEGORY(category, process_context_switch, OMNITRACE_CATEGORY_PROCESS_CONTEXT_SWITCH, "process_context_switch", "Context switches in process (collected in background thread)")
OMNITRACE_DEFINE_CATEGORY(category, process_page_fault, OMNITRACE_CATEGORY_PROCESS_PAGE_FAULT, "process_page_fault", "Memory page faults in process (collected in background thread)")
OMNITRACE_DEFINE_CATEGORY(category, process_user_mode_time, OMNITRACE_CATEGORY_PROCESS_USER_MODE_TIME, "process_user_cpu_time", "CPU time of functions executing in user-space in process in seconds (collected in background thread)")
OMNITRACE_DEFINE_CATEGORY(category, process_kernel_mode_time, OMNITRACE_CATEGORY_PROCESS_KERNEL_MODE_TIME, "process_kernel_cpu_time", "CPU time of functions executing in kernel-space in process in seconds (collected in background thread)")
OMNITRACE_DEFINE_CATEGORY(category, thread_wall_time, OMNITRACE_CATEGORY_THREAD_WALL_TIME, "thread_wall_time", "Wall-clock time on thread (derived from sampling)")
OMNITRACE_DEFINE_CATEGORY(category, thread_cpu_time, OMNITRACE_CATEGORY_THREAD_CPU_TIME, "thread_cpu_time", "CPU time on thread (derived from sampling)")
OMNITRACE_DEFINE_CATEGORY(category, thread_page_fault, OMNITRACE_CATEGORY_THREAD_PAGE_FAULT, "thread_page_fault", "Memory page faults on thread (derived from sampling)")
OMNITRACE_DEFINE_CATEGORY(category, thread_peak_memory, OMNITRACE_CATEGORY_THREAD_PEAK_MEMORY, "thread_peak_memory", "Peak memory usage on thread in MB (derived from sampling)")
OMNITRACE_DEFINE_CATEGORY(category, thread_context_switch, OMNITRACE_CATEGORY_THREAD_CONTEXT_SWITCH, "thread_context_switch", "Context switches on thread (derived from sampling)")
OMNITRACE_DEFINE_CATEGORY(category, thread_hardware_counter, OMNITRACE_CATEGORY_THREAD_HARDWARE_COUNTER, "thread_hardware_counter", "Hardware counter value on thread (derived from sampling)")
OMNITRACE_DEFINE_CATEGORY(category, kernel_hardware_counter, OMNITRACE_CATEGORY_KERNEL_HARDWARE_COUNTER, "kernel_hardware_counter", "Hardware counter value for kernel (deterministic)")
OMNITRACE_DEFINE_CATEGORY(category, numa, OMNITRACE_CATEGORY_NUMA, "numa", "Non-unified memory architecture")
OMNITRACE_DEFINE_CATEGORY(category, timer_sampling, OMNITRACE_CATEGORY_TIMER_SAMPLING, "timer_sampling", "Sampling based on a timer")
OMNITRACE_DEFINE_CATEGORY(category, overflow_sampling, OMNITRACE_CATEGORY_OVERFLOW_SAMPLING, "overflow_sampling", "Sampling based on a counter overflow")
// these are defined by rocprofsys
ROCPROFSYS_DEFINE_CATEGORY(project, rocprofsys, ROCPROFSYS_CATEGORY_NONE, "rocprofsys", "ROCm Systems Profiler project")
ROCPROFSYS_DEFINE_CATEGORY(category, host, ROCPROFSYS_CATEGORY_HOST, "host", "Host-side function tracing")
ROCPROFSYS_DEFINE_CATEGORY(category, user, ROCPROFSYS_CATEGORY_USER, "user", "User-defined regions")
ROCPROFSYS_DEFINE_CATEGORY(category, python, ROCPROFSYS_CATEGORY_PYTHON, "python", "Python regions")
ROCPROFSYS_DEFINE_CATEGORY(category, device_hip, ROCPROFSYS_CATEGORY_DEVICE_HIP, "device_hip", "Device-side functions submitted via HIP API")
ROCPROFSYS_DEFINE_CATEGORY(category, device_hsa, ROCPROFSYS_CATEGORY_DEVICE_HSA, "device_hsa", "Device-side functions submitted via HSA API")
ROCPROFSYS_DEFINE_CATEGORY(category, rocm_hip, ROCPROFSYS_CATEGORY_ROCM_HIP, "rocm_hip", "Host-side HIP functions")
ROCPROFSYS_DEFINE_CATEGORY(category, rocm_hsa, ROCPROFSYS_CATEGORY_ROCM_HSA, "rocm_hsa", "Host-side HSA functions")
ROCPROFSYS_DEFINE_CATEGORY(category, rocm_roctx, ROCPROFSYS_CATEGORY_ROCM_ROCTX, "rocm_roctx", "ROCTx labels")
ROCPROFSYS_DEFINE_CATEGORY(category, rocm_smi, ROCPROFSYS_CATEGORY_ROCM_SMI, "rocm_smi", "rocm-smi data")
ROCPROFSYS_DEFINE_CATEGORY(category, rocm_smi_busy, ROCPROFSYS_CATEGORY_ROCM_SMI_BUSY, "device_busy", "Busy percentage of a GPU device")
ROCPROFSYS_DEFINE_CATEGORY(category, rocm_smi_temp, ROCPROFSYS_CATEGORY_ROCM_SMI_TEMP, "device_temp", "Temperature of a GPU device")
ROCPROFSYS_DEFINE_CATEGORY(category, rocm_smi_power, ROCPROFSYS_CATEGORY_ROCM_SMI_POWER, "device_power", "Power consumption of a GPU device")
ROCPROFSYS_DEFINE_CATEGORY(category, rocm_smi_memory_usage, ROCPROFSYS_CATEGORY_ROCM_SMI_MEMORY_USAGE, "device_memory_usage", "Memory usage of a GPU device")
ROCPROFSYS_DEFINE_CATEGORY(category, rocm_rccl, ROCPROFSYS_CATEGORY_ROCM_RCCL, "rccl", "ROCm Communication Collectives Library (RCCL) regions")
ROCPROFSYS_DEFINE_CATEGORY(category, roctracer, ROCPROFSYS_CATEGORY_ROCTRACER, "roctracer", "Kernel tracing provided by roctracer")
ROCPROFSYS_DEFINE_CATEGORY(category, rocprofiler, ROCPROFSYS_CATEGORY_ROCPROFILER, "rocprofiler", "HW counter data provided by rocprofiler")
ROCPROFSYS_DEFINE_CATEGORY(category, pthread, ROCPROFSYS_CATEGORY_PTHREAD, "pthread", "POSIX threading functions")
ROCPROFSYS_DEFINE_CATEGORY(category, kokkos, ROCPROFSYS_CATEGORY_KOKKOS, "kokkos", "KokkosTools regions")
ROCPROFSYS_DEFINE_CATEGORY(category, mpi, ROCPROFSYS_CATEGORY_MPI, "mpi", "MPI regions")
ROCPROFSYS_DEFINE_CATEGORY(category, ompt, ROCPROFSYS_CATEGORY_OMPT, "ompt", "OpenMP tools regions")
ROCPROFSYS_DEFINE_CATEGORY(category, process_sampling, ROCPROFSYS_CATEGORY_PROCESS_SAMPLING, "process_sampling", "Process-level data")
ROCPROFSYS_DEFINE_CATEGORY(category, comm_data, ROCPROFSYS_CATEGORY_COMM_DATA, "comm_data", "MPI/RCCL counters for tracking amount of data sent or received")
ROCPROFSYS_DEFINE_CATEGORY(category, causal, ROCPROFSYS_CATEGORY_CAUSAL, "causal", "Causal profiling data")
ROCPROFSYS_DEFINE_CATEGORY(category, cpu_freq, ROCPROFSYS_CATEGORY_CPU_FREQ, "cpu_frequency", "CPU frequency (collected in background thread)")
ROCPROFSYS_DEFINE_CATEGORY(category, process_page, ROCPROFSYS_CATEGORY_PROCESS_PAGE, "process_page_fault", "Memory page faults in process (collected in background thread)")
ROCPROFSYS_DEFINE_CATEGORY(category, process_virt, ROCPROFSYS_CATEGORY_PROCESS_VIRT, "process_virtual_memory", "Virtual memory usage in process in MB (collected in background thread)")
ROCPROFSYS_DEFINE_CATEGORY(category, process_peak, ROCPROFSYS_CATEGORY_PROCESS_PEAK, "process_memory_hwm", "Memory High-Water Mark i.e. peak memory usage (collected in background thread)")
ROCPROFSYS_DEFINE_CATEGORY(category, process_context_switch, ROCPROFSYS_CATEGORY_PROCESS_CONTEXT_SWITCH, "process_context_switch", "Context switches in process (collected in background thread)")
ROCPROFSYS_DEFINE_CATEGORY(category, process_page_fault, ROCPROFSYS_CATEGORY_PROCESS_PAGE_FAULT, "process_page_fault", "Memory page faults in process (collected in background thread)")
ROCPROFSYS_DEFINE_CATEGORY(category, process_user_mode_time, ROCPROFSYS_CATEGORY_PROCESS_USER_MODE_TIME, "process_user_cpu_time", "CPU time of functions executing in user-space in process in seconds (collected in background thread)")
ROCPROFSYS_DEFINE_CATEGORY(category, process_kernel_mode_time, ROCPROFSYS_CATEGORY_PROCESS_KERNEL_MODE_TIME, "process_kernel_cpu_time", "CPU time of functions executing in kernel-space in process in seconds (collected in background thread)")
ROCPROFSYS_DEFINE_CATEGORY(category, thread_wall_time, ROCPROFSYS_CATEGORY_THREAD_WALL_TIME, "thread_wall_time", "Wall-clock time on thread (derived from sampling)")
ROCPROFSYS_DEFINE_CATEGORY(category, thread_cpu_time, ROCPROFSYS_CATEGORY_THREAD_CPU_TIME, "thread_cpu_time", "CPU time on thread (derived from sampling)")
ROCPROFSYS_DEFINE_CATEGORY(category, thread_page_fault, ROCPROFSYS_CATEGORY_THREAD_PAGE_FAULT, "thread_page_fault", "Memory page faults on thread (derived from sampling)")
ROCPROFSYS_DEFINE_CATEGORY(category, thread_peak_memory, ROCPROFSYS_CATEGORY_THREAD_PEAK_MEMORY, "thread_peak_memory", "Peak memory usage on thread in MB (derived from sampling)")
ROCPROFSYS_DEFINE_CATEGORY(category, thread_context_switch, ROCPROFSYS_CATEGORY_THREAD_CONTEXT_SWITCH, "thread_context_switch", "Context switches on thread (derived from sampling)")
ROCPROFSYS_DEFINE_CATEGORY(category, thread_hardware_counter, ROCPROFSYS_CATEGORY_THREAD_HARDWARE_COUNTER, "thread_hardware_counter", "Hardware counter value on thread (derived from sampling)")
ROCPROFSYS_DEFINE_CATEGORY(category, kernel_hardware_counter, ROCPROFSYS_CATEGORY_KERNEL_HARDWARE_COUNTER, "kernel_hardware_counter", "Hardware counter value for kernel (deterministic)")
ROCPROFSYS_DEFINE_CATEGORY(category, numa, ROCPROFSYS_CATEGORY_NUMA, "numa", "Non-unified memory architecture")
ROCPROFSYS_DEFINE_CATEGORY(category, timer_sampling, ROCPROFSYS_CATEGORY_TIMER_SAMPLING, "timer_sampling", "Sampling based on a timer")
ROCPROFSYS_DEFINE_CATEGORY(category, overflow_sampling, ROCPROFSYS_CATEGORY_OVERFLOW_SAMPLING, "overflow_sampling", "Sampling based on a counter overflow")
OMNITRACE_DECLARE_CATEGORY(category, sampling, OMNITRACE_CATEGORY_SAMPLING, "sampling", "Host-side call-stack sampling")
ROCPROFSYS_DECLARE_CATEGORY(category, sampling, ROCPROFSYS_CATEGORY_SAMPLING, "sampling", "Host-side call-stack sampling")
// clang-format on
namespace tim
@@ -142,64 +142,64 @@ using name = perfetto_category<Tp...>;
}
} // namespace tim
#define OMNITRACE_PERFETTO_CATEGORY(TYPE) \
#define ROCPROFSYS_PERFETTO_CATEGORY(TYPE) \
::perfetto::Category(::tim::trait::perfetto_category<::tim::TYPE>::value) \
.SetDescription(::tim::trait::perfetto_category<::tim::TYPE>::description)
#define OMNITRACE_PERFETTO_CATEGORIES \
OMNITRACE_PERFETTO_CATEGORY(category::host), \
OMNITRACE_PERFETTO_CATEGORY(category::user), \
OMNITRACE_PERFETTO_CATEGORY(category::python), \
OMNITRACE_PERFETTO_CATEGORY(category::sampling), \
OMNITRACE_PERFETTO_CATEGORY(category::device_hip), \
OMNITRACE_PERFETTO_CATEGORY(category::device_hsa), \
OMNITRACE_PERFETTO_CATEGORY(category::rocm_hip), \
OMNITRACE_PERFETTO_CATEGORY(category::rocm_hsa), \
OMNITRACE_PERFETTO_CATEGORY(category::rocm_roctx), \
OMNITRACE_PERFETTO_CATEGORY(category::rocm_smi), \
OMNITRACE_PERFETTO_CATEGORY(category::rocm_smi_busy), \
OMNITRACE_PERFETTO_CATEGORY(category::rocm_smi_temp), \
OMNITRACE_PERFETTO_CATEGORY(category::rocm_smi_power), \
OMNITRACE_PERFETTO_CATEGORY(category::rocm_smi_memory_usage), \
OMNITRACE_PERFETTO_CATEGORY(category::rocm_rccl), \
OMNITRACE_PERFETTO_CATEGORY(category::roctracer), \
OMNITRACE_PERFETTO_CATEGORY(category::rocprofiler), \
OMNITRACE_PERFETTO_CATEGORY(category::pthread), \
OMNITRACE_PERFETTO_CATEGORY(category::kokkos), \
OMNITRACE_PERFETTO_CATEGORY(category::mpi), \
OMNITRACE_PERFETTO_CATEGORY(category::ompt), \
OMNITRACE_PERFETTO_CATEGORY(category::sampling), \
OMNITRACE_PERFETTO_CATEGORY(category::process_sampling), \
OMNITRACE_PERFETTO_CATEGORY(category::comm_data), \
OMNITRACE_PERFETTO_CATEGORY(category::causal), \
OMNITRACE_PERFETTO_CATEGORY(category::cpu_freq), \
OMNITRACE_PERFETTO_CATEGORY(category::process_page), \
OMNITRACE_PERFETTO_CATEGORY(category::process_virt), \
OMNITRACE_PERFETTO_CATEGORY(category::process_peak), \
OMNITRACE_PERFETTO_CATEGORY(category::process_context_switch), \
OMNITRACE_PERFETTO_CATEGORY(category::process_page_fault), \
OMNITRACE_PERFETTO_CATEGORY(category::process_user_mode_time), \
OMNITRACE_PERFETTO_CATEGORY(category::process_kernel_mode_time), \
OMNITRACE_PERFETTO_CATEGORY(category::thread_wall_time), \
OMNITRACE_PERFETTO_CATEGORY(category::thread_cpu_time), \
OMNITRACE_PERFETTO_CATEGORY(category::thread_page_fault), \
OMNITRACE_PERFETTO_CATEGORY(category::thread_peak_memory), \
OMNITRACE_PERFETTO_CATEGORY(category::thread_context_switch), \
OMNITRACE_PERFETTO_CATEGORY(category::thread_hardware_counter), \
OMNITRACE_PERFETTO_CATEGORY(category::kernel_hardware_counter), \
OMNITRACE_PERFETTO_CATEGORY(category::numa), \
OMNITRACE_PERFETTO_CATEGORY(category::timer_sampling), \
OMNITRACE_PERFETTO_CATEGORY(category::overflow_sampling), \
#define ROCPROFSYS_PERFETTO_CATEGORIES \
ROCPROFSYS_PERFETTO_CATEGORY(category::host), \
ROCPROFSYS_PERFETTO_CATEGORY(category::user), \
ROCPROFSYS_PERFETTO_CATEGORY(category::python), \
ROCPROFSYS_PERFETTO_CATEGORY(category::sampling), \
ROCPROFSYS_PERFETTO_CATEGORY(category::device_hip), \
ROCPROFSYS_PERFETTO_CATEGORY(category::device_hsa), \
ROCPROFSYS_PERFETTO_CATEGORY(category::rocm_hip), \
ROCPROFSYS_PERFETTO_CATEGORY(category::rocm_hsa), \
ROCPROFSYS_PERFETTO_CATEGORY(category::rocm_roctx), \
ROCPROFSYS_PERFETTO_CATEGORY(category::rocm_smi), \
ROCPROFSYS_PERFETTO_CATEGORY(category::rocm_smi_busy), \
ROCPROFSYS_PERFETTO_CATEGORY(category::rocm_smi_temp), \
ROCPROFSYS_PERFETTO_CATEGORY(category::rocm_smi_power), \
ROCPROFSYS_PERFETTO_CATEGORY(category::rocm_smi_memory_usage), \
ROCPROFSYS_PERFETTO_CATEGORY(category::rocm_rccl), \
ROCPROFSYS_PERFETTO_CATEGORY(category::roctracer), \
ROCPROFSYS_PERFETTO_CATEGORY(category::rocprofiler), \
ROCPROFSYS_PERFETTO_CATEGORY(category::pthread), \
ROCPROFSYS_PERFETTO_CATEGORY(category::kokkos), \
ROCPROFSYS_PERFETTO_CATEGORY(category::mpi), \
ROCPROFSYS_PERFETTO_CATEGORY(category::ompt), \
ROCPROFSYS_PERFETTO_CATEGORY(category::sampling), \
ROCPROFSYS_PERFETTO_CATEGORY(category::process_sampling), \
ROCPROFSYS_PERFETTO_CATEGORY(category::comm_data), \
ROCPROFSYS_PERFETTO_CATEGORY(category::causal), \
ROCPROFSYS_PERFETTO_CATEGORY(category::cpu_freq), \
ROCPROFSYS_PERFETTO_CATEGORY(category::process_page), \
ROCPROFSYS_PERFETTO_CATEGORY(category::process_virt), \
ROCPROFSYS_PERFETTO_CATEGORY(category::process_peak), \
ROCPROFSYS_PERFETTO_CATEGORY(category::process_context_switch), \
ROCPROFSYS_PERFETTO_CATEGORY(category::process_page_fault), \
ROCPROFSYS_PERFETTO_CATEGORY(category::process_user_mode_time), \
ROCPROFSYS_PERFETTO_CATEGORY(category::process_kernel_mode_time), \
ROCPROFSYS_PERFETTO_CATEGORY(category::thread_wall_time), \
ROCPROFSYS_PERFETTO_CATEGORY(category::thread_cpu_time), \
ROCPROFSYS_PERFETTO_CATEGORY(category::thread_page_fault), \
ROCPROFSYS_PERFETTO_CATEGORY(category::thread_peak_memory), \
ROCPROFSYS_PERFETTO_CATEGORY(category::thread_context_switch), \
ROCPROFSYS_PERFETTO_CATEGORY(category::thread_hardware_counter), \
ROCPROFSYS_PERFETTO_CATEGORY(category::kernel_hardware_counter), \
ROCPROFSYS_PERFETTO_CATEGORY(category::numa), \
ROCPROFSYS_PERFETTO_CATEGORY(category::timer_sampling), \
ROCPROFSYS_PERFETTO_CATEGORY(category::overflow_sampling), \
::perfetto::Category("timemory").SetDescription("Events from the timemory API")
#if defined(TIMEMORY_USE_PERFETTO)
# define TIMEMORY_PERFETTO_CATEGORIES OMNITRACE_PERFETTO_CATEGORIES
# define TIMEMORY_PERFETTO_CATEGORIES ROCPROFSYS_PERFETTO_CATEGORIES
#endif
#include <set>
#include <string>
namespace omnitrace
namespace rocprofsys
{
inline namespace config
{
@@ -224,4 +224,4 @@ setup();
void
shutdown();
} // namespace categories
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -50,8 +50,8 @@
#include <utility>
#include <vector>
#define OMNITRACE_DECLARE_COMPONENT(NAME) \
namespace omnitrace \
#define ROCPROFSYS_DECLARE_COMPONENT(NAME) \
namespace rocprofsys \
{ \
namespace component \
{ \
@@ -63,7 +63,7 @@
namespace trait \
{ \
template <> \
struct is_component<omnitrace::component::NAME> : true_type \
struct is_component<rocprofsys::component::NAME> : true_type \
{}; \
} \
} \
@@ -71,12 +71,12 @@
{ \
namespace component \
{ \
using ::omnitrace::component::NAME; \
using ::rocprofsys::component::NAME; \
} \
}
#define OMNITRACE_COMPONENT_ALIAS(NAME, ...) \
namespace omnitrace \
#define ROCPROFSYS_COMPONENT_ALIAS(NAME, ...) \
namespace rocprofsys \
{ \
namespace component \
{ \
@@ -87,22 +87,22 @@
{ \
namespace component \
{ \
using ::omnitrace::component::NAME; \
using ::rocprofsys::component::NAME; \
} \
}
#define OMNITRACE_DEFINE_CONCRETE_TRAIT(TRAIT, TYPE, VALUE) \
#define ROCPROFSYS_DEFINE_CONCRETE_TRAIT(TRAIT, TYPE, VALUE) \
namespace tim \
{ \
namespace trait \
{ \
template <> \
struct TRAIT<::omnitrace::TYPE> : VALUE \
struct TRAIT<::rocprofsys::TYPE> : VALUE \
{}; \
} \
}
namespace omnitrace
namespace rocprofsys
{
namespace api = ::tim::api; // NOLINT
namespace category = ::tim::category; // NOLINT
@@ -126,9 +126,9 @@ struct construct_on_thread
{
int64_t index = threading::get_id();
};
} // namespace omnitrace
} // namespace rocprofsys
// same sort of functionality as python's " ".join([...])
#if !defined(JOIN)
# define JOIN(...) ::omnitrace::common::join(__VA_ARGS__)
# define JOIN(...) ::rocprofsys::common::join(__VA_ARGS__)
#endif
@@ -3,4 +3,5 @@ set(component_sources)
set(component_headers ${CMAKE_CURRENT_LIST_DIR}/fwd.hpp)
target_sources(omnitrace-core-library PRIVATE ${component_sources} ${component_headers})
target_sources(rocprofiler-systems-core-library PRIVATE ${component_sources}
${component_headers})
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -39,15 +39,15 @@
#include <type_traits>
OMNITRACE_DECLARE_COMPONENT(roctracer)
OMNITRACE_DECLARE_COMPONENT(rocprofiler)
OMNITRACE_DECLARE_COMPONENT(rcclp_handle)
OMNITRACE_DECLARE_COMPONENT(comm_data)
ROCPROFSYS_DECLARE_COMPONENT(roctracer)
ROCPROFSYS_DECLARE_COMPONENT(rocprofiler)
ROCPROFSYS_DECLARE_COMPONENT(rcclp_handle)
ROCPROFSYS_DECLARE_COMPONENT(comm_data)
OMNITRACE_COMPONENT_ALIAS(comm_data_tracker_t,
::tim::component::data_tracker<float, project::omnitrace>)
ROCPROFSYS_COMPONENT_ALIAS(comm_data_tracker_t,
::tim::component::data_tracker<float, project::rocprofsys>)
namespace omnitrace
namespace rocprofsys
{
namespace policy = ::tim::policy; // NOLINT
namespace comp = ::tim::component; // NOLINT
@@ -94,161 +94,162 @@ template <typename ApiT, typename StartFuncT = default_functor_t,
typename StopFuncT = default_functor_t>
struct functors;
} // namespace component
} // namespace omnitrace
} // namespace rocprofsys
#if !defined(OMNITRACE_USE_ROCTRACER)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::roctracer, false_type)
#if !defined(ROCPROFSYS_USE_ROCTRACER)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::roctracer, false_type)
#endif
#if !defined(OMNITRACE_USE_ROCPROFILER)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::rocprofiler, false_type)
#if !defined(ROCPROFSYS_USE_ROCPROFILER)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::rocprofiler, false_type)
#endif
#if !defined(OMNITRACE_USE_RCCL)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, category::rocm_rccl, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::rcclp_handle, false_type)
#if !defined(ROCPROFSYS_USE_RCCL)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, category::rocm_rccl, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::rcclp_handle, false_type)
#endif
#if !defined(OMNITRACE_USE_RCCL) && !defined(OMNITRACE_USE_MPI)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::comm_data_tracker_t, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::comm_data, false_type)
#if !defined(ROCPROFSYS_USE_RCCL) && !defined(ROCPROFSYS_USE_MPI)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::comm_data_tracker_t, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::comm_data, false_type)
#endif
#if !defined(TIMEMORY_USE_LIBUNWIND)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, category::sampling, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::backtrace, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::backtrace_metrics, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::backtrace_timestamp, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_wall_clock, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_cpu_clock, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_percent, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, category::sampling, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::backtrace, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::backtrace_metrics, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::backtrace_timestamp, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_wall_clock, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_cpu_clock, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_percent, false_type)
#endif
#if !defined(TIMEMORY_USE_LIBUNWIND) || !defined(OMNITRACE_USE_ROCM_SMI)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_gpu_busy, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_gpu_temp, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_gpu_power, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_gpu_memory, false_type)
#if !defined(TIMEMORY_USE_LIBUNWIND) || !defined(ROCPROFSYS_USE_ROCM_SMI)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_gpu_busy, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_gpu_temp, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_gpu_power, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_available, component::sampling_gpu_memory, false_type)
#endif
TIMEMORY_SET_COMPONENT_API(omnitrace::component::roctracer, project::omnitrace,
TIMEMORY_SET_COMPONENT_API(rocprofsys::component::roctracer, project::rocprofsys,
tpls::rocm, device::gpu, os::supports_linux,
category::external)
TIMEMORY_SET_COMPONENT_API(omnitrace::component::rocprofiler, project::omnitrace,
TIMEMORY_SET_COMPONENT_API(rocprofsys::component::rocprofiler, project::rocprofsys,
tpls::rocm, device::gpu, os::supports_linux,
category::external, category::hardware_counter)
TIMEMORY_SET_COMPONENT_API(omnitrace::component::sampling_wall_clock, project::omnitrace,
TIMEMORY_SET_COMPONENT_API(rocprofsys::component::sampling_wall_clock,
project::rocprofsys, category::timing, os::supports_unix,
category::sampling, category::interrupt_sampling)
TIMEMORY_SET_COMPONENT_API(rocprofsys::component::sampling_cpu_clock, project::rocprofsys,
category::timing, os::supports_unix, category::sampling,
category::interrupt_sampling)
TIMEMORY_SET_COMPONENT_API(omnitrace::component::sampling_cpu_clock, project::omnitrace,
TIMEMORY_SET_COMPONENT_API(rocprofsys::component::sampling_percent, project::rocprofsys,
category::timing, os::supports_unix, category::sampling,
category::interrupt_sampling)
TIMEMORY_SET_COMPONENT_API(omnitrace::component::sampling_percent, project::omnitrace,
category::timing, os::supports_unix, category::sampling,
category::interrupt_sampling)
TIMEMORY_SET_COMPONENT_API(omnitrace::component::sampling_gpu_busy, project::omnitrace,
TIMEMORY_SET_COMPONENT_API(rocprofsys::component::sampling_gpu_busy, project::rocprofsys,
tpls::rocm, device::gpu, os::supports_linux,
category::sampling, category::process_sampling)
TIMEMORY_SET_COMPONENT_API(omnitrace::component::sampling_gpu_memory, project::omnitrace,
tpls::rocm, device::gpu, os::supports_linux, category::memory,
category::sampling, category::process_sampling)
TIMEMORY_SET_COMPONENT_API(omnitrace::component::sampling_gpu_power, project::omnitrace,
TIMEMORY_SET_COMPONENT_API(rocprofsys::component::sampling_gpu_memory,
project::rocprofsys, tpls::rocm, device::gpu,
os::supports_linux, category::memory, category::sampling,
category::process_sampling)
TIMEMORY_SET_COMPONENT_API(rocprofsys::component::sampling_gpu_power, project::rocprofsys,
tpls::rocm, device::gpu, os::supports_linux, category::power,
category::sampling, category::process_sampling)
TIMEMORY_SET_COMPONENT_API(omnitrace::component::sampling_gpu_temp, project::omnitrace,
TIMEMORY_SET_COMPONENT_API(rocprofsys::component::sampling_gpu_temp, project::rocprofsys,
tpls::rocm, device::gpu, os::supports_linux,
category::temperature, category::sampling,
category::process_sampling)
TIMEMORY_METADATA_SPECIALIZATION(omnitrace::component::roctracer, "roctracer",
TIMEMORY_METADATA_SPECIALIZATION(rocprofsys::component::roctracer, "roctracer",
"High-precision ROCm API and kernel tracing", "")
TIMEMORY_METADATA_SPECIALIZATION(omnitrace::component::rocprofiler, "rocprofiler",
TIMEMORY_METADATA_SPECIALIZATION(rocprofsys::component::rocprofiler, "rocprofiler",
"ROCm kernel hardware counters", "")
TIMEMORY_METADATA_SPECIALIZATION(omnitrace::component::sampling_wall_clock,
TIMEMORY_METADATA_SPECIALIZATION(rocprofsys::component::sampling_wall_clock,
"sampling_wall_clock", "Wall-clock timing",
"Derived from statistical sampling")
TIMEMORY_METADATA_SPECIALIZATION(omnitrace::component::sampling_cpu_clock,
TIMEMORY_METADATA_SPECIALIZATION(rocprofsys::component::sampling_cpu_clock,
"sampling_cpu_clock", "CPU-clock timing",
"Derived from statistical sampling")
TIMEMORY_METADATA_SPECIALIZATION(omnitrace::component::sampling_percent,
TIMEMORY_METADATA_SPECIALIZATION(rocprofsys::component::sampling_percent,
"sampling_percent",
"Fraction of wall-clock time spent in functions",
"Derived from statistical sampling")
TIMEMORY_METADATA_SPECIALIZATION(omnitrace::component::sampling_gpu_busy,
TIMEMORY_METADATA_SPECIALIZATION(rocprofsys::component::sampling_gpu_busy,
"sampling_gpu_busy",
"GPU Utilization (% busy) via ROCm-SMI",
"Derived from sampling")
TIMEMORY_METADATA_SPECIALIZATION(omnitrace::component::sampling_gpu_memory,
TIMEMORY_METADATA_SPECIALIZATION(rocprofsys::component::sampling_gpu_memory,
"sampling_gpu_memory_usage",
"GPU Memory Usage via ROCm-SMI", "Derived from sampling")
TIMEMORY_METADATA_SPECIALIZATION(omnitrace::component::sampling_gpu_power,
TIMEMORY_METADATA_SPECIALIZATION(rocprofsys::component::sampling_gpu_power,
"sampling_gpu_power", "GPU Power Usage via ROCm-SMI",
"Derived from sampling")
TIMEMORY_METADATA_SPECIALIZATION(omnitrace::component::sampling_gpu_temp,
TIMEMORY_METADATA_SPECIALIZATION(rocprofsys::component::sampling_gpu_temp,
"sampling_gpu_temp", "GPU Temperature via ROCm-SMI",
"Derived from sampling")
// statistics type
TIMEMORY_STATISTICS_TYPE(omnitrace::component::sampling_wall_clock, double)
TIMEMORY_STATISTICS_TYPE(omnitrace::component::sampling_cpu_clock, double)
TIMEMORY_STATISTICS_TYPE(omnitrace::component::sampling_gpu_busy, double)
TIMEMORY_STATISTICS_TYPE(omnitrace::component::sampling_gpu_temp, double)
TIMEMORY_STATISTICS_TYPE(omnitrace::component::sampling_gpu_power, double)
TIMEMORY_STATISTICS_TYPE(omnitrace::component::sampling_gpu_memory, double)
TIMEMORY_STATISTICS_TYPE(omnitrace::component::comm_data_tracker_t, float)
TIMEMORY_STATISTICS_TYPE(rocprofsys::component::sampling_wall_clock, double)
TIMEMORY_STATISTICS_TYPE(rocprofsys::component::sampling_cpu_clock, double)
TIMEMORY_STATISTICS_TYPE(rocprofsys::component::sampling_gpu_busy, double)
TIMEMORY_STATISTICS_TYPE(rocprofsys::component::sampling_gpu_temp, double)
TIMEMORY_STATISTICS_TYPE(rocprofsys::component::sampling_gpu_power, double)
TIMEMORY_STATISTICS_TYPE(rocprofsys::component::sampling_gpu_memory, double)
TIMEMORY_STATISTICS_TYPE(rocprofsys::component::comm_data_tracker_t, float)
// enable timing units
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_timing_category, component::sampling_wall_clock,
true_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_timing_category, component::sampling_cpu_clock,
true_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_timing_category, component::sampling_percent,
true_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(uses_timing_units, component::sampling_wall_clock,
true_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(uses_timing_units, component::sampling_cpu_clock,
true_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_timing_category, component::sampling_wall_clock,
true_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_timing_category, component::sampling_cpu_clock,
true_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_timing_category, component::sampling_percent,
true_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(uses_timing_units, component::sampling_wall_clock,
true_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(uses_timing_units, component::sampling_cpu_clock,
true_type)
// enable percent units
OMNITRACE_DEFINE_CONCRETE_TRAIT(uses_percent_units, component::sampling_gpu_busy,
true_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(uses_percent_units, component::sampling_percent,
true_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(uses_percent_units, component::sampling_gpu_busy,
true_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(uses_percent_units, component::sampling_percent,
true_type)
// enable memory units
OMNITRACE_DEFINE_CONCRETE_TRAIT(is_memory_category, component::sampling_gpu_memory,
true_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(uses_memory_units, component::sampling_gpu_memory,
true_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(is_memory_category, component::sampling_gpu_memory,
true_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(uses_memory_units, component::sampling_gpu_memory,
true_type)
// reporting categories (sum)
OMNITRACE_DEFINE_CONCRETE_TRAIT(report_sum, component::sampling_gpu_busy, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(report_sum, component::sampling_gpu_temp, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(report_sum, component::sampling_gpu_power, false_type)
OMNITRACE_DEFINE_CONCRETE_TRAIT(report_sum, component::sampling_gpu_memory, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(report_sum, component::sampling_gpu_busy, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(report_sum, component::sampling_gpu_temp, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(report_sum, component::sampling_gpu_power, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(report_sum, component::sampling_gpu_memory, false_type)
// reporting categories (mean)
OMNITRACE_DEFINE_CONCRETE_TRAIT(report_mean, component::sampling_percent, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(report_mean, component::sampling_percent, false_type)
// reporting categories (stats)
OMNITRACE_DEFINE_CONCRETE_TRAIT(report_statistics, component::sampling_percent,
false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(report_statistics, component::sampling_percent,
false_type)
// reporting categories (self)
OMNITRACE_DEFINE_CONCRETE_TRAIT(report_self, component::sampling_percent, false_type)
ROCPROFSYS_DEFINE_CONCRETE_TRAIT(report_self, component::sampling_percent, false_type)
#define OMNITRACE_DECLARE_EXTERN_COMPONENT(NAME, HAS_DATA, ...) \
#define ROCPROFSYS_DECLARE_EXTERN_COMPONENT(NAME, HAS_DATA, ...) \
TIMEMORY_DECLARE_EXTERN_TEMPLATE( \
struct tim::component::base<TIMEMORY_ESC(omnitrace::component::NAME), \
struct tim::component::base<TIMEMORY_ESC(rocprofsys::component::NAME), \
__VA_ARGS__>) \
TIMEMORY_DECLARE_EXTERN_OPERATIONS(TIMEMORY_ESC(omnitrace::component::NAME), \
TIMEMORY_DECLARE_EXTERN_OPERATIONS(TIMEMORY_ESC(rocprofsys::component::NAME), \
HAS_DATA) \
TIMEMORY_DECLARE_EXTERN_STORAGE(TIMEMORY_ESC(omnitrace::component::NAME))
TIMEMORY_DECLARE_EXTERN_STORAGE(TIMEMORY_ESC(rocprofsys::component::NAME))
#define OMNITRACE_INSTANTIATE_EXTERN_COMPONENT(NAME, HAS_DATA, ...) \
#define ROCPROFSYS_INSTANTIATE_EXTERN_COMPONENT(NAME, HAS_DATA, ...) \
TIMEMORY_INSTANTIATE_EXTERN_TEMPLATE( \
struct tim::component::base<TIMEMORY_ESC(omnitrace::component::NAME), \
struct tim::component::base<TIMEMORY_ESC(rocprofsys::component::NAME), \
__VA_ARGS__>) \
TIMEMORY_INSTANTIATE_EXTERN_OPERATIONS(TIMEMORY_ESC(omnitrace::component::NAME), \
TIMEMORY_INSTANTIATE_EXTERN_OPERATIONS(TIMEMORY_ESC(rocprofsys::component::NAME), \
HAS_DATA) \
TIMEMORY_INSTANTIATE_EXTERN_STORAGE(TIMEMORY_ESC(omnitrace::component::NAME))
TIMEMORY_INSTANTIATE_EXTERN_STORAGE(TIMEMORY_ESC(rocprofsys::component::NAME))
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -31,16 +31,16 @@
#include <optional>
#include <type_traits>
namespace omnitrace
namespace rocprofsys
{
namespace concepts = ::tim::concepts; // NOLINT
static constexpr size_t max_supported_threads = OMNITRACE_MAX_THREADS;
static constexpr size_t max_supported_threads = ROCPROFSYS_MAX_THREADS;
template <typename Tp>
struct thread_deleter;
// unique ptr type for omnitrace
// unique ptr type for rocprof-sys
template <typename Tp>
using unique_ptr_t = std::unique_ptr<Tp, thread_deleter<Tp>>;
@@ -59,7 +59,7 @@ make_unique(Args&&... args)
{
return unique_ptr_t<Tp>{ new Tp{ std::forward<Args>(args)... } };
}
} // namespace omnitrace
} // namespace rocprofsys
namespace tim
{
@@ -70,7 +70,7 @@ struct is_unique_pointer : std::false_type
{};
template <typename Tp>
struct is_unique_pointer<::omnitrace::unique_ptr_t<Tp>> : std::true_type
struct is_unique_pointer<::rocprofsys::unique_ptr_t<Tp>> : std::true_type
{};
template <typename Tp>
File diff ditekan karena terlalu besar Load Diff
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -35,7 +35,7 @@
#include <string_view>
#include <unordered_set>
namespace omnitrace
namespace rocprofsys
{
//
// Initialization routines
@@ -49,7 +49,7 @@ using signal_handler_t = void (*)(void);
signal_handler_t set_signal_handler(signal_handler_t);
bool
settings_are_configured() OMNITRACE_HOT;
settings_are_configured() ROCPROFSYS_HOT;
void
configure_settings(bool _init = true);
@@ -156,10 +156,10 @@ bool&
is_binary_rewrite();
bool
get_is_continuous_integration() OMNITRACE_HOT;
get_is_continuous_integration() ROCPROFSYS_HOT;
bool
get_debug_env() OMNITRACE_HOT;
get_debug_env() ROCPROFSYS_HOT;
bool
get_debug_init();
@@ -168,49 +168,49 @@ bool
get_debug_finalize();
bool
get_debug() OMNITRACE_HOT;
get_debug() ROCPROFSYS_HOT;
bool
get_debug_sampling() OMNITRACE_HOT;
get_debug_sampling() ROCPROFSYS_HOT;
bool
get_debug_tid() OMNITRACE_HOT;
get_debug_tid() ROCPROFSYS_HOT;
bool
get_debug_pid() OMNITRACE_HOT;
get_debug_pid() ROCPROFSYS_HOT;
int
get_verbose_env() OMNITRACE_HOT;
get_verbose_env() ROCPROFSYS_HOT;
int
get_verbose() OMNITRACE_HOT;
get_verbose() ROCPROFSYS_HOT;
bool&
get_use_perfetto() OMNITRACE_HOT;
get_use_perfetto() ROCPROFSYS_HOT;
bool&
get_use_timemory() OMNITRACE_HOT;
get_use_timemory() ROCPROFSYS_HOT;
bool&
get_use_causal() OMNITRACE_HOT;
get_use_causal() ROCPROFSYS_HOT;
bool
get_use_roctracer() OMNITRACE_HOT;
get_use_roctracer() ROCPROFSYS_HOT;
bool
get_use_rocprofiler() OMNITRACE_HOT;
get_use_rocprofiler() ROCPROFSYS_HOT;
bool
get_use_rocm_smi() OMNITRACE_HOT;
get_use_rocm_smi() ROCPROFSYS_HOT;
bool
get_use_roctx();
bool&
get_use_sampling() OMNITRACE_HOT;
get_use_sampling() ROCPROFSYS_HOT;
bool&
get_use_process_sampling() OMNITRACE_HOT;
get_use_process_sampling() ROCPROFSYS_HOT;
bool&
get_use_pid();
@@ -267,7 +267,7 @@ std::set<std::string>
get_disabled_categories();
bool
get_perfetto_annotations() OMNITRACE_HOT;
get_perfetto_annotations() ROCPROFSYS_HOT;
uint64_t
get_thread_pool_size();
@@ -278,12 +278,12 @@ get_trace_hsa_api_types();
std::string&
get_perfetto_backend();
// make this visible so omnitrace-avail can call it
// make this visible so rocprof-sys-avail can call it
std::string
get_perfetto_output_filename();
bool
get_perfetto_roctracer_per_stream() OMNITRACE_HOT;
get_perfetto_roctracer_per_stream() ROCPROFSYS_HOT;
double
get_trace_delay();
@@ -424,4 +424,4 @@ get_causal_source_exclude();
std::vector<std::string>
get_causal_function_exclude();
} // namespace config
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -36,7 +36,7 @@
#include <thread>
#include <type_traits>
namespace omnitrace
namespace rocprofsys
{
namespace constraint
{
@@ -47,7 +47,7 @@ namespace units = ::tim::units;
using clock_type = std::chrono::high_resolution_clock;
using duration_type = std::chrono::duration<double, std::nano>;
#define OMNITRACE_CLOCK_IDENTIFIER(VAL) \
#define ROCPROFSYS_CLOCK_IDENTIFIER(VAL) \
clock_identifier { #VAL, VAL }
auto
@@ -63,13 +63,13 @@ clock_name(std::string _v)
}
auto accepted_clock_ids =
std::set<clock_identifier>{ OMNITRACE_CLOCK_IDENTIFIER(CLOCK_REALTIME),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_MONOTONIC),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_PROCESS_CPUTIME_ID),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_MONOTONIC_RAW),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_REALTIME_COARSE),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_MONOTONIC_COARSE),
OMNITRACE_CLOCK_IDENTIFIER(CLOCK_BOOTTIME) };
std::set<clock_identifier>{ ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_REALTIME),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_MONOTONIC),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_PROCESS_CPUTIME_ID),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_MONOTONIC_RAW),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_REALTIME_COARSE),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_MONOTONIC_COARSE),
ROCPROFSYS_CLOCK_IDENTIFIER(CLOCK_BOOTTIME) };
template <typename Tp>
clock_identifier
@@ -101,9 +101,9 @@ find_clock_identifier(const Tp& _v)
}
}
OMNITRACE_THROW("Unknown clock id %s: %s. Valid choices: %s\n", _descript,
timemory::join::join("", _v).c_str(),
timemory::join::join("", accepted_clock_ids).c_str());
ROCPROFSYS_THROW("Unknown clock id %s: %s. Valid choices: %s\n", _descript,
timemory::join::join("", _v).c_str(),
timemory::join::join("", accepted_clock_ids).c_str());
}
void
@@ -232,10 +232,10 @@ spec::spec(const std::string& _clock_id, double _delay, double _dur, uint64_t _n
{}
spec::spec(const std::string& _line)
: spec{ config::get_setting_value<std::string>("OMNITRACE_TRACE_PERIOD_CLOCK_ID")
: spec{ config::get_setting_value<std::string>("ROCPROFSYS_TRACE_PERIOD_CLOCK_ID")
.value_or("CLOCK_REALTIME"),
config::get_setting_value<double>("OMNITRACE_TRACE_DELAY").value_or(0.0),
config::get_setting_value<double>("OMNITRACE_TRACE_DURATION").value_or(0.0) }
config::get_setting_value<double>("ROCPROFSYS_TRACE_DELAY").value_or(0.0),
config::get_setting_value<double>("ROCPROFSYS_TRACE_DURATION").value_or(0.0) }
{
auto _delim = tim::delimit(_line, ":");
if(!_delim.empty()) delay = utility::convert<double>(_delim.at(0));
@@ -266,11 +266,11 @@ spec::operator()(const stages& _stages) const
return _ret;
};
OMNITRACE_VERBOSE(2,
"Executing constraint spec %lu of %lu :: delay: %6.3f, "
"duration: %6.3f, clock: %s\n",
i, _spec.repeat, _spec.delay, _spec.duration,
_spec.clock_id.as_string().c_str());
ROCPROFSYS_VERBOSE(2,
"Executing constraint spec %lu of %lu :: delay: %6.3f, "
"duration: %6.3f, clock: %s\n",
i, _spec.repeat, _spec.delay, _spec.duration,
_spec.clock_id.as_string().c_str());
if(_stages.init(_spec) && _wait(_stages.wait, _spec.delay) &&
_stages.start(_spec) && _wait(_stages.collect, _spec.duration) &&
@@ -302,11 +302,11 @@ get_trace_specs()
{
auto _delay_v =
config::get_setting_value<double>("OMNITRACE_TRACE_DELAY").value_or(0.0);
config::get_setting_value<double>("ROCPROFSYS_TRACE_DELAY").value_or(0.0);
auto _duration_v =
config::get_setting_value<double>("OMNITRACE_TRACE_DURATION").value_or(0.0);
config::get_setting_value<double>("ROCPROFSYS_TRACE_DURATION").value_or(0.0);
auto _clock_v = find_clock_identifier(
config::get_setting_value<std::string>("OMNITRACE_TRACE_PERIOD_CLOCK_ID")
config::get_setting_value<std::string>("ROCPROFSYS_TRACE_PERIOD_CLOCK_ID")
.value_or("CLOCK_REALTIME"));
if(_delay_v > 0.0 || _duration_v > 0.0)
@@ -317,7 +317,7 @@ get_trace_specs()
{
auto _periods_v =
config::get_setting_value<std::string>("OMNITRACE_TRACE_PERIODS")
config::get_setting_value<std::string>("ROCPROFSYS_TRACE_PERIODS")
.value_or("");
if(!_periods_v.empty())
{
@@ -349,4 +349,4 @@ get_trace_stages()
return _v;
}
} // namespace constraint
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -39,7 +39,7 @@
#include <string>
#include <vector>
namespace omnitrace
namespace rocprofsys
{
namespace constraint
{
@@ -51,7 +51,7 @@ struct stages
stages();
OMNITRACE_DEFAULT_COPY_MOVE(stages)
ROCPROFSYS_DEFAULT_COPY_MOVE(stages)
functor_t init = [](const spec&) { return true; };
functor_t wait = [](const spec&) { return true; };
@@ -69,7 +69,7 @@ struct clock_identifier
clock_identifier();
clock_identifier(std::string_view, int);
OMNITRACE_DEFAULT_COPY_MOVE(clock_identifier)
ROCPROFSYS_DEFAULT_COPY_MOVE(clock_identifier)
std::string as_string() const;
@@ -91,7 +91,7 @@ struct spec
spec(const std::string&, double, double, uint64_t = 0, uint64_t = 1);
spec(const std::string&);
OMNITRACE_DEFAULT_COPY_MOVE(spec)
ROCPROFSYS_DEFAULT_COPY_MOVE(spec)
void operator()(const stages&) const;
@@ -111,4 +111,4 @@ get_trace_specs();
stages
get_trace_stages();
} // namespace constraint
} // namespace omnitrace
} // namespace rocprofsys
@@ -8,4 +8,5 @@ set(containers_headers
${CMAKE_CURRENT_LIST_DIR}/stable_vector.hpp
${CMAKE_CURRENT_LIST_DIR}/static_vector.hpp)
target_sources(omnitrace-core-library PRIVATE ${containers_sources} ${containers_headers})
target_sources(rocprofiler-systems-core-library PRIVATE ${containers_sources}
${containers_headers})
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -32,21 +32,21 @@
#include <cstdlib>
#include <new>
namespace omnitrace
namespace rocprofsys
{
namespace container
{
#if !defined(OMNITRACE_CACHELINE_SIZE)
#if !defined(ROCPROFSYS_CACHELINE_SIZE)
# ifdef __cpp_lib_hardware_interference_size
# define OMNITRACE_CACHELINE_SIZE std::hardware_destructive_interference_size
# define ROCPROFSYS_CACHELINE_SIZE std::hardware_destructive_interference_size
# else
// 64 bytes on x86-64 │ L1_CACHE_BYTES │ L1_CACHE_SHIFT │ __cacheline_aligned │ ...
# define OMNITRACE_CACHELINE_SIZE 64
# define ROCPROFSYS_CACHELINE_SIZE 64
# endif
#endif
constexpr std::size_t cacheline_align_v =
std::max<size_t>(OMNITRACE_CACHELINE_SIZE, OMNITRACE_CACHELINE_SIZE_MIN);
std::max<size_t>(ROCPROFSYS_CACHELINE_SIZE, ROCPROFSYS_CACHELINE_SIZE_MIN);
template <typename Tp, size_t N, size_t AlignN = cacheline_align_v,
bool AtomicSizeV = false>
@@ -228,7 +228,7 @@ aligned_static_vector<Tp, N, AlignN, AtomicSizeV>&
aligned_static_vector<Tp, N, AlignN, AtomicSizeV>::operator=(
std::initializer_list<Tp>&& _v)
{
if(OMNITRACE_UNLIKELY(_v.size() > N))
if(ROCPROFSYS_UNLIKELY(_v.size() > N))
{
throw exception<std::out_of_range>(
std::string{ "aligned_static_vector::operator=(initializer_list) size > " } +
@@ -323,4 +323,4 @@ aligned_static_vector<Tp, N, AlignN, AtomicSizeV>::emplace_back(Args&&... _v)
}
} // namespace container
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -31,7 +31,7 @@
#include <stdexcept>
#include <vector>
namespace omnitrace
namespace rocprofsys
{
namespace container
{
@@ -62,7 +62,7 @@ struct c_array
Tp& at(size_t i)
{
if(i < m_size) return m_base[i];
throw ::omnitrace::exception<std::out_of_range>(
throw ::rocprofsys::exception<std::out_of_range>(
std::string{ typeid(*this).name() } + std::to_string(i) + " exceeds size " +
std::to_string(m_size));
}
@@ -71,7 +71,7 @@ struct c_array
const Tp& at(size_t i) const
{
if(i < m_size) return m_base[i];
throw ::omnitrace::exception<std::out_of_range>(
throw ::rocprofsys::exception<std::out_of_range>(
std::string{ typeid(*this).name() } + std::to_string(i) + " exceeds size " +
std::to_string(m_size));
}
@@ -137,4 +137,4 @@ wrap_c_array(Tp* base, size_t size)
return c_array<Tp>(base, size);
}
} // namespace container
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -27,30 +27,30 @@
#include <iterator>
#include <type_traits>
#define OMNITRACE_IMPORT_TEMPLATE2(template_name)
#define OMNITRACE_IMPORT_TEMPLATE1(template_name)
#define ROCPROFSYS_IMPORT_TEMPLATE2(template_name)
#define ROCPROFSYS_IMPORT_TEMPLATE1(template_name)
// Import a 2-type-argument operator template into boost (if necessary) and
// provide a specialization of 'is_chained_base<>' for it.
#define OMNITRACE_OPERATOR_TEMPLATE2(template_name2) \
OMNITRACE_IMPORT_TEMPLATE2(template_name2) \
#define ROCPROFSYS_OPERATOR_TEMPLATE2(template_name2) \
ROCPROFSYS_IMPORT_TEMPLATE2(template_name2) \
template <typename T, typename U, typename B> \
struct is_chained_base<::omnitrace::container::template_name2<T, U, B>> \
struct is_chained_base<::rocprofsys::container::template_name2<T, U, B>> \
{ \
using value = ::omnitrace::container::true_t; \
using value = ::rocprofsys::container::true_t; \
};
// Import a 1-type-argument operator template into boost (if necessary) and
// provide a specialization of 'is_chained_base<>' for it.
#define OMNITRACE_OPERATOR_TEMPLATE1(template_name1) \
OMNITRACE_IMPORT_TEMPLATE1(template_name1) \
#define ROCPROFSYS_OPERATOR_TEMPLATE1(template_name1) \
ROCPROFSYS_IMPORT_TEMPLATE1(template_name1) \
template <typename T, typename B> \
struct is_chained_base<::omnitrace::container::template_name1<T, B>> \
struct is_chained_base<::rocprofsys::container::template_name1<T, B>> \
{ \
using value = ::omnitrace::container::true_t; \
using value = ::rocprofsys::container::true_t; \
};
#define OMNITRACE_OPERATOR_TEMPLATE(template_name) \
#define ROCPROFSYS_OPERATOR_TEMPLATE(template_name) \
template <typename T, typename U = T, typename B = empty_base<T>, \
typename O = typename is_chained_base<U>::value> \
struct template_name; \
@@ -74,13 +74,13 @@
template <typename T, typename U, typename B, typename O> \
struct is_chained_base<template_name<T, U, B, O>> \
{ \
using value = ::omnitrace::container::true_t; \
using value = ::rocprofsys::container::true_t; \
}; \
\
OMNITRACE_OPERATOR_TEMPLATE2(template_name##2) \
OMNITRACE_OPERATOR_TEMPLATE1(template_name##1)
ROCPROFSYS_OPERATOR_TEMPLATE2(template_name##2) \
ROCPROFSYS_OPERATOR_TEMPLATE1(template_name##1)
#define OMNITRACE_BINARY_OPERATOR_COMMUTATIVE(NAME, OP) \
#define ROCPROFSYS_BINARY_OPERATOR_COMMUTATIVE(NAME, OP) \
template <typename T, typename U, typename B = empty_base<T>> \
struct NAME##2 \
: B{ friend T operator OP(T lhs, const U& rhs){ return lhs OP## = rhs; \
@@ -96,7 +96,7 @@
} \
;
#define OMNITRACE_BINARY_OPERATOR_NON_COMMUTATIVE(NAME, OP) \
#define ROCPROFSYS_BINARY_OPERATOR_NON_COMMUTATIVE(NAME, OP) \
template <typename T, typename U, typename B = empty_base<T>> \
struct NAME##2 \
: B{ friend T operator OP(T lhs, const U& rhs){ return lhs OP## = rhs; \
@@ -104,7 +104,7 @@
} \
;
namespace omnitrace
namespace rocprofsys
{
namespace container
{
@@ -124,10 +124,10 @@ struct is_chained_base
using value = true_t;
};
OMNITRACE_BINARY_OPERATOR_COMMUTATIVE(addable, +)
OMNITRACE_BINARY_OPERATOR_NON_COMMUTATIVE(subtractable, -)
ROCPROFSYS_BINARY_OPERATOR_COMMUTATIVE(addable, +)
ROCPROFSYS_BINARY_OPERATOR_NON_COMMUTATIVE(subtractable, -)
OMNITRACE_OPERATOR_TEMPLATE(addable)
ROCPROFSYS_OPERATOR_TEMPLATE(addable)
template <typename T, typename B = empty_base<T>>
struct incrementable : B
@@ -237,4 +237,4 @@ struct random_access_iterator_helper
friend D requires_difference_operator(const T& x, const T& y) { return x - y; }
}; // random_access_iterator_helper
} // namespace container
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -34,11 +34,11 @@
#include <type_traits>
#include <vector>
namespace omnitrace
namespace rocprofsys
{
namespace container
{
template <typename Tp, size_t ChunkSizeV = OMNITRACE_MAX_THREADS,
template <typename Tp, size_t ChunkSizeV = ROCPROFSYS_MAX_THREADS,
size_t AlignN = alignof(Tp)>
class stable_vector
{
@@ -299,7 +299,7 @@ template <typename Tp, size_t ChunkSizeV, size_t AlignN>
typename stable_vector<Tp, ChunkSizeV, AlignN>::chunk_type&
stable_vector<Tp, ChunkSizeV, AlignN>::last_chunk()
{
if(OMNITRACE_UNLIKELY(m_chunks.empty() || m_chunks.back()->size() == ChunkSizeV))
if(ROCPROFSYS_UNLIKELY(m_chunks.empty() || m_chunks.back()->size() == ChunkSizeV))
{
add_chunk();
}
@@ -358,9 +358,9 @@ template <typename Tp, size_t ChunkSizeV, size_t AlignN>
typename stable_vector<Tp, ChunkSizeV, AlignN>::reference
stable_vector<Tp, ChunkSizeV, AlignN>::at(size_type i)
{
if(OMNITRACE_UNLIKELY(i >= size()))
if(ROCPROFSYS_UNLIKELY(i >= size()))
{
throw ::omnitrace::exception<std::out_of_range>(
throw ::rocprofsys::exception<std::out_of_range>(
"stable_vector::at(" + std::to_string(i) + "). size is " +
std::to_string(size()));
}
@@ -387,4 +387,4 @@ resize(stable_vector<Tp, ChunkSizeV, AlignN>& _v, size_t _n, Args&&... args)
return _v.size();
}
} // namespace container
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,7 @@
#include <atomic>
#include <cstdlib>
namespace omnitrace
namespace rocprofsys
{
namespace container
{
@@ -147,7 +147,7 @@ template <typename Tp, size_t N, bool AtomicSizeV>
static_vector<Tp, N, AtomicSizeV>&
static_vector<Tp, N, AtomicSizeV>::operator=(std::initializer_list<Tp>&& _v)
{
if(OMNITRACE_UNLIKELY(_v.size() > N))
if(ROCPROFSYS_UNLIKELY(_v.size() > N))
{
throw exception<std::out_of_range>(
std::string{ "static_vector::operator=(initializer_list) size > " } +
@@ -227,4 +227,4 @@ static_vector<Tp, N, AtomicSizeV>::update_size(size_t _n)
m_size = _n;
}
} // namespace container
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,7 @@
#include <sstream>
#include <string>
namespace omnitrace
namespace rocprofsys
{
namespace debug
{
@@ -48,7 +48,7 @@ struct source_location_history
const std::string&
get_file_name()
{
static auto _fname = tim::get_env<std::string>("OMNITRACE_LOG_FILE", "");
static auto _fname = tim::get_env<std::string>("ROCPROFSYS_LOG_FILE", "");
return _fname;
}
@@ -127,7 +127,7 @@ close_file()
fclose(_file);
// Write the trace into a file.
if(get_verbose() >= 0)
operation::file_output_message<tim::project::omnitrace>{}(
operation::file_output_message<tim::project::rocprofsys>{}(
get_file_name(), std::string{ "debug" });
}
}
@@ -164,4 +164,4 @@ template std::string as_hex<int64_t>(int64_t, size_t);
template std::string as_hex<uint64_t>(uint64_t, size_t);
template std::string
as_hex<void*>(void*, size_t);
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -43,30 +43,30 @@
#include <string_view>
#include <utility>
namespace omnitrace
namespace rocprofsys
{
inline namespace config
{
bool
get_debug() OMNITRACE_HOT;
get_debug() ROCPROFSYS_HOT;
int
get_verbose() OMNITRACE_HOT;
get_verbose() ROCPROFSYS_HOT;
bool
get_debug_env() OMNITRACE_HOT;
get_debug_env() ROCPROFSYS_HOT;
int
get_verbose_env() OMNITRACE_HOT;
get_verbose_env() ROCPROFSYS_HOT;
bool
get_is_continuous_integration() OMNITRACE_HOT;
get_is_continuous_integration() ROCPROFSYS_HOT;
bool
get_debug_tid() OMNITRACE_HOT;
get_debug_tid() ROCPROFSYS_HOT;
bool
get_debug_pid() OMNITRACE_HOT;
get_debug_pid() ROCPROFSYS_HOT;
} // namespace config
namespace debug
@@ -96,8 +96,8 @@ flush()
fprintf(stdout, "%s", ::tim::log::color::end());
fflush(stdout);
std::cout << ::tim::log::color::end() << std::flush;
fprintf(::omnitrace::debug::get_file(), "%s", ::tim::log::color::end());
fflush(::omnitrace::debug::get_file());
fprintf(::rocprofsys::debug::get_file(), "%s", ::tim::log::color::end());
fflush(::rocprofsys::debug::get_file());
std::cerr << ::tim::log::color::end() << std::flush;
}
//
@@ -152,58 +152,58 @@ extern template std::string as_hex<int64_t>(int64_t, size_t);
extern template std::string as_hex<uint64_t>(uint64_t, size_t);
extern template std::string
as_hex<void*>(void*, size_t);
} // namespace omnitrace
} // namespace rocprofsys
#if !defined(OMNITRACE_DEBUG_BUFFER_LEN)
# define OMNITRACE_DEBUG_BUFFER_LEN 1024
#if !defined(ROCPROFSYS_DEBUG_BUFFER_LEN)
# define ROCPROFSYS_DEBUG_BUFFER_LEN 1024
#endif
#if !defined(OMNITRACE_DEBUG_PROCESS_IDENTIFIER)
#if !defined(ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER)
# if defined(TIMEMORY_USE_MPI)
# define OMNITRACE_DEBUG_PROCESS_IDENTIFIER static_cast<int>(::tim::dmp::rank())
# define ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER static_cast<int>(::tim::dmp::rank())
# elif defined(TIMEMORY_USE_MPI_HEADERS)
# define OMNITRACE_DEBUG_PROCESS_IDENTIFIER \
# define ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER \
(::tim::dmp::is_initialized()) ? static_cast<int>(::tim::dmp::rank()) \
: static_cast<int>(::tim::process::get_id())
# else
# define OMNITRACE_DEBUG_PROCESS_IDENTIFIER \
# define ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER \
static_cast<int>(::tim::process::get_id())
# endif
#endif
#if !defined(OMNITRACE_DEBUG_THREAD_IDENTIFIER)
# define OMNITRACE_DEBUG_THREAD_IDENTIFIER ::omnitrace::debug::get_tid()
#if !defined(ROCPROFSYS_DEBUG_THREAD_IDENTIFIER)
# define ROCPROFSYS_DEBUG_THREAD_IDENTIFIER ::rocprofsys::debug::get_tid()
#endif
#if !defined(OMNITRACE_SOURCE_LOCATION)
# define OMNITRACE_SOURCE_LOCATION \
::omnitrace::debug::source_location { __PRETTY_FUNCTION__, __FILE__, __LINE__ }
#if !defined(ROCPROFSYS_SOURCE_LOCATION)
# define ROCPROFSYS_SOURCE_LOCATION \
::rocprofsys::debug::source_location { __PRETTY_FUNCTION__, __FILE__, __LINE__ }
#endif
#if !defined(OMNITRACE_RECORD_SOURCE_LOCATION)
# define OMNITRACE_RECORD_SOURCE_LOCATION \
::omnitrace::debug::set_source_location(OMNITRACE_SOURCE_LOCATION)
#if !defined(ROCPROFSYS_RECORD_SOURCE_LOCATION)
# define ROCPROFSYS_RECORD_SOURCE_LOCATION \
::rocprofsys::debug::set_source_location(ROCPROFSYS_SOURCE_LOCATION)
#endif
#if defined(__clang__) || (__GNUC__ < 9)
# define OMNITRACE_FUNCTION \
# define ROCPROFSYS_FUNCTION \
std::string{ __FUNCTION__ } \
.substr(0, std::string_view{ __FUNCTION__ }.find("_hidden")) \
.c_str()
# define OMNITRACE_PRETTY_FUNCTION \
# define ROCPROFSYS_PRETTY_FUNCTION \
std::string{ __PRETTY_FUNCTION__ } \
.substr(0, std::string_view{ __PRETTY_FUNCTION__ }.find("_hidden")) \
.c_str()
#else
# define OMNITRACE_FUNCTION \
::omnitrace::debug::get_chars( \
# define ROCPROFSYS_FUNCTION \
::rocprofsys::debug::get_chars( \
std::string_view{ __FUNCTION__ }, \
std::make_index_sequence<std::min( \
std::string_view{ __FUNCTION__ }.find("_hidden"), \
std::string_view{ __FUNCTION__ }.length())>{}) \
.data()
# define OMNITRACE_PRETTY_FUNCTION \
::omnitrace::debug::get_chars( \
# define ROCPROFSYS_PRETTY_FUNCTION \
::rocprofsys::debug::get_chars( \
std::string_view{ __PRETTY_FUNCTION__ }, \
std::make_index_sequence<std::min( \
std::string_view{ __PRETTY_FUNCTION__ }.find("_hidden"), \
@@ -213,331 +213,332 @@ as_hex<void*>(void*, size_t);
//--------------------------------------------------------------------------------------//
#define OMNITRACE_FPRINTF_STDERR_COLOR(COLOR) \
fprintf(::omnitrace::debug::get_file(), "%s", ::tim::log::color::COLOR())
#define ROCPROFSYS_FPRINTF_STDERR_COLOR(COLOR) \
fprintf(::rocprofsys::debug::get_file(), "%s", ::tim::log::color::COLOR())
//--------------------------------------------------------------------------------------//
#define OMNITRACE_CONDITIONAL_PRINT_COLOR(COLOR, COND, ...) \
if(OMNITRACE_UNLIKELY((COND) && ::omnitrace::config::get_debug_tid() && \
::omnitrace::config::get_debug_pid())) \
#define ROCPROFSYS_CONDITIONAL_PRINT_COLOR(COLOR, COND, ...) \
if(ROCPROFSYS_UNLIKELY((COND) && ::rocprofsys::config::get_debug_tid() && \
::rocprofsys::config::get_debug_pid())) \
{ \
::omnitrace::debug::flush(); \
::omnitrace::debug::lock _debug_lk{}; \
OMNITRACE_FPRINTF_STDERR_COLOR(COLOR); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::rocprofsys::debug::flush(); \
::rocprofsys::debug::lock _debug_lk{}; \
ROCPROFSYS_FPRINTF_STDERR_COLOR(COLOR); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i][%li]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_DEBUG_THREAD_IDENTIFIER, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
}
#define OMNITRACE_CONDITIONAL_PRINT_COLOR_F(COLOR, COND, ...) \
if(OMNITRACE_UNLIKELY((COND) && ::omnitrace::config::get_debug_tid() && \
::omnitrace::config::get_debug_pid())) \
#define ROCPROFSYS_CONDITIONAL_PRINT_COLOR_F(COLOR, COND, ...) \
if(ROCPROFSYS_UNLIKELY((COND) && ::rocprofsys::config::get_debug_tid() && \
::rocprofsys::config::get_debug_pid())) \
{ \
::omnitrace::debug::flush(); \
::omnitrace::debug::lock _debug_lk{}; \
OMNITRACE_FPRINTF_STDERR_COLOR(COLOR); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li][%s]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
OMNITRACE_FUNCTION, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::rocprofsys::debug::flush(); \
::rocprofsys::debug::lock _debug_lk{}; \
ROCPROFSYS_FPRINTF_STDERR_COLOR(COLOR); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i][%li][%s]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_DEBUG_THREAD_IDENTIFIER, \
ROCPROFSYS_FUNCTION, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
}
#define OMNITRACE_PRINT_COLOR(COLOR, ...) \
OMNITRACE_CONDITIONAL_PRINT_COLOR(COLOR, true, __VA_ARGS__)
#define ROCPROFSYS_PRINT_COLOR(COLOR, ...) \
ROCPROFSYS_CONDITIONAL_PRINT_COLOR(COLOR, true, __VA_ARGS__)
#define OMNITRACE_PRINT_COLOR_F(COLOR, ...) \
OMNITRACE_CONDITIONAL_PRINT_COLOR_F(COLOR, true, __VA_ARGS__)
#define ROCPROFSYS_PRINT_COLOR_F(COLOR, ...) \
ROCPROFSYS_CONDITIONAL_PRINT_COLOR_F(COLOR, true, __VA_ARGS__)
//--------------------------------------------------------------------------------------//
#define OMNITRACE_CONDITIONAL_PRINT(COND, ...) \
if(OMNITRACE_UNLIKELY((COND) && ::omnitrace::config::get_debug_tid() && \
::omnitrace::config::get_debug_pid())) \
#define ROCPROFSYS_CONDITIONAL_PRINT(COND, ...) \
if(ROCPROFSYS_UNLIKELY((COND) && ::rocprofsys::config::get_debug_tid() && \
::rocprofsys::config::get_debug_pid())) \
{ \
::omnitrace::debug::flush(); \
::omnitrace::debug::lock _debug_lk{}; \
OMNITRACE_FPRINTF_STDERR_COLOR(info); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::rocprofsys::debug::flush(); \
::rocprofsys::debug::lock _debug_lk{}; \
ROCPROFSYS_FPRINTF_STDERR_COLOR(info); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i][%li]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_DEBUG_THREAD_IDENTIFIER, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
}
#define OMNITRACE_CONDITIONAL_BASIC_PRINT(COND, ...) \
if(OMNITRACE_UNLIKELY((COND) && ::omnitrace::config::get_debug_tid() && \
::omnitrace::config::get_debug_pid())) \
#define ROCPROFSYS_CONDITIONAL_BASIC_PRINT(COND, ...) \
if(ROCPROFSYS_UNLIKELY((COND) && ::rocprofsys::config::get_debug_tid() && \
::rocprofsys::config::get_debug_pid())) \
{ \
::omnitrace::debug::flush(); \
::omnitrace::debug::lock _debug_lk{}; \
OMNITRACE_FPRINTF_STDERR_COLOR(info); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::rocprofsys::debug::flush(); \
::rocprofsys::debug::lock _debug_lk{}; \
ROCPROFSYS_FPRINTF_STDERR_COLOR(info); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
}
#define OMNITRACE_CONDITIONAL_PRINT_F(COND, ...) \
if(OMNITRACE_UNLIKELY((COND) && ::omnitrace::config::get_debug_tid() && \
::omnitrace::config::get_debug_pid())) \
#define ROCPROFSYS_CONDITIONAL_PRINT_F(COND, ...) \
if(ROCPROFSYS_UNLIKELY((COND) && ::rocprofsys::config::get_debug_tid() && \
::rocprofsys::config::get_debug_pid())) \
{ \
::omnitrace::debug::flush(); \
::omnitrace::debug::lock _debug_lk{}; \
OMNITRACE_FPRINTF_STDERR_COLOR(info); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li][%s]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
OMNITRACE_FUNCTION, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::rocprofsys::debug::flush(); \
::rocprofsys::debug::lock _debug_lk{}; \
ROCPROFSYS_FPRINTF_STDERR_COLOR(info); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i][%li][%s]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_DEBUG_THREAD_IDENTIFIER, \
ROCPROFSYS_FUNCTION, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
}
#define OMNITRACE_CONDITIONAL_BASIC_PRINT_F(COND, ...) \
if(OMNITRACE_UNLIKELY((COND) && ::omnitrace::config::get_debug_tid() && \
::omnitrace::config::get_debug_pid())) \
#define ROCPROFSYS_CONDITIONAL_BASIC_PRINT_F(COND, ...) \
if(ROCPROFSYS_UNLIKELY((COND) && ::rocprofsys::config::get_debug_tid() && \
::rocprofsys::config::get_debug_pid())) \
{ \
::omnitrace::debug::flush(); \
::omnitrace::debug::lock _debug_lk{}; \
OMNITRACE_FPRINTF_STDERR_COLOR(info); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%s]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_FUNCTION, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::rocprofsys::debug::flush(); \
::rocprofsys::debug::lock _debug_lk{}; \
ROCPROFSYS_FPRINTF_STDERR_COLOR(info); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i][%s]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_FUNCTION, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
}
//--------------------------------------------------------------------------------------//
#define OMNITRACE_CONDITIONAL_WARN(COND, ...) \
if(OMNITRACE_UNLIKELY((COND) && ::omnitrace::config::get_debug_tid() && \
::omnitrace::config::get_debug_pid())) \
#define ROCPROFSYS_CONDITIONAL_WARN(COND, ...) \
if(ROCPROFSYS_UNLIKELY((COND) && ::rocprofsys::config::get_debug_tid() && \
::rocprofsys::config::get_debug_pid())) \
{ \
::omnitrace::debug::flush(); \
::omnitrace::debug::lock _debug_lk{}; \
OMNITRACE_FPRINTF_STDERR_COLOR(warning); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::rocprofsys::debug::flush(); \
::rocprofsys::debug::lock _debug_lk{}; \
ROCPROFSYS_FPRINTF_STDERR_COLOR(warning); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i][%li]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_DEBUG_THREAD_IDENTIFIER, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
}
#define OMNITRACE_CONDITIONAL_BASIC_WARN(COND, ...) \
if(OMNITRACE_UNLIKELY((COND) && ::omnitrace::config::get_debug_tid() && \
::omnitrace::config::get_debug_pid())) \
#define ROCPROFSYS_CONDITIONAL_BASIC_WARN(COND, ...) \
if(ROCPROFSYS_UNLIKELY((COND) && ::rocprofsys::config::get_debug_tid() && \
::rocprofsys::config::get_debug_pid())) \
{ \
::omnitrace::debug::flush(); \
::omnitrace::debug::lock _debug_lk{}; \
OMNITRACE_FPRINTF_STDERR_COLOR(warning); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::rocprofsys::debug::flush(); \
::rocprofsys::debug::lock _debug_lk{}; \
ROCPROFSYS_FPRINTF_STDERR_COLOR(warning); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
}
#define OMNITRACE_CONDITIONAL_WARN_F(COND, ...) \
if(OMNITRACE_UNLIKELY((COND) && ::omnitrace::config::get_debug_tid() && \
::omnitrace::config::get_debug_pid())) \
#define ROCPROFSYS_CONDITIONAL_WARN_F(COND, ...) \
if(ROCPROFSYS_UNLIKELY((COND) && ::rocprofsys::config::get_debug_tid() && \
::rocprofsys::config::get_debug_pid())) \
{ \
::omnitrace::debug::flush(); \
::omnitrace::debug::lock _debug_lk{}; \
OMNITRACE_FPRINTF_STDERR_COLOR(warning); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li][%s]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
OMNITRACE_FUNCTION, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::rocprofsys::debug::flush(); \
::rocprofsys::debug::lock _debug_lk{}; \
ROCPROFSYS_FPRINTF_STDERR_COLOR(warning); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i][%li][%s]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_DEBUG_THREAD_IDENTIFIER, \
ROCPROFSYS_FUNCTION, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
}
#define OMNITRACE_CONDITIONAL_BASIC_WARN_F(COND, ...) \
if(OMNITRACE_UNLIKELY((COND) && ::omnitrace::config::get_debug_tid() && \
::omnitrace::config::get_debug_pid())) \
#define ROCPROFSYS_CONDITIONAL_BASIC_WARN_F(COND, ...) \
if(ROCPROFSYS_UNLIKELY((COND) && ::rocprofsys::config::get_debug_tid() && \
::rocprofsys::config::get_debug_pid())) \
{ \
::omnitrace::debug::flush(); \
::omnitrace::debug::lock _debug_lk{}; \
OMNITRACE_FPRINTF_STDERR_COLOR(warning); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%s]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_FUNCTION, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::rocprofsys::debug::flush(); \
::rocprofsys::debug::lock _debug_lk{}; \
ROCPROFSYS_FPRINTF_STDERR_COLOR(warning); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i][%s]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_FUNCTION, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
}
//--------------------------------------------------------------------------------------//
#define OMNITRACE_CONDITIONAL_THROW_E(COND, TYPE, ...) \
if(OMNITRACE_UNLIKELY((COND))) \
#define ROCPROFSYS_CONDITIONAL_THROW_E(COND, TYPE, ...) \
if(ROCPROFSYS_UNLIKELY((COND))) \
{ \
char _msg_buffer[OMNITRACE_DEBUG_BUFFER_LEN]; \
snprintf(_msg_buffer, OMNITRACE_DEBUG_BUFFER_LEN, "[omnitrace][%i][%li][%s]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
OMNITRACE_FUNCTION, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
char _msg_buffer[ROCPROFSYS_DEBUG_BUFFER_LEN]; \
snprintf(_msg_buffer, ROCPROFSYS_DEBUG_BUFFER_LEN, \
"[rocprof-sys][%i][%li][%s]%s", ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, \
ROCPROFSYS_DEBUG_THREAD_IDENTIFIER, ROCPROFSYS_FUNCTION, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
auto len = strlen(_msg_buffer); \
snprintf(_msg_buffer + len, OMNITRACE_DEBUG_BUFFER_LEN - len, __VA_ARGS__); \
throw ::omnitrace::exception<TYPE>( \
snprintf(_msg_buffer + len, ROCPROFSYS_DEBUG_BUFFER_LEN - len, __VA_ARGS__); \
throw ::rocprofsys::exception<TYPE>( \
::tim::log::string(::tim::log::color::fatal(), _msg_buffer)); \
}
#define OMNITRACE_CONDITIONAL_BASIC_THROW_E(COND, TYPE, ...) \
if(OMNITRACE_UNLIKELY((COND))) \
#define ROCPROFSYS_CONDITIONAL_BASIC_THROW_E(COND, TYPE, ...) \
if(ROCPROFSYS_UNLIKELY((COND))) \
{ \
char _msg_buffer[OMNITRACE_DEBUG_BUFFER_LEN]; \
snprintf(_msg_buffer, OMNITRACE_DEBUG_BUFFER_LEN, "[omnitrace][%i][%s]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_FUNCTION, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
char _msg_buffer[ROCPROFSYS_DEBUG_BUFFER_LEN]; \
snprintf(_msg_buffer, ROCPROFSYS_DEBUG_BUFFER_LEN, "[rocprof-sys][%i][%s]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_FUNCTION, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
auto len = strlen(_msg_buffer); \
snprintf(_msg_buffer + len, OMNITRACE_DEBUG_BUFFER_LEN - len, __VA_ARGS__); \
throw ::omnitrace::exception<TYPE>( \
snprintf(_msg_buffer + len, ROCPROFSYS_DEBUG_BUFFER_LEN - len, __VA_ARGS__); \
throw ::rocprofsys::exception<TYPE>( \
::tim::log::string(::tim::log::color::fatal(), _msg_buffer)); \
}
#define OMNITRACE_CI_THROW_E(COND, TYPE, ...) \
OMNITRACE_CONDITIONAL_THROW_E( \
::omnitrace::get_is_continuous_integration() && (COND), TYPE, __VA_ARGS__)
#define ROCPROFSYS_CI_THROW_E(COND, TYPE, ...) \
ROCPROFSYS_CONDITIONAL_THROW_E( \
::rocprofsys::get_is_continuous_integration() && (COND), TYPE, __VA_ARGS__)
#define OMNITRACE_CI_BASIC_THROW_E(COND, TYPE, ...) \
OMNITRACE_CONDITIONAL_BASIC_THROW_E( \
::omnitrace::get_is_continuous_integration() && (COND), TYPE, __VA_ARGS__)
#define ROCPROFSYS_CI_BASIC_THROW_E(COND, TYPE, ...) \
ROCPROFSYS_CONDITIONAL_BASIC_THROW_E( \
::rocprofsys::get_is_continuous_integration() && (COND), TYPE, __VA_ARGS__)
//--------------------------------------------------------------------------------------//
#define OMNITRACE_CONDITIONAL_THROW(COND, ...) \
OMNITRACE_CONDITIONAL_THROW_E((COND), std::runtime_error, __VA_ARGS__)
#define ROCPROFSYS_CONDITIONAL_THROW(COND, ...) \
ROCPROFSYS_CONDITIONAL_THROW_E((COND), std::runtime_error, __VA_ARGS__)
#define OMNITRACE_CONDITIONAL_BASIC_THROW(COND, ...) \
OMNITRACE_CONDITIONAL_BASIC_THROW_E((COND), std::runtime_error, __VA_ARGS__)
#define ROCPROFSYS_CONDITIONAL_BASIC_THROW(COND, ...) \
ROCPROFSYS_CONDITIONAL_BASIC_THROW_E((COND), std::runtime_error, __VA_ARGS__)
#define OMNITRACE_CI_THROW(COND, ...) \
OMNITRACE_CI_THROW_E((COND), std::runtime_error, __VA_ARGS__)
#define ROCPROFSYS_CI_THROW(COND, ...) \
ROCPROFSYS_CI_THROW_E((COND), std::runtime_error, __VA_ARGS__)
#define OMNITRACE_CI_BASIC_THROW(COND, ...) \
OMNITRACE_CI_BASIC_THROW_E((COND), std::runtime_error, __VA_ARGS__)
#define ROCPROFSYS_CI_BASIC_THROW(COND, ...) \
ROCPROFSYS_CI_BASIC_THROW_E((COND), std::runtime_error, __VA_ARGS__)
//--------------------------------------------------------------------------------------//
#define OMNITRACE_CONDITIONAL_FAILURE(COND, METHOD, ...) \
if(OMNITRACE_UNLIKELY((COND))) \
#define ROCPROFSYS_CONDITIONAL_FAILURE(COND, METHOD, ...) \
if(ROCPROFSYS_UNLIKELY((COND))) \
{ \
::omnitrace::debug::flush(); \
OMNITRACE_FPRINTF_STDERR_COLOR(fatal); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::omnitrace::set_state(::omnitrace::State::Finalized); \
::rocprofsys::debug::flush(); \
ROCPROFSYS_FPRINTF_STDERR_COLOR(fatal); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i][%li]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_DEBUG_THREAD_IDENTIFIER, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
::rocprofsys::set_state(::rocprofsys::State::Finalized); \
timemory_print_demangled_backtrace<64>(); \
METHOD; \
}
#define OMNITRACE_CONDITIONAL_BASIC_FAILURE(COND, METHOD, ...) \
if(OMNITRACE_UNLIKELY((COND))) \
#define ROCPROFSYS_CONDITIONAL_BASIC_FAILURE(COND, METHOD, ...) \
if(ROCPROFSYS_UNLIKELY((COND))) \
{ \
::omnitrace::debug::flush(); \
OMNITRACE_FPRINTF_STDERR_COLOR(fatal); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::omnitrace::set_state(::omnitrace::State::Finalized); \
::rocprofsys::debug::flush(); \
ROCPROFSYS_FPRINTF_STDERR_COLOR(fatal); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
::rocprofsys::set_state(::rocprofsys::State::Finalized); \
timemory_print_demangled_backtrace<64>(); \
METHOD; \
}
#define OMNITRACE_CONDITIONAL_FAILURE_F(COND, METHOD, ...) \
if(OMNITRACE_UNLIKELY((COND))) \
#define ROCPROFSYS_CONDITIONAL_FAILURE_F(COND, METHOD, ...) \
if(ROCPROFSYS_UNLIKELY((COND))) \
{ \
::omnitrace::debug::flush(); \
OMNITRACE_FPRINTF_STDERR_COLOR(fatal); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%li][%s]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_DEBUG_THREAD_IDENTIFIER, \
OMNITRACE_FUNCTION, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::omnitrace::set_state(::omnitrace::State::Finalized); \
::rocprofsys::debug::flush(); \
ROCPROFSYS_FPRINTF_STDERR_COLOR(fatal); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i][%li][%s]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_DEBUG_THREAD_IDENTIFIER, \
ROCPROFSYS_FUNCTION, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
::rocprofsys::set_state(::rocprofsys::State::Finalized); \
timemory_print_demangled_backtrace<64>(); \
METHOD; \
}
#define OMNITRACE_CONDITIONAL_BASIC_FAILURE_F(COND, METHOD, ...) \
if(OMNITRACE_UNLIKELY((COND))) \
#define ROCPROFSYS_CONDITIONAL_BASIC_FAILURE_F(COND, METHOD, ...) \
if(ROCPROFSYS_UNLIKELY((COND))) \
{ \
::omnitrace::debug::flush(); \
OMNITRACE_FPRINTF_STDERR_COLOR(fatal); \
fprintf(::omnitrace::debug::get_file(), "[omnitrace][%i][%s]%s", \
OMNITRACE_DEBUG_PROCESS_IDENTIFIER, OMNITRACE_FUNCTION, \
::omnitrace::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::omnitrace::debug::get_file(), __VA_ARGS__); \
::omnitrace::debug::flush(); \
::omnitrace::set_state(::omnitrace::State::Finalized); \
::rocprofsys::debug::flush(); \
ROCPROFSYS_FPRINTF_STDERR_COLOR(fatal); \
fprintf(::rocprofsys::debug::get_file(), "[rocprof-sys][%i][%s]%s", \
ROCPROFSYS_DEBUG_PROCESS_IDENTIFIER, ROCPROFSYS_FUNCTION, \
::rocprofsys::debug::is_bracket(__VA_ARGS__) ? "" : " "); \
fprintf(::rocprofsys::debug::get_file(), __VA_ARGS__); \
::rocprofsys::debug::flush(); \
::rocprofsys::set_state(::rocprofsys::State::Finalized); \
timemory_print_demangled_backtrace<64>(); \
METHOD; \
}
#define OMNITRACE_CI_FAILURE(COND, METHOD, ...) \
OMNITRACE_CONDITIONAL_FAILURE( \
::omnitrace::get_is_continuous_integration() && (COND), METHOD, __VA_ARGS__)
#define ROCPROFSYS_CI_FAILURE(COND, METHOD, ...) \
ROCPROFSYS_CONDITIONAL_FAILURE( \
::rocprofsys::get_is_continuous_integration() && (COND), METHOD, __VA_ARGS__)
#define OMNITRACE_CI_BASIC_FAILURE(COND, METHOD, ...) \
OMNITRACE_CONDITIONAL_BASIC_FAILURE( \
::omnitrace::get_is_continuous_integration() && (COND), METHOD, __VA_ARGS__)
#define ROCPROFSYS_CI_BASIC_FAILURE(COND, METHOD, ...) \
ROCPROFSYS_CONDITIONAL_BASIC_FAILURE( \
::rocprofsys::get_is_continuous_integration() && (COND), METHOD, __VA_ARGS__)
//--------------------------------------------------------------------------------------//
#define OMNITRACE_CONDITIONAL_FAIL(COND, ...) \
OMNITRACE_CONDITIONAL_FAILURE(COND, OMNITRACE_ESC(::std::exit(EXIT_FAILURE)), \
__VA_ARGS__)
#define ROCPROFSYS_CONDITIONAL_FAIL(COND, ...) \
ROCPROFSYS_CONDITIONAL_FAILURE(COND, ROCPROFSYS_ESC(::std::exit(EXIT_FAILURE)), \
__VA_ARGS__)
#define OMNITRACE_CONDITIONAL_BASIC_FAIL(COND, ...) \
OMNITRACE_CONDITIONAL_BASIC_FAILURE(COND, OMNITRACE_ESC(::std::exit(EXIT_FAILURE)), \
__VA_ARGS__)
#define ROCPROFSYS_CONDITIONAL_BASIC_FAIL(COND, ...) \
ROCPROFSYS_CONDITIONAL_BASIC_FAILURE( \
COND, ROCPROFSYS_ESC(::std::exit(EXIT_FAILURE)), __VA_ARGS__)
#define OMNITRACE_CONDITIONAL_FAIL_F(COND, ...) \
OMNITRACE_CONDITIONAL_FAILURE_F(COND, OMNITRACE_ESC(::std::exit(EXIT_FAILURE)), \
__VA_ARGS__)
#define ROCPROFSYS_CONDITIONAL_FAIL_F(COND, ...) \
ROCPROFSYS_CONDITIONAL_FAILURE_F(COND, ROCPROFSYS_ESC(::std::exit(EXIT_FAILURE)), \
__VA_ARGS__)
#define OMNITRACE_CONDITIONAL_BASIC_FAIL_F(COND, ...) \
OMNITRACE_CONDITIONAL_BASIC_FAILURE_F( \
COND, OMNITRACE_ESC(::std::exit(EXIT_FAILURE)), __VA_ARGS__)
#define ROCPROFSYS_CONDITIONAL_BASIC_FAIL_F(COND, ...) \
ROCPROFSYS_CONDITIONAL_BASIC_FAILURE_F( \
COND, ROCPROFSYS_ESC(::std::exit(EXIT_FAILURE)), __VA_ARGS__)
#define OMNITRACE_CI_FAIL(COND, ...) \
OMNITRACE_CI_FAILURE(COND, OMNITRACE_ESC(::std::exit(EXIT_FAILURE)), __VA_ARGS__)
#define ROCPROFSYS_CI_FAIL(COND, ...) \
ROCPROFSYS_CI_FAILURE(COND, ROCPROFSYS_ESC(::std::exit(EXIT_FAILURE)), __VA_ARGS__)
#define OMNITRACE_CI_BASIC_FAIL(COND, ...) \
OMNITRACE_CI_BASIC_FAILURE(COND, OMNITRACE_ESC(::std::exit(EXIT_FAILURE)), \
__VA_ARGS__)
#define ROCPROFSYS_CI_BASIC_FAIL(COND, ...) \
ROCPROFSYS_CI_BASIC_FAILURE(COND, ROCPROFSYS_ESC(::std::exit(EXIT_FAILURE)), \
__VA_ARGS__)
//--------------------------------------------------------------------------------------//
#define OMNITRACE_CONDITIONAL_ABORT(COND, ...) \
OMNITRACE_CONDITIONAL_FAILURE(COND, OMNITRACE_ESC(::std::abort()), __VA_ARGS__)
#define ROCPROFSYS_CONDITIONAL_ABORT(COND, ...) \
ROCPROFSYS_CONDITIONAL_FAILURE(COND, ROCPROFSYS_ESC(::std::abort()), __VA_ARGS__)
#define OMNITRACE_CONDITIONAL_BASIC_ABORT(COND, ...) \
OMNITRACE_CONDITIONAL_BASIC_FAILURE(COND, OMNITRACE_ESC(::std::abort()), __VA_ARGS__)
#define ROCPROFSYS_CONDITIONAL_BASIC_ABORT(COND, ...) \
ROCPROFSYS_CONDITIONAL_BASIC_FAILURE(COND, ROCPROFSYS_ESC(::std::abort()), \
__VA_ARGS__)
#define OMNITRACE_CONDITIONAL_ABORT_F(COND, ...) \
OMNITRACE_CONDITIONAL_FAILURE_F(COND, OMNITRACE_ESC(::std::abort()), __VA_ARGS__)
#define ROCPROFSYS_CONDITIONAL_ABORT_F(COND, ...) \
ROCPROFSYS_CONDITIONAL_FAILURE_F(COND, ROCPROFSYS_ESC(::std::abort()), __VA_ARGS__)
#define OMNITRACE_CONDITIONAL_BASIC_ABORT_F(COND, ...) \
OMNITRACE_CONDITIONAL_BASIC_FAILURE_F(COND, OMNITRACE_ESC(::std::abort()), \
__VA_ARGS__)
#define ROCPROFSYS_CONDITIONAL_BASIC_ABORT_F(COND, ...) \
ROCPROFSYS_CONDITIONAL_BASIC_FAILURE_F(COND, ROCPROFSYS_ESC(::std::abort()), \
__VA_ARGS__)
#define OMNITRACE_CI_ABORT(COND, ...) \
OMNITRACE_CI_FAILURE(COND, OMNITRACE_ESC(::std::abort()), __VA_ARGS__)
#define ROCPROFSYS_CI_ABORT(COND, ...) \
ROCPROFSYS_CI_FAILURE(COND, ROCPROFSYS_ESC(::std::abort()), __VA_ARGS__)
#define OMNITRACE_CI_BASIC_ABORT(COND, ...) \
OMNITRACE_CI_BASIC_FAILURE(COND, OMNITRACE_ESC(::std::abort()), __VA_ARGS__)
#define ROCPROFSYS_CI_BASIC_ABORT(COND, ...) \
ROCPROFSYS_CI_BASIC_FAILURE(COND, ROCPROFSYS_ESC(::std::abort()), __VA_ARGS__)
//--------------------------------------------------------------------------------------//
//
@@ -545,17 +546,17 @@ as_hex<void*>(void*, size_t);
//
//--------------------------------------------------------------------------------------//
#define OMNITRACE_DEBUG(...) \
OMNITRACE_CONDITIONAL_PRINT(::omnitrace::get_debug(), __VA_ARGS__)
#define ROCPROFSYS_DEBUG(...) \
ROCPROFSYS_CONDITIONAL_PRINT(::rocprofsys::get_debug(), __VA_ARGS__)
#define OMNITRACE_BASIC_DEBUG(...) \
OMNITRACE_CONDITIONAL_BASIC_PRINT(::omnitrace::get_debug_env(), __VA_ARGS__)
#define ROCPROFSYS_BASIC_DEBUG(...) \
ROCPROFSYS_CONDITIONAL_BASIC_PRINT(::rocprofsys::get_debug_env(), __VA_ARGS__)
#define OMNITRACE_DEBUG_F(...) \
OMNITRACE_CONDITIONAL_PRINT_F(::omnitrace::get_debug(), __VA_ARGS__)
#define ROCPROFSYS_DEBUG_F(...) \
ROCPROFSYS_CONDITIONAL_PRINT_F(::rocprofsys::get_debug(), __VA_ARGS__)
#define OMNITRACE_BASIC_DEBUG_F(...) \
OMNITRACE_CONDITIONAL_BASIC_PRINT_F(::omnitrace::get_debug_env(), __VA_ARGS__)
#define ROCPROFSYS_BASIC_DEBUG_F(...) \
ROCPROFSYS_CONDITIONAL_BASIC_PRINT_F(::rocprofsys::get_debug_env(), __VA_ARGS__)
//--------------------------------------------------------------------------------------//
//
@@ -563,23 +564,25 @@ as_hex<void*>(void*, size_t);
//
//--------------------------------------------------------------------------------------//
#define OMNITRACE_VERBOSE(LEVEL, ...) \
OMNITRACE_CONDITIONAL_PRINT( \
::omnitrace::get_debug() || (::omnitrace::get_verbose() >= LEVEL), __VA_ARGS__)
#define ROCPROFSYS_VERBOSE(LEVEL, ...) \
ROCPROFSYS_CONDITIONAL_PRINT(::rocprofsys::get_debug() || \
(::rocprofsys::get_verbose() >= LEVEL), \
__VA_ARGS__)
#define OMNITRACE_BASIC_VERBOSE(LEVEL, ...) \
OMNITRACE_CONDITIONAL_BASIC_PRINT(::omnitrace::get_debug_env() || \
(::omnitrace::get_verbose_env() >= LEVEL), \
__VA_ARGS__)
#define ROCPROFSYS_BASIC_VERBOSE(LEVEL, ...) \
ROCPROFSYS_CONDITIONAL_BASIC_PRINT(::rocprofsys::get_debug_env() || \
(::rocprofsys::get_verbose_env() >= LEVEL), \
__VA_ARGS__)
#define OMNITRACE_VERBOSE_F(LEVEL, ...) \
OMNITRACE_CONDITIONAL_PRINT_F( \
::omnitrace::get_debug() || (::omnitrace::get_verbose() >= LEVEL), __VA_ARGS__)
#define ROCPROFSYS_VERBOSE_F(LEVEL, ...) \
ROCPROFSYS_CONDITIONAL_PRINT_F(::rocprofsys::get_debug() || \
(::rocprofsys::get_verbose() >= LEVEL), \
__VA_ARGS__)
#define OMNITRACE_BASIC_VERBOSE_F(LEVEL, ...) \
OMNITRACE_CONDITIONAL_BASIC_PRINT_F(::omnitrace::get_debug_env() || \
(::omnitrace::get_verbose_env() >= LEVEL), \
__VA_ARGS__)
#define ROCPROFSYS_BASIC_VERBOSE_F(LEVEL, ...) \
ROCPROFSYS_CONDITIONAL_BASIC_PRINT_F(::rocprofsys::get_debug_env() || \
(::rocprofsys::get_verbose_env() >= LEVEL), \
__VA_ARGS__)
//--------------------------------------------------------------------------------------//
//
@@ -587,49 +590,51 @@ as_hex<void*>(void*, size_t);
//
//--------------------------------------------------------------------------------------//
#define OMNITRACE_WARNING(LEVEL, ...) \
OMNITRACE_CONDITIONAL_WARN( \
::omnitrace::get_debug() || (::omnitrace::get_verbose() >= LEVEL), __VA_ARGS__)
#define ROCPROFSYS_WARNING(LEVEL, ...) \
ROCPROFSYS_CONDITIONAL_WARN(::rocprofsys::get_debug() || \
(::rocprofsys::get_verbose() >= LEVEL), \
__VA_ARGS__)
#define OMNITRACE_BASIC_WARNING(LEVEL, ...) \
OMNITRACE_CONDITIONAL_BASIC_WARN(::omnitrace::get_debug_env() || \
(::omnitrace::get_verbose_env() >= LEVEL), \
__VA_ARGS__)
#define ROCPROFSYS_BASIC_WARNING(LEVEL, ...) \
ROCPROFSYS_CONDITIONAL_BASIC_WARN(::rocprofsys::get_debug_env() || \
(::rocprofsys::get_verbose_env() >= LEVEL), \
__VA_ARGS__)
#define OMNITRACE_WARNING_F(LEVEL, ...) \
OMNITRACE_CONDITIONAL_WARN_F( \
::omnitrace::get_debug() || (::omnitrace::get_verbose() >= LEVEL), __VA_ARGS__)
#define ROCPROFSYS_WARNING_F(LEVEL, ...) \
ROCPROFSYS_CONDITIONAL_WARN_F(::rocprofsys::get_debug() || \
(::rocprofsys::get_verbose() >= LEVEL), \
__VA_ARGS__)
#define OMNITRACE_BASIC_WARNING_F(LEVEL, ...) \
OMNITRACE_CONDITIONAL_BASIC_WARN_F(::omnitrace::get_debug_env() || \
(::omnitrace::get_verbose_env() >= LEVEL), \
__VA_ARGS__)
#define ROCPROFSYS_BASIC_WARNING_F(LEVEL, ...) \
ROCPROFSYS_CONDITIONAL_BASIC_WARN_F(::rocprofsys::get_debug_env() || \
(::rocprofsys::get_verbose_env() >= LEVEL), \
__VA_ARGS__)
#define OMNITRACE_WARNING_IF(COND, ...) OMNITRACE_CONDITIONAL_WARN((COND), __VA_ARGS__)
#define ROCPROFSYS_WARNING_IF(COND, ...) ROCPROFSYS_CONDITIONAL_WARN((COND), __VA_ARGS__)
#define OMNITRACE_WARNING_IF_F(COND, ...) \
OMNITRACE_CONDITIONAL_WARN_F((COND), __VA_ARGS__)
#define ROCPROFSYS_WARNING_IF_F(COND, ...) \
ROCPROFSYS_CONDITIONAL_WARN_F((COND), __VA_ARGS__)
#define OMNITRACE_WARNING_OR_CI_THROW(LEVEL, ...) \
#define ROCPROFSYS_WARNING_OR_CI_THROW(LEVEL, ...) \
{ \
if(OMNITRACE_UNLIKELY(::omnitrace::get_is_continuous_integration())) \
if(ROCPROFSYS_UNLIKELY(::rocprofsys::get_is_continuous_integration())) \
{ \
OMNITRACE_CI_THROW(true, __VA_ARGS__); \
ROCPROFSYS_CI_THROW(true, __VA_ARGS__); \
} \
else \
{ \
OMNITRACE_CONDITIONAL_WARN(::omnitrace::get_debug() || \
(::omnitrace::get_verbose() >= LEVEL), \
__VA_ARGS__) \
ROCPROFSYS_CONDITIONAL_WARN(::rocprofsys::get_debug() || \
(::rocprofsys::get_verbose() >= LEVEL), \
__VA_ARGS__) \
} \
}
#define OMNITRACE_REQUIRE(...) TIMEMORY_REQUIRE(__VA_ARGS__)
#define OMNITRACE_PREFER(COND) \
((OMNITRACE_LIKELY(COND)) \
#define ROCPROFSYS_REQUIRE(...) TIMEMORY_REQUIRE(__VA_ARGS__)
#define ROCPROFSYS_PREFER(COND) \
((ROCPROFSYS_LIKELY(COND)) \
? ::tim::log::base() \
: ((::omnitrace::get_is_continuous_integration()) ? TIMEMORY_FATAL \
: TIMEMORY_WARNING))
: ((::rocprofsys::get_is_continuous_integration()) ? TIMEMORY_FATAL \
: TIMEMORY_WARNING))
//--------------------------------------------------------------------------------------//
//
@@ -638,10 +643,10 @@ as_hex<void*>(void*, size_t);
//
//--------------------------------------------------------------------------------------//
#define OMNITRACE_BASIC_PRINT(...) OMNITRACE_CONDITIONAL_BASIC_PRINT(true, __VA_ARGS__)
#define ROCPROFSYS_BASIC_PRINT(...) ROCPROFSYS_CONDITIONAL_BASIC_PRINT(true, __VA_ARGS__)
#define OMNITRACE_BASIC_PRINT_F(...) \
OMNITRACE_CONDITIONAL_BASIC_PRINT_F(true, __VA_ARGS__)
#define ROCPROFSYS_BASIC_PRINT_F(...) \
ROCPROFSYS_CONDITIONAL_BASIC_PRINT_F(true, __VA_ARGS__)
//--------------------------------------------------------------------------------------//
//
@@ -649,9 +654,9 @@ as_hex<void*>(void*, size_t);
//
//--------------------------------------------------------------------------------------//
#define OMNITRACE_PRINT(...) OMNITRACE_CONDITIONAL_PRINT(true, __VA_ARGS__)
#define ROCPROFSYS_PRINT(...) ROCPROFSYS_CONDITIONAL_PRINT(true, __VA_ARGS__)
#define OMNITRACE_PRINT_F(...) OMNITRACE_CONDITIONAL_PRINT_F(true, __VA_ARGS__)
#define ROCPROFSYS_PRINT_F(...) ROCPROFSYS_CONDITIONAL_PRINT_F(true, __VA_ARGS__)
//--------------------------------------------------------------------------------------//
//
@@ -659,9 +664,9 @@ as_hex<void*>(void*, size_t);
//
//--------------------------------------------------------------------------------------//
#define OMNITRACE_THROW(...) OMNITRACE_CONDITIONAL_THROW(true, __VA_ARGS__)
#define ROCPROFSYS_THROW(...) ROCPROFSYS_CONDITIONAL_THROW(true, __VA_ARGS__)
#define OMNITRACE_BASIC_THROW(...) OMNITRACE_CONDITIONAL_BASIC_THROW(true, __VA_ARGS__)
#define ROCPROFSYS_BASIC_THROW(...) ROCPROFSYS_CONDITIONAL_BASIC_THROW(true, __VA_ARGS__)
//--------------------------------------------------------------------------------------//
//
@@ -669,13 +674,14 @@ as_hex<void*>(void*, size_t);
//
//--------------------------------------------------------------------------------------//
#define OMNITRACE_FAIL(...) OMNITRACE_CONDITIONAL_FAIL(true, __VA_ARGS__)
#define ROCPROFSYS_FAIL(...) ROCPROFSYS_CONDITIONAL_FAIL(true, __VA_ARGS__)
#define OMNITRACE_FAIL_F(...) OMNITRACE_CONDITIONAL_FAIL_F(true, __VA_ARGS__)
#define ROCPROFSYS_FAIL_F(...) ROCPROFSYS_CONDITIONAL_FAIL_F(true, __VA_ARGS__)
#define OMNITRACE_BASIC_FAIL(...) OMNITRACE_CONDITIONAL_BASIC_FAIL(true, __VA_ARGS__)
#define ROCPROFSYS_BASIC_FAIL(...) ROCPROFSYS_CONDITIONAL_BASIC_FAIL(true, __VA_ARGS__)
#define OMNITRACE_BASIC_FAIL_F(...) OMNITRACE_CONDITIONAL_BASIC_FAIL_F(true, __VA_ARGS__)
#define ROCPROFSYS_BASIC_FAIL_F(...) \
ROCPROFSYS_CONDITIONAL_BASIC_FAIL_F(true, __VA_ARGS__)
//--------------------------------------------------------------------------------------//
//
@@ -683,14 +689,14 @@ as_hex<void*>(void*, size_t);
//
//--------------------------------------------------------------------------------------//
#define OMNITRACE_ABORT(...) OMNITRACE_CONDITIONAL_ABORT(true, __VA_ARGS__)
#define ROCPROFSYS_ABORT(...) ROCPROFSYS_CONDITIONAL_ABORT(true, __VA_ARGS__)
#define OMNITRACE_ABORT_F(...) OMNITRACE_CONDITIONAL_ABORT_F(true, __VA_ARGS__)
#define ROCPROFSYS_ABORT_F(...) ROCPROFSYS_CONDITIONAL_ABORT_F(true, __VA_ARGS__)
#define OMNITRACE_BASIC_ABORT(...) OMNITRACE_CONDITIONAL_BASIC_ABORT(true, __VA_ARGS__)
#define ROCPROFSYS_BASIC_ABORT(...) ROCPROFSYS_CONDITIONAL_BASIC_ABORT(true, __VA_ARGS__)
#define OMNITRACE_BASIC_ABORT_F(...) \
OMNITRACE_CONDITIONAL_BASIC_ABORT_F(true, __VA_ARGS__)
#define ROCPROFSYS_BASIC_ABORT_F(...) \
ROCPROFSYS_CONDITIONAL_BASIC_ABORT_F(true, __VA_ARGS__)
#include <string>
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -24,10 +24,10 @@
#include "common/defines.h"
#define OMNITRACE_METADATA(...) ::tim::manager::add_metadata(__VA_ARGS__)
#define ROCPROFSYS_METADATA(...) ::tim::manager::add_metadata(__VA_ARGS__)
#if !defined(OMNITRACE_DEFAULT_OBJECT)
# define OMNITRACE_DEFAULT_OBJECT(NAME) \
#if !defined(ROCPROFSYS_DEFAULT_OBJECT)
# define ROCPROFSYS_DEFAULT_OBJECT(NAME) \
NAME() = default; \
NAME(const NAME&) = default; \
NAME(NAME&&) noexcept = default; \
@@ -35,8 +35,8 @@
NAME& operator=(NAME&&) noexcept = default;
#endif
#if !defined(OMNITRACE_DEFAULT_COPY_MOVE)
# define OMNITRACE_DEFAULT_COPY_MOVE(NAME) \
#if !defined(ROCPROFSYS_DEFAULT_COPY_MOVE)
# define ROCPROFSYS_DEFAULT_COPY_MOVE(NAME) \
NAME(const NAME&) = default; \
NAME(NAME&&) noexcept = default; \
NAME& operator=(const NAME&) = default; \
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -33,7 +33,7 @@
#include <string>
#include <utility>
namespace omnitrace
namespace rocprofsys
{
namespace procfs = ::tim::procfs;
@@ -100,14 +100,15 @@ dynamic_library::dynamic_library(std::string _env, std::string _fname, int _flag
}
else if(_env_val.find('/') == 0)
{
OMNITRACE_VERBOSE_F(1,
"Ignoring environment variable %s=\"%s\" because the "
"filepath does not exist. Using \"%s\" instead...\n",
envname.c_str(), _env_val.c_str(), filename.c_str())
ROCPROFSYS_VERBOSE_F(
1,
"Ignoring environment variable %s=\"%s\" because the "
"filepath does not exist. Using \"%s\" instead...\n",
envname.c_str(), _env_val.c_str(), filename.c_str())
}
else if(_env_val.find('/') != 0 && filename.find('/') == 0)
{
OMNITRACE_VERBOSE_F(
ROCPROFSYS_VERBOSE_F(
1,
"Ignoring environment variable %s=\"%s\" because the "
"filepath is relative. Using absolute path \"%s\" instead...\n",
@@ -129,8 +130,8 @@ dynamic_library::open()
handle = dlopen(filename.c_str(), flags);
if(!handle)
{
OMNITRACE_VERBOSE(2, "[dynamic_library] Error opening %s=\"%s\" :: %s.\n",
envname.c_str(), filename.c_str(), dlerror());
ROCPROFSYS_VERBOSE(2, "[dynamic_library] Error opening %s=\"%s\" :: %s.\n",
envname.c_str(), filename.c_str(), dlerror());
}
dlerror(); // Clear any existing error
}
@@ -149,4 +150,4 @@ dynamic_library::is_open() const
{
return (handle != nullptr);
}
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -29,7 +29,7 @@
#include <unistd.h>
#include <vector>
namespace omnitrace
namespace rocprofsys
{
std::string
find_library_path(const std::string& _name, const std::vector<std::string>& _env_vars,
@@ -77,10 +77,10 @@ dynamic_library::invoke(std::string_view _name, RetT (*&_func)(Args...), Args...
}
else
{
fprintf(stderr, "[omnitrace][pid=%i]> %s :: %s\n", getpid(), _name.data(),
fprintf(stderr, "[rocprof-sys][pid=%i]> %s :: %s\n", getpid(), _name.data(),
dlerror());
}
}
return RetT{};
}
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -37,7 +37,7 @@
#include <typeinfo>
#include <variant>
namespace omnitrace
namespace rocprofsys
{
namespace
{
@@ -125,4 +125,4 @@ template class exception<std::underflow_error>;
// template class exception<std::bad_weak_ptr>;
// template class exception<std::bad_any_cast>;
// template class exception<std::bad_variant_access>;
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -28,7 +28,7 @@
#include <timemory/utility/backtrace.hpp>
#include <type_traits>
namespace omnitrace
namespace rocprofsys
{
template <typename Tp>
class exception : public Tp
@@ -50,4 +50,4 @@ public:
private:
char* m_what = nullptr;
};
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -22,17 +22,17 @@
#include "common/defines.h"
#if !defined(OMNITRACE_USE_ROCM_SMI)
# define OMNITRACE_USE_ROCM_SMI 0
#if !defined(ROCPROFSYS_USE_ROCM_SMI)
# define ROCPROFSYS_USE_ROCM_SMI 0
#endif
#if !defined(OMNITRACE_USE_HIP)
# define OMNITRACE_USE_HIP 0
#if !defined(ROCPROFSYS_USE_HIP)
# define ROCPROFSYS_USE_HIP 0
#endif
#include "core/hip_runtime.hpp"
#if OMNITRACE_USE_HIP > 0
#if ROCPROFSYS_USE_HIP > 0
# if !defined(TIMEMORY_USE_HIP)
# define TIMEMORY_USE_HIP 1
# endif
@@ -44,19 +44,19 @@
#include <timemory/manager.hpp>
#if OMNITRACE_USE_ROCM_SMI > 0
#if ROCPROFSYS_USE_ROCM_SMI > 0
# include <rocm_smi/rocm_smi.h>
#endif
#if OMNITRACE_USE_HIP > 0
#if ROCPROFSYS_USE_HIP > 0
# include <timemory/components/hip/backends.hpp>
# if !defined(OMNITRACE_HIP_RUNTIME_CALL)
# define OMNITRACE_HIP_RUNTIME_CALL(err) \
# if !defined(ROCPROFSYS_HIP_RUNTIME_CALL)
# define ROCPROFSYS_HIP_RUNTIME_CALL(err) \
{ \
if(err != ::tim::hip::success_v && (int) err != 0) \
{ \
OMNITRACE_THROW( \
ROCPROFSYS_THROW( \
"[%s:%d] Warning! HIP API call failed with code %i :: %s\n", \
__FILE__, __LINE__, (int) err, hipGetErrorString(err)); \
} \
@@ -64,7 +64,7 @@
# endif
#endif
namespace omnitrace
namespace rocprofsys
{
namespace gpu
{
@@ -72,9 +72,9 @@ namespace
{
namespace scope = ::tim::scope;
#if OMNITRACE_USE_ROCM_SMI > 0
# define OMNITRACE_ROCM_SMI_CALL(ERROR_CODE) \
::omnitrace::gpu::check_rsmi_error(ERROR_CODE, __FILE__, __LINE__)
#if ROCPROFSYS_USE_ROCM_SMI > 0
# define ROCPROFSYS_ROCM_SMI_CALL(ERROR_CODE) \
::rocprofsys::gpu::check_rsmi_error(ERROR_CODE, __FILE__, __LINE__)
void
check_rsmi_error(rsmi_status_t _code, const char* _file, int _line)
@@ -83,11 +83,11 @@ check_rsmi_error(rsmi_status_t _code, const char* _file, int _line)
const char* _msg = nullptr;
auto _err = rsmi_status_string(_code, &_msg);
if(_err != RSMI_STATUS_SUCCESS)
OMNITRACE_THROW("rsmi_status_string failed. No error message available. "
"Error code %i originated at %s:%i\n",
static_cast<int>(_code), _file, _line);
OMNITRACE_THROW("[%s:%i] Error code %i :: %s", _file, _line, static_cast<int>(_code),
_msg);
ROCPROFSYS_THROW("rsmi_status_string failed. No error message available. "
"Error code %i originated at %s:%i\n",
static_cast<int>(_code), _file, _line);
ROCPROFSYS_THROW("[%s:%i] Error code %i :: %s", _file, _line, static_cast<int>(_code),
_msg);
}
bool
@@ -96,11 +96,11 @@ rsmi_init()
auto _rsmi_init = []() {
try
{
OMNITRACE_ROCM_SMI_CALL(::rsmi_init(0));
ROCPROFSYS_ROCM_SMI_CALL(::rsmi_init(0));
} catch(std::exception& _e)
{
OMNITRACE_BASIC_VERBOSE(1, "Exception thrown initializing rocm-smi: %s\n",
_e.what());
ROCPROFSYS_BASIC_VERBOSE(1, "Exception thrown initializing rocm-smi: %s\n",
_e.what());
return false;
}
return true;
@@ -110,7 +110,7 @@ rsmi_init()
}
#endif
#if OMNITRACE_HIP_VERSION >= 60000
#if ROCPROFSYS_HIP_VERSION >= 60000
template <typename ArchiveT, typename ArgT,
std::enable_if_t<!std::is_pointer<ArgT>::value, int> = 0>
void
@@ -164,7 +164,7 @@ device_prop_serialize(ArchiveT& archive, const char* name, hipDeviceArch_t arg)
namespace cereal = tim::cereal;
using cereal::make_nvp;
# define OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(NAME) \
# define ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(NAME) \
{ \
auto val = arg.NAME; \
archive(make_nvp(#NAME, val)); \
@@ -172,26 +172,26 @@ device_prop_serialize(ArchiveT& archive, const char* name, hipDeviceArch_t arg)
archive.setNextName(name);
archive.startNode();
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasGlobalInt32Atomics)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasGlobalFloatAtomicExch)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasSharedInt32Atomics)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasSharedFloatAtomicExch)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasFloatAtomicAdd)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasGlobalInt64Atomics)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasSharedInt64Atomics)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasDoubles)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasWarpVote)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasWarpBallot)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasWarpShuffle)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasFunnelShift)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasThreadFenceSystem)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasSyncThreadsExt)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasSurfaceFuncs)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(has3dGrid)
OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH(hasDynamicParallelism)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasGlobalInt32Atomics)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasGlobalFloatAtomicExch)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasSharedInt32Atomics)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasSharedFloatAtomicExch)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasFloatAtomicAdd)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasGlobalInt64Atomics)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasSharedInt64Atomics)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasDoubles)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasWarpVote)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasWarpBallot)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasWarpShuffle)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasFunnelShift)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasThreadFenceSystem)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasSyncThreadsExt)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasSurfaceFuncs)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(has3dGrid)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH(hasDynamicParallelism)
archive.finishNode();
# undef OMNITRACE_SERIALIZE_HIP_DEVICE_ARCH
# undef ROCPROFSYS_SERIALIZE_HIP_DEVICE_ARCH
}
#endif
} // namespace
@@ -199,7 +199,7 @@ device_prop_serialize(ArchiveT& archive, const char* name, hipDeviceArch_t arg)
int
hip_device_count()
{
#if OMNITRACE_USE_HIP > 0
#if ROCPROFSYS_USE_HIP > 0
return ::tim::hip::device_count();
#else
return 0;
@@ -209,17 +209,17 @@ hip_device_count()
int
rsmi_device_count()
{
#if OMNITRACE_USE_ROCM_SMI > 0
#if ROCPROFSYS_USE_ROCM_SMI > 0
if(!rsmi_init()) return 0;
static auto _num_devices = []() {
uint32_t _v = 0;
try
{
OMNITRACE_ROCM_SMI_CALL(rsmi_num_monitor_devices(&_v));
ROCPROFSYS_ROCM_SMI_CALL(rsmi_num_monitor_devices(&_v));
} catch(std::exception& _e)
{
OMNITRACE_BASIC_VERBOSE(
ROCPROFSYS_BASIC_VERBOSE(
1, "Exception thrown getting the rocm-smi devices: %s\n", _e.what());
}
return _v;
@@ -234,10 +234,10 @@ rsmi_device_count()
int
device_count()
{
#if OMNITRACE_USE_ROCM_SMI > 0
#if ROCPROFSYS_USE_ROCM_SMI > 0
// store as static since calls after rsmi_shutdown will return zero
return rsmi_device_count();
#elif OMNITRACE_USE_HIP > 0
#elif ROCPROFSYS_USE_HIP > 0
return ::tim::hip::device_count();
#else
return 0;
@@ -251,7 +251,7 @@ add_hip_device_metadata(ArchiveT& ar)
namespace cereal = tim::cereal;
using cereal::make_nvp;
#if OMNITRACE_USE_HIP > 0
#if ROCPROFSYS_USE_HIP > 0
int _device_count = 0;
int _current_device = 0;
hipError_t _device_count_err = hipGetDeviceCount(&_device_count);
@@ -263,7 +263,7 @@ add_hip_device_metadata(ArchiveT& ar)
scope::destructor _dtor{ [_current_device, _current_device_err]() {
if(_current_device_err == hipSuccess)
{
OMNITRACE_HIP_RUNTIME_CALL(hipSetDevice(_current_device));
ROCPROFSYS_HIP_RUNTIME_CALL(hipSetDevice(_current_device));
}
} };
@@ -279,20 +279,20 @@ add_hip_device_metadata(ArchiveT& ar)
auto _device_prop = hipDeviceProp_t{};
int _driver_version = 0;
int _runtime_version = 0;
OMNITRACE_HIP_RUNTIME_CALL(hipSetDevice(dev));
OMNITRACE_HIP_RUNTIME_CALL(hipGetDeviceProperties(&_device_prop, dev));
OMNITRACE_HIP_RUNTIME_CALL(hipDriverGetVersion(&_driver_version));
OMNITRACE_HIP_RUNTIME_CALL(hipRuntimeGetVersion(&_runtime_version));
ROCPROFSYS_HIP_RUNTIME_CALL(hipSetDevice(dev));
ROCPROFSYS_HIP_RUNTIME_CALL(hipGetDeviceProperties(&_device_prop, dev));
ROCPROFSYS_HIP_RUNTIME_CALL(hipDriverGetVersion(&_driver_version));
ROCPROFSYS_HIP_RUNTIME_CALL(hipRuntimeGetVersion(&_runtime_version));
ar.startNode();
# if OMNITRACE_HIP_VERSION < 60000
# if ROCPROFSYS_HIP_VERSION < 60000
using intvec_t = std::vector<int>;
# define OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(NAME) \
# define ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(NAME) \
ar(make_nvp(#NAME, _device_prop.NAME));
# define OMNITRACE_SERIALIZE_HIP_DEVICE_PROP_ARRAY(NAME, ...) \
# define ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP_ARRAY(NAME, ...) \
ar(make_nvp(NAME, __VA_ARGS__));
ar(make_nvp("name", std::string{ _device_prop.name }));
@@ -301,162 +301,162 @@ add_hip_device_metadata(ArchiveT& ar)
ar(make_nvp("capability.major_version", _device_prop.major));
ar(make_nvp("capability.minor_version", _device_prop.minor));
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(totalGlobalMem)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(totalConstMem)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(clockRate)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(totalGlobalMem)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(totalConstMem)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(clockRate)
# if OMNITRACE_HIP_VERSION >= 50000
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(memoryClockRate)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(memoryBusWidth)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(l2CacheSize)
# if ROCPROFSYS_HIP_VERSION >= 50000
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(memoryClockRate)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(memoryBusWidth)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(l2CacheSize)
# endif
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(sharedMemPerBlock)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(regsPerBlock)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(warpSize)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(multiProcessorCount)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxThreadsPerMultiProcessor)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxThreadsPerBlock)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP_ARRAY(
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(sharedMemPerBlock)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(regsPerBlock)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(warpSize)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(multiProcessorCount)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxThreadsPerMultiProcessor)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxThreadsPerBlock)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP_ARRAY(
"maxThreadsDim",
intvec_t{ _device_prop.maxThreadsDim[0], _device_prop.maxThreadsDim[1],
_device_prop.maxThreadsDim[2] })
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP_ARRAY("maxGridSize",
intvec_t{ _device_prop.maxGridSize[0],
_device_prop.maxGridSize[1],
_device_prop.maxGridSize[2] })
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(memPitch)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(textureAlignment)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(kernelExecTimeoutEnabled)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(integrated)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(canMapHostMemory)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(ECCEnabled)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(cooperativeLaunch)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceLaunch)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(pciDomainID)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(pciBusID)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(pciDeviceID)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(computeMode)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(gcnArch)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(gcnArchName)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(isMultiGpuBoard)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(clockInstructionRate)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(pageableMemoryAccess)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(pageableMemoryAccessUsesHostPageTables)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(directManagedMemAccessFromHost)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(concurrentManagedAccess)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(concurrentKernels)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxSharedMemoryPerMultiProcessor)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(asicRevision)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP_ARRAY(
"maxGridSize",
intvec_t{ _device_prop.maxGridSize[0], _device_prop.maxGridSize[1],
_device_prop.maxGridSize[2] })
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(memPitch)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(textureAlignment)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(kernelExecTimeoutEnabled)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(integrated)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(canMapHostMemory)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(ECCEnabled)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(cooperativeLaunch)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceLaunch)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(pciDomainID)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(pciBusID)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(pciDeviceID)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(computeMode)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(gcnArch)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(gcnArchName)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(isMultiGpuBoard)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(clockInstructionRate)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(pageableMemoryAccess)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(pageableMemoryAccessUsesHostPageTables)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(directManagedMemAccessFromHost)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(concurrentManagedAccess)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(concurrentKernels)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxSharedMemoryPerMultiProcessor)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(asicRevision)
# else
# define OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(NAME) \
# define ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(NAME) \
device_prop_serialize(ar, #NAME, _device_prop.NAME);
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(name)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(uuid)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(luid)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(luidDeviceNodeMask)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(totalGlobalMem)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(sharedMemPerBlock)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(regsPerBlock)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(warpSize)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(memPitch)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxThreadsPerBlock)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxThreadsDim)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxGridSize)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(clockRate)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(totalConstMem)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(major)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(minor)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(textureAlignment)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(texturePitchAlignment)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(deviceOverlap)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(multiProcessorCount)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(kernelExecTimeoutEnabled)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(integrated)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(canMapHostMemory)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(computeMode)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTexture1D)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTexture1DMipmap)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTexture1DLinear)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTexture2D)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTexture2DMipmap)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTexture2DLinear)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTexture2DGather)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTexture3D)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTexture3DAlt)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTextureCubemap)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTexture1DLayered)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTexture2DLayered)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxTextureCubemapLayered)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxSurface1D)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxSurface2D)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxSurface3D)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxSurface1DLayered)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxSurface2DLayered)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxSurfaceCubemap)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxSurfaceCubemapLayered)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(surfaceAlignment)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(concurrentKernels)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(ECCEnabled)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(pciBusID)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(pciDeviceID)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(pciDomainID)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(tccDriver)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(asyncEngineCount)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(unifiedAddressing)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(memoryClockRate)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(memoryBusWidth)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(l2CacheSize)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(persistingL2CacheMaxSize)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxThreadsPerMultiProcessor)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(streamPrioritiesSupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(globalL1CacheSupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(localL1CacheSupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(sharedMemPerMultiprocessor)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(regsPerMultiprocessor)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(managedMemory)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(isMultiGpuBoard)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(multiGpuBoardGroupID)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(hostNativeAtomicSupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(singleToDoublePrecisionPerfRatio)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(pageableMemoryAccess)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(concurrentManagedAccess)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(computePreemptionSupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(canUseHostPointerForRegisteredMem)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(cooperativeLaunch)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceLaunch)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(sharedMemPerBlockOptin)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(pageableMemoryAccessUsesHostPageTables)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(directManagedMemAccessFromHost)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxBlocksPerMultiProcessor)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(accessPolicyMaxWindowSize)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(reservedSharedMemPerBlock)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(hostRegisterSupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(sparseHipArraySupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(hostRegisterReadOnlySupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(timelineSemaphoreInteropSupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(memoryPoolsSupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(gpuDirectRDMASupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(gpuDirectRDMAFlushWritesOptions)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(gpuDirectRDMAWritesOrdering)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(memoryPoolSupportedHandleTypes)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(deferredMappingHipArraySupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(ipcEventSupported)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(clusterLaunch)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(unifiedFunctionPointers)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(gcnArchName)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(maxSharedMemoryPerMultiProcessor)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(clockInstructionRate)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(arch)
// OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(hdpMemFlushCntl)
// OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(hdpRegFlushCntl)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceUnmatchedFunc)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceUnmatchedGridDim)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceUnmatchedBlockDim)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceUnmatchedSharedMem)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(isLargeBar)
OMNITRACE_SERIALIZE_HIP_DEVICE_PROP(asicRevision)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(name)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(uuid)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(luid)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(luidDeviceNodeMask)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(totalGlobalMem)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(sharedMemPerBlock)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(regsPerBlock)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(warpSize)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(memPitch)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxThreadsPerBlock)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxThreadsDim)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxGridSize)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(clockRate)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(totalConstMem)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(major)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(minor)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(textureAlignment)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(texturePitchAlignment)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(deviceOverlap)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(multiProcessorCount)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(kernelExecTimeoutEnabled)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(integrated)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(canMapHostMemory)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(computeMode)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTexture1D)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTexture1DMipmap)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTexture1DLinear)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTexture2D)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTexture2DMipmap)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTexture2DLinear)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTexture2DGather)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTexture3D)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTexture3DAlt)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTextureCubemap)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTexture1DLayered)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTexture2DLayered)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxTextureCubemapLayered)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxSurface1D)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxSurface2D)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxSurface3D)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxSurface1DLayered)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxSurface2DLayered)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxSurfaceCubemap)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxSurfaceCubemapLayered)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(surfaceAlignment)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(concurrentKernels)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(ECCEnabled)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(pciBusID)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(pciDeviceID)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(pciDomainID)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(tccDriver)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(asyncEngineCount)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(unifiedAddressing)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(memoryClockRate)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(memoryBusWidth)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(l2CacheSize)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(persistingL2CacheMaxSize)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxThreadsPerMultiProcessor)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(streamPrioritiesSupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(globalL1CacheSupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(localL1CacheSupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(sharedMemPerMultiprocessor)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(regsPerMultiprocessor)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(managedMemory)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(isMultiGpuBoard)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(multiGpuBoardGroupID)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(hostNativeAtomicSupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(singleToDoublePrecisionPerfRatio)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(pageableMemoryAccess)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(concurrentManagedAccess)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(computePreemptionSupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(canUseHostPointerForRegisteredMem)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(cooperativeLaunch)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceLaunch)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(sharedMemPerBlockOptin)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(pageableMemoryAccessUsesHostPageTables)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(directManagedMemAccessFromHost)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxBlocksPerMultiProcessor)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(accessPolicyMaxWindowSize)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(reservedSharedMemPerBlock)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(hostRegisterSupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(sparseHipArraySupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(hostRegisterReadOnlySupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(timelineSemaphoreInteropSupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(memoryPoolsSupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(gpuDirectRDMASupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(gpuDirectRDMAFlushWritesOptions)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(gpuDirectRDMAWritesOrdering)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(memoryPoolSupportedHandleTypes)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(deferredMappingHipArraySupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(ipcEventSupported)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(clusterLaunch)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(unifiedFunctionPointers)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(gcnArchName)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(maxSharedMemoryPerMultiProcessor)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(clockInstructionRate)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(arch)
// ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(hdpMemFlushCntl)
// ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(hdpRegFlushCntl)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceUnmatchedFunc)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceUnmatchedGridDim)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceUnmatchedBlockDim)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(cooperativeMultiDeviceUnmatchedSharedMem)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(isLargeBar)
ROCPROFSYS_SERIALIZE_HIP_DEVICE_PROP(asicRevision)
# endif
const auto _compute_mode_descr = std::array<const char*, 6>{
@@ -487,15 +487,15 @@ add_hip_device_metadata()
{
if(device_count() == 0) return;
OMNITRACE_METADATA([](auto& ar) {
ROCPROFSYS_METADATA([](auto& ar) {
try
{
add_hip_device_metadata(ar);
} catch(std::runtime_error& _e)
{
OMNITRACE_VERBOSE(2, "%s\n", _e.what());
ROCPROFSYS_VERBOSE(2, "%s\n", _e.what());
}
});
}
} // namespace gpu
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -22,7 +22,7 @@
#pragma once
namespace omnitrace
namespace rocprofsys
{
namespace gpu
{
@@ -38,4 +38,4 @@ rsmi_device_count();
void
add_hip_device_metadata();
} // namespace gpu
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -24,7 +24,7 @@
#include "core/defines.hpp"
#if defined(OMNITRACE_USE_HIP) && OMNITRACE_USE_HIP > 0
#if defined(ROCPROFSYS_USE_HIP) && ROCPROFSYS_USE_HIP > 0
# if defined(HIP_INCLUDE_HIP_HIP_RUNTIME_H) || \
defined(HIP_INCLUDE_HIP_HIP_RUNTIME_API_H)
@@ -35,7 +35,7 @@
# define HIP_PROF_HIP_API_STRING 1
// following must be included before <roctracer_hip.h> for ROCm 6.0+
# if OMNITRACE_HIP_VERSION >= 60000
# if ROCPROFSYS_HIP_VERSION >= 60000
# if defined(USE_PROF_API)
# undef USE_PROF_API
# endif
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -27,11 +27,11 @@
#include <atomic>
#include <mutex>
namespace omnitrace
namespace rocprofsys
{
namespace locking
{
using atomic_mutex = ::tim::locking::spin_mutex;
using atomic_lock = ::tim::locking::spin_lock;
} // namespace locking
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -32,7 +32,7 @@
#include <thread>
#include <unistd.h>
namespace omnitrace
namespace rocprofsys
{
namespace mproc
{
@@ -46,7 +46,7 @@ get_concurrent_processes(int _ppid)
std::ifstream _ifs{ _inp };
if(!_ifs)
{
OMNITRACE_VERBOSE_F(2, "Warning! File '%s' cannot be read\n", _inp.c_str());
ROCPROFSYS_VERBOSE_F(2, "Warning! File '%s' cannot be read\n", _inp.c_str());
return _children;
}
@@ -191,4 +191,4 @@ diagnose_status(pid_t _pid, int _status, int _verbose)
return _ec;
}
} // namespace mproc
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -25,7 +25,7 @@
#include <set>
#include <unistd.h>
namespace omnitrace
namespace rocprofsys
{
namespace mproc
{
@@ -42,4 +42,4 @@ wait_pid(pid_t _pid, int _opts = 0);
int
diagnose_status(pid_t _pid, int _status, int _verbose = 0);
} // namespace mproc
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -25,7 +25,7 @@
#include <timemory/units.hpp>
namespace omnitrace
namespace rocprofsys
{
namespace perf
{
@@ -101,7 +101,7 @@ get_hw_config(std::string_view _v)
return hw_config::reference_cpu_cycles;
else
{
OMNITRACE_THROW("Unknown perf hardware config: %s", _v.data());
ROCPROFSYS_THROW("Unknown perf hardware config: %s", _v.data());
}
#undef HW_CONFIG_REGEX
@@ -134,7 +134,7 @@ get_sw_config(std::string_view _v)
return sw_config::emulation_faults;
else
{
OMNITRACE_THROW("Unknown perf hw cache config: %s", _v.data());
ROCPROFSYS_THROW("Unknown perf hw cache config: %s", _v.data());
}
#undef SW_CONFIG_REGEX
@@ -165,7 +165,7 @@ get_hw_cache_config(std::string_view _v)
else if(HW_CACHE_CONFIG_REGEX("NODE"))
_value |= static_cast<int>(hw_cache_config::node);
else
OMNITRACE_THROW("Unknown perf software config: %s", _v.data());
ROCPROFSYS_THROW("Unknown perf software config: %s", _v.data());
#undef HW_CACHE_CONFIG_REGEX
#define HW_CACHE_OP_REGEX(KEY) \
@@ -226,7 +226,7 @@ config_overflow_sampling(struct perf_event_attr& _pe, std::string_view _event,
case PERF_TYPE_MAX:
default:
{
OMNITRACE_THROW("unsupported perf type");
ROCPROFSYS_THROW("unsupported perf type");
}
};
@@ -241,4 +241,4 @@ config_overflow_sampling(struct perf_event_attr& _pe, std::string_view _event,
}
}
} // namespace perf
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -42,7 +42,7 @@ enum
HW_BREAKPOINT_X = 4
};
namespace omnitrace
namespace rocprofsys
{
namespace perf
{
@@ -288,4 +288,4 @@ int get_hw_cache_config(std::string_view);
void
config_overflow_sampling(struct perf_event_attr&, std::string_view, double);
} // namespace perf
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -26,7 +26,7 @@
#include "perfetto_fwd.hpp"
#include "utility.hpp"
namespace omnitrace
namespace rocprofsys
{
namespace perfetto
{
@@ -86,8 +86,8 @@ setup()
for(const auto& itr : config::get_disabled_categories())
{
OMNITRACE_VERBOSE_F(1, "Disabling perfetto track event category: %s\n",
itr.c_str());
ROCPROFSYS_VERBOSE_F(1, "Disabling perfetto track event category: %s\n",
itr.c_str());
track_event_cfg.add_disabled_categories(itr);
}
@@ -124,12 +124,12 @@ start()
}
else
{
OMNITRACE_VERBOSE(2, "Resuming perfetto...\n");
ROCPROFSYS_VERBOSE(2, "Resuming perfetto...\n");
_tmp_file->fopen("a+");
}
}
OMNITRACE_VERBOSE(2, "Setup perfetto...\n");
ROCPROFSYS_VERBOSE(2, "Setup perfetto...\n");
int _fd = (_tmp_file) ? _tmp_file->fd : -1;
auto& cfg = get_config();
tracing_session->Setup(cfg, _fd);
@@ -143,16 +143,17 @@ stop()
auto& tracing_session = get_perfetto_session();
OMNITRACE_CI_THROW(tracing_session == nullptr, "Null pointer to the tracing session");
ROCPROFSYS_CI_THROW(tracing_session == nullptr,
"Null pointer to the tracing session");
if(tracing_session)
{
// Make sure the last event is closed
OMNITRACE_VERBOSE(2, "Flushing the perfetto trace data...\n");
ROCPROFSYS_VERBOSE(2, "Flushing the perfetto trace data...\n");
::perfetto::TrackEvent::Flush();
tracing_session->FlushBlocking();
OMNITRACE_VERBOSE(2, "Stopping the perfetto trace session (blocking)...\n");
ROCPROFSYS_VERBOSE(2, "Stopping the perfetto trace session (blocking)...\n");
tracing_session->StopBlocking();
}
}
@@ -177,7 +178,7 @@ post_process(tim::manager* _timemory_manager, bool& _perfetto_output_error)
if(!_fdata)
{
OMNITRACE_VERBOSE(
ROCPROFSYS_VERBOSE(
-1, "Error! perfetto temp trace file '%s' could not be read",
_tmp_file->filename.c_str());
return char_vec_t{ tracing_session->ReadTraceBlocking() };
@@ -191,7 +192,7 @@ post_process(tim::manager* _timemory_manager, bool& _perfetto_output_error)
auto _fnum_read = fread(_data.data(), sizeof(char), _fnum_elem, _fdata);
fclose(_fdata);
OMNITRACE_CI_THROW(
ROCPROFSYS_CI_THROW(
_fnum_read != _fnum_elem,
"Error! read %zu elements from perfetto trace file '%s'. Expected %zu\n",
_fnum_read, _tmp_file->filename.c_str(), _fnum_elem);
@@ -233,7 +234,7 @@ post_process(tim::manager* _timemory_manager, bool& _perfetto_output_error)
auto _filename = config::get_perfetto_output_filename();
if(!trace_data.empty())
{
operation::file_output_message<tim::project::omnitrace> _fom{};
operation::file_output_message<tim::project::rocprofsys> _fom{};
// Write the trace into a file.
if(config::get_verbose() >= 0)
_fom(_filename, std::string{ "perfetto" },
@@ -259,7 +260,7 @@ post_process(tim::manager* _timemory_manager, bool& _perfetto_output_error)
}
else if(dmp::rank() == 0)
{
OMNITRACE_VERBOSE(
ROCPROFSYS_VERBOSE(
0, "perfetto trace data is empty. File '%s' will not be written...\n",
_filename.c_str());
}
@@ -278,8 +279,8 @@ post_process(tim::manager* _timemory_manager, bool& _perfetto_output_error)
std::unique_ptr<::perfetto::TracingSession>&
get_perfetto_session(pid_t _pid)
{
return ::omnitrace::perfetto::get_session(_pid);
return ::rocprofsys::perfetto::get_session(_pid);
}
} // namespace omnitrace
} // namespace rocprofsys
PERFETTO_TRACK_EVENT_STATIC_STORAGE();
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -29,7 +29,7 @@
# include <timemory/components/perfetto/backends.hpp>
#else
# include <perfetto.h>
PERFETTO_DEFINE_CATEGORIES(OMNITRACE_PERFETTO_CATEGORIES);
PERFETTO_DEFINE_CATEGORIES(ROCPROFSYS_PERFETTO_CATEGORIES);
#endif
#include "debug.hpp"
@@ -43,7 +43,7 @@ PERFETTO_DEFINE_CATEGORIES(OMNITRACE_PERFETTO_CATEGORIES);
#include <utility>
#include <vector>
namespace omnitrace
namespace rocprofsys
{
std::unique_ptr<::perfetto::TracingSession>& get_perfetto_session(
pid_t = process::get_id());
@@ -143,15 +143,15 @@ perfetto_counter_track<Tp>::emplace(size_t _idx, const std::string& _v,
std::stringstream _css{};
for(auto&& eitr : _curr)
_css << " " << std::hex << std::setw(12) << std::left << eitr;
OMNITRACE_THROW("perfetto_counter_track emplace method for '%s' (%p) "
"invalidated C-string '%s' (%p).\n%8s: %s\n%8s: %s\n",
_v.c_str(), (void*) _name->c_str(),
std::get<0>(itr).c_str(),
(void*) std::get<0>(itr).c_str(), "previous",
_pss.str().c_str(), "current", _css.str().c_str());
ROCPROFSYS_THROW("perfetto_counter_track emplace method for '%s' (%p) "
"invalidated C-string '%s' (%p).\n%8s: %s\n%8s: %s\n",
_v.c_str(), (void*) _name->c_str(),
std::get<0>(itr).c_str(),
(void*) std::get<0>(itr).c_str(), "previous",
_pss.str().c_str(), "current", _css.str().c_str());
}
}
}
return _index;
}
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -27,7 +27,7 @@ namespace tim
class manager;
}
namespace omnitrace
namespace rocprofsys
{
namespace perfetto
{
@@ -43,4 +43,4 @@ stop();
void
post_process(tim::manager*, bool&);
} // namespace perfetto
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -25,9 +25,9 @@
#include "core/defines.hpp"
#include "core/hip_runtime.hpp"
#if defined(OMNITRACE_USE_HIP) && OMNITRACE_USE_HIP > 0 && \
defined(OMNITRACE_USE_RCCL) && OMNITRACE_USE_RCCL > 0
# if OMNITRACE_HIP_VERSION == 0 || OMNITRACE_HIP_VERSION >= 50200
#if defined(ROCPROFSYS_USE_HIP) && ROCPROFSYS_USE_HIP > 0 && \
defined(ROCPROFSYS_USE_RCCL) && ROCPROFSYS_USE_RCCL > 0
# if ROCPROFSYS_HIP_VERSION == 0 || ROCPROFSYS_HIP_VERSION >= 50200
# include <rccl/rccl.h>
# else
# include <rccl.h>
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -31,15 +31,15 @@
#include <streambuf>
#include <string>
namespace omnitrace
namespace rocprofsys
{
inline namespace config
{
bool
get_debug() OMNITRACE_HOT;
get_debug() ROCPROFSYS_HOT;
int
get_verbose() OMNITRACE_HOT;
get_verbose() ROCPROFSYS_HOT;
} // namespace config
struct redirect
@@ -68,10 +68,11 @@ struct redirect
if(_v != _expect)
{
if(get_verbose() > 0)
std::cerr << "[omnitrace::redirect] Expected:\n[omnitrace::redirect] "
<< _expect
<< "\n[omnitrace::redirect] Found:\n[omnitrace::redirect] "
<< _v << "\n";
std::cerr
<< "[rocprofsys::redirect] Expected:\n[rocprofsys::redirect] "
<< _expect
<< "\n[rocprofsys::redirect] Found:\n[rocprofsys::redirect] " << _v
<< "\n";
if(get_verbose() <= 0 || (&m_os != &std::cerr && &m_os != &std::cout))
m_os << m_buffer.str() << std::flush;
}
@@ -99,4 +100,4 @@ private:
std::stringstream m_buffer{};
std::streambuf* m_strm_buffer = nullptr;
};
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -28,7 +28,7 @@
#include <atomic>
#include <string>
namespace omnitrace
namespace rocprofsys
{
namespace
{
@@ -49,10 +49,10 @@ get_thread_state_value()
auto&
get_thread_state_history(int64_t _idx = utility::get_thread_index())
{
static auto _v = utility::get_filled_array<OMNITRACE_MAX_THREADS>(
static auto _v = utility::get_filled_array<ROCPROFSYS_MAX_THREADS>(
[]() { return utility::get_reserved_vector<ThreadState>(32); });
if(_idx >= OMNITRACE_MAX_THREADS)
if(_idx >= ROCPROFSYS_MAX_THREADS)
{
static thread_local auto _tl_v = utility::get_reserved_vector<ThreadState>(32);
return _tl_v;
@@ -77,11 +77,11 @@ get_thread_state()
State
set_state(State _n)
{
OMNITRACE_CONDITIONAL_PRINT_F(get_debug_init(), "Setting state :: %s -> %s\n",
std::to_string(get_state()).c_str(),
std::to_string(_n).c_str());
ROCPROFSYS_CONDITIONAL_PRINT_F(get_debug_init(), "Setting state :: %s -> %s\n",
std::to_string(get_state()).c_str(),
std::to_string(_n).c_str());
// state should always be increased, not decreased
OMNITRACE_CI_BASIC_THROW(
ROCPROFSYS_CI_BASIC_THROW(
_n < get_state(), "State is being assigned to a lesser value :: %s -> %s",
std::to_string(get_state()).c_str(), std::to_string(_n).c_str());
auto _v = get_state();
@@ -118,57 +118,57 @@ pop_thread_state()
}
return get_thread_state();
}
} // namespace omnitrace
} // namespace rocprofsys
namespace std
{
std::string
to_string(omnitrace::State _v)
to_string(rocprofsys::State _v)
{
switch(_v)
{
case omnitrace::State::PreInit: return "PreInit";
case omnitrace::State::Init: return "Init";
case omnitrace::State::Active: return "Active";
case omnitrace::State::Disabled: return "Disabled";
case omnitrace::State::Finalized: return "Finalized";
case rocprofsys::State::PreInit: return "PreInit";
case rocprofsys::State::Init: return "Init";
case rocprofsys::State::Active: return "Active";
case rocprofsys::State::Disabled: return "Disabled";
case rocprofsys::State::Finalized: return "Finalized";
}
return {};
}
std::string
to_string(omnitrace::ThreadState _v)
to_string(rocprofsys::ThreadState _v)
{
switch(_v)
{
case omnitrace::ThreadState::Enabled: return "Enabled";
case omnitrace::ThreadState::Internal: return "Internal";
case omnitrace::ThreadState::Completed: return "Completed";
case omnitrace::ThreadState::Disabled: return "Disabled";
case rocprofsys::ThreadState::Enabled: return "Enabled";
case rocprofsys::ThreadState::Internal: return "Internal";
case rocprofsys::ThreadState::Completed: return "Completed";
case rocprofsys::ThreadState::Disabled: return "Disabled";
}
return {};
}
std::string
to_string(omnitrace::Mode _v)
to_string(rocprofsys::Mode _v)
{
switch(_v)
{
case omnitrace::Mode::Trace: return "Trace";
case omnitrace::Mode::Sampling: return "Sampling";
case omnitrace::Mode::Causal: return "Causal";
case omnitrace::Mode::Coverage: return "Coverage";
case rocprofsys::Mode::Trace: return "Trace";
case rocprofsys::Mode::Sampling: return "Sampling";
case rocprofsys::Mode::Causal: return "Causal";
case rocprofsys::Mode::Coverage: return "Coverage";
}
return {};
}
std::string
to_string(omnitrace::CausalMode _v)
to_string(rocprofsys::CausalMode _v)
{
switch(_v)
{
case omnitrace::CausalMode::Line: return "Line";
case omnitrace::CausalMode::Function: return "Function";
case rocprofsys::CausalMode::Line: return "Line";
case rocprofsys::CausalMode::Function: return "Function";
}
return {};
}
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -28,9 +28,9 @@
#include <cstdint>
#include <string>
namespace omnitrace
namespace rocprofsys
{
// used for specifying the state of omnitrace
// used for specifying the state of rocprof-sys
enum class State : unsigned short
{
PreInit = 0,
@@ -40,7 +40,7 @@ enum class State : unsigned short
Disabled,
};
// used for specifying the state of omnitrace
// used for specifying the state of rocprof-sys
enum class ThreadState : unsigned short
{
Enabled = 0,
@@ -74,48 +74,49 @@ enum class CausalMode : unsigned short
// Runtime configuration data
//
State
get_state() OMNITRACE_HOT;
get_state() ROCPROFSYS_HOT;
ThreadState
get_thread_state() OMNITRACE_HOT;
get_thread_state() ROCPROFSYS_HOT;
/// returns old state
State set_state(State) OMNITRACE_COLD; // does not change often
State set_state(State) ROCPROFSYS_COLD; // does not change often
/// returns old state
ThreadState set_thread_state(ThreadState) OMNITRACE_HOT; // changes often
ThreadState set_thread_state(ThreadState) ROCPROFSYS_HOT; // changes often
/// return current state (state change may be ignored)
ThreadState push_thread_state(ThreadState) OMNITRACE_HOT;
ThreadState push_thread_state(ThreadState) ROCPROFSYS_HOT;
/// return current state (state change may be ignored)
ThreadState
pop_thread_state() OMNITRACE_HOT;
pop_thread_state() ROCPROFSYS_HOT;
struct scoped_thread_state
{
OMNITRACE_INLINE scoped_thread_state(ThreadState _v) { push_thread_state(_v); }
OMNITRACE_INLINE ~scoped_thread_state() { pop_thread_state(); }
ROCPROFSYS_INLINE scoped_thread_state(ThreadState _v) { push_thread_state(_v); }
ROCPROFSYS_INLINE ~scoped_thread_state() { pop_thread_state(); }
};
} // namespace omnitrace
} // namespace rocprofsys
#define OMNITRACE_SCOPED_THREAD_STATE(STATE) \
::omnitrace::scoped_thread_state OMNITRACE_VARIABLE(_scoped_thread_state_, __LINE__) \
#define ROCPROFSYS_SCOPED_THREAD_STATE(STATE) \
::rocprofsys::scoped_thread_state ROCPROFSYS_VARIABLE(_scoped_thread_state_, \
__LINE__) \
{ \
::omnitrace::STATE \
::rocprofsys::STATE \
}
namespace std
{
std::string
to_string(omnitrace::State _v);
to_string(rocprofsys::State _v);
std::string
to_string(omnitrace::ThreadState _v);
to_string(rocprofsys::ThreadState _v);
std::string
to_string(omnitrace::Mode _v);
to_string(rocprofsys::Mode _v);
std::string
to_string(omnitrace::CausalMode _v);
to_string(rocprofsys::CausalMode _v);
} // namespace std
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -22,6 +22,6 @@
#include "timemory.hpp"
using namespace omnitrace;
using namespace rocprofsys;
TIMEMORY_INITIALIZE_STORAGE(comp::wall_clock, comp::user_global_bundle)
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -43,7 +43,7 @@
#include <timemory/utility/signals.hpp>
#include <timemory/variadic.hpp>
namespace omnitrace
namespace rocprofsys
{
namespace audit = ::tim::audit; // NOLINT
namespace comp = ::tim::component; // NOLINT
@@ -56,4 +56,4 @@ using settings = ::tim::settings; // NOLINT
using ::tim::get_env; // NOLINT
using ::tim::set_env; // NOLINT
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -23,7 +23,7 @@
#include "utility.hpp"
#include "debug.hpp"
namespace omnitrace
namespace rocprofsys
{
namespace utility
{
@@ -71,7 +71,7 @@ parse_numeric_range(std::string _input_string, const std::string& _label, Up _in
{
if(_v.find_first_not_of("0123456789-:") != std::string::npos)
{
OMNITRACE_BASIC_VERBOSE_F(
ROCPROFSYS_BASIC_VERBOSE_F(
0,
"Invalid %s specification. Only numerical values (e.g., 0), ranges "
"(e.g., 0-7), and ranges with increments (e.g. 20-40:10) are permitted. "
@@ -92,7 +92,7 @@ parse_numeric_range(std::string _input_string, const std::string& _label, Up _in
if(_v.find('-') != std::string::npos)
{
auto _vv = tim::delimit(_v, "-");
OMNITRACE_CONDITIONAL_THROW(
ROCPROFSYS_CONDITIONAL_THROW(
_vv.size() != 2,
"Invalid %s range specification: %s. Required format N-M, e.g. 0-4",
_label.c_str(), _v.c_str());
@@ -120,4 +120,4 @@ template std::unordered_set<int64_t>
parse_numeric_range<int64_t, std::unordered_set<int64_t>>(std::string, const std::string&,
long);
} // namespace utility
} // namespace omnitrace
} // namespace rocprofsys
@@ -1,6 +1,6 @@
// MIT License
//
// Copyright (c) 2022 Advanced Micro Devices, Inc. All Rights Reserved.
// Copyright (c) 2022-2024 Advanced Micro Devices, Inc. All Rights Reserved.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
@@ -38,7 +38,7 @@
#include <stdexcept>
#include <vector>
namespace omnitrace
namespace rocprofsys
{
namespace utility
{
@@ -253,4 +253,4 @@ extern template std::unordered_set<int64_t>
parse_numeric_range<int64_t, std::unordered_set<int64_t>>(std::string, const std::string&,
long);
} // namespace utility
} // namespace omnitrace
} // namespace rocprofsys