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:
HouQiming
2022-02-28 21:34:02 -05:00
committed by GitHub
co-authored by Haicheng Wu
parent e96f00586c
commit 96a11a1ef3
4 changed files with 13 additions and 13 deletions
+4 -1
View File
@@ -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()) { }