Here is kind of error using android NDK r12b and GNU++14(error)
for cl2.hpp “Copyright (c) 2008-2016 The Khronos Group Inc.” quite old
C:/Users/user/Documents/AndroidStudioProjects/androidcl-master-xiaomi/app/src/main/jni/CL3/cl2.hpp:2029:92: required from here
C:/android-ndk-r12b/build//../sources/cxx-stl/llvm-libc++/libcxx/include/tuple:290:102: error: invalid initialization of reference of type 'void (*&)(const cl::Device&)' from expression of type 'void (* const)(const cl::Device&)'
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Hp& get() _NOEXCEPT {return value;}
^
C:/android-ndk-r12b/build//../sources/cxx-stl/llvm-libc++/libcxx/include/tuple:290:108: error: body of constexpr function 'constexpr _Hp& std::__ndk1::__tuple_leaf<_Ip, _Hp, <anonymous> >::get() const [with long unsigned int _Ip = 0ul; _Hp = void (*)(const cl::Device&); bool <anonymous> = false]' not a return-statement
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 _Hp& get() _NOEXCEPT {return value;}
^
C:/android-ndk-r12b/build//../sources/cxx-stl/llvm-libc++/libcxx/include/tuple: In instantiation of 'constexpr _Hp& std::__ndk1::__tuple_leaf<_Ip, _Hp, <anonymous> >::get() const [with long unsigned int _Ip = 0ul; _Hp = void (*)(const cl::Platform&); bool <anonymous> = false]':
C:/android-ndk-r12b/build//../sources/cxx-stl/llvm-libc++/libcxx/include/tuple:714:65: required from 'constexpr typename std::__ndk1::tuple_element<_Ip, std::__ndk1::tuple<_Tp ...> >::type& std::__ndk1::get(std::__ndk1::tuple<_Tp ...>&) [with long unsigned int _Ip = 0ul; _Tp = {void (*)(const cl::Platform&), std::__ndk1::reference_wrapper<const cl::Platform>}; typename std::__ndk1::tuple_element<_Ip, std::__ndk1::tuple<_Tp ...> >::type = void (*)(const cl::Platform&)]'
C:/android-ndk-r12b/build//../sources/cxx-stl/llvm-libc++/libcxx/include/mutex:498:48: required from 'void std::__ndk1::__call_once_param<_Fp>::__execute(std::__ndk1::__tuple_indices<_Uf ...>) [with long unsigned int ..._Indices = {1ul}; _Fp = std::__ndk1::tuple<void (*)(const cl::Platform&), std::__ndk1::reference_wrapper<const cl::Platform> >]'
C:/android-ndk-r12b/build//../sources/cxx-stl/llvm-libc++/libcxx/include/mutex:490:27: required from 'void std::__ndk1::__call_once_param<_Fp>::operator()() [with _Fp = std::__ndk1::tuple<void (*)(const cl::Platform&), std::__ndk1::reference_wrapper<const cl::Platform> >]'
C:/android-ndk-r12b/build//../sources/cxx-stl/llvm-libc++/libcxx/include/mutex:531:12: required from 'void std::__ndk1::__call_once_proxy(void*) [with _Fp = std::__ndk1::tuple<void (*)(const cl::Platform&), std::__ndk1::reference_wrapper<const cl::Platform> >]'
C:/android-ndk-r12b/build//../sources/cxx-stl/llvm-libc++/libcxx/include/mutex:548:67: required from 'void std::__ndk1::call_once(std::__ndk1::once_flag&, _Callable&&, _Args&& ...) [with _Callable = void (&)(const cl::Platform&); _Args = {std::__ndk1::reference_wrapper<const cl::Platform>}]'
The 4 other error are the same for “const cl::Device&” “const cl::Platform&” “const cl::Context&” “const cl::CommandQueue&”
but from NDK r16b until NDK r21d and gnu++17 no more error.
use android NDK r27c and GNU++20/23 got 5 time the same error ?
> C:/Users/user/Documents/AndroidStudioProjects/androidcl-master-xiaomi/app/src/main/jni/CL3/cl2.hpp:1887:96: note: in instantiation of member function 'std::vector<std::pair<cl::Device, std::string>>::vector' requested here
> 1887 | BuildError(cl_int err, const char * errStr, const BuildLogType &vec) : Error(err, errStr), buildLogs(vec)
> | ^
> C:/Users/user/Documents/AndroidStudioProjects/androidcl-master-xiaomi/app/src/main/jni/CL3/cl2.hpp:695:11: note: forward declaration of 'cl::Device'
> 695 | class Device;
> | ^
> In file included from C:/Users/user/Documents/AndroidStudioProjects/androidcl-master-xiaomi/app/src/main/jni/processor.cpp:20:
> In file included from C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/string:571:
> In file included from C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__algorithm/max.h:14:
> In file included from C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__algorithm/max_element.h:15:
> In file included from C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__iterator/iterator_traits.h:14:
> In file included from C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__concepts/constructible.h:15:
> C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__type_traits/is_constructible.h:22:79: error: incomplete type 'cl::Device' used in type trait expression
> 22 | struct _LIBCPP_TEMPLATE_VIS is_constructible : public integral_constant<bool, __is_constructible(_Tp, _Args...)> {};
> | ^
> C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__utility/pair.h:135:14: note: in instantiation of template class 'std::is_constructible<cl::Device, const cl::Device &>' requested here
> 135 | return is_constructible<first_type, _U1>::value && is_constructible<second_type, _U2>::value;
> | ^
> C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__utility/pair.h:145:14: note: in instantiation of function template specialization 'std::pair<cl::Device, std::string>::_CheckArgs::__is_pair_constructible<const cl::Device &, const std::string &>' requested here
> 145 | return __is_pair_constructible<_U1, _U2>() && !__is_implicit<_U1, _U2>();
> | ^
> C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__utility/pair.h:222:48: note: in instantiation of function template specialization 'std::pair<cl::Device, std::string>::_CheckArgs::__enable_explicit<const cl::Device &, const std::string &>' requested here
> 222 | __enable_if_t<_CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>(), int> = 0>
> | ^
> C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__utility/pair.h:223:64: note: while substituting prior template arguments into non-type template parameter [with _U1 = cl::Device, _U2 = std::string]
> 223 | _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit pair(pair<_U1, _U2> const& __p)
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 224 | _NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 225 | is_nothrow_constructible<second_type, _U2 const&>::value))
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 226 | : first(__p.first), second(__p.second) {}
> | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__type_traits/is_trivially_copy_constructible.h:24:38: note: while substituting deduced template arguments into function template 'pair' [with _U1 = cl::Device, _U2 = std::string, $2 = (no value)]
> 24 | : public integral_constant<bool, __is_trivially_constructible(_Tp, __add_lvalue_reference_t<const _Tp>)> {};
> | ^
> C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__memory/uninitialized_algorithms.h:567:15: note: (skipping 2 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
> 567 | is_trivially_copy_constructible<_RawTypeIn>::value && is_trivially_copy_assignable<_RawTypeIn>::value &&
> | ^
> C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/__memory/uninitialized_algorithms.h:589:28: note: while substituting deduced template arguments into function template '__uninitialized_allocator_copy_impl' [with _Alloc = std::allocator<std::pair<cl::Device, std::string>>, _In = std::pair<cl::Device, std::string>, _RawTypeIn = (no value), _Out = std::pair<cl::Device, std::string>, $4 = (no value)]
> 589 | auto __result = std::__uninitialized_allocator_copy_impl(
> | ^
> C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/vector:1082:22: note: in instantiation of function template specialization 'std::__uninitialized_allocator_copy<std::allocator<std::pair<cl::Device, std::string>>, std::pair<cl::Device, std::string> *, std::pair<cl::Device, std::string> *, std::pair<cl::Device, std::string> *>' requested here
> 1082 | __tx.__pos_ = std::__uninitialized_allocator_copy(__alloc(), __first, __last, __tx.__pos_);
> | ^
> C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/vector:760:7: note: in instantiation of function template specialization 'std::vector<std::pair<cl::Device, std::string>>::__construct_at_end<std::pair<cl::Device, std::string> *, std::pair<cl::Device, std::string> *>' requested here
> 760 | __construct_at_end(__first, __last, __n);
> | ^
> C:/android-ndk-r27c/build/../toolchains/llvm/prebuilt/windows-x86_64/sysroot/usr/include/c++/v1/vector:1195:3: note: in instantiation of function template specialization 'std::vector<std::pair<cl::Device, std::string>>::__init_with_size<std::pair<cl::Device, std::string> *, std::pair<cl::Device, std::string> *>' requested here
> 1195 | __init_with_size(__x.__begin_, __x.__end_, __x.size());
> | ^
````Preformatted text`
`> Blockquote`
I am trying a way around I let you know. Using OpenCL became less and less easy ? :upside_down_face:
May be with vulkan. But i never loock at vulkan OpenCL yet.
I know that there where change on compiler version those last years. But it look like it is big change. It is the mess for me :smirk: