Skip to content

Commit dc40a7c

Browse files
committed
AMDMiGraphX Fedora 40 build error fix
Enable code for exception_ptr only if it is used. Not sure whether this error was caused by optimizion as patch was not needed on Fedora 39, Ubuntu 23.10 or on Mageia 9. Error message was: AMDMIGraphX/src/include/migraphx/par.hpp:58:22: error: no member named 'exception_ptr' in namespace 'std' Fixes: #12 Signed-off-by: Mika Laitio <[email protected]>
1 parent 766d48e commit dc40a7c

3 files changed

+56
-6
lines changed

patches/rocm-6.1.1/AMDMIGraphX/0001-fix-no-matching-constructor-build-error.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From a60531a70d6bc67d9c2e4253987d41f4ef8dac15 Mon Sep 17 00:00:00 2001
1+
From 3567e09b96983fb9593218cdcc290579a169e2d7 Mon Sep 17 00:00:00 2001
22
From: Mika Laitio <[email protected]>
33
Date: Thu, 9 May 2024 09:11:08 -0700
4-
Subject: [PATCH 1/2] fix no matching constructor build error
4+
Subject: [PATCH 1/3] fix no matching constructor build error
55

66
fix the build error for no matching constructor
77
by type casting auto arguments x and y to int.
@@ -53,5 +53,5 @@ index bf6807afb..3f9ac1f1e 100644
5353
return result;
5454
}
5555
--
56-
2.41.0
56+
2.45.1
5757

patches/rocm-6.1.1/AMDMIGraphX/0002-add-gfx1010-and-gfx1035.patch

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
From 81e67876eadf2c9bd82d9e983e8bed7d1d9f33db Mon Sep 17 00:00:00 2001
1+
From e8b47071e093630f6945a359a028230dd7838a09 Mon Sep 17 00:00:00 2001
22
From: Mika Laitio <[email protected]>
33
Date: Thu, 9 May 2024 13:12:33 -0700
4-
Subject: [PATCH 2/2] add gfx1010 and gfx1035
4+
Subject: [PATCH 2/3] add gfx1010 and gfx1035
55

66
Signed-off-by: Mika Laitio <[email protected]>
77
---
@@ -22,5 +22,5 @@ index 1d701ad89..ebb892650 100644
2222
}
2323

