From 2449e7cd462672e3ff9f040c710dcac236af28be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9sz=C3=A1ros=20Gergely?= Date: Fri, 18 Nov 2022 19:12:59 +0100 Subject: [PATCH] rocm: Fix compilation with rocm >= 5.3.1 (#214) * rocm: Fix compilation with rocm >= 5.3.1 Add another version checked initialiation, because: [roctracer has changed `hsa_ops_properties_t` again in 5.3.1][hsa_ops_properties_t] [hsa_ops_properties_t]: https://github.com/ROCm-Developer-Tools/roctracer/compare/rocm-5.3.0...rocm-5.3.1#diff-42ffacd4e7f57213868dcd96aeb5c0d47d91d2a1121ba8d67f46caa267c1818cL41 * Fix formatting * Fix preprocessing directive --- source/lib/omnitrace/library/rocm.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/lib/omnitrace/library/rocm.cpp b/source/lib/omnitrace/library/rocm.cpp index ecff93e18b..628521b843 100644 --- a/source/lib/omnitrace/library/rocm.cpp +++ b/source/lib/omnitrace/library/rocm.cpp @@ -237,13 +237,18 @@ extern "C" hsa_activity_callback), nullptr, output_prefix }; -#else +#elif OMNITRACE_HIP_VERSION < 50301 hsa_ops_properties_t ops_properties; ops_properties.table = table; ops_properties.reserved1[0] = reinterpret_cast(&hsa_activity_callback); ops_properties.reserved1[1] = nullptr; ops_properties.reserved1[2] = nullptr; +#else + hsa_ops_properties_t ops_properties{ + table, reinterpret_cast(&hsa_activity_callback), nullptr, + nullptr + }; #endif roctracer_set_properties(ACTIVITY_DOMAIN_HSA_OPS, &ops_properties);