From c15cf2e9c30848dde05fd2f11769d717758e5e6f Mon Sep 17 00:00:00 2001 From: changzhu Date: Wed, 21 Nov 2018 17:11:53 +0800 Subject: [PATCH] kfdtest: fix SDMACopyParams build error on redhat 7.2 in KFDTestUtilQueue.cpp MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In file included from /usr/include/c++/4.8.2/algorithm:62:0, from /home/jenkins/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp:24: /usr/include/c++/4.8.2/bits/stl_algo.h: In instantiation of ‘_RandomAccessIterator std::__unguarded_partition(_RandomAccessIterator, _RandomAccessIterator, const _Tp&, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Tp = SDMACopyParams; _Compare = bool (*)(SDMACopyParams&, SDMACopyParams&)]’: /usr/include/c++/4.8.2/bits/stl_algo.h:2296:78: required from ‘_RandomAccessIterator std::__unguarded_partition_pivot(_RandomAccessIterator, _RandomAccessIterator, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Compare = bool (*)(SDMACopyParams&, SDMACopyParams&)]’ /usr/include/c++/4.8.2/bits/stl_algo.h:2337:62: required from ‘void std::__introsort_loop(_RandomAccessIterator, _RandomAccessIterator, _Size, _Compare) [with _RandomAccessIterator = __gnu_cxx::__normal_iterator >; _Size = long int; _Compare = bool (*)(SDMACopyParams&, SDMACopyParams&)]’ /usr/include/c++/4.8.2/bits/stl_algo.h:5499:44: required from ‘void std::sort(_RAIter, _RAIter, _Compare) [with _RAIter = __gnu_cxx::__normal_iterator >; _Compare = bool (*)(SDMACopyParams&, SDMACopyParams&)]’ /home/jenkins/libhsakmt/tests/kfdtest/src/KFDTestUtilQueue.cpp:351:66: required from here /usr/include/c++/4.8.2/bits/stl_algo.h:2263:35: error: invalid initialization of reference of type ‘SDMACopyParams&’ from expression of type ‘const SDMACopyParams’ while (__comp(*__first, __pivot)) ^ /usr/include/c++/4.8.2/bits/stl_algo.h:2266:34: error: invalid initialization of reference of type ‘SDMACopyParams&’ from expression of type ‘const SDMACopyParams’ while (__comp(__pivot, *__last)) ^ Change-Id: I0fce0c7e6d0a0ce93b1e6522ee8f216615765568 Signed-off-by: changzhu --- tests/kfdtest/src/KFDTestUtilQueue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/kfdtest/src/KFDTestUtilQueue.cpp b/tests/kfdtest/src/KFDTestUtilQueue.cpp index b6604287cf..46c88cf702 100644 --- a/tests/kfdtest/src/KFDTestUtilQueue.cpp +++ b/tests/kfdtest/src/KFDTestUtilQueue.cpp @@ -323,7 +323,7 @@ class AsyncMPMQ { * SDMA queue helper functions. */ -bool sort_SDMACopyParams(SDMACopyParams &a1, SDMACopyParams &a2) { +bool sort_SDMACopyParams(const SDMACopyParams &a1, const SDMACopyParams &a2) { if (a1.node != a2.node) return a1.node < a2.node; return a1.group < a2.group;