Removed trivial copy constructors on parameter classes to enable devi… (#366)
* Removed trivial copy constructors on parameter classes to enable device-side launch of CUTLASS kernels * Added SFINAE to the `TensorRef(NonConstTensorRef const&)` constructor to avoid making it a copy-constructor for device code * std => platform * fix affine2 * really fix affine2 Co-authored-by: Haicheng Wu <haichengw@nvidia.com>
This commit is contained in:
@@ -219,9 +219,12 @@ class TensorRef {
|
||||
}
|
||||
|
||||
/// Converting constructor from TensorRef to non-constant data.
|
||||
template<typename _Magic = int>
|
||||
CUTLASS_HOST_DEVICE
|
||||
TensorRef(
|
||||
NonConstTensorRef const &ref ///< TensorRef to non-const data
|
||||
NonConstTensorRef const &ref, ///< TensorRef to non-const data
|
||||
///SFINAE trick to avoid creating a copy-constructor when Element_ is already non-const
|
||||
_Magic magic = (typename platform::enable_if< ! platform::is_same<NonConstTensorRef, TensorRef<Element_, Layout_> >::value, _Magic>::type)0
|
||||
):
|
||||
ptr_(ref.data()), layout_(ref.layout()) { }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user