Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions cmake/HPX_AddConfigTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -498,15 +498,6 @@ function(hpx_check_for_cxx20_lambda_capture)
)
endfunction()

# ##############################################################################
function(hpx_check_for_cxx20_source_location)
add_hpx_config_test(
HPX_WITH_CXX20_SOURCE_LOCATION
SOURCE cmake/tests/cxx20_source_location.cpp
FILE ${ARGN}
)
endfunction()

# ##############################################################################
function(hpx_check_for_pthread_setname_np)
add_hpx_config_test(
Expand Down
4 changes: 0 additions & 4 deletions cmake/HPX_PerformCxxFeatureTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ function(hpx_perform_cxx_feature_tests)
DEFINITIONS HPX_HAVE_CXX20_LAMBDA_CAPTURE
)

hpx_check_for_cxx20_source_location(
DEFINITIONS HPX_HAVE_CXX20_SOURCE_LOCATION
)

if(HPX_WITH_SUPPORT_NO_UNIQUE_ADDRESS_ATTRIBUTE AND NOT MSVC) # see above
hpx_check_for_cxx20_no_unique_address_attribute(
DEFINITIONS HPX_HAVE_CXX20_NO_UNIQUE_ADDRESS_ATTRIBUTE
Expand Down
138 changes: 67 additions & 71 deletions cmake/templates/std_headers.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -9,130 +9,126 @@

#pragma once

#include <hpx/config/defines.hpp>
#include <hpx/config/compiler_specific.hpp>
#include <hpx/config/defines.hpp>
#include <hpx/config/modules_enabled.hpp>

@cxx_standard_headers@
@cxx_standard_headers @
#if defined(HPX_HAVE_STDEXEC)
# if defined(HPX_GCC_VERSION)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wall"
# pragma GCC diagnostic ignored "-Wextra"
# pragma GCC diagnostic ignored "-Wmissing-braces"
# elif defined(HPX_CLANG_VERSION)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Weverything"
# endif
#if defined(HPX_GCC_VERSION)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wall"
#pragma GCC diagnostic ignored "-Wextra"
#pragma GCC diagnostic ignored "-Wmissing-braces"
#elif defined(HPX_CLANG_VERSION)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
#endif

# include <stdexec/execution.hpp>
#include <stdexec/execution.hpp>

# if defined(HPX_GCC_VERSION)
# pragma GCC diagnostic pop
# elif defined(HPX_CLANG_VERSION)
# pragma clang diagnostic pop
# endif
#if defined(HPX_GCC_VERSION)
#pragma GCC diagnostic pop
#elif defined(HPX_CLANG_VERSION)
#pragma clang diagnostic pop
#endif


#if defined(HPX_HAVE_CXX20_COROUTINES)
# if defined(__has_include)
# if __has_include(<coroutine>)
# include <coroutine>
# elif __has_include(<experimental/coroutine>)
# include <experimental/coroutine>
# endif
# endif
#if defined(__has_include)
#if __has_include(<coroutine>)
#include <coroutine>
#elif __has_include(<experimental/coroutine>)
#include <experimental/coroutine>
#endif

#include <bit>
#if defined(HPX_HAVE_CXX20_SOURCE_LOCATION)
# include <source_location>
#endif
#include <source_location>

#if defined(HPX_HAVE_CXX23_STD_GENERATOR)
# include <generator>
#include <generator>
#endif

#if defined(HPX_GCC_VERSION)
# include <cxxabi.h>
#include <cxxabi.h>
#endif

#if defined(HPX_WINDOWS)
# include <excpt.h>
# undef exception_info
#include <excpt.h>
#undef exception_info
#endif

#include <asio.hpp>
#include <hwloc.h>

#if defined(HPX_HAVE_MODULE_LIKWID)
# include <likwid.h>
#include <likwid.h>
#endif

// Include MPI headers if required
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_MPI)) || \
defined(HPX_HAVE_MODULE_MPI_BASE)

# if defined(HPX_CLANG_VERSION)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wcast-qual"
# elif defined(HPX_GCC_VERSION)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wcast-qual"
# endif
#if defined(HPX_CLANG_VERSION)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wcast-qual"
#elif defined(HPX_GCC_VERSION)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wcast-qual"
#endif

# include <mpi.h>
#include <mpi.h>

# if defined(HPX_GCC_VERSION)
# pragma GCC diagnostic pop
# elif defined(HPX_CLANG_VERSION)
# pragma clang diagnostic pop
# endif
#if defined(HPX_GCC_VERSION)
#pragma GCC diagnostic pop
#elif defined(HPX_CLANG_VERSION)
#pragma clang diagnostic pop
#endif

#endif

// Include LCI headers if required
#if (defined(HPX_HAVE_NETWORKING) && defined(HPX_HAVE_PARCELPORT_LCI)) || \
defined(HPX_HAVE_MODULE_LCI_BASE)
# include "lci.hpp"
# include "lct.h"
#include "lci.hpp"
#include "lct.h"
#endif

