CUTLASS
CUDA Templates for Linear Algebra Subroutines and Solvers
platform.h
Go to the documentation of this file.
1 /***************************************************************************************************
2  * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without modification, are permitted
5  * provided that the following conditions are met:
6  * * Redistributions of source code must retain the above copyright notice, this list of
7  * conditions and the following disclaimer.
8  * * Redistributions in binary form must reproduce the above copyright notice, this list of
9  * conditions and the following disclaimer in the documentation and/or other materials
10  * provided with the distribution.
11  * * Neither the name of the NVIDIA CORPORATION nor the names of its contributors may be used
12  * to endorse or promote products derived from this software without specific prior written
13  * permission.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
16  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
20  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
21  * STRICT LIABILITY, OR TOR (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
22  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23  *
24  **************************************************************************************************/
25 
26 #pragma once
27 
94 //-----------------------------------------------------------------------------
95 // Dependencies
96 //-----------------------------------------------------------------------------
97 
98 #include <stdint.h>
99 
100 #if !defined(__CUDACC_RTC__)
101 //-----------------------------------------------------------------------------
102 // Include STL files that platform provides functionality for
103 //-----------------------------------------------------------------------------
104 
105 #include <algorithm> // Minimum/maximum operations
106 #include <cstddef> // nullptr_t
107 #include <functional> // Arithmetic operations
108 #include <utility> // For methods on std::pair
109 #if (!defined(_MSC_VER) && (__cplusplus >= 201103L)) || (defined(_MSC_VER) && (_MS_VER >= 1500))
110 #include <type_traits> // For integral constants, conditional metaprogramming, and type traits
111 #endif
112 
113 #include "cutlass/cutlass.h"
114 
115 #endif
116 
117 //-----------------------------------------------------------------------------
118 // OS
119 //-----------------------------------------------------------------------------
120 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32) && !defined(__CYGWIN__)
121 #define CUTLASS_OS_WINDOWS
122 #endif
123 
124 /******************************************************************************
125  * Macros
126  ******************************************************************************/
127 //-----------------------------------------------------------------------------
128 // Keywords
129 //-----------------------------------------------------------------------------
130 
132 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1900))
133 #ifndef noexcept
134 #define noexcept
135 #endif
136 #ifndef constexpr
137 #define constexpr
138 #endif
139 #endif
140 
142 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1310))
143 #ifndef nullptr
144 #define nullptr 0
145 #endif
146 #endif
147 
149 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1600))
150 #ifndef static_assert
151 #define __platform_cat_(a, b) a##b
152 #define __platform_cat(a, b) __platform_cat_(a, b)
153 #define static_assert(__e, __m) typedef int __platform_cat(AsSeRt, __LINE__)[(__e) ? 1 : -1]
154 #endif
155 #endif
156 
157 //-----------------------------------------------------------------------------
158 // Functions
159 //-----------------------------------------------------------------------------
160 
162 #ifndef __NV_STD_MAX
163 #define __NV_STD_MAX(a, b) (((b) > (a)) ? (b) : (a))
164 #endif
165 
167 #ifndef __NV_STD_MIN
168 #define __NV_STD_MIN(a, b) (((b) < (a)) ? (b) : (a))
169 #endif
170 
171 /******************************************************************************
172  * Re-implementations
173  ******************************************************************************/
174 namespace cutlass {
175 namespace platform {
176 
177 //-----------------------------------------------------------------------------
178 // Minimum/maximum operations <algorithm>
179 //-----------------------------------------------------------------------------
180 
182 template <typename T>
183 CUTLASS_HOST_DEVICE constexpr const T& min(const T& a, const T& b) {
184  return (b < a) ? b : a;
185 }
186 
188 template <typename T>
189 CUTLASS_HOST_DEVICE constexpr const T& max(const T& a, const T& b) {
190  return (a < b) ? b : a;
191 }
192 
193 #if !defined(__CUDACC_RTC__)
194 //-----------------------------------------------------------------------------
195 // Methods on std::pair
196 //-----------------------------------------------------------------------------
197 
198 using std::pair;
199 
200 template <class T1, class T2>
201 CUTLASS_HOST_DEVICE constexpr bool operator==(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
202  return (lhs.first == rhs.first) && (lhs.second == rhs.second);
203 }
204 
205 template <class T1, class T2>
206 CUTLASS_HOST_DEVICE constexpr bool operator!=(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
207  return (lhs.first != rhs.first) && (lhs.second != rhs.second);
208 }
209 
210 template <class T1, class T2>
211 CUTLASS_HOST_DEVICE constexpr bool operator<(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
212  return (lhs.first < rhs.first) ? true : (rhs.first < lhs.first) ? false
213  : (lhs.second < rhs.second);
214 }
215 
216 template <class T1, class T2>
217 CUTLASS_HOST_DEVICE constexpr bool operator<=(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
218  return !(rhs < lhs);
219 }
220 
221 template <class T1, class T2>
222 CUTLASS_HOST_DEVICE constexpr bool operator>(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
223  return (rhs < lhs);
224 }
225 
226 template <class T1, class T2>
227 CUTLASS_HOST_DEVICE constexpr bool operator>=(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
228  return !(lhs < rhs);
229 }
230 
231 template <class T1, class T2>
232 CUTLASS_HOST_DEVICE std::pair<T1, T2> make_pair(T1 t, T2 u) {
233  std::pair<T1, T2> retval;
234  retval.first = t;
235  retval.second = u;
236  return retval;
237 }
238 #endif
239 
240 } // namespace platform
241 
242 /******************************************************************************
243  * Implementations of C++ 11/14/17/... STL features
244  ******************************************************************************/
245 
246 namespace platform {
247 
248 //-----------------------------------------------------------------------------
249 // Integral constant helper types <type_traits>
250 //-----------------------------------------------------------------------------
251 
252 #if defined(__CUDACC_RTC__) || (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1500))
253 
255 template <typename value_t, value_t V>
257 
259 template <typename value_t, value_t V>
260 struct integral_constant {
261  static const value_t value = V;
262 
263  typedef value_t value_type;
265 
266  CUTLASS_HOST_DEVICE operator value_type() const { return value; }
267 
268  CUTLASS_HOST_DEVICE const value_type operator()() const { return value; }
269 };
270 
271 #else
272 
273 using std::integral_constant;
274 using std::pair;
275 
276 #endif
277 
280 
283 
284 #if defined(__CUDACC_RTC__) || (!defined(_MSC_VER) && (__cplusplus <= 201402L)) || (defined(_MSC_VER) && (_MSC_VER < 1900))
285 
287 template <bool V>
289 
290 #else
291 
292 using std::bool_constant;
293 
294 #endif
295 
296 #if defined(__CUDACC_RTC__) || (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1700))
297 
299 struct nullptr_t {};
300 
301 #else
302 
303 using std::nullptr_t;
304 
305 #endif
306 
307 //-----------------------------------------------------------------------------
308 // Conditional metaprogramming <type_traits>
309 //-----------------------------------------------------------------------------
310 
311 #if defined(__CUDACC_RTC__) || (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1600))
312 
314 template <bool C, typename T = void>
315 struct enable_if {
316  typedef T type;
317 };
318 
320 template <typename T>
321 struct enable_if<false, T> {};
322 
324 template <bool B, class T, class F>
325 struct conditional {
326  typedef T type;
327 };
328 
330 template <class T, class F>
331 struct conditional<false, T, F> {
332  typedef F type;
333 };
334 
335 #else
336 
337 using std::enable_if;
338 using std::conditional;
339 
340 #endif
341 
342 //-----------------------------------------------------------------------------
343 // Const/volatility specifiers <type_traits>
344 //-----------------------------------------------------------------------------
345 
346 #if defined(__CUDACC_RTC__) || (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1500))
347 
349 template <typename T>
350 struct remove_const {
351  typedef T type;
352 };
353 
355 template <typename T>
356 struct remove_const<const T> {
357  typedef T type;
358 };
359 
361 template <typename T>
363  typedef T type;
364 };
365 
367 template <typename T>
368 struct remove_volatile<volatile T> {
369  typedef T type;
370 };
371 
373 template <typename T>
374 struct remove_cv {
376 };
377 
378 #else
379 
380 using std::remove_const;
381 using std::remove_volatile;
382 using std::remove_cv;
383 
384 #endif
385 
386 //-----------------------------------------------------------------------------
387 // Type relationships <type_traits>
388 //-----------------------------------------------------------------------------
389 
390 #if defined(__CUDACC_RTC__) || (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1500))
391 
393 template <typename A, typename B>
394 struct is_same : false_type {};
395 
397 template <typename A>
398 struct is_same<A, A> : true_type {};
399 
401 template <typename BaseT, typename DerivedT>
403  typedef char (&yes)[1];
404  typedef char (&no)[2];
405 
406  template <typename B, typename D>
407  struct dummy {
408  CUTLASS_HOST_DEVICE operator B*() const;
409  CUTLASS_HOST_DEVICE operator D*();
410  };
411 
412  template <typename T>
413  CUTLASS_HOST_DEVICE static yes check(DerivedT*, T);
414 
415  CUTLASS_HOST_DEVICE static no check(BaseT*, int);
416 
417  static const bool value = sizeof(check(dummy<BaseT, DerivedT>(), int())) == sizeof(yes);
418 };
419 
421 template <typename BaseT, typename DerivedT>
423  : integral_constant<bool,
424  (is_base_of_helper<typename remove_cv<BaseT>::type,
425  typename remove_cv<DerivedT>::type>::value) ||
426  (is_same<typename remove_cv<BaseT>::type,
427  typename remove_cv<DerivedT>::type>::value)> {};
428 
429 #else
430 
431 using std::is_same;
432 using std::is_base_of;
433 
434 #endif
435 
436 //-----------------------------------------------------------------------------
437 // Type properties <type_traits>
438 //-----------------------------------------------------------------------------
439 
440 #if defined(__CUDACC_RTC__) || (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1500))
441 
443 template <typename T>
444 struct is_volatile : false_type {};
445 template <typename T>
446 struct is_volatile<volatile T> : true_type {};
447 
449 template <typename T>
450 struct is_pointer_helper : false_type {};
451 
453 template <typename T>
454 struct is_pointer_helper<T*> : true_type {};
455 
457 template <typename T>
458 struct is_pointer : is_pointer_helper<typename remove_cv<T>::type> {};
459 
461 template <typename T>
462 struct is_void : is_same<void, typename remove_cv<T>::type> {};
463 
465 template <typename T>
466 struct is_integral : false_type {};
467 template <>
468 struct is_integral<char> : true_type {};
469 template <>
470 struct is_integral<signed char> : true_type {};
471 template <>
472 struct is_integral<unsigned char> : true_type {};
473 template <>
474 struct is_integral<short> : true_type {};
475 template <>
476 struct is_integral<unsigned short> : true_type {};
477 template <>
478 struct is_integral<int> : true_type {};
479 template <>
480 struct is_integral<unsigned int> : true_type {};
481 template <>
482 struct is_integral<long> : true_type {};
483 template <>
484 struct is_integral<unsigned long> : true_type {};
485 template <>
486 struct is_integral<long long> : true_type {};
487 template <>
488 struct is_integral<unsigned long long> : true_type {};
489 template <typename T>
490 struct is_integral<volatile T> : is_integral<T> {};
491 template <typename T>
492 struct is_integral<const T> : is_integral<T> {};
493 template <typename T>
494 struct is_integral<const volatile T> : is_integral<T> {};
495 
497 template <typename T>
499  : integral_constant<bool,
500  (is_same<float, typename remove_cv<T>::type>::value ||
501  is_same<double, typename remove_cv<T>::type>::value)> {};
502 
504 template <typename T>
506  : integral_constant<bool, (is_integral<T>::value || is_floating_point<T>::value)> {};
507 
509 template <typename T>
511  : integral_constant<bool,
512  (is_arithmetic<T>::value || is_void<T>::value ||
513  is_same<nullptr_t, typename remove_cv<T>::type>::value)> {};
514 
515 #else
516 
517 using std::is_volatile;
518 using std::is_pointer;
519 using std::is_void;
520 using std::is_integral;
521 using std::is_floating_point;
522 using std::is_arithmetic;
523 using std::is_fundamental;
524 
525 #endif
526 
527 #if defined(__CUDACC_RTC__) || (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1800)) || \
528  (defined(__GNUG__) && (__GNUC__ < 5))
529 
540 template <typename T>
542  : integral_constant<bool, (is_fundamental<T>::value || is_pointer<T>::value)> {};
543 
544 #else
545 
546 using std::is_trivially_copyable;
547 
548 #endif
549 
550 //-----------------------------------------------------------------------------
551 // Alignment and layout utilities
552 //-----------------------------------------------------------------------------
553 
554 #if defined(__CUDACC_RTC__) || (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1500))
555 
557 template <typename value_t>
558 struct alignment_of {
559  struct pad {
560  value_t val;
561  char byte;
562  };
563 
564  enum { value = sizeof(pad) - sizeof(value_t) };
565 };
566 
567 #else
568 
569 template <typename value_t>
570 struct alignment_of : std::alignment_of<value_t> {};
571 
572 #endif
573 
574 /* 16B specializations where 32-bit Win32 host compiler disagrees with device compiler */
575 template <>
576 struct alignment_of<int4> {
577  enum { value = 16 };
578 };
579 template <>
580 struct alignment_of<uint4> {
581  enum { value = 16 };
582 };
583 template <>
584 struct alignment_of<float4> {
585  enum { value = 16 };
586 };
587 template <>
588 struct alignment_of<long4> {
589  enum { value = 16 };
590 };
591 template <>
592 struct alignment_of<ulong4> {
593  enum { value = 16 };
594 };
595 template <>
596 struct alignment_of<longlong2> {
597  enum { value = 16 };
598 };
599 template <>
600 struct alignment_of<ulonglong2> {
601  enum { value = 16 };
602 };
603 template <>
604 struct alignment_of<double2> {
605  enum { value = 16 };
606 };
607 template <>
608 struct alignment_of<longlong4> {
609  enum { value = 16 };
610 };
611 template <>
612 struct alignment_of<ulonglong4> {
613  enum { value = 16 };
614 };
615 template <>
616 struct alignment_of<double4> {
617  enum { value = 16 };
618 };
619 
620 // Specializations for volatile/const qualified types
621 template <typename value_t>
622 struct alignment_of<volatile value_t> : alignment_of<value_t> {};
623 template <typename value_t>
624 struct alignment_of<const value_t> : alignment_of<value_t> {};
625 template <typename value_t>
626 struct alignment_of<const volatile value_t> : alignment_of<value_t> {};
627 
628 #if defined(__CUDACC_RTC__) || (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1800))
629 
630 template <size_t Align>
632 template <>
633 struct __align__(1) aligned_chunk<1> {
634  uint8_t buff;
635 };
636 template <>
637 struct __align__(2) aligned_chunk<2> {
638  uint16_t buff;
639 };
640 template <>
641 struct __align__(4) aligned_chunk<4> {
642  uint32_t buff;
643 };
644 template <>
645 struct __align__(8) aligned_chunk<8> {
646  uint32_t buff[2];
647 };
648 template <>
649 struct __align__(16) aligned_chunk<16> {
650  uint32_t buff[4];
651 };
652 template <>
653 struct __align__(32) aligned_chunk<32> {
654  uint32_t buff[8];
655 };
656 template <>
657 struct __align__(64) aligned_chunk<64> {
658  uint32_t buff[16];
659 };
660 template <>
661 struct __align__(128) aligned_chunk<128> {
662  uint32_t buff[32];
663 };
664 template <>
665 struct __align__(256) aligned_chunk<256> {
666  uint32_t buff[64];
667 };
668 template <>
669 struct __align__(512) aligned_chunk<512> {
670  uint32_t buff[128];
671 };
672 template <>
673 struct __align__(1024) aligned_chunk<1024> {
674  uint32_t buff[256];
675 };
676 template <>
677 struct __align__(2048) aligned_chunk<2048> {
678  uint32_t buff[512];
679 };
680 template <>
681 struct __align__(4096) aligned_chunk<4096> {
682  uint32_t buff[1024];
683 };
684 
686 template <size_t Len, size_t Align>
688  typedef aligned_chunk<Align> type[Len / sizeof(aligned_chunk<Align>)];
689 };
690 
691 #else
692 
693 using std::aligned_storage;
694 
695 #endif
696 
697 #if !defined(__CUDACC_RTC__)
698 template <typename T>
701  void operator()(T* ptr) const { delete ptr; }
702 };
703 
705 template <typename T>
706 struct default_delete<T[]> {
707  void operator()(T* ptr) const { delete[] ptr; }
708 };
709 
711 template <class T, class Deleter = default_delete<T> >
712 class unique_ptr {
713  public:
714  typedef T* pointer;
715  typedef T element_type;
716  typedef Deleter deleter_type;
717 
718  private:
720  pointer _ptr;
721 
723  deleter_type _deleter;
724 
725  public:
726  unique_ptr() : _ptr(nullptr) {}
727  unique_ptr(pointer p) : _ptr(p) {}
728 
730  if (_ptr) {
731  _deleter(_ptr);
732  }
733  }
735  pointer get() const noexcept { return _ptr; }
736 
738  pointer release() noexcept {
739  pointer p(_ptr);
740  _ptr = nullptr;
741  return p;
742  }
743 
745  void reset(pointer p = pointer()) noexcept {
746  pointer old_ptr = _ptr;
747  _ptr = p;
748  if (old_ptr != nullptr) {
749  get_deleter()(old_ptr);
750  }
751  }
752 
754  void swap(unique_ptr& other) noexcept { std::swap(_ptr, other._ptr); }
755 
757  Deleter& get_deleter() noexcept { return _deleter; }
758 
760  Deleter const& get_deleter() const noexcept { return _deleter; }
761 
763  operator bool() const noexcept { return _ptr != nullptr; }
764 
766  T& operator*() const { return *_ptr; }
767 
769  pointer operator->() const noexcept { return _ptr; }
770 
772  T& operator[](size_t i) const { return _ptr[i]; }
773 };
774 
776 template <typename T, typename Deleter>
778  lhs.swap(rhs);
779 }
780 #endif
781 
782 } // namespace platform
783 } // namespace cutlass
T & operator[](size_t i) const
Array access to managed object.
Definition: platform.h:772
CUTLASS_HOST_DEVICE constexpr const T & max(const T &a, const T &b)
std::max
Definition: platform.h:189
Definition: aligned_buffer.h:35
#define constexpr
Definition: platform.h:137
std::nullptr_t
Definition: platform.h:299
void swap(unique_ptr< T, Deleter > &lhs, unique_ptr< T, Deleter > &rhs) noexcept
Specializes the swap algorithm.
Definition: platform.h:777
Helper for std::is_pointer (false specialization)
Definition: platform.h:450
Deleter deleter_type
Definition: platform.h:716
T type
Definition: platform.h:351
value_t val
Definition: platform.h:560
T type
Definition: platform.h:326
T * pointer
Definition: platform.h:714
std::is_same (false specialization)
Definition: platform.h:394
std::is_pointer
Definition: platform.h:458
value_t value_type
Definition: platform.h:263
CUTLASS_HOST_DEVICE std::pair< T1, T2 > make_pair(T1 t, T2 u)
Definition: platform.h:232
unique_ptr()
Definition: platform.h:726
void operator()(T *ptr) const
Definition: platform.h:707
CUTLASS_HOST_DEVICE constexpr bool operator==(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: platform.h:201
std::is_void
Definition: platform.h:462
CUTLASS_HOST_DEVICE constexpr bool operator>=(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: platform.h:227
pointer operator->() const noexcept
Returns a pointer to the managed object.
Definition: platform.h:769
CUTLASS_HOST_DEVICE constexpr bool operator>(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: platform.h:222
Default deleter.
Definition: platform.h:700
CUTLASS_HOST_DEVICE constexpr bool operator!=(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: platform.h:206
std::unique_ptr
Definition: platform.h:712
Definition: platform.h:559
std::is_floating_point
Definition: platform.h:498
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
Definition: platform.h:282
Deleter const & get_deleter() const noexcept
Returns the deleter object.
Definition: platform.h:760
std::remove_cv
Definition: platform.h:374
~unique_ptr()
Definition: platform.h:729
struct __align__(1) aligned_chunk< 1 >
Definition: platform.h:633
T type
Definition: platform.h:357
T type
Definition: platform.h:363
std::is_integral
Definition: platform.h:466
integral_constant< value_t, V > type
Definition: platform.h:264
std::is_arithmetic
Definition: platform.h:505
char byte
Definition: platform.h:561
std::integral_constant
Definition: platform.h:256
std::is_base_of
Definition: platform.h:422
T type
Definition: platform.h:316
#define nullptr
nullptr
Definition: platform.h:144
std::is_volatile
Definition: platform.h:444
std::is_fundamental
Definition: platform.h:510
T & operator*() const
Dereferences the unique_ptr.
Definition: platform.h:766
std::enable_if (true specialization)
Definition: platform.h:315
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
Definition: platform.h:279
#define CUTLASS_HOST_DEVICE
Definition: cutlass.h:89
T element_type
Definition: platform.h:715
Deleter & get_deleter() noexcept
Returns the deleter object.
Definition: platform.h:757
std::alignment_of
Definition: platform.h:558
CUTLASS_HOST_DEVICE constexpr const T & min(const T &a, const T &b)
std::min
Definition: platform.h:183
remove_volatile< typename remove_const< T >::type >::type type
Definition: platform.h:375
std::conditional (true specialization)
Definition: platform.h:325
#define noexcept
noexcept, constexpr
Definition: platform.h:134
void reset(pointer p=pointer()) noexcept
Replaces the managed object, deleting the old object.
Definition: platform.h:745
CUTLASS_HOST_DEVICE const value_type operator()() const
Definition: platform.h:268
Helper for std::is_base_of.
Definition: platform.h:402
std::remove_const (non-const specialization)
Definition: platform.h:350
Definition: platform.h:631
void swap(unique_ptr &other) noexcept
Swaps the managed objects with *this and another unique_ptr.
Definition: platform.h:754
void operator()(T *ptr) const
Definition: platform.h:701
std::aligned_storage
Definition: platform.h:687
std::remove_volatile (non-volatile specialization)
Definition: platform.h:362
unique_ptr(pointer p)
Definition: platform.h:727
pointer release() noexcept
Releases ownership of the managed object, if any.
Definition: platform.h:738
Basic include for CUTLASS.
std::bool_constant
Definition: platform.h:288