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

Try and fix CI for old CTK #116

Merged
merged 17 commits into from
Jun 28, 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
2 changes: 1 addition & 1 deletion ci/build_libcudacxx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ cmake -S .. -B ../build \
-DTHRUST_ENABLE_INSTALL_RULES=ON \
-G Ninja

LIBCUDACXX_SITE_CONFIG="../build/libcudacxx/test/lit.site.cfg" lit -v --no-progress-bar --no-execute -Dcompute_archs=${GPU_ARCHS} -Dstd="c++${CXX_STANDARD}" ../libcudacxx/.upstream-tests/test
LIBCUDACXX_SITE_CONFIG="../build/libcudacxx/test/lit.site.cfg" lit -v --no-progress-bar -Dexecutor="NoopExecutor()" -Dcompute_archs=${GPU_ARCHS} -Dstd="c++${CXX_STANDARD}" ../libcudacxx/.upstream-tests/test

Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@

// UNSUPPORTED: pre-sm-80

#pragma nv_diag_suppress static_var_with_dynamic_init
#pragma nv_diag_suppress set_but_not_used

#include <cuda/barrier>

#include "cuda_space_selector.h"
#include "test_macros.h"

TEST_NV_DIAG_SUPPRESS(static_var_with_dynamic_init)
TEST_NV_DIAG_SUPPRESS(set_but_not_used)

__device__
void test()
Expand Down
12 changes: 7 additions & 5 deletions libcudacxx/.upstream-tests/test/cuda/pipeline_arrive_on.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@

// Remove after bump to version 4
#define _LIBCUDACXX_CUDA_ABI_VERSION 3
// TODO: Remove pointless comparison suppression when compiler fixes short-circuiting
#pragma nv_diag_suppress 186

#pragma nv_diag_suppress static_var_with_dynamic_init
#pragma nv_diag_suppress declared_but_not_referenced

#include <cuda_pipeline.h>
#include <cuda/barrier>

#include "cuda_space_selector.h"
#include "test_macros.h"

// TODO: Remove pointless comparison suppression when compiler fixes short-circuiting
TEST_NV_DIAG_SUPPRESS(186) // pointless comparison of unsigned integer with zero

TEST_NV_DIAG_SUPPRESS(static_var_with_dynamic_init)
TEST_NV_DIAG_SUPPRESS(declared_but_not_referenced)

using nvcuda::experimental::pipeline;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,17 @@

#define _LIBCUDACXX_CUDA_ABI_VERSION 2

// TODO: Remove pointless comparison suppression when compiler fixes short-circuiting
#pragma nv_diag_suppress 186

#pragma nv_diag_suppress static_var_with_dynamic_init
#pragma nv_diag_suppress declared_but_not_referenced

#include <cuda_pipeline.h>
#include <cuda/barrier>

#include "cuda_space_selector.h"
#include "test_macros.h"

// TODO: Remove pointless comparison suppression when compiler fixes short-circuiting
TEST_NV_DIAG_SUPPRESS(186) // pointless comparison of unsigned integer with zero

TEST_NV_DIAG_SUPPRESS(static_var_with_dynamic_init)
TEST_NV_DIAG_SUPPRESS(declared_but_not_referenced)

using nvcuda::experimental::pipeline;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,19 @@
// UNSUPPORTED: pre-sm-70
// UNSUPPORTED: nvrtc

#include <cuda/std/type_traits>
#include <cooperative_groups/memcpy_async.h>
#include <cuda/pipeline>
#include <cuda_pipeline.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

#include "test_macros.h"

TEST_NV_DIAG_SUPPRESS(static_var_with_dynamic_init)
TEST_NV_DIAG_SUPPRESS(186) // pointless comparison of unsigned integer with zero

constexpr int nthreads = 256;
constexpr size_t stages_count = 2; // Pipeline with two stages

