Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Move the unused helper function into test_macros.h #384

Merged
merged 1 commit into from
Mar 13, 2023
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
6 changes: 2 additions & 4 deletions .upstream-tests/test/cuda/bad_atomic_alignment.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,9 @@
// https://github.com/NVIDIA/libcudacxx/issues/160

#include <cuda/atomic>
#include "cuda_space_selector.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}
#include "cuda_space_selector.h"
#include "test_macros.h"

template <template<typename, typename> typename Selector>
struct TestFn {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@

#include "cuda_space_selector.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

enum class foo_bar_enum : uint8_t {
foo,
bar,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@

#include "test_macros.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

struct aggregate {
double a;
double b;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@
#define TEST_NOT_COPY_ASSIGNABLE(T) static_assert(!cuda::std::is_copy_assignable<T>::value, "")
#endif

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

struct NoDefault {
__host__ __device__ NoDefault(int) {}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@ __host__ __device__ constexpr bool check_idx( size_t idx, double val )
}
#endif

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

int main(int, char**)
{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
#pragma warning(disable: 4324)
#endif

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

template <class T, size_t Size>
struct MyArray {
T elems[Size];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,3 @@ struct is_stride_avail< T

template< class T, class RankType >
constexpr bool is_stride_avail_v = is_stride_avail< T, RankType >::value;

// Workaround for variables that are only used in static_assert's
template< typename T >
__host__ __device__ constexpr bool unused( T && ) { return true; }
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
#include "test_macros.h"
#include "test_iterators.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

template <class It>
__host__ __device__
void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,6 @@
#include "test_macros.h"
#include "test_iterators.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

template <class It>
__host__ __device__
void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@

#include "test_macros.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

int main(int, char**)
{
cuda::std::complex<double> d;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@

#include "cuda_space_selector.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

template<typename Barrier,
template<typename, typename> typename Selector,
typename Initializer = constructor_initializer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@

#include "cuda_space_selector.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

template<typename Barrier,
template<typename, typename> typename Selector,
typename Initializer = constructor_initializer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
#include <cuda/std/cassert>

#include "test_macros.h"
template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

int main(int, char**)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@

#include "test_macros.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

__host__ __device__
constexpr bool test_ignore_constexpr()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@
// Disable the missing braces warning for this reason.
#include "disable_missing_braces_warning.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

__host__ __device__
constexpr int constexpr_sum_fn() { return 0; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
// Disable the missing braces warning for this reason.
#include "disable_missing_braces_warning.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

template <class Tuple>
struct ConstexprConstructibleFromTuple {
template <class ...Args>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

#include "test_macros.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

struct NonAssignable {
NonAssignable& operator=(NonAssignable const&) = delete;
NonAssignable& operator=(NonAssignable&&) = delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@
#include "test_macros.h"
#include "MoveOnly.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

struct NonAssignable {
NonAssignable& operator=(NonAssignable const&) = delete;
NonAssignable& operator=(NonAssignable&&) = delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// template <class... UTypes>
// explicit tuple(UTypes&&... u);

// UNSUPPORTED: c++98, c++03
// UNSUPPORTED: c++98, c++03
// UNSUPPORTED: nvrtc

/*
Expand All @@ -24,9 +24,7 @@
#include <cuda/std/tuple>
#include <cuda/std/cassert>

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}
#include "test_macros.h"

class MoveOnly
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,6 @@
#include "../alloc_first.h"
#include "../alloc_last.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

template <class T = void>
struct NonDefaultConstructible {
__host__ __device__ constexpr NonDefaultConstructible() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@

#include "test_macros.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

struct Empty {};

int main(int, char**)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@
#include "test_macros.h"
#include "archetypes.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

// Overloads
// using A = Allocator
// using AT = cuda::std::allocator_arg_t
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@
#include "test_macros.h"
#include "DefaultOnly.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

struct NoDefault {
NoDefault() = delete;
__host__ __device__ explicit NoDefault(int) { }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@
#include "test_macros.h"
#include "MoveOnly.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

struct ConstructsWithTupleLeaf
{
__host__ __device__ ConstructsWithTupleLeaf() {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
#include "test_macros.h"
#include "MoveOnly.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

struct NothrowConstruct
{
__host__ __device__ constexpr NothrowConstruct(int) noexcept {};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
#include "test_macros.h"
#include "MoveOnly.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

int main(int, char**)
{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,6 @@

#include "test_macros.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

#if TEST_STD_VER > 11
__host__ __device__ TEST_CONSTEXPR_CXX14 bool test_constexpr() {
int v = 12;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@

#include "test_macros.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

class A
{
__host__ __device__ A(const A&);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@

#include <cuda/std/utility>

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}
#include "test_macros.h"

int main(int, char**) {
cuda::std::piecewise_construct_t x = cuda::std::piecewise_construct;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@

#include "test_macros.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

struct NonAssignable {
NonAssignable& operator=(NonAssignable const&) = delete;
NonAssignable& operator=(NonAssignable&&) = delete;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
#include "test_macros.h"
#include "archetypes.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

// Overloads
// ---------------
// (1) pair(const T1&, const T2&) -> pair<T1, T2>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,6 @@ struct IsAContainer {
T v_;
};

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

__host__ __device__ void checkCV()
{
IsAContainer<int> v{};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@

#include "test_macros.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

template <typename Span>
__host__ __device__
constexpr bool testConstexprSpan(Span sp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@

#include "test_macros.h"

template <typename T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

template <typename Span>
__host__ __device__
constexpr bool testConstexprSpan(Span sp)
Expand Down
4 changes: 4 additions & 0 deletions .upstream-tests/test/support/test_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ inline void DoNotOptimize(Tp const& value) {
return v; \
}

template <class T>
__host__ __device__
constexpr bool unused(T &&) {return true;}

#if defined(__GNUC__)
#pragma GCC diagnostic pop
#endif
Expand Down