| 227 | /// Converting constructor from TensorRef to non-constant data. |
| 228 | template<typename _Magic = int> |
| 229 | CUTLASS_HOST_DEVICE |
| 230 | TensorRef( |
| 231 | NonConstTensorRef const &ref, ///< TensorRef to non-const data |
| 232 | ///SFINAE trick to avoid creating a copy-constructor when Element_ is already non-const |
| 233 | _Magic magic = (typename platform::enable_if< ! platform::is_same<NonConstTensorRef, TensorRef<Element_, Layout_> >::value, _Magic>::type)0 |
| 234 | ): |
| 235 | ptr_(ref.data()), layout_(ref.layout()) { } |
| 236 | |
| 237 | /// Returns a reference to constant-valued tensor. |
| 238 | CUTLASS_HOST_DEVICE |
| 239 | ConstTensorRef const_ref() const { |
| 240 | return ConstTensorRef(ptr_, layout_); |
| 241 | } |
| 242 | |
| 243 | CUTLASS_HOST_DEVICE |
| 244 | NonConstTensorRef non_const_ref() const { |