Expand All @@ -40,7 +46,6 @@ __global__ void with_staging(int* global_out, int const* global_in, size_t size,
size_t shared_offset[stages_count] = { 0, block.size() }; // Offsets to each batch

// Allocate shared storage for a two-stage cuda::pipeline:
#pragma nv_diag_suppress static_var_with_dynamic_init
__shared__ cuda::pipeline_shared_state<cuda::thread_scope::thread_scope_block, stages_count> shared_state;
auto pipeline = cuda::make_pipeline(block, &shared_state);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@
// UNSUPPORTED: pre-sm-70

// TODO: Remove pointless comparison suppression when compiler fixes short-circuiting
#pragma nv_diag_suppress 186

#include <cuda/pipeline>
#include "test_macros.h"

TEST_NV_DIAG_SUPPRESS(186) // pointless comparison of unsigned integer with zero

template <typename T_size, typename T_thread_rank>
struct single_thread_test_group {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include <cuda/std/type_traits>
#include "test_macros.h"

#pragma nv_diag_suppress cuda_demote_unsupported_floating_point
TEST_NV_DIAG_SUPPRESS(cuda_demote_unsupported_floating_point)

template <class T>
__host__ __device__
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@

// static constexpr bool is_always_lock_free;

#include <cuda/std/atomic>
#include <cuda/std/cassert>
#include <cuda/std/atomic>

#include "test_macros.h"

TEST_NV_DIAG_SUPPRESS(cuda_demote_unsupported_floating_point)

// NVRTC doesn't include host atomic making this feature test invalid
// TODO: Should we define __cpp_lib_atomic_is_always_lock_free for NVRTC?
#if !defined(__CUDACC_RTC__)
Expand Down Expand Up @@ -97,7 +99,7 @@ void run()
CHECK_ALWAYS_LOCK_FREE(void*);
CHECK_ALWAYS_LOCK_FREE(float);
CHECK_ALWAYS_LOCK_FREE(double);
CHECK_ALWAYS_LOCK_FREE(long double);
//CHECK_ALWAYS_LOCK_FREE(long double); // long double is not supported
#if __has_attribute(vector_size) && defined(_LIBCUDACXX_VERSION) && !defined(__CUDACC__)
// NOTE: NVCC doesn't support the vector_size attribute in device code.
CHECK_ALWAYS_LOCK_FREE(int __attribute__((vector_size(1 * sizeof(int)))));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

// template<class From, class To>
// concept convertible_to;
#pragma nv_diag_suppress 3013 // a volatile function parameter is deprecated

#if defined(__clang__)
#pragma clang diagnostic ignored "-Wc++17-extensions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

// template<class T>
// concept copy_constructible;
#pragma nv_diag_suppress 3013 // a volatile function parameter is deprecated

#if defined(__clang__)
#pragma clang diagnostic ignored "-Wc++17-extensions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

// template<class T>
// concept move_constructible;
#pragma nv_diag_suppress 3013 // a volatile function parameter is deprecated

#if defined(__clang__)
#pragma clang diagnostic ignored "-Wc++17-extensions"
Expand All @@ -21,6 +20,7 @@
#include <cuda/std/type_traits>

#include "type_classification/moveconstructible.h"
#include "test_macros.h"

using cuda::std::move_constructible;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

// template<class T>
// concept swappable = // see below
#pragma nv_diag_suppress 3013 // a volatile function parameter is deprecated

#if defined(__clang__)
#pragma clang diagnostic ignored "-Wc++17-extensions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

// template<class T, class U>
// concept swappable_with = // see below
#pragma nv_diag_suppress 3013 // a volatile function parameter is deprecated

#if defined(__clang__)
#pragma clang diagnostic ignored "-Wc++17-extensions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

// template<class T>
// concept copyable = see below;
#pragma nv_diag_suppress 3013 // a volatile function parameter is deprecated

#if defined(__clang__)
#pragma clang diagnostic ignored "-Wc++17-extensions"
Expand All @@ -21,6 +20,7 @@
#include <cuda/std/type_traits>

#include "type_classification/copyable.h"
#include "test_macros.h"

using cuda::std::copyable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

// template<class T>
// concept movable = see below;
#pragma nv_diag_suppress 3013 // a volatile function parameter is deprecated

#if defined(__clang__)
#pragma clang diagnostic ignored "-Wc++17-extensions"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

// template<class T>
// concept regular = see below;
#pragma nv_diag_suppress 3013 // a volatile function parameter is deprecated

#if defined(__clang__)
#pragma clang diagnostic ignored "-Wc++17-extensions"
Expand All @@ -22,6 +21,7 @@

#include "type_classification/moveconstructible.h"
#include "type_classification/semiregular.h"
#include "test_macros.h"

using cuda::std::regular;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

// template<class T>
// concept semiregular = see below;
#pragma nv_diag_suppress 3013 // a volatile function parameter is deprecated

#if defined(__clang__)
#pragma clang diagnostic ignored "-Wc++17-extensions"
Expand All @@ -21,6 +20,7 @@
#include <cuda/std/type_traits>

#include "type_classification/semiregular.h"
#include "test_macros.h"

using cuda::std::semiregular;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
// UNSUPPORTED: libcpp-no-deduction-guides
// Clang 5 will generate bad implicit deduction guides
// Specifically, for the copy constructor.
// UNSUPPORTED: clang-9 && nvcc-11.1


// template <class T, class... U>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ int main(int, char**)

static_assert( is_array_cons_avail_v< cuda::std::dextents< int,2>, my_int, 2 > == true , "" );

#if !defined(TEST_COMPILER_NVCC_BELOW_11_3)
// Constraint: rank consistency
static_assert( is_array_cons_avail_v< cuda::std::dextents< int,1>, int , 2 > == false, "" );

Expand All @@ -65,6 +66,7 @@ int main(int, char**)
#ifndef TEST_COMPILER_NVHPC
static_assert( is_array_cons_avail_v< cuda::std::dextents< int,1>, my_int_non_nothrow_constructible, 1 > == false, "" );
#endif // TEST_COMPILER_NVHPC
#endif // !defined(TEST_COMPILER_NVCC_BELOW_11_3)

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ int main(int, char**)

static_assert( is_span_cons_avail_v< cuda::std::dextents<int,2>, my_int, 2 > == true , "" );

#if !defined(TEST_COMPILER_NVCC_BELOW_11_3)
// Constraint: rank consistency
static_assert( is_span_cons_avail_v< cuda::std::dextents<int,1>, int , 2 > == false, "" );

Expand All @@ -66,6 +67,7 @@ int main(int, char**)
#ifndef TEST_COMPILER_NVHPC
static_assert( is_span_cons_avail_v< cuda::std::dextents<int,1>, my_int_non_nothrow_constructible, 1 > == false, "" );
#endif // TEST_COMPILER_NVHPC
#endif // !defined(TEST_COMPILER_NVCC_BELOW_11_3)

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ void test_const_array( const T (&array)[Sz] )
assert ( cuda::std::data(array) == &array[0]);
}

STATIC_TEST_GLOBAL_VAR constexpr int arrA [] { 1, 2, 3 };
STATIC_TEST_GLOBAL_VAR TEST_CONSTEXPR_GLOBAL int arrA [] { 1, 2, 3 };

int main(int, char**)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void test_const_array( const T (&array)[Sz] )
assert (!cuda::std::empty(array));
}

