Cutlass
CUDA Templates for Linear Algebra Subroutines and Solvers
nv_std.h
Go to the documentation of this file.
1 /***************************************************************************************************
2  * Copyright (c) 2017-2018, 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 nv_std 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  * Macros
118  ******************************************************************************/
119 //-----------------------------------------------------------------------------
120 // Keywords
121 //-----------------------------------------------------------------------------
122 
124 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1900))
125 #ifndef noexcept
126 #define noexcept
127 #endif
128 #ifndef constexpr
129 #define constexpr
130 #endif
131 #endif
132 
134 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1310))
135 #ifndef nullptr
136 #define nullptr 0
137 #endif
138 #endif
139 
141 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1600))
142 #ifndef static_assert
143 #define __nv_std_cat_(a, b) a##b
144 #define __nv_std_cat(a, b) __nv_std_cat_(a, b)
145 #define static_assert(__e, __m) typedef int __nv_std_cat(AsSeRt, __LINE__)[(__e) ? 1 : -1]
146 #endif
147 #endif
148 
149 //-----------------------------------------------------------------------------
150 // Functions
151 //-----------------------------------------------------------------------------
152 
154 #ifndef __NV_STD_MAX
155 #define __NV_STD_MAX(a, b) (((b) > (a)) ? (b) : (a))
156 #endif
157 
159 #ifndef __NV_STD_MIN
160 #define __NV_STD_MIN(a, b) (((b) < (a)) ? (b) : (a))
161 #endif
162 
163 /******************************************************************************
164  * Re-implementations
165  ******************************************************************************/
166 
167 namespace nv_std {
168 
169 //-----------------------------------------------------------------------------
170 // Arithmetic operations, comparisons <functional>
171 //-----------------------------------------------------------------------------
172 
174 template <typename T>
175 struct plus {
176  CUTLASS_HOST_DEVICE constexpr T operator()(const T& lhs, const T& rhs) const { return lhs + rhs; }
177 };
178 
180 template <typename T>
181 struct less {
182  CUTLASS_HOST_DEVICE constexpr bool operator()(const T& lhs, const T& rhs) const {
183  return lhs < rhs;
184  }
185 };
186 
188 template <typename T>
189 struct greater {
190  CUTLASS_HOST_DEVICE constexpr bool operator()(const T& lhs, const T& rhs) const {
191  return lhs > rhs;
192  }
193 };
194 
195 //-----------------------------------------------------------------------------
196 // Minimum/maximum operations <algorithm>
197 //-----------------------------------------------------------------------------
198 
200 template <typename T>
201 CUTLASS_HOST_DEVICE constexpr const T& min(const T& a, const T& b) {
202  return (b < a) ? b : a;
203 }
204 
206 template <typename T>
207 CUTLASS_HOST_DEVICE constexpr const T& max(const T& a, const T& b) {
208  return (a < b) ? b : a;
209 }
210 
211 #if !defined(__CUDACC_RTC__)
212 //-----------------------------------------------------------------------------
213 // Methods on std::pair
214 //-----------------------------------------------------------------------------
215 
216 using std::pair;
217 
218 template <class T1, class T2>
219 CUTLASS_HOST_DEVICE constexpr bool operator==(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
220  return (lhs.first == rhs.first) && (lhs.second == rhs.second);
221 }
222 
223 template <class T1, class T2>
224 CUTLASS_HOST_DEVICE constexpr bool operator!=(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
225  return (lhs.first != rhs.first) && (lhs.second != rhs.second);
226 }
227 
228 template <class T1, class T2>
229 CUTLASS_HOST_DEVICE constexpr bool operator<(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
230  return (lhs.first < rhs.first) ? true : (rhs.first < lhs.first) ? false
231  : (lhs.second < rhs.second);
232 }
233 
234 template <class T1, class T2>
235 CUTLASS_HOST_DEVICE constexpr bool operator<=(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
236  return !(rhs < lhs);
237 }
238 
239 template <class T1, class T2>
240 CUTLASS_HOST_DEVICE constexpr bool operator>(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
241  return (rhs < lhs);
242 }
243 
244 template <class T1, class T2>
245 CUTLASS_HOST_DEVICE constexpr bool operator>=(const pair<T1, T2>& lhs, const pair<T1, T2>& rhs) {
246  return !(lhs < rhs);
247 }
248 
249 template <class T1, class T2>
250 CUTLASS_HOST_DEVICE std::pair<T1, T2> make_pair(T1 t, T2 u) {
251  std::pair<T1, T2> retval;
252  retval.first = t;
253  retval.second = u;
254  return retval;
255 }
256 #endif
257 
258 } // namespace nv_std
259 
260 /******************************************************************************
261  * Implementations of C++ 11/14/17/... STL features
262  ******************************************************************************/
263 
264 namespace nv_std {
265 
266 //-----------------------------------------------------------------------------
267 // Integral constant helper types <type_traits>
268 //-----------------------------------------------------------------------------
269 
270 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1500))
271 
273 template <typename value_t, value_t V>
275 
277 template <typename value_t, value_t V>
278 struct integral_constant {
279  static const value_t value = V;
280 
281  typedef value_t value_type;
283 
284  CUTLASS_HOST_DEVICE operator value_type() const { return value; }
285 
286  CUTLASS_HOST_DEVICE const value_type operator()() const { return value; }
287 };
288 
289 #else
290 
291 using std::integral_constant;
292 using std::pair;
293 
294 #endif
295 
298 
301 
302 #if (!defined(_MSC_VER) && (__cplusplus < 201402L)) || (defined(_MSC_VER) && (_MSC_VER < 1900))
303 
305 template <bool V>
307 
308 #else
309 
310 using std::bool_constant;
311 
312 #endif
313 
314 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1700))
315 
317 struct nullptr_t {};
318 
319 #else
320 
321 using std::nullptr_t;
322 
323 #endif
324 
325 //-----------------------------------------------------------------------------
326 // Conditional metaprogramming <type_traits>
327 //-----------------------------------------------------------------------------
328 
329 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1600))
330 
332 template <bool C, typename T = void>
333 struct enable_if {
334  typedef T type;
335 };
336 
338 template <typename T>
339 struct enable_if<false, T> {};
340 
342 template <bool B, class T, class F>
343 struct conditional {
344  typedef T type;
345 };
346 
348 template <class T, class F>
349 struct conditional<false, T, F> {
350  typedef F type;
351 };
352 
353 #else
354 
355 using std::enable_if;
356 using std::conditional;
357 
358 #endif
359 
360 //-----------------------------------------------------------------------------
361 // Const/volatility specifiers <type_traits>
362 //-----------------------------------------------------------------------------
363 
364 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1500))
365 
367 template <typename T>
368 struct remove_const {
369  typedef T type;
370 };
371 
373 template <typename T>
374 struct remove_const<const T> {
375  typedef T type;
376 };
377 
379 template <typename T>
381  typedef T type;
382 };
383 
385 template <typename T>
386 struct remove_volatile<volatile T> {
387  typedef T type;
388 };
389 
391 template <typename T>
392 struct remove_cv {
394 };
395 
396 #else
397 
398 using std::remove_const;
399 using std::remove_volatile;
400 using std::remove_cv;
401 
402 #endif
403 
404 //-----------------------------------------------------------------------------
405 // Type relationships <type_traits>
406 //-----------------------------------------------------------------------------
407 
408 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1500))
409 
411 template <typename A, typename B>
412 struct is_same : false_type {};
413 
415 template <typename A>
416 struct is_same<A, A> : true_type {};
417 
419 template <typename BaseT, typename DerivedT>
421  typedef char (&yes)[1];
422  typedef char (&no)[2];
423 
424  template <typename B, typename D>
425  struct dummy {
426  CUTLASS_HOST_DEVICE operator B*() const;
427  CUTLASS_HOST_DEVICE operator D*();
428  };
429 
430  template <typename T>
431  CUTLASS_HOST_DEVICE static yes check(DerivedT*, T);
432 
433  CUTLASS_HOST_DEVICE static no check(BaseT*, int);
434 
435  static const bool value = sizeof(check(dummy<BaseT, DerivedT>(), int())) == sizeof(yes);
436 };
437 
439 template <typename BaseT, typename DerivedT>
441  : integral_constant<bool, (is_base_of_helper<typename remove_cv<BaseT>::type,
442  typename remove_cv<DerivedT>::type>::value) ||
443  (is_same<typename remove_cv<BaseT>::type,
444  typename remove_cv<DerivedT>::type>::value)> {};
445 
446 #else
447 
448 using std::is_same;
449 using std::is_base_of;
450 
451 #endif
452 
453 //-----------------------------------------------------------------------------
454 // Type properties <type_traits>
455 //-----------------------------------------------------------------------------
456 
457 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1500))
458 
460 template <typename T>
462 template <typename T>
463 struct is_volatile<volatile T> : true_type {};
464 
466 template <typename T>
468 
470 template <typename T>
471 struct is_pointer_helper<T*> : true_type {};
472 
474 template <typename T>
475 struct is_pointer : is_pointer_helper<typename remove_cv<T>::type> {};
476 
478 template <typename T>
479 struct is_void : is_same<void, typename remove_cv<T>::type> {};
480 
482 template <typename T>
484 template <>
485 struct is_integral<char> : true_type {};
486 template <>
487 struct is_integral<signed char> : true_type {};
488 template <>
489 struct is_integral<unsigned char> : true_type {};
490 template <>
491 struct is_integral<short> : true_type {};
492 template <>
493 struct is_integral<unsigned short> : true_type {};
494 template <>
495 struct is_integral<int> : true_type {};
496 template <>
497 struct is_integral<unsigned int> : true_type {};
498 template <>
499 struct is_integral<long> : true_type {};
500 template <>
501 struct is_integral<unsigned long> : true_type {};
502 template <>
503 struct is_integral<long long> : true_type {};
504 template <>
505 struct is_integral<unsigned long long> : true_type {};
506 template <typename T>
507 struct is_integral<volatile T> : is_integral<T> {};
508 template <typename T>
509 struct is_integral<const T> : is_integral<T> {};
510 template <typename T>
511 struct is_integral<const volatile T> : is_integral<T> {};
512 
514 template <typename T>
516  : integral_constant<bool, (is_same<float, typename remove_cv<T>::type>::value ||
517  is_same<double, typename remove_cv<T>::type>::value)> {};
518 
520 template <typename T>
522  : integral_constant<bool, (is_integral<T>::value || is_floating_point<T>::value)> {};
523 
525 template <typename T>
527  : integral_constant<bool, (is_arithmetic<T>::value || is_void<T>::value ||
528  is_same<nullptr_t, typename remove_cv<T>::type>::value)> {};
529 
530 #else
531 
532 using std::is_volatile;
533 using std::is_pointer;
534 using std::is_void;
535 using std::is_integral;
536 using std::is_floating_point;
537 using std::is_arithmetic;
538 using std::is_fundamental;
539 
540 #endif
541 
542 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1800)) || \
543  (defined(__GNUG__) && (__GNUC__ < 5))
544 
555 template <typename T>
557  : integral_constant<bool, (is_fundamental<T>::value || is_pointer<T>::value)> {};
558 
559 #else
560 
561 using std::is_trivially_copyable;
562 
563 #endif
564 
565 //-----------------------------------------------------------------------------
566 // Alignment and layout utilities
567 //-----------------------------------------------------------------------------
568 
569 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1500))
570 
572 template <typename value_t>
573 struct alignment_of {
574  struct pad {
575  value_t val;
576  char byte;
577  };
578 
579  enum { value = sizeof(pad) - sizeof(value_t) };
580 };
581 
582 #else
583 
584 template <typename value_t>
585 struct alignment_of : std::alignment_of<value_t> {};
586 
587 #endif
588 
589 /* 16B specializations where 32-bit Win32 host compiler disagrees with device compiler */
590 template <>
591 struct alignment_of<int4> {
592  enum { value = 16 };
593 };
594 template <>
595 struct alignment_of<uint4> {
596  enum { value = 16 };
597 };
598 template <>
599 struct alignment_of<float4> {
600  enum { value = 16 };
601 };
602 template <>
603 struct alignment_of<long4> {
604  enum { value = 16 };
605 };
606 template <>
607 struct alignment_of<ulong4> {
608  enum { value = 16 };
609 };
610 template <>
611 struct alignment_of<longlong2> {
612  enum { value = 16 };
613 };
614 template <>
615 struct alignment_of<ulonglong2> {
616  enum { value = 16 };
617 };
618 template <>
619 struct alignment_of<double2> {
620  enum { value = 16 };
621 };
622 template <>
623 struct alignment_of<longlong4> {
624  enum { value = 16 };
625 };
626 template <>
627 struct alignment_of<ulonglong4> {
628  enum { value = 16 };
629 };
630 template <>
631 struct alignment_of<double4> {
632  enum { value = 16 };
633 };
634 
635 // Specializations for volatile/const qualified types
636 template <typename value_t>
637 struct alignment_of<volatile value_t> : alignment_of<value_t> {};
638 template <typename value_t>
639 struct alignment_of<const value_t> : alignment_of<value_t> {};
640 template <typename value_t>
641 struct alignment_of<const volatile value_t> : alignment_of<value_t> {};
642 
643 #if (!defined(_MSC_VER) && (__cplusplus < 201103L)) || (defined(_MSC_VER) && (_MSC_VER < 1800))
644 
645 template <size_t Align>
647 template <>
648 struct __align__(1) aligned_chunk<1> {
649  uint8_t buff;
650 };
651 template <>
652 struct __align__(2) aligned_chunk<2> {
653  uint16_t buff;
654 };
655 template <>
656 struct __align__(4) aligned_chunk<4> {
657  uint32_t buff;
658 };
659 template <>
660 struct __align__(8) aligned_chunk<8> {
661  uint32_t buff[2];
662 };
663 template <>
664 struct __align__(16) aligned_chunk<16> {
665  uint32_t buff[4];
666 };
667 template <>
668 struct __align__(32) aligned_chunk<32> {
669  uint32_t buff[8];
670 };
671 template <>
672 struct __align__(64) aligned_chunk<64> {
673  uint32_t buff[16];
674 };
675 template <>
676 struct __align__(128) aligned_chunk<128> {
677  uint32_t buff[32];
678 };
679 template <>
680 struct __align__(256) aligned_chunk<256> {
681  uint32_t buff[64];
682 };
683 template <>
684 struct __align__(512) aligned_chunk<512> {
685  uint32_t buff[128];
686 };
687 template <>
688 struct __align__(1024) aligned_chunk<1024> {
689  uint32_t buff[256];
690 };
691 template <>
692 struct __align__(2048) aligned_chunk<2048> {
693  uint32_t buff[512];
694 };
695 template <>
696 struct __align__(4096) aligned_chunk<4096> {
697  uint32_t buff[1024];
698 };
699 
701 template <size_t Len, size_t Align>
704 };
705 
706 #else
707 
708 using std::aligned_storage;
709 
710 #endif
711 
712 #if !defined(__CUDACC_RTC__)
713 template <typename T>
716  void operator()(T* ptr) const { delete ptr; }
717 };
718 
720 template <typename T>
721 struct default_delete<T[]> {
722  void operator()(T* ptr) const { delete[] ptr; }
723 };
724 
726 template <class T, class Deleter = nv_std::default_delete<T> >
727 class unique_ptr {
728  public:
729  typedef T* pointer;
730  typedef T element_type;
731  typedef Deleter deleter_type;
732 
733  private:
735  pointer _ptr;
736 
738  deleter_type _deleter;
739 
740  public:
741  unique_ptr() : _ptr(nullptr) {}
742  unique_ptr(pointer p) : _ptr(p) {}
743 
745  if (_ptr) {
746  _deleter(_ptr);
747  }
748  }
750  pointer get() const noexcept { return _ptr; }
751 
754  pointer p(_ptr);
755  _ptr = nullptr;
756  return p;
757  }
758 
761  pointer old_ptr = _ptr;
762  _ptr = p;
763  if (old_ptr != nullptr) {
764  get_deleter()(old_ptr);
765  }
766  }
767 
769  void swap(unique_ptr& other) noexcept { std::swap(_ptr, other._ptr); }
770 
772  Deleter& get_deleter() noexcept { return _deleter; }
773 
775  Deleter const& get_deleter() const noexcept { return _deleter; }
776 
778  operator bool() const noexcept { return _ptr != nullptr; }
779 
781  T& operator*() const { return *_ptr; }
782 
784  pointer operator->() const noexcept { return _ptr; }
785 
787  T& operator[](size_t i) const { return _ptr[i]; }
788 };
789 
791 template <typename T, typename Deleter>
793  lhs.swap(rhs);
794 }
795 #endif
796 
797 }; // namespace nv_std
std::unique_ptr
Definition: nv_std.h:727
Definition: nv_std.h:574
void reset(pointer p=pointer()) noexcept
Replaces the managed object, deleting the old object.
Definition: nv_std.h:760
static const bool value
Definition: nv_std.h:435
CUTLASS_HOST_DEVICE constexpr bool operator>(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: nv_std.h:240
std::conditional (true specialization)
Definition: nv_std.h:343
T type
Definition: nv_std.h:344
value_t value_type
Definition: nv_std.h:281
Deleter & get_deleter() noexcept
Returns the deleter object.
Definition: nv_std.h:772
pointer release() noexcept
Releases ownership of the managed object, if any.
Definition: nv_std.h:753
T type
Definition: nv_std.h:334
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
Definition: nv_std.h:300
std::is_pointer
Definition: nv_std.h:475
pointer operator->() const noexcept
Returns a pointer to the managed object.
Definition: nv_std.h:784
std::alignment_of
Definition: nv_std.h:573
Definition: nv_std.h:556
integral_constant< value_t, V > type
Definition: nv_std.h:282
char byte
Definition: nv_std.h:576
Definition: nv_std.h:579
Helper for std::is_pointer (false specialization)
Definition: nv_std.h:467
T & operator[](size_t i) const
Array access to managed object.
Definition: nv_std.h:787
char(& no)[2]
Definition: nv_std.h:422
std::less
Definition: nv_std.h:181
Deleter deleter_type
Definition: nv_std.h:731
value_t val
Definition: nv_std.h:575
#define constexpr
Definition: nv_std.h:129
std::remove_volatile (non-volatile specialization)
Definition: nv_std.h:380
static const value_t value
Definition: nv_std.h:279
CUTLASS_HOST_DEVICE constexpr bool operator==(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: nv_std.h:219
std::remove_cv
Definition: nv_std.h:392
std::is_base_of
Definition: nv_std.h:440
CUTLASS_HOST_DEVICE std::pair< T1, T2 > make_pair(T1 t, T2 u)
Definition: nv_std.h:250
std::integral_constant
Definition: nv_std.h:274
struct __align__(1) aligned_chunk< 1 >
Definition: nv_std.h:648
void operator()(T *ptr) const
Definition: nv_std.h:716
void swap(unique_ptr &other) noexcept
Swaps the managed objects with *this and another unique_ptr.
Definition: nv_std.h:769
std::remove_const (non-const specialization)
Definition: nv_std.h:368
CUTLASS_HOST_DEVICE constexpr const T & max(const T &a, const T &b)
std::max
Definition: nv_std.h:207
Definition: nv_std.h:167
char(& yes)[1]
Definition: nv_std.h:421
T type
Definition: nv_std.h:381
CUTLASS_HOST_DEVICE constexpr bool operator!=(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: nv_std.h:224
std::is_volatile
Definition: nv_std.h:461
T element_type
Definition: nv_std.h:730
nv_std::plus
Definition: nv_std.h:175
std::is_same (false specialization)
Definition: nv_std.h:412
Default deleter.
Definition: nv_std.h:715
T * pointer
Definition: nv_std.h:729
Deleter const & get_deleter() const noexcept
Returns the deleter object.
Definition: nv_std.h:775
std::is_integral
Definition: nv_std.h:483
Helper for std::is_base_of.
Definition: nv_std.h:420
std::is_fundamental
Definition: nv_std.h:526
void swap(unique_ptr< T, Deleter > &lhs, unique_ptr< T, Deleter > &rhs) noexcept
Specializes the swap algorithm.
Definition: nv_std.h:792
Definition: nv_std.h:425
CUTLASS_HOST_DEVICE const value_type operator()() const
Definition: nv_std.h:286
#define CUTLASS_HOST_DEVICE
Definition: cutlass.h:46
#define noexcept
noexcept, constexpr
Definition: nv_std.h:126
std::enable_if (true specialization)
Definition: nv_std.h:333
Definition: nv_std.h:646
unique_ptr()
Definition: nv_std.h:741
std::greater
Definition: nv_std.h:189
std::is_floating_point
Definition: nv_std.h:515
#define nullptr
nullptr
Definition: nv_std.h:136
CUTLASS_HOST_DEVICE constexpr const T & min(const T &a, const T &b)
std::min
Definition: nv_std.h:201
CUTLASS_HOST_DEVICE constexpr bool operator()(const T &lhs, const T &rhs) const
Definition: nv_std.h:190
aligned_chunk< Align > type[Len/sizeof(aligned_chunk< Align >)]
Definition: nv_std.h:703
std::nullptr_t
Definition: nv_std.h:317
CUTLASS_HOST_DEVICE constexpr bool operator()(const T &lhs, const T &rhs) const
Definition: nv_std.h:182
unique_ptr(pointer p)
Definition: nv_std.h:742
std::aligned_storage
Definition: nv_std.h:702
remove_volatile< typename remove_const< T >::type >::type type
Definition: nv_std.h:393
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
Definition: nv_std.h:297
T & operator*() const
Dereferences the unique_ptr.
Definition: nv_std.h:781
std::bool_constant
Definition: nv_std.h:306
std::is_void
Definition: nv_std.h:479
F type
Definition: nv_std.h:350
static CUTLASS_HOST_DEVICE yes check(DerivedT *, T)
T type
Definition: nv_std.h:369
CUTLASS_HOST_DEVICE constexpr T operator()(const T &lhs, const T &rhs) const
Definition: nv_std.h:176
T type
Definition: nv_std.h:375
Basic include for CUTLASS macros.
T type
Definition: nv_std.h:387
void operator()(T *ptr) const
Definition: nv_std.h:722
CUTLASS_HOST_DEVICE constexpr bool operator>=(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: nv_std.h:245
~unique_ptr()
Definition: nv_std.h:744
std::is_arithmetic
Definition: nv_std.h:521