Commit 468ffbd6 authored by Po-Yen, Chen's avatar Po-Yen, Chen
Browse files

Undo changes on Embed

parent 59c5d989
...@@ -383,8 +383,6 @@ template <typename UpLengths, ...@@ -383,8 +383,6 @@ template <typename UpLengths,
typename enable_if<UpLengths::Size() == Coefficients::Size(), bool>::type = false> typename enable_if<UpLengths::Size() == Coefficients::Size(), bool>::type = false>
struct Embed struct Embed
{ {
static_assert(!std::is_reference_v<UpLengths> && !std::is_reference_v<Coefficients>);
static constexpr index_t NDimUp = UpLengths::Size(); static constexpr index_t NDimUp = UpLengths::Size();
using LowerIndex = MultiIndex<1>; using LowerIndex = MultiIndex<1>;
...@@ -395,17 +393,12 @@ struct Embed ...@@ -395,17 +393,12 @@ struct Embed
__host__ __device__ constexpr Embed() = default; __host__ __device__ constexpr Embed() = default;
__host__ constexpr Embed(const UpLengths& up_lengths, const Coefficients& coefficients) __host__ __device__ constexpr Embed(const UpLengths& up_lengths,
const Coefficients& coefficients)
: up_lengths_{up_lengths}, coefficients_{coefficients} : up_lengths_{up_lengths}, coefficients_{coefficients}
{ {
} }
/// NOTE: force copying here to prevent uninitialized data members (on device side)
__device__ constexpr Embed(UpLengths up_lengths, Coefficients coefficients)
: up_lengths_{std::move(up_lengths)}, coefficients_{std::move(coefficients)}
{
}
__host__ __device__ static constexpr index_t GetNumOfLowerDimension() { return 1; } __host__ __device__ static constexpr index_t GetNumOfLowerDimension() { return 1; }
__host__ __device__ static constexpr index_t GetNumOfUpperDimension() { return NDimUp; } __host__ __device__ static constexpr index_t GetNumOfUpperDimension() { return NDimUp; }
......
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