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

Rework our mdspan implementation #3343

Draft
wants to merge 53 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
897101a
Modernize `mdspan` from upstream
miscco Jan 22, 2025
f7a848e
Implement `submdspan_extents`
miscco Jan 22, 2025
f9a56b5
Implement `submdspan_mapping`
miscco Jan 22, 2025
fa8cc5c
Try and fix sfinae_helpers
miscco Jan 22, 2025
82ae52d
try and fix fold
miscco Jan 22, 2025
2176eb1
more fixes
miscco Jan 22, 2025
9bf4dee
Even more fixes
miscco Jan 22, 2025
cb073d2
More evil fixes
miscco Jan 22, 2025
73b53ae
Try and fix empty case
miscco Jan 22, 2025
0f7faec
mdspan fixes
miscco Jan 22, 2025
9ec4a14
slice fixes
miscco Jan 22, 2025
c2e81b6
Fix `CustomTestAccessor`
miscco Jan 23, 2025
20c71cc
Fix issue with older nvcc
miscco Jan 23, 2025
b9a8b8b
Fix issue in checked_accessor
miscco Jan 23, 2025
3e23135
Work around uninitialized access in CustomTestLayout
miscco Jan 23, 2025
adb2a3b
Fix Element pool
miscco Jan 23, 2025
d87953c
Refactor __is_representable_as
miscco Jan 23, 2025
34e6cf8
Avoid unused variable warnings on clang
miscco Jan 23, 2025
22d0c41
Fix nvrtc
miscco Jan 23, 2025
0e78599
Fix CTAD issue with gcc
miscco Jan 23, 2025
c62fb60
Minor gcc fixes
miscco Jan 23, 2025
e794dd0
Add missing includes
miscco Jan 23, 2025
605bb04
Try and work around MSVC issue
miscco Jan 24, 2025
d4eb246
Make `__possibly_empty_array` play nice with MSVC
miscco Jan 24, 2025
9a37b4f
Suppress warning about `[[msvc::no_unique_address]]`
miscco Jan 24, 2025
5d50922
Fix conversion warnings
miscco Jan 24, 2025
c00daeb
Improve `ElementPool`
miscco Jan 24, 2025
d757bd9
Try and improve `__check_size`
miscco Jan 24, 2025
3fdd930
Try and drop most of the fold macros now that we require C++17
miscco Jan 24, 2025
00b5a0c
Fix
miscco Jan 24, 2025
62aa867
More fixes
miscco Jan 24, 2025
83396e8
More fixes
miscco Jan 24, 2025
7e35706
MSVC...
miscco Jan 24, 2025
9633d4e
Fix conversion warning
miscco Jan 24, 2025
dec2b70
Suppress unused variable warnings
miscco Jan 24, 2025
3e0d71e
Try and fix confusion about the type of m
miscco Jan 24, 2025
c7157a7
Fix one more test
miscco Jan 24, 2025
2e94719
Cleanup extent converting constructor
miscco Jan 24, 2025
a53ef7f
Try and make mdspan compile with nvhpc if it has no default construct…
miscco Jan 24, 2025
9069639
Come on MSVC2019 you can do it
miscco Jan 24, 2025
45d65ec
Avoid vexing parse for MSVC
miscco Jan 24, 2025
5b89f3e
Do not use `_CCCL_NO_UNIQUE_ADDRESS` with MSVC
miscco Jan 27, 2025
55bd623
Use a handwritten no_unique_address implementation
miscco Jan 27, 2025
da4fb3b
MSVC cannot deal with no unique address
miscco Jan 27, 2025
2f282b1
Make MSVC pass
miscco Jan 27, 2025
91b0794
Drop workaround given that we cannot do anything there
miscco Jan 27, 2025
ef8bb6c
Add missing header
miscco Jan 27, 2025
f46dbb0
Fix formatting issues
miscco Jan 27, 2025
e6569aa
Add missing constructors
miscco Jan 27, 2025
f2ab7ba
Try and fix gcc issue
miscco Jan 27, 2025
dbf0eff
Try and be more resilient once more
miscco Jan 27, 2025
9e6ecd3
Avoid compiler issues with default constructor
miscco Jan 27, 2025
e337f30
Disable failing test for old nvcc and clang
miscco Jan 28, 2025
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
2 changes: 2 additions & 0 deletions cudax/include/cuda/experimental/__algorithm/copy.cuh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#endif // no system header

#include <cuda/std/__concepts/concept_macros.h>
#include <cuda/std/mdspan>
#include <cuda/std/span>

#include <cuda/experimental/__algorithm/common.cuh>
#include <cuda/experimental/__stream/stream_ref.cuh>
Expand Down
4 changes: 2 additions & 2 deletions libcudacxx/include/cuda/std/__algorithm/comp_ref_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ struct __debug_less
#ifdef _CCCL_ENABLE_DEBUG_MODE
template <class _Comp>
using __comp_ref_type = __debug_less<_Comp>;
#else
#else // ^^^ _LIBCUDACXX_ENABLE_DEBUG_MODE ^^^ / vvv !_LIBCUDACXX_ENABLE_DEBUG_MODE vvv
template <class _Comp>
using __comp_ref_type = _Comp&;
#endif
#endif // !_LIBCUDACXX_ENABLE_DEBUG_MODE

_LIBCUDACXX_END_NAMESPACE_STD

Expand Down
73 changes: 73 additions & 0 deletions libcudacxx/include/cuda/std/__fwd/mdspan.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
// -*- C++ -*-
//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
// SPDX-FileCopyrightText: Copyright (c) 2024 NVIDIA CORPORATION & AFFILIATES.
//
// Kokkos v. 4.0
// Copyright (2022) National Technology & Engineering
// Solutions of Sandia, LLC (NTESS).
//
// Under the terms of Contract DE-NA0003525 with NTESS,
// the U.S. Government retains certain rights in this software.
//
//===---------------------------------------------------------------------===//

#ifndef _LIBCUDACXX___FWD_MDSPAN_H
#define _LIBCUDACXX___FWD_MDSPAN_H

#include <cuda/std/detail/__config>

#if defined(_CCCL_IMPLICIT_SYSTEM_HEADER_GCC)
# pragma GCC system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_CLANG)
# pragma clang system_header
#elif defined(_CCCL_IMPLICIT_SYSTEM_HEADER_MSVC)
# pragma system_header
#endif // no system header

#include <cuda/std/__type_traits/void_t.h>

#if _CCCL_STD_VER >= 2017

_LIBCUDACXX_BEGIN_NAMESPACE_STD

// Layout policy with a mapping which corresponds to FORTRAN-style array layouts
struct layout_left
{
template <class _Extents>
class mapping;
};

// Layout policy with a mapping which corresponds to C-style array layouts
struct layout_right
{
template <class _Extents>
class mapping;
};

// Layout policy with a unique mapping where strides are arbitrary
struct layout_stride
{
template <class Extents>
class mapping;
};

// [mdspan.layout.policy.reqmts]
namespace __mdspan_detail
{
template <class _Layout, class _Extents, class = void>
_CCCL_INLINE_VAR constexpr bool __is_valid_layout_mapping = false;

template <class _Layout, class _Extents>
_CCCL_INLINE_VAR constexpr bool
__is_valid_layout_mapping<_Layout, _Extents, void_t<typename _Layout::template mapping<_Extents>>> = true;
} // namespace __mdspan_detail

_LIBCUDACXX_END_NAMESPACE_STD

#endif // _CCCL_STD_VER >= 2017

#endif // _LIBCUDACXX___FWD_MDSPAN_H
256 changes: 0 additions & 256 deletions libcudacxx/include/cuda/std/__mdspan/compressed_pair.h

This file was deleted.

Loading
Loading