Skip to content

Commit

Permalink
Remove optimizations for certain built-in compiler intrinsics
Browse files Browse the repository at this point in the history
- those have caused trouble when the compiler used to build HPX is different
  from the compiler used to compile a dependent application
  • Loading branch information
hkaiser committed May 3, 2024
1 parent 0010301 commit 95dfbec
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 201 deletions.
49 changes: 2 additions & 47 deletions cmake/HPX_AddConfigTest.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Copyright (c) 2017 Google
# Copyright (c) 2017 Taeguk Kwon
# Copyright (c) 2020 Giannis Gonidelis
# Copyright (c) 2021-2022 Hartmut Kaiser
# Copyright (c) 2021-2024 Hartmut Kaiser
#
# SPDX-License-Identifier: BSL-1.0
# Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down Expand Up @@ -373,7 +373,7 @@ endfunction()
function(hpx_check_for_cxx14_delete_operator_with_size)
add_hpx_config_test(
HPX_WITH_CXX14_DELETE_OPERATOR_WITH_SIZE
SOURCE cmake/tests/cxx_14_delete_operator_with_size.cpp
SOURCE cmake/tests/cxx14_delete_operator_with_size.cpp
FILE ${ARGN}
)
endfunction()
Expand Down Expand Up @@ -669,51 +669,6 @@ function(hpx_check_for_cxx_lambda_capture_decltype)
)
endfunction()

# ##############################################################################
function(hpx_check_for_builtin_integer_pack)
add_hpx_config_test(
HPX_WITH_BUILTIN_INTEGER_PACK
SOURCE cmake/tests/builtin_integer_pack.cpp
FILE ${ARGN}
)
endfunction()

# ##############################################################################
function(hpx_check_for_builtin_make_integer_seq)
add_hpx_config_test(
HPX_WITH_BUILTIN_MAKE_INTEGER_SEQ
SOURCE cmake/tests/builtin_make_integer_seq.cpp
FILE ${ARGN}
)
endfunction()

# ##############################################################################
function(hpx_check_for_builtin_make_integer_seq_cuda)
add_hpx_config_test(
HPX_WITH_BUILTIN_MAKE_INTEGER_SEQ_CUDA
SOURCE cmake/tests/builtin_make_integer_seq.cu CUDA
FILE ${ARGN}
)
endfunction()

# ##############################################################################
function(hpx_check_for_builtin_type_pack_element)
add_hpx_config_test(
HPX_WITH_BUILTIN_TYPE_PACK_ELEMENT
SOURCE cmake/tests/builtin_type_pack_element.cpp
FILE ${ARGN}
)
endfunction()

# ##############################################################################
function(hpx_check_for_builtin_type_pack_element_cuda)
add_hpx_config_test(
HPX_WITH_BUILTIN_TYPE_PACK_ELEMENT_CUDA
SOURCE cmake/tests/builtin_type_pack_element.cu CUDA
FILE ${ARGN}
)
endfunction()

# ##############################################################################
function(hpx_check_for_mm_prefetch)
add_hpx_config_test(
Expand Down
23 changes: 0 additions & 23 deletions cmake/HPX_PerformCxxFeatureTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -169,29 +169,6 @@ function(hpx_perform_cxx_feature_tests)
DEFINITIONS HPX_HAVE_CXX_LAMBDA_CAPTURE_DECLTYPE
)

# Check the availability of certain C++ builtins
hpx_check_for_builtin_integer_pack(DEFINITIONS HPX_HAVE_BUILTIN_INTEGER_PACK)

hpx_check_for_builtin_make_integer_seq(
DEFINITIONS HPX_HAVE_BUILTIN_MAKE_INTEGER_SEQ
)

if(HPX_WITH_CUDA)
hpx_check_for_builtin_make_integer_seq_cuda(
DEFINITIONS HPX_HAVE_BUILTIN_MAKE_INTEGER_SEQ_CUDA
)
endif()

hpx_check_for_builtin_type_pack_element(
DEFINITIONS HPX_HAVE_BUILTIN_TYPE_PACK_ELEMENT
)

if(HPX_WITH_CUDA)
hpx_check_for_builtin_type_pack_element_cuda(
DEFINITIONS HPX_HAVE_BUILTIN_TYPE_PACK_ELEMENT_CUDA
)
endif()

hpx_check_for_builtin_forward_move(DEFINITIONS HPX_HAVE_BUILTIN_FORWARD_MOVE)

endfunction()
31 changes: 0 additions & 31 deletions cmake/tests/builtin_integer_pack.cpp

This file was deleted.

31 changes: 0 additions & 31 deletions cmake/tests/builtin_make_integer_seq.cpp

This file was deleted.

9 changes: 0 additions & 9 deletions cmake/tests/builtin_make_integer_seq.cu

This file was deleted.

26 changes: 0 additions & 26 deletions cmake/tests/builtin_type_pack_element.cpp

This file was deleted.

9 changes: 0 additions & 9 deletions cmake/tests/builtin_type_pack_element.cu

This file was deleted.

26 changes: 1 addition & 25 deletions libs/core/type_support/include/hpx/type_support/pack.hpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Copyright (c) 2014-2020 Agustin Berge
// Copyright (c) 2024 Hartmut Kaiser
//
// SPDX-License-Identifier: BSL-1.0
// Distributed under the Boost Software License, Version 1.0. (See accompanying
Expand Down Expand Up @@ -45,17 +46,8 @@ namespace hpx::util {

template <std::size_t N>
struct make_index_pack
#if defined(HPX_HAVE_BUILTIN_INTEGER_PACK)
: index_pack<__integer_pack(N)...>
#elif (defined(HPX_HAVE_BUILTIN_MAKE_INTEGER_SEQ) && \
!defined(HPX_COMPUTE_DEVICE_CODE)) || \
(defined(HPX_HAVE_BUILTIN_MAKE_INTEGER_SEQ_CUDA) && \
defined(HPX_COMPUTE_DEVICE_CODE))
: __make_integer_seq<pack_c, std::size_t, N>
#else
: detail::make_index_pack_join<typename make_index_pack<N / 2>::type,
typename make_index_pack<N - N / 2>::type>
#endif
{
};

Expand Down Expand Up @@ -168,21 +160,6 @@ namespace hpx::util {
{
};

#if (defined(HPX_HAVE_BUILTIN_TYPE_PACK_ELEMENT) && \
!defined(HPX_COMPUTE_DEVICE_CODE)) || \
(defined(HPX_HAVE_BUILTIN_TYPE_PACK_ELEMENT_CUDA) && \
defined(HPX_COMPUTE_DEVICE_CODE))
template <std::size_t I, typename Ts, bool InBounds = (I < Ts::size)>
struct at_index_impl : empty_helper
{
};

template <std::size_t I, typename... Ts>
struct at_index_impl<I, pack<Ts...>, /*InBounds*/ true>
{
using type = __type_pack_element<I, Ts...>;
};
#else
template <std::size_t I, typename T>
struct indexed
{
Expand Down Expand Up @@ -210,7 +187,6 @@ namespace hpx::util {
indexer<Ts, make_index_pack_t<Ts::size>>()))
{
};
#endif
} // namespace detail

template <std::size_t I, typename... Ts>
Expand Down

0 comments on commit 95dfbec

Please sign in to comment.