#if defined(HPX_HAVE_MODULE_ASYNC_CUDA)
# if defined(HPX_HAVE_CUDA) && defined(HPX_HAVE_GPUBLAS)
# include <cublas_v2.h>
# elif defined(HPX_HAVE_HIP) && defined(HPX_HAVE_GPUBLAS)
# include <hipblas.h>
# endif
#if defined(HPX_HAVE_CUDA) && defined(HPX_HAVE_GPUBLAS)
#include <cublas_v2.h>
#elif defined(HPX_HAVE_HIP) && defined(HPX_HAVE_GPUBLAS)
#include <hipblas.h>
#endif
#endif

#if defined(HPX_HAVE_MODULE_THRUST)
# include <hpx/thrust/thrust_headers.hpp>
#include <hpx/thrust/thrust_headers.hpp>
#endif

#if defined(HPX_HAVE_MM_PREFETCH)
# if defined(HPX_MSVC)
# include <intrin.h>
# endif
# if defined(HPX_GCC_VERSION)
# include <emmintrin.h>
# endif
#if defined(HPX_MSVC)
#include <intrin.h>
#endif
#if defined(HPX_GCC_VERSION)
#include <emmintrin.h>
#endif
#endif

#if defined(HPX_HAVE_DATAPAR)
# if defined(HPX_HAVE_DATAPAR_EVE)
# include <eve/eve.hpp>
# include <eve/memory/aligned_ptr.hpp>
# endif
# if defined(HPX_HAVE_DATAPAR_STD_EXPERIMENTAL_SIMD)
# include <experimental/simd>
# endif
# if defined(HPX_HAVE_DATAPAR_VC)
# include <Vc/Vc>
# include <Vc/global.h>
# endif
#if defined(HPX_HAVE_DATAPAR_EVE)
#include <eve/eve.hpp>
#include <eve/memory/aligned_ptr.hpp>
#endif
#if defined(HPX_HAVE_DATAPAR_STD_EXPERIMENTAL_SIMD)
#include <experimental/simd>
#endif
#if defined(HPX_HAVE_DATAPAR_VC)
#include <Vc/Vc>
#include <Vc/global.h>
#endif
#endif

#if defined(HPX_HAVE_DISTRIBUTED_RUNTIME)
# include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/accumulators.hpp>
Comment thread
hkaiser marked this conversation as resolved.
Outdated
#endif
19 changes: 0 additions & 19 deletions cmake/tests/cxx20_source_location.cpp

This file was deleted.

8 changes: 0 additions & 8 deletions libs/core/assertion/include/hpx/assertion/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,5 @@
"on the issue tracker: https://github.com/STEllAR-GROUP/hpx/issues."); \
std::terminate()

#if defined(HPX_HAVE_CXX20_SOURCE_LOCATION)
#define HPX_CURRENT_SOURCE_LOCATION() std::source_location::current()
#else
#define HPX_CURRENT_SOURCE_LOCATION() \
::hpx::source_location \
{ \
__FILE__, static_cast<std::uint_least32_t>(__LINE__), __func__ \
}
#endif
#endif
56 changes: 0 additions & 56 deletions libs/core/assertion/include/hpx/assertion/source_location.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,70 +13,14 @@

#include <hpx/config/export_definitions.hpp>

#include <cstdint>
#include <iosfwd>

#if defined(HPX_HAVE_CXX20_SOURCE_LOCATION)
#include <source_location>
#endif

namespace hpx {

/// This contains the location information where \a HPX_ASSERT has been
/// called
#if defined(HPX_HAVE_CXX20_SOURCE_LOCATION)
HPX_CXX_CORE_EXPORT using std::source_location;
#else
/// The \a source_location class represents certain information about the
/// source code, such as file names, line numbers, and function names.
/// Previously, functions that desire to obtain this information about
/// the call site (for logging, testing, or debugging purposes) must
/// use macros so that predefined macros like \a __LINE__ and \a __FILE__
/// are expanded in the context of the caller. The \a source_location class
/// provides a better alternative.
/// \a source_location meets the \a DefaultConstructible, \a CopyConstructible,
/// \a CopyAssignable and \a Destructible requirements. Lvalue of \a
/// source_location meets the Swappable requirement. Additionally, the following
/// conditions are true:
/// - \code std::is_nothrow_move_constructible_v<std::source_location> \endcode
/// - \code std::is_nothrow_move_assignable_v<std::source_location> \endcode
/// - \code std::is_nothrow_swappable_v<std::source_location> \endcode
/// It is intended that source_location has a small size and can be copied
/// efficiently.
/// It is unspecified whether the copy/move constructors and the copy/move
/// assignment operators of \a source_location are trivial and/or constexpr.
HPX_CXX_CORE_EXPORT struct source_location
{
char const* filename;
std::uint_least32_t line_number;
char const* functionname;

// compatibility with C++20 std::source_location
/// return the line number represented by this object
[[nodiscard]] constexpr std::uint_least32_t line() const noexcept
{
return line_number;
}

/// return the column number represented by this object
[[nodiscard]] static constexpr std::uint_least32_t column() noexcept
{
return 0;
}

/// return the file name represented by this object
[[nodiscard]] constexpr char const* file_name() const noexcept
{
return filename;
}

/// return the name of the function represented by this object, if any
[[nodiscard]] constexpr char const* function_name() const noexcept
{
return functionname;
}
};
#endif

HPX_CXX_CORE_EXPORT HPX_CORE_EXPORT std::ostream& operator<<(
std::ostream& os, source_location const& loc);
Expand Down
Loading