Skip to content

Commit

Permalink
fixes for intel and nvidia compilers
Browse files Browse the repository at this point in the history
  • Loading branch information
nmm0 committed Feb 26, 2024
1 parent 4ab7984 commit 9dd342d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
5 changes: 3 additions & 2 deletions include/experimental/__p0009_bits/extents.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ __check_compatible_extents(
template<class IndexType, class ... Arguments>
MDSPAN_INLINE_FUNCTION
static constexpr bool are_valid_indices() {
return
return
(std::is_convertible<Arguments, IndexType>::value && ... && true) &&
(std::is_nothrow_constructible<IndexType, Arguments>::value && ... && true);
}
Expand Down Expand Up @@ -148,7 +148,8 @@ struct index_sequence_scan_impl<R, FirstVal, Values...> {

template <size_t R, size_t FirstVal>
struct index_sequence_scan_impl<R, FirstVal> {
#if defined(__NVCC__) || defined(__NVCOMPILER)
#if defined(__NVCC__) || defined(__NVCOMPILER) || \
defined(_MDSPAN_COMPILER_INTEL)
// NVCC warns about pointless comparison with 0 for R==0 and r being const
// evaluatable and also 0.
MDSPAN_INLINE_FUNCTION
Expand Down
3 changes: 2 additions & 1 deletion include/experimental/__p0009_bits/layout_left.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,8 @@ class layout_left::mapping {

// [mdspan.submdspan.mapping], submdspan mapping specialization
template<class... SliceSpecifiers>
constexpr auto submdspan_mapping_impl(
MDSPAN_INLINE_FUNCTION
constexpr auto submdspan_mapping_impl(
SliceSpecifiers... slices) const;

template<class... SliceSpecifiers>
Expand Down
3 changes: 2 additions & 1 deletion include/experimental/__p0009_bits/layout_right.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,8 @@ class layout_right::mapping {

// [mdspan.submdspan.mapping], submdspan mapping specialization
template<class... SliceSpecifiers>
constexpr auto submdspan_mapping_impl(
MDSPAN_INLINE_FUNCTION
constexpr auto submdspan_mapping_impl(
SliceSpecifiers... slices) const;

template<class... SliceSpecifiers>
Expand Down
3 changes: 2 additions & 1 deletion include/experimental/__p0009_bits/layout_stride.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ struct layout_stride {

// [mdspan.submdspan.mapping], submdspan mapping specialization
template<class... SliceSpecifiers>
constexpr auto submdspan_mapping_impl(
MDSPAN_INLINE_FUNCTION
constexpr auto submdspan_mapping_impl(
SliceSpecifiers... slices) const;

template<class... SliceSpecifiers>
Expand Down
4 changes: 0 additions & 4 deletions include/experimental/__p2630_bits/submdspan_mapping.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,6 @@ template <class LayoutMapping> struct submdspan_mapping_result {
};

namespace detail {
using detail::first_of;
using detail::stride_of;
using detail::inv_map_rank;

// constructs sub strides
template <class SrcMapping, class... slice_strides, size_t... InvMapIdxs>
MDSPAN_INLINE_FUNCTION
Expand Down
8 changes: 4 additions & 4 deletions include/experimental/__p2642_bits/layout_padded.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ struct padded_extent {
}

MDSPAN_INLINE_FUNCTION static constexpr static_array_type
init_padding(const _Extents &exts,
index_type padding_value) {
init_padding([[maybe_unused]] const _Extents &exts,
[[maybe_unused]] index_type pv) {
if constexpr (_Extents::rank() > 1) {
return {find_next_multiple(padding_value,
return {find_next_multiple(pv,
exts.extent(_ExtentToPadIdx))};
} else {
return {};
Expand All @@ -116,7 +116,7 @@ struct padded_extent {

template <typename _Mapping, size_t _PaddingStrideIdx>
MDSPAN_INLINE_FUNCTION static constexpr static_array_type
init_padding(const _Mapping &other_mapping,
init_padding([[maybe_unused]] const _Mapping &other_mapping,
std::integral_constant<size_t, _PaddingStrideIdx>) {
if constexpr (_Extents::rank() > 1) {
return {other_mapping.stride(_PaddingStrideIdx)};
Expand Down

0 comments on commit 9dd342d

Please sign in to comment.