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

Provide a collapsed implementation of all pairs #3

Merged
merged 5 commits into from
Jun 24, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Workaround nvc++ stdpar=multicore bug
  • Loading branch information
gonzalobg committed Jun 23, 2024
commit 7347243ecc3893e1a1600d4c326401a675d526a2
12 changes: 7 additions & 5 deletions src/counting_iterator.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@

#include <ranges>

// Workaround for nvc++ not supporting 128-bit integers yet
// used by std::views::iota(64-bit int) overflow checking:
#if defined(_NVHPC_STDPAR_GPU)
// Workaround for two nvc++ bugs:
// - Not supporting 128-bit integers yet on GPUs,
// used by std::views::iota(64-bit int) overflow checking.
// - Link failure with OpenMP on CPU due to unknown issue yet.
#if defined(_NVHPC_STDPAR_GPU) || defined(_NVHPC_STDPAR_MULTICORE)
#include <thrust/iterator/counting_iterator.h>
#endif

template <typename T>
auto counting_iterator(T v = T(0)) {
#if defined(_NVHPC_STDPAR_GPU)
constexpr auto counting_iterator(T v = T(0)) {
#if defined(_NVHPC_STDPAR_GPU) || defined(_NVHPC_STDPAR_MULTICORE)
return thrust::counting_iterator<T>(T(v));
#else
return std::views::iota(T(v)).begin();
Expand Down