Commit 8b0777c4 authored by Allison Vacanti's avatar Allison Vacanti Committed by Kitware Robot
Browse files

Merge topic 'cuda_32bit_id_fix'

1751b493 Fix build error and host/device warnings on 32-bit builds with CUDA.
768086a0 Merge branch 'upstream-taotuple' into cuda_32bit_id_fix
d4b38a78 taotuple 2018-06-29 (4bd72b5e)
b4110cd5

 Update update.sh for taotuple to reflect upstream changes.
Acked-by: Kitware Robot's avatarKitware Robot <kwrobot@kitware.com>
Acked-by: default avatarRobert Maynard <robert.maynard@kitware.com>
Merge-request: !1295
parents 6bc579e4 1751b493
...@@ -54,11 +54,11 @@ public: ...@@ -54,11 +54,11 @@ public:
using IteratorType = IteratorT; using IteratorType = IteratorT;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT VTKM_CONT
ArrayPortalFromIterators() {} ArrayPortalFromIterators() {}
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT VTKM_CONT
ArrayPortalFromIterators(IteratorT begin, IteratorT end) ArrayPortalFromIterators(IteratorT begin, IteratorT end)
: BeginIterator(begin) : BeginIterator(begin)
{ {
...@@ -80,8 +80,9 @@ public: ...@@ -80,8 +80,9 @@ public:
/// type that can be copied to this iterator type. This allows us to do any /// type that can be copied to this iterator type. This allows us to do any
/// type casting that the iterators do (like the non-const to const cast). /// type casting that the iterators do (like the non-const to const cast).
/// ///
VTKM_SUPPRESS_EXEC_WARNINGS
template <class OtherIteratorT> template <class OtherIteratorT>
VTKM_EXEC_CONT ArrayPortalFromIterators(const ArrayPortalFromIterators<OtherIteratorT>& src) VTKM_CONT ArrayPortalFromIterators(const ArrayPortalFromIterators<OtherIteratorT>& src)
: BeginIterator(src.GetIteratorBegin()) : BeginIterator(src.GetIteratorBegin())
, NumberOfValues(src.GetNumberOfValues()) , NumberOfValues(src.GetNumberOfValues())
{ {
...@@ -128,7 +129,7 @@ public: ...@@ -128,7 +129,7 @@ public:
using IteratorType = IteratorT; using IteratorType = IteratorT;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT VTKM_CONT
ArrayPortalFromIterators() ArrayPortalFromIterators()
: BeginIterator(nullptr) : BeginIterator(nullptr)
, NumberOfValues(0) , NumberOfValues(0)
...@@ -136,7 +137,7 @@ public: ...@@ -136,7 +137,7 @@ public:
} }
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT VTKM_CONT
ArrayPortalFromIterators(IteratorT begin, IteratorT end) ArrayPortalFromIterators(IteratorT begin, IteratorT end)
: BeginIterator(begin) : BeginIterator(begin)
{ {
...@@ -158,8 +159,9 @@ public: ...@@ -158,8 +159,9 @@ public:
/// type that can be copied to this iterator type. This allows us to do any /// type that can be copied to this iterator type. This allows us to do any
/// type casting that the iterators do (like the non-const to const cast). /// type casting that the iterators do (like the non-const to const cast).
/// ///
VTKM_SUPPRESS_EXEC_WARNINGS
template <class OtherIteratorT> template <class OtherIteratorT>
VTKM_EXEC_CONT ArrayPortalFromIterators(const ArrayPortalFromIterators<OtherIteratorT>& src) VTKM_CONT ArrayPortalFromIterators(const ArrayPortalFromIterators<OtherIteratorT>& src)
: BeginIterator(src.GetIteratorBegin()) : BeginIterator(src.GetIteratorBegin())
, NumberOfValues(src.GetNumberOfValues()) , NumberOfValues(src.GetNumberOfValues())
{ {
...@@ -223,7 +225,7 @@ public: ...@@ -223,7 +225,7 @@ public:
using IteratorType = _IteratorType; using IteratorType = _IteratorType;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT VTKM_CONT
ArrayPortalToIterators(const PortalType& portal) ArrayPortalToIterators(const PortalType& portal)
: Iterator(portal.GetIteratorBegin()) : Iterator(portal.GetIteratorBegin())
, NumberOfValues(portal.GetNumberOfValues()) , NumberOfValues(portal.GetNumberOfValues())
...@@ -237,7 +239,7 @@ public: ...@@ -237,7 +239,7 @@ public:
using IteratorType = stdext::checked_array_iterator<_IteratorType>; using IteratorType = stdext::checked_array_iterator<_IteratorType>;
VTKM_SUPPRESS_EXEC_WARNINGS VTKM_SUPPRESS_EXEC_WARNINGS
VTKM_EXEC_CONT VTKM_CONT
ArrayPortalToIterators(const PortalType& portal) ArrayPortalToIterators(const PortalType& portal)
: Iterator(portal.GetIteratorBegin(), static_cast<size_t>(portal.GetNumberOfValues())) : Iterator(portal.GetIteratorBegin(), static_cast<size_t>(portal.GetNumberOfValues()))
, NumberOfValues(portal.GetNumberOfValues()) , NumberOfValues(portal.GetNumberOfValues())
......
...@@ -11,19 +11,12 @@ readonly repo="https://gitlab.kitware.com/third-party/$name.git" ...@@ -11,19 +11,12 @@ readonly repo="https://gitlab.kitware.com/third-party/$name.git"
readonly tag="for/vtk-m" readonly tag="for/vtk-m"
readonly paths=" readonly paths="
include include
git-subtree
LICENSE LICENSE
README.md README.md
" "
extract_source () { extract_source () {
git_archive git_archive
pushd "$extractdir/$name-reduced"
rm include/tao/seq
cp -r git-subtree/sequences/include/tao/seq include/tao/
rm -rf git-subtree
popd
} }
. "${BASH_SOURCE%/*}/../update-common.sh" . "${BASH_SOURCE%/*}/../update-common.sh"
The MIT License (MIT) The MIT License (MIT)
Copyright (c) 2015 Daniel Frey Copyright (c) 2015-2018 Daniel Frey
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal
......
# The Art of C++ / Tuple # The Art of C++ / Tuple
[![Release](https://img.shields.io/github/release/taocpp/tuple.svg)](https://github.com/taocpp/tuple/releases/latest) [![Release](https://img.shields.io/github/release/taocpp/tuple.svg)](https://github.com/taocpp/tuple/releases/latest)
[![License](https://img.shields.io/github/license/taocpp/tuple.svg)](#license)
[![TravisCI](https://travis-ci.org/taocpp/tuple.svg)](https://travis-ci.org/taocpp/tuple) [![TravisCI](https://travis-ci.org/taocpp/tuple.svg)](https://travis-ci.org/taocpp/tuple)
[![Issues](https://img.shields.io/github/issues/taocpp/tuple.svg)](https://github.com/taocpp/tuple/issues) [![AppVeyor](https://ci.appveyor.com/api/projects/status/9opt30ae579kw19b/branch/master?svg=true)](https://ci.appveyor.com/project/taocpp/tuple)
The Art of C++ / Tuple is a C++11 header-only reference implementation of [The Art of C++](https://taocpp.github.io/) / Tuple is a C++11 header-only reference implementation of
[`std::tuple`](http://en.cppreference.com/w/cpp/utility/tuple). [`std::tuple`](http://en.cppreference.com/w/cpp/utility/tuple).
## Rationale ## Rationale
...@@ -35,7 +34,7 @@ of 15 on the same system. ...@@ -35,7 +34,7 @@ of 15 on the same system.
The Art of C++ is certified [Open Source](http://www.opensource.org/docs/definition.html) software. It may be used for any purpose, including commercial purposes, at absolutely no cost. It is distributed under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.html) reproduced here. The Art of C++ is certified [Open Source](http://www.opensource.org/docs/definition.html) software. It may be used for any purpose, including commercial purposes, at absolutely no cost. It is distributed under the terms of the [MIT license](http://www.opensource.org/licenses/mit-license.html) reproduced here.
> Copyright (c) 2015 Daniel Frey > Copyright (c) 2015-2018 Daniel Frey
> >
> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
> >
......
...@@ -37,6 +37,20 @@ ...@@ -37,6 +37,20 @@
#endif // __CUDACC__ #endif // __CUDACC__
#endif // TAOCPP_ANNOTATION #endif // TAOCPP_ANNOTATION
// Ignore "calling a __host__ function from a __host__ _device__ function is not allowed" warnings
#ifndef TAO_TUPLE_SUPPRESS_NVCC_HD_WARN
#ifdef __CUDACC__
#if __CUDAVER__ >= 75000
#define TAO_TUPLE_SUPPRESS_NVCC_HD_WARN #pragma nv_exec_check_disable
#else
#define TAO_TUPLE_SUPPRESS_NVCC_HD_WARN #pragma hd_warning_disable
#endif
#else
#define TAO_TUPLE_SUPPRESS_NVCC_HD_WARN
#endif
#endif
namespace simple_tuple namespace simple_tuple
{ {
namespace detail namespace detail
...@@ -49,26 +63,31 @@ protected: ...@@ -49,26 +63,31 @@ protected:
Head Value; Head Value;
public: public:
TAO_TUPLE_SUPPRESS_NVCC_HD_WARN
TAOCPP_ANNOTATION constexpr tuple_leaf() TAOCPP_ANNOTATION constexpr tuple_leaf()
: Value() : Value()
{ {
} }
TAO_TUPLE_SUPPRESS_NVCC_HD_WARN
TAOCPP_ANNOTATION constexpr tuple_leaf(const Head& value) TAOCPP_ANNOTATION constexpr tuple_leaf(const Head& value)
: Value(value) : Value(value)
{ {
} }
TAO_TUPLE_SUPPRESS_NVCC_HD_WARN
TAOCPP_ANNOTATION constexpr tuple_leaf(const tuple_leaf& o) TAOCPP_ANNOTATION constexpr tuple_leaf(const tuple_leaf& o)
: Value(o.Value) : Value(o.Value)
{ {
} }
TAO_TUPLE_SUPPRESS_NVCC_HD_WARN
TAOCPP_ANNOTATION constexpr tuple_leaf(tuple_leaf&& o) TAOCPP_ANNOTATION constexpr tuple_leaf(tuple_leaf&& o)
: Value(std::move(o.Value)) : Value(std::move(o.Value))
{ {
} }
TAO_TUPLE_SUPPRESS_NVCC_HD_WARN
template <typename Other> template <typename Other>
TAOCPP_ANNOTATION constexpr tuple_leaf(Other&& o) TAOCPP_ANNOTATION constexpr tuple_leaf(Other&& o)
: Value(std::forward<Other>(o)) : Value(std::forward<Other>(o))
...@@ -82,6 +101,7 @@ public: ...@@ -82,6 +101,7 @@ public:
return o.Value; return o.Value;
} }
TAO_TUPLE_SUPPRESS_NVCC_HD_WARN
TAOCPP_ANNOTATION TAOCPP_ANNOTATION
tuple_leaf& operator=(tuple_leaf& o) tuple_leaf& operator=(tuple_leaf& o)
{ {
......
// Copyright (c) 2015-2018 Daniel Frey
// Please see LICENSE for license or visit https://github.com/taocpp/sequences/
#ifndef TAO_SEQ_AT_INDEX_HPP
#define TAO_SEQ_AT_INDEX_HPP
#include <cstddef>
#include "make_integer_sequence.hpp"
namespace tao
{
namespace seq
{
// based on http://talesofcpp.fusionfenix.com/post-22/true-story-efficient-packing
namespace impl
{
template< std::size_t, typename T >
struct indexed
{
using type = T;
};
template< typename, typename... Ts >
struct indexer;
template< std::size_t... Is, typename... Ts >
struct indexer< index_sequence< Is... >, Ts... >
: indexed< Is, Ts >...
{
};
template< std::size_t I, typename T >
indexed< I, T > select( const indexed< I, T >& );
} // namespace impl
template< std::size_t I, typename... Ts >
using at_index = decltype( impl::select< I >( impl::indexer< index_sequence_for< Ts... >, Ts... >() ) );
#ifndef _MSC_VER
template< std::size_t I, typename... Ts >
using at_index_t = typename at_index< I, Ts... >::type;
#else
namespace impl
{
template< typename T >
struct get_type
{
using type = typename T::type;
};
} // namespace impl
template< std::size_t I, typename... Ts >
using at_index_t = typename impl::get_type< at_index< I, Ts... > >::type;
#endif
} // namespace seq
} // namespace tao
#endif
// The Art of C++ / Sequences
// Copyright (c) 2015 Daniel Frey
#ifndef TAOCPP_SEQUENCES_INCLUDE_CONCATENATE_HPP
#define TAOCPP_SEQUENCES_INCLUDE_CONCATENATE_HPP
#include <type_traits>
#include "integer_sequence.hpp"
namespace tao
{
namespace seq
{
template< typename, typename >
struct concatenate;
template< typename TA, TA... As, typename TB, TB... Bs >
struct concatenate< integer_sequence< TA, As... >, integer_sequence< TB, Bs... > >
{
using type = integer_sequence< typename std::common_type< TA, TB >::type, As..., Bs... >;
};
template< typename A, typename B >
using concatenate_t = typename concatenate< A, B >::type;
}
}
#endif // TAOCPP_SEQUENCES_INCLUDE_CONCATENATE_HPP
// The Art of C++ / Sequences // Copyright (c) 2015-2018 Daniel Frey
// Copyright (c) 2015 Daniel Frey // Please see LICENSE for license or visit https://github.com/taocpp/sequences/
#ifndef TAOCPP_SEQUENCES_INCLUDE_CONFIG_HPP #ifndef TAO_SEQ_CONFIG_HPP
#define TAOCPP_SEQUENCES_INCLUDE_CONFIG_HPP #define TAO_SEQ_CONFIG_HPP
#if __cplusplus >= 201402L #include <utility>
# define TAOCPP_USE_STD_INTEGER_SEQUENCE
#endif
#if (__cplusplus >= 201402L) && defined(_LIBCPP_VERSION) #ifndef TAO_SEQ_USE_STD_INTEGER_SEQUENCE
# define TAOCPP_USE_STD_MAKE_INTEGER_SEQUENCE #if defined( __cpp_lib_integer_sequence )
#define TAO_SEQ_USE_STD_INTEGER_SEQUENCE
#elif defined( _LIBCPP_VERSION ) && ( __cplusplus >= 201402L )
#define TAO_SEQ_USE_STD_INTEGER_SEQUENCE
#elif defined( _MSC_VER )
#define TAO_SEQ_USE_STD_INTEGER_SEQUENCE
#endif
#endif #endif
#if defined(__cpp_fold_expressions) #ifndef TAO_SEQ_USE_STD_MAKE_INTEGER_SEQUENCE
# define TAOCPP_FOLD_EXPRESSIONS #if defined( _GLIBCXX_RELEASE ) && ( _GLIBCXX_RELEASE >= 8 ) && ( __cplusplus >= 201402L )
#elif __cplusplus > 201402L #define TAO_SEQ_USE_STD_MAKE_INTEGER_SEQUENCE
# if defined(__apple_build_version__) && (__clang_major__ >= 7) #elif defined( _LIBCPP_VERSION ) && ( __cplusplus >= 201402L )
# define TAOCPP_FOLD_EXPRESSIONS #define TAO_SEQ_USE_STD_MAKE_INTEGER_SEQUENCE
# elif defined(__clang__) && ((__clang_major__ > 3) || ((__clang_major__ == 3) && (__clang_minor__ >= 6))) #elif defined( _MSC_VER ) && ( _MSC_FULL_VER >= 190023918 )
# define TAOCPP_FOLD_EXPRESSIONS #define TAO_SEQ_USE_STD_MAKE_INTEGER_SEQUENCE
# endif #endif
#endif #endif
#ifndef TAOCPP_ANNOTATION #if defined( __cpp_fold_expressions ) && ( !defined( __GNUC__ ) || ( __GNUC__ >= 8 ) )
#ifdef __CUDACC__ #define TAO_SEQ_FOLD_EXPRESSIONS
#define TAOCPP_ANNOTATION __host__ __device__ #endif
#else
#define TAOCPP_ANNOTATION
#endif // __CUDACC__
#endif // TAOCPP_ANNOTATION
#endif // TAOCPP_SEQUENCES_INCLUDE_CONFIG_HPP #endif
// The Art of C++ / Sequences // Copyright (c) 2015-2018 Daniel Frey
// Copyright (c) 2015 Daniel Frey // Please see LICENSE for license or visit https://github.com/taocpp/sequences/
#ifndef TAOCPP_SEQUENCES_INCLUDE_EXCLUSIVE_SCAN_HPP #ifndef TAO_SEQ_EXCLUSIVE_SCAN_HPP
#define TAOCPP_SEQUENCES_INCLUDE_EXCLUSIVE_SCAN_HPP #define TAO_SEQ_EXCLUSIVE_SCAN_HPP
#include <utility> #include <utility>
...@@ -11,33 +11,38 @@ ...@@ -11,33 +11,38 @@
namespace tao namespace tao
{ {
namespace seq namespace seq
{ {
namespace impl namespace impl
{ {
template< typename S, typename = make_index_sequence< S::size() > > template< typename S, typename = make_index_sequence< S::size() > >
struct exclusive_scan; struct exclusive_scan;
template< typename S, std::size_t... Is > template< typename S, std::size_t... Is >
struct exclusive_scan< S, index_sequence< Is... > > struct exclusive_scan< S, index_sequence< Is... > >
{
using type = integer_sequence< typename S::value_type, partial_sum< Is, S >::value... >;
};
} // namespace impl
template< typename T, T... Ns >
struct exclusive_scan
: impl::exclusive_scan< integer_sequence< T, Ns... > >
{
};
template< typename T, T... Ns >
struct exclusive_scan< integer_sequence< T, Ns... > >
: impl::exclusive_scan< integer_sequence< T, Ns... > >
{ {
using type = integer_sequence< typename S::value_type, partial_sum< Is, S >::value... >;
}; };
}
template< typename T, T... Ns > template< typename T, T... Ns >
struct exclusive_scan using exclusive_scan_t = typename exclusive_scan< T, Ns... >::type;
: impl::exclusive_scan< integer_sequence< T, Ns... > >
{};
template< typename T, T... Ns > } // namespace seq
struct exclusive_scan< integer_sequence< T, Ns... > >
: impl::exclusive_scan< integer_sequence< T, Ns... > >
{};
template< typename T, T... Ns > } // namespace tao
using exclusive_scan_t = typename exclusive_scan< T, Ns... >::type;
}
}
#endif // TAOCPP_SEQUENCES_INCLUDE_EXCLUSIVE_SCAN_HPP #endif
// The Art of C++ / Sequences
// Copyright (c) 2015 Daniel Frey
#ifndef TAOCPP_SEQUENCES_INCLUDE_FOLD_HPP
#define TAOCPP_SEQUENCES_INCLUDE_FOLD_HPP
#include <type_traits>
#include "values.hpp"
#include "integer_sequence.hpp"
#include "make_integer_sequence.hpp"
namespace tao
{
namespace seq
{
namespace impl
{
template< template< typename U, U, U > class, typename, bool, typename T, T... >
struct folder;
template< template< typename U, U, U > class OP, std::size_t... Is, typename T, T... Ns >
struct folder< OP, index_sequence< Is... >, false, T, Ns... >
{
using values = seq::values< T, Ns... >;
using type = integer_sequence< T, OP< T, values::data[ 2 * Is ], values::data[ 2 * Is + 1 ] >::value... >;
};
template< template< typename U, U, U > class OP, std::size_t... Is, typename T, T N, T... Ns >
struct folder< OP, index_sequence< Is... >, true, T, N, Ns... >
{
using values = seq::values< T, Ns... >;
using type = integer_sequence< T, N, OP< T, values::data[ 2 * Is ], values::data[ 2 * Is + 1 ] >::value... >;
};
}
template< template< typename U, U, U > class, typename T, T... >
struct fold;
template< template< typename U, U, U > class OP, typename T, T N >
struct fold< OP, T, N >
: std::integral_constant< T, N >
{};
template< template< typename U, U, U > class OP, typename T, T... Ns >
struct fold
: fold< OP, typename impl::folder< OP, make_index_sequence< sizeof...( Ns ) / 2 >, sizeof...( Ns ) % 2 == 1, T, Ns... >::type >
{};
template< template< typename U, U, U > class OP, typename T, T... Ns >
struct fold< OP, integer_sequence< T, Ns... > >
: fold< OP, T, Ns... >
{};
}
}
#endif // TAOCPP_SEQUENCES_INCLUDE_FOLD_HPP
// The Art of C++ / Sequences
// Copyright (c) 2015 Daniel Frey
#ifndef TAOCPP_SEQUENCES_INCLUDE_HEAD_HPP
#define TAOCPP_SEQUENCES_INCLUDE_HEAD_HPP
#include <type_traits>
#include "integer_sequence.hpp"
namespace tao
{
namespace seq
{
template< typename T, T... Ns >