Skip to content

Commit

Permalink
Publicly expose <cuda/std/numeric>
Browse files Browse the repository at this point in the history
  • Loading branch information
miscco committed Apr 30, 2024
1 parent 6cbaa6e commit 301e8ff
Show file tree
Hide file tree
Showing 45 changed files with 84 additions and 243 deletions.
2 changes: 1 addition & 1 deletion libcudacxx/include/cuda/std/__mdspan/layout_stride.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
#include <cuda/std/__utility/integer_sequence.h>
#include <cuda/std/__utility/move.h>
#include <cuda/std/array>
#include <cuda/std/detail/libcxx/include/numeric>
#include <cuda/std/numeric>
#if __MDSPAN_USE_CONCEPTS && __MDSPAN_HAS_CXX_20
# include <cuda/std/concepts>
#endif // __MDSPAN_USE_CONCEPTS && __MDSPAN_HAS_CXX_20
Expand Down
25 changes: 0 additions & 25 deletions libcudacxx/include/cuda/std/__numeric_

This file was deleted.

176 changes: 0 additions & 176 deletions libcudacxx/include/cuda/std/detail/libcxx/include/numeric

This file was deleted.

42 changes: 42 additions & 0 deletions libcudacxx/include/cuda/std/numeric
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//===----------------------------------------------------------------------===//
//
// Part of libcu++, the C++ Standard Library for your entire system,
// 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.
//
//===----------------------------------------------------------------------===//

#ifndef _CUDA_STD_NUMERIC
#define _CUDA_STD_NUMERIC

#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/__numeric/accumulate.h>
#include <cuda/std/__numeric/adjacent_difference.h>
#include <cuda/std/__numeric/exclusive_scan.h>
#include <cuda/std/__numeric/gcd_lcm.h>
#include <cuda/std/__numeric/inclusive_scan.h>
#include <cuda/std/__numeric/inner_product.h>
#include <cuda/std/__numeric/iota.h>
#include <cuda/std/__numeric/midpoint.h>
#include <cuda/std/__numeric/partial_sum.h>
#include <cuda/std/__numeric/reduce.h>
#include <cuda/std/__numeric/transform_exclusive_scan.h>
#include <cuda/std/__numeric/transform_inclusive_scan.h>
#include <cuda/std/__numeric/transform_reduce.h>
#include <cuda/std/detail/libcxx/include/__assert> // all public C++ headers provide the assertion handler

// standard mandated include
#include <cuda/std/version>

#endif // _CUDA_STD_NUMERIC
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
// T
// accumulate(Iter first, Iter last, T init);

#include <cuda/std/__numeric_>
#include <cuda/std/cassert>
#include <cuda/std/numeric>

#include "test_iterators.h"
#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
// T
// accumulate(Iter first, Iter last, T init, BinaryOperation binary_op);

#include <cuda/std/__numeric_>
#include <cuda/std/cassert>
#include <cuda/std/functional>
#include <cuda/std/numeric>
#ifdef _LIBCUDACXX_HAS_STRING
# include <cuda/std/string>
#endif // _LIBCUDACXX_HAS_STRING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// OutIter
// adjacent_difference(InIter first, InIter last, OutIter result);

#include <cuda/std/__numeric_>
#include <cuda/std/cassert>
#include <cuda/std/numeric>

#include "test_iterators.h"
#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// OutIter
// adjacent_difference(InIter first, InIter last, OutIter result, BinaryOperation binary_op);

#include <cuda/std/__numeric_>
#include <cuda/std/functional>
#include <cuda/std/numeric>
#ifdef _LIBCUDACXX_HAS_STRING
# include <cuda/std/string>
#endif // _LIBCUDACXX_HAS_STRING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
//

#include <cuda/std/__algorithm_>
#include <cuda/std/__numeric_>
#include <cuda/std/array>
#include <cuda/std/cassert>
#include <cuda/std/functional>
#include <cuda/std/iterator>
#include <cuda/std/numeric>

#include "test_iterators.h"
#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
// T init, BinaryOperation binary_op); // C++17

#include <cuda/std/__algorithm_>
#include <cuda/std/__numeric_>
#include <cuda/std/array>
#include <cuda/std/cassert>
#include <cuda/std/functional>
#include <cuda/std/iterator>
#include <cuda/std/numeric>

#include "test_iterators.h"
#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
//

#include <cuda/std/__algorithm_>
#include <cuda/std/__numeric_>
#include <cuda/std/array>
#include <cuda/std/cassert>
#include <cuda/std/functional>
#include <cuda/std/iterator>
#include <cuda/std/numeric>

#include "test_iterators.h"
#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
// BinaryOperation binary_op); // C++17

#include <cuda/std/__algorithm_>
#include <cuda/std/__numeric_>
#include <cuda/std/array>
#include <cuda/std/cassert>
#include <cuda/std/functional>
#include <cuda/std/iterator>
#include <cuda/std/numeric>

#include "test_iterators.h"
#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
// BinaryOperation binary_op, T init); // C++17

#include <cuda/std/__algorithm_>
#include <cuda/std/__numeric_>
#include <cuda/std/array>
#include <cuda/std/cassert>
#include <cuda/std/functional>
#include <cuda/std/iterator>
#include <cuda/std/numeric>

#include "test_iterators.h"
#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// T
// inner_product(Iter1 first1, Iter1 last1, Iter2 first2, T init);

#include <cuda/std/__numeric_>
#include <cuda/std/cassert>
#include <cuda/std/numeric>

#include "test_iterators.h"
#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
// inner_product(Iter1 first1, Iter1 last1, Iter2 first2,
// T init, BinaryOperation1 binary_op1, BinaryOperation2 binary_op2);

#include <cuda/std/__numeric_>
#include <cuda/std/functional>
#include <cuda/std/numeric>
#ifdef _LIBCUDACXX_HAS_STRING
# include <cuda/std/string>
#endif // _LIBCUDACXX_HAS_STRING
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// template <class ForwardIterator, class T>
// void iota(ForwardIterator first, ForwardIterator last, T value);

#include <cuda/std/__numeric_>
#include <cuda/std/cassert>
#include <cuda/std/numeric>

#include "test_iterators.h"
#include "test_macros.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
// Remarks: If either M or N is not an integer type,
// or if either is (a possibly cv-qualified) bool, the program is ill-formed.

#include <cuda/std/__numeric_>
#include <cuda/std/numeric>

int main(int, char**)
{
Expand Down
Loading

0 comments on commit 301e8ff

Please sign in to comment.