STATIC_TEST_GLOBAL_VAR constexpr int arrA [] { 1, 2, 3 };
STATIC_TEST_GLOBAL_VAR TEST_CONSTEXPR_GLOBAL int arrA [] { 1, 2, 3 };

int main(int, char**)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ void test_const_array( const T (&array)[Sz] )
assert ( cuda::std::size(array) == Sz );
}

STATIC_TEST_GLOBAL_VAR constexpr int arrA [] { 1, 2, 3 };
STATIC_TEST_GLOBAL_VAR TEST_CONSTEXPR_GLOBAL int arrA [] { 1, 2, 3 };

int main(int, char**)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void test_const_array(const T (&array)[Sz])
assert ( cuda::std::ssize(array) == Sz );
}

STATIC_TEST_GLOBAL_VAR constexpr int arrA [] { 1, 2, 3 };
STATIC_TEST_GLOBAL_VAR TEST_CONSTEXPR_GLOBAL int arrA [] { 1, 2, 3 };

int main(int, char**)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,12 @@ void test_const_array( const T (&array)[Sz] ) {
#endif
}

STATIC_TEST_GLOBAL_VAR constexpr int global_array [] { 1, 2, 3 };
STATIC_TEST_GLOBAL_VAR TEST_CONSTEXPR_GLOBAL int global_array [] { 1, 2, 3 };
#if TEST_STD_VER > 14
STATIC_TEST_GLOBAL_VAR constexpr const int global_const_array[] = {0,1,2,3,4};
#endif
#if !defined(TEST_COMPILER_NVCC_BELOW_11_3)
STATIC_TEST_GLOBAL_VAR TEST_CONSTEXPR_GLOBAL int global_const_array[] = {0,1,2,3,4};
#endif // nvcc > 11.2
#endif // TEST_STD_VER > 14