2424
--
25-
2.41.0
25+
2.45.1
2626

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From 95ed53dfcf1a6cafff1ab08d22305a9ae94552ce Mon Sep 17 00:00:00 2001
2+
From: Mika Laitio <[email protected]>
3+
Date: Thu, 30 May 2024 09:51:05 -0700
4+
Subject: [PATCH 3/3] define detail namespace only if used
5+
6+
This fixes the build problen on Fedora, not
7+
sure whether the real reason is some kind of optimization.
8+
Tested first that following did not help:
9+
#ifndef HAS_EXCEPTION_PTR
10+
#define HAS_EXCEPTION_PTR
11+
#endif
12+
13+
Builded ok on Fedora 39 and Ubuntu 23.10 but had following error in Fedora 40:
14+
cd /home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/builddir/035_AMDMIGraphX/test && /opt/rocm_sdk_611/bin/clang++ -DHAVE_GPU -DMIGRAPHX_HAS_EXECUTORS=0 -DMIGRAPHX_HAS_FIND_2_API -DMIGRAPHX_HAS_FIND_MODE_API -DMIGRAPHX_PREALLOCATE_MIOPEN_BUFFERS -DMIGRAPHX_USE_ROCBLAS_FP8_API -DMIGRAPHX_USE_ROCBLAS_TUNING_API -DROCBLAS_BETA_FEATURES_API -DROCBLAS_NO_DEPRECATED_WARNINGS -DUSE_PROF_API=1 -D__HIP_PLATFORM_AMD__ -D__HIP_PLATFORM_AMD__=1 -I/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/AMDMIGraphX/test/include -I/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/builddir/035_AMDMIGraphX/src/include -I/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/AMDMIGraphX/src/include -I/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/builddir/035_AMDMIGraphX/src/onnx/include -I/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/builddir/035_AMDMIGraphX/src/tf/include -I/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/builddir/035_AMDMIGraphX/src/targets/ref/include -I/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/AMDMIGraphX/src/targets/ref/include -I/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/builddir/035_AMDMIGraphX/src/targets/gpu/include -I/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/AMDMIGraphX/src/targets/gpu/include -isystem /opt/rocm_sdk_611/include -O3 -DNDEBUG -std=c++17 -Wall -Wextra -Wcomment -Wendif-labels -Wformat -Winit-self -Wreturn-type -Wsequence-point -Wswitch -Wtrigraphs -Wundef -Wuninitialized -Wunreachable-code -Wunused -Wno-sign-compare -Weverything -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-conversion -Wno-double-promotion -Wno-exit-time-destructors -Wno-extra-semi -Wno-extra-semi-stmt -Wno-float-conversion -Wno-gnu-anonymous-struct -Wno-gnu-zero-variadic-macro-arguments -Wno-missing-prototypes -Wno-nested-anon-types -Wno-option-ignored -Wno-padded -Wno-shorten-64-to-32 -Wno-sign-conversion -Wno-unused-command-line-argument -Wno-weak-vtables -Wno-c99-extensions -Wno-unsafe-buffer-usage -MD -MT test/CMakeFiles/header_src_include_migraphx_execution_environment_hpp.dir/header-static-include-header_src_include_migraphx_execution_environment_hpp.cpp.o -MF CMakeFiles/header_src_include_migraphx_execution_environment_hpp.dir/header-static-include-header_src_include_migraphx_execution_environment_hpp.cpp.o.d -o CMakeFiles/header_src_include_migraphx_execution_environment_hpp.dir/header-static-include-header_src_include_migraphx_execution_environment_hpp.cpp.o -c /home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/builddir/035_AMDMIGraphX/test/header-static-include-header_src_include_migraphx_execution_environment_hpp.cpp
15+
In file included from /home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/builddir/035_AMDMIGraphX/test/header-main-include-header_src_include_migraphx_convolution_hpp.cpp:2:
16+
In file included from /home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/AMDMIGraphX/src/include/migraphx/convolution.hpp:29:
17+
In file included from /home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/AMDMIGraphX/src/include/migraphx/par_for.hpp:27:
18+
/home/lamikr/own/rocm/src/sdk/rocm_sdk_builder_611/src_projects/AMDMIGraphX/src/include/migraphx/par.hpp:58:22: error: no member named 'exception_ptr' in namespace 'std'
19+
58 | std::vector<std::exception_ptr> exceptions;
20+
21+
Signed-off-by: Mika Laitio <[email protected]>
22+
---
23+
src/include/migraphx/par.hpp | 4 ++++
24+
1 file changed, 4 insertions(+)
25+
26+
diff --git a/src/include/migraphx/par.hpp b/src/include/migraphx/par.hpp
27+
index 270d0f07b..46b27f516 100644
28+
--- a/src/include/migraphx/par.hpp
29+
+++ b/src/include/migraphx/par.hpp
30+
@@ -37,6 +37,8 @@
31+
namespace migraphx {
32+
inline namespace MIGRAPHX_INLINE_NS {
33+
34+
+#if MIGRAPHX_HAS_EXECUTORS
35+
+
36+
namespace detail {
37+
38+
struct exception_list
39+
@@ -71,6 +73,8 @@ struct exception_list
40+
41+
} // namespace detail
42+
43+
+#endif
44+
+
45+
template <class InputIt, class OutputIt, class UnaryOperation>
46+
OutputIt par_transform(InputIt first1, InputIt last1, OutputIt d_first, UnaryOperation unary_op)
47+
{
48+
--
49+
2.45.1
50+

0 commit comments

Comments
 (0)