Skip to content

Commit

Permalink
Workaround nvcc failing to call base class ctors
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardmgruber committed Dec 2, 2022
1 parent 92ebb92 commit 9622885
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/llama/mapping/One.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ namespace llama::mapping
using Flattener = FlattenRecordDim<TRecordDim>;
static constexpr std::size_t blobCount = 1;

#ifndef __NVCC__
using Base::Base;
#else
constexpr One() = default;

LLAMA_FN_HOST_ACC_INLINE constexpr explicit One(TArrayExtents extents, TRecordDim = {}) : Base(extents)
{
}
#endif

LLAMA_FN_HOST_ACC_INLINE constexpr auto blobSize(size_type) const -> size_type
{
Expand Down
8 changes: 8 additions & 0 deletions include/llama/mapping/SoA.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,15 @@ namespace llama::mapping
inline static constexpr std::size_t blobCount
= SeparateBuffers ? boost::mp11::mp_size<FlatRecordDim<TRecordDim>>::value : 1;

#ifndef __NVCC__
using Base::Base;
#else
constexpr SoA() = default;

LLAMA_FN_HOST_ACC_INLINE constexpr explicit SoA(TArrayExtents extents, TRecordDim = {}) : Base(extents)
{
}
#endif

LLAMA_FN_HOST_ACC_INLINE
constexpr auto blobSize([[maybe_unused]] size_type blobIndex) const -> size_type
Expand Down

0 comments on commit 9622885

Please sign in to comment.