Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Various compiler warnings and fixes #315

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
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 @@ -252,7 +252,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
Loading