Commit 3ab2821d authored by Po-Yen, Chen's avatar Po-Yen, Chen
Browse files

Make new 'Embed' ctor only available for device code

parent 18495464
......@@ -393,8 +393,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