int main(int, char**) {
#if defined(_LIBCUDACXX_HAS_VECTOR)
Expand Down Expand Up @@ -214,14 +216,16 @@ int main(int, char**) {
static_assert ( *cuda::std::crbegin(local_const_array) == 4, "" );
}

#if !defined(TEST_COMPILER_NVCC_BELOW_11_3)
{

static_assert ( *cuda::std::begin(global_const_array) == 0, "" );
static_assert ( *cuda::std::cbegin(global_const_array) == 0, "" );
static_assert ( *cuda::std::rbegin(global_const_array) == 4, "" );
static_assert ( *cuda::std::crbegin(global_const_array) == 4, "" );
}
#endif
#endif // nvcc > 11.2
#endif // TEST_STD_VER > 14

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@

// max_align_t is a trivial standard-layout type whose alignment requirement
// is at least as great as that of every scalar type
#include "test_macros.h"

#ifndef __CUDACC_RTC__
#ifndef TEST_COMPILER_NVRTC
#include <stdio.h>
#endif // __CUDACC_RTC__
#include "test_macros.h"
#endif // TEST_COMPILER_NVRTC

#pragma nv_diag_suppress cuda_demote_unsupported_floating_point
TEST_NV_DIAG_SUPPRESS(cuda_demote_unsupported_floating_point)

int main(int, char**)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ __host__ __device__ void testException() {
int main(int, char**) {
test();
#if defined(_LIBCUDACXX_ADDRESSOF)
#if !(defined(TEST_COMPILER_NVCC_BELOW_11_3) && defined(TEST_COMPILER_CLANG))
static_assert(test(), "");
#endif // !(defined(TEST_COMPILER_NVCC_BELOW_11_3) && defined(TEST_COMPILER_CLANG))
#endif // defined(_LIBCUDACXX_ADDRESSOF)
testException();
return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ __host__ __device__ void testException() {
int main(int, char**) {
test();
#if defined(_LIBCUDACXX_ADDRESSOF)
#if !(defined(TEST_COMPILER_NVCC_BELOW_11_3) && defined(TEST_COMPILER_CLANG))
static_assert(test(), "");
#endif // !(defined(TEST_COMPILER_NVCC_BELOW_11_3) && defined(TEST_COMPILER_CLANG))
#endif // defined(_LIBCUDACXX_ADDRESSOF)
testException();
return 0;
Expand Down
Loading
Loading