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

Commit

Permalink
Integration with cuda_pipeline.h.
Browse files Browse the repository at this point in the history
This is the beginning of a history rewrite annotation.
This is a rewrite of a commit initially made in the main repo.
Original hash: 8486eb8.
  • Loading branch information
griwes committed Sep 4, 2020
1 parent dd06154 commit 8b3506e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion include/cuda/std/barrier
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define _CUDA_BARRIER

#include "atomic"
#include "cstddef"

#include "detail/__config"

Expand Down Expand Up @@ -47,8 +48,10 @@ public:
}
};

struct __block_scope_barrier_base {};

template<>
class barrier<thread_scope_block, std::__empty_completion> {
class barrier<thread_scope_block, std::__empty_completion> : public __block_scope_barrier_base {
using __barrier_base = std::__barrier_base<std::__empty_completion, (int)thread_scope_block>;
__barrier_base __barrier;

Expand All @@ -62,6 +65,7 @@ public:

_LIBCUDACXX_INLINE_VISIBILITY
barrier(std::ptrdiff_t __expected, std::__empty_completion __completion = std::__empty_completion()) {
static_assert(offsetof(barrier<thread_scope_block>, __barrier) == 0, "fatal error: bad barrier layout");
init(this, __expected, __completion);
}

Expand Down
6 changes: 6 additions & 0 deletions include/cuda/std/detail/__config
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@
# define _LIBCUDACXX_CUDA_ABI_VERSION 2
#endif

#ifdef _LIBCUDACXX_PIPELINE_ASSUMED_ABI_VERSION
#if _LIBCUDACXX_PIPELINE_ASSUMED_ABI_VERSION != _LIBCUDACXX_CUDA_ABI_VERSION
#error cuda_pipeline.h has assumed a different libcu++ ABI version than provided by this library. To fix this, please include a libcu++ header before including cuda_pipeline.h, or upgrade to a version of the toolkit this version of libcu++ shipped in.
#endif
#endif

#ifndef _LIBCUDACXX_CUDA_ABI_NAMESPACE
# define _LIBCUDACXX_CUDA_ABI_NAMESPACE _LIBCUDACXX_CONCAT(__,_LIBCUDACXX_CUDA_ABI_VERSION)
#endif
Expand Down

0 comments on commit 8b3506e

Please sign in to comment.