Commit 7b30d1c9 authored by Po-Yen, Chen's avatar Po-Yen, Chen
Browse files

Merge branch 'feature/fix-descriptor-attr-not-copied' into feature/integrage-karg-simplification-pr

parents 6570ef7a ce20fe06
......@@ -383,6 +383,8 @@ template <typename UpLengths,
typename enable_if<UpLengths::Size() == Coefficients::Size(), bool>::type = false>
struct Embed
{
static_assert(!std::is_reference_v<UpLengths> && !std::is_reference_v<Coefficients>);
static constexpr index_t NDimUp = UpLengths::Size();
using LowerIndex = MultiIndex<1>;
......@@ -393,8 +395,13 @@ struct Embed
__host__ __device__ constexpr Embed() = default;
__host__ constexpr Embed(const UpLengths& up_lengths, const Coefficients& coefficients)
: up_lengths_{up_lengths}, coefficients_{coefficients}
{
}
/// NOTE: force copying here to prevent uninitialized data members (on device side)
__host__ __device__ constexpr Embed(UpLengths up_lengths, Coefficients coefficients)
__device__ constexpr Embed(UpLengths up_lengths, Coefficients coefficients)
: up_lengths_{std::move(up_lengths)}, coefficients_{std::move(coefficients)}
{
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment