Skip to content
  • Kenneth Moreland's avatar
    Register Variant as trivially copyable if possible · 5b18ffd7
    Kenneth Moreland authored
    The Variant template can hold any type. If it is holding a type that is
    non-copyable, then it has to make sure that appropriate constructors,
    copiers, movers, and destructors are called.
    
    Previously, these were called even the Variant was holding a trivially
    copyable class because no harm no foul. If you were holding a trivially
    copyable class and did a memcpy, that work work, which should make it
    possible to copy between host and device, right?
    
    In theory yes, but in practice no. The problem is that Cuda is
    outsmarting the code. It is checking that Variant is not trivially-
    copyable by C++ semantics and refusing to push it.
    
    So, change Variant to check to see if all its supported classes are
    trivially copyable. If they are, then it use the default constructors,
    destructors, movers, and copiers so that C++ recognizes it as trivially
    copyable.
    5b18ffd7