Skip to content

Commit

Permalink
Merge branch 'mac-wa' into 'master'
Browse files Browse the repository at this point in the history
Mac wa

See merge request correaa/boost-multi!1250
  • Loading branch information
correaa committed Oct 10, 2024
2 parents c2628eb + 03c7b52 commit cddc943
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 12 deletions.
10 changes: 7 additions & 3 deletions include/boost/multi/adaptors/blas/test/copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#if defined(NDEBUG) // && !defined(__NVCC__) && !(defined(__clang__) && defined(__CUDA__))
#include <algorithm> // for transform
#include <chrono> // for duration, high_resolution...
#if __has_include(<execution>) && !defined(__NVCC__) && !defined(__NVCOMPILER) && !(defined(__clang__) && defined(__CUDA__)) && (!defined(__INTEL_LLVM_COMPILER) || (__INTEL_LLVM_COMPILER > 20240000))
#if __has_include(<execution>) && !defined(__NVCC__) && !defined(__NVCOMPILER) && !((defined(__clang__) && !defined(__apple_build_version__)) && defined(__CUDA__)) && (!defined(__INTEL_LLVM_COMPILER) || (__INTEL_LLVM_COMPILER > 20240000))
#include <execution> // for execution_policy
#endif
#include <functional> // for invoke // IWYU pragma: keep
Expand Down Expand Up @@ -129,7 +129,10 @@ auto main() -> int { // NOLINT(readability-function-cognitive-complexity,bugpro

BOOST_TEST( A2D_block == B2D_block );

#if defined(__cpp_lib_execution) && (__cpp_lib_execution >= 201603L) && !defined(__NVCC__) && !defined(__NVCOMPILER) && !(defined(__clang__) && defined(__CUDA__)) && (!defined(__INTEL_LLVM_COMPILER) || (__INTEL_LLVM_COMPILER > 20240000))
// #if defined(__cpp_lib_execution) && (__cpp_lib_execution >= 201603L) && !defined(__NVCC__) && !defined(__NVCOMPILER) && !((defined(__clang__) ) && defined(__CUDA__)) && (!defined(__INTEL_LLVM_COMPILER) || (__INTEL_LLVM_COMPILER > 20240000))
#if __has_include(<execution>) && !defined(__NVCC__) && !defined(__NVCOMPILER) && !((defined(__clang__) ) && defined(__CUDA__)) && (!defined(__INTEL_LLVM_COMPILER) || (__INTEL_LLVM_COMPILER > 20240000))
#if(__cplusplus >= 202002L)
#if !defined(__apple_build_version__)
std::cout << "std::transform par BLAS\n"
<< std::invoke([&, start_time = high_resolution_clock::now()] {
std::transform(std::execution::par, A2D_block.begin(), A2D_block.end(), B2D_block.begin(), [](auto& row) { return multi::blas::copy(row); });
Expand All @@ -138,7 +141,7 @@ auto main() -> int { // NOLINT(readability-function-cognitive-complexity,bugpro
<< '\n';

BOOST_TEST( A2D_block == B2D_block );

#endif
std::cout << "std::copy par\n"
<< std::invoke([&, start_time = high_resolution_clock::now()] {
std::copy(std::execution::par, A2D_block.begin(), A2D_block.end(), B2D_block.begin());
Expand Down Expand Up @@ -169,6 +172,7 @@ auto main() -> int { // NOLINT(readability-function-cognitive-complexity,bugpro
<< '\n';

BOOST_TEST( A2D_block == B2D_block );
#endif
#endif

std::cout << "std::copy\n"
Expand Down
1 change: 0 additions & 1 deletion include/boost/multi/adaptors/blas/test/gemv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <boost/multi/adaptors/blas/axpy.hpp> // for operator-
#include <boost/multi/adaptors/blas/core.hpp> // for gemv, context, dot, nrm2
#include <boost/multi/adaptors/blas/dot.hpp> // for dot, dot_ref
#include <boost/multi/adaptors/blas/gemm.hpp> // for operator*, gemm_range
#include <boost/multi/adaptors/blas/gemv.hpp> // for gemv_range, gemv, oper...
#include <boost/multi/adaptors/blas/nrm2.hpp> // for operator^
#include <boost/multi/array.hpp> // for array, layout_t, array...
Expand Down
6 changes: 3 additions & 3 deletions include/boost/multi/adaptors/blas/test/nrm2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ auto main() -> int { // NOLINT(readability-function-cognitive-complexity,bugpro
multi::blas::dot_n(&ctx, xx.begin(), xx.size(), xx.begin(), res.base());
// multi::blas::nrm2_n(&ctx, xx.begin(), xx.size(), res.base());

//BOOST_TEST( *res.base() == 1.0*1.0 + 2.0*2.0 + 3.0*3.0 );
// BOOST_TEST( *res.base() == 1.0*1.0 + 2.0*2.0 + 3.0*3.0 );

//multi::blas::nrm2(xx, res);
// multi::blas::nrm2(xx, res);

//BOOST_TEST( *res.base() == 1.0*1.0 + 2.0*2.0 + 3.0*3.0 );
// BOOST_TEST( *res.base() == 1.0*1.0 + 2.0*2.0 + 3.0*3.0 );
}
}

Expand Down
1 change: 0 additions & 1 deletion test/fill.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,6 @@ auto main() -> int { // NOLINT(readability-function-cognitive-complexity,bugpro
BOOST_TEST( arr[5] == 99 );
BOOST_TEST( arr[6] == 99 );
BOOST_TEST( arr[7] == 7 );

}

return boost::report_errors();
Expand Down
6 changes: 3 additions & 3 deletions test/fix_complex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ BOOST_AUTO_TEST_CASE(pmr_double_uninitialized) {
BOOST_TEST ( &Aarr[0][0] == buffer.data() );
BOOST_TEST( std::abs( Aarr[0][0] - 4.0 ) < 1E-6);
#elif defined(_LIBCPP_VERSION)
BOOST_TEST ( &Aarr[0][0] == buffer.data() + (buffer.size() - 4) ); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
BOOST_TEST ( &Aarr[0][0] == &buffer[buffer.size() - 4] ); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
BOOST_TEST( std::abs( Aarr[0][0] - 996.0 ) < 1E-6 );
#endif
}
Expand All @@ -81,7 +81,7 @@ BOOST_AUTO_TEST_CASE(pmr_double_uninitialized) {
BOOST_TEST( std::abs( buffer[buffer.size()-3] - 0.0 ) < 1E-6 );
BOOST_TEST( std::abs( buffer[buffer.size()-5] - 11.0 ) < 1E-6 );

BOOST_TEST( &Aarr[0][0] == buffer.data() + (buffer.size() - 4) ); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
BOOST_TEST( &Aarr[0][0] == &buffer[buffer.size() - 4] ); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
#endif

BOOST_TEST( std::abs( Aarr[0][0] - 0.0 ) < 1E-6);
Expand Down Expand Up @@ -139,7 +139,7 @@ BOOST_AUTO_TEST_CASE(pmr_complex_initialized_4) {
#if defined(__GLIBCXX__)
BOOST_TEST( static_cast<void*>(buffer.data()) == static_cast<void*>(&Aarr[0][0]) );
#elif defined(_LIBCPP_VERSION)
BOOST_TEST( static_cast<void*>(buffer.data() + 4) == static_cast<void*>(&Aarr[0][0]) ); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
BOOST_TEST( static_cast<void*>(&buffer[4]) == static_cast<void*>(&Aarr[0][0]) ); // NOLINT(cppcoreguidelines-pro-bounds-pointer-arithmetic)
#endif
}

Expand Down
3 changes: 2 additions & 1 deletion test/sort.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

#include <algorithm> // for is_sorted, stable_sort
#include <array> // for array
#include <cmath> // for abs
#include <cmath> // for abs // IWYU pragma: keep
// IWYU pragma: no_include <cstdlib> // for abs
// #include <functional> // for __cpp_lib_ranges // IWYU pragma: keep
#include <iterator> // for begin, end
#include <numeric> // for accumulate
Expand Down

0 comments on commit cddc943

Please sign in to comment.