11 #ifndef CUBBYFLOW_CUDA_STD_ARRAY_HPP 12 #define CUBBYFLOW_CUDA_STD_ARRAY_HPP 14 #ifdef CUBBYFLOW_USE_CUDA 22 template <
typename T,
size_t N>
28 using ConstReference =
const T&;
30 using ConstPointer =
const T*;
31 using Iterator = Pointer;
32 using ConstIterator = ConstPointer;
34 CUBBYFLOW_CUDA_HOST_DEVICE CUDAStdArray();
36 template <
typename... Args>
37 CUBBYFLOW_CUDA_HOST_DEVICE CUDAStdArray(ConstReference first, Args... rest);
39 CUBBYFLOW_CUDA_HOST CUDAStdArray(
const std::array<T, N>& other);
41 CUBBYFLOW_CUDA_HOST CUDAStdArray(
const Vector<T, N>& other);
43 ~CUDAStdArray() =
default;
45 CUBBYFLOW_CUDA_HOST_DEVICE CUDAStdArray(
const CUDAStdArray& other);
47 CUBBYFLOW_CUDA_HOST_DEVICE CUDAStdArray(CUDAStdArray&& other) noexcept;
49 CUBBYFLOW_CUDA_HOST_DEVICE CUDAStdArray& operator=(
50 const CUDAStdArray& other);
52 CUBBYFLOW_CUDA_HOST_DEVICE CUDAStdArray& operator=(
53 CUDAStdArray&& other) noexcept;
55 CUBBYFLOW_CUDA_HOST_DEVICE
void Fill(ConstReference val);
57 CUBBYFLOW_CUDA_HOST Vector<T, N> ToVector()
const;
59 CUBBYFLOW_CUDA_HOST_DEVICE Reference operator[](
size_t i);
61 CUBBYFLOW_CUDA_HOST_DEVICE ConstReference operator[](
size_t i)
const;
63 CUBBYFLOW_CUDA_HOST_DEVICE
bool operator==(
const CUDAStdArray& other)
const;
65 CUBBYFLOW_CUDA_HOST_DEVICE
bool operator!=(
const CUDAStdArray& other)
const;
68 template <
typename... Args>
69 CUBBYFLOW_CUDA_HOST_DEVICE
void SetAt(
size_t i, ConstReference first,
72 template <
typename... Args>
73 CUBBYFLOW_CUDA_HOST_DEVICE
void SetAt(
size_t i, ConstReference first);
constexpr std::enable_if_t< IsMatrixSizeStatic< Rows, Cols >), bool > operator==(const MatrixExpression< T, Rows, Cols, M1 > &a, const MatrixExpression< T, Rows, Cols, M2 > &b)
Definition: Matrix-Impl.hpp:1408
Definition: pybind11Utils.hpp:20
void Fill(ArrayView< T, N > a, const Vector< size_t, N > &begin, const Vector< size_t, N > &end, const T &val)
Definition: ArrayUtils-Impl.hpp:19
bool operator!=(const MatrixExpression< T, R1, C1, M1 > &a, const MatrixExpression< T, R2, C2, M2 > &b)
Definition: Matrix-Impl.hpp:1443