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>
274 struct integral_constant;
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;
282 typedef integral_constant<value_t, V> 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
297 typedef integral_constant<bool, true> true_type;
298
300 typedef integral_constant<bool, false> false_type;
301
302 #if (!defined(_MSC_VER) && (__cplusplus < 201402L)) || (defined(_MSC_VER) && (_MSC_VER < 1900))
303
305 template <bool V>
306 struct bool_constant : nv_std::integral_constant<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>
380 struct remove_volatile {
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 {
393 typedef typename remove_volatile<typename remove_const<T>::type>::type type;
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>
420 struct is_base_of_helper {
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>
440 struct is_base_of
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>
461 struct is_volatile : false_type {};
462 template <typename T>
463 struct is_volatile<volatile T> : true_type {};
464
466 template <typename T>
467 struct is_pointer_helper : false_type {};
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>
483 struct is_integral : false_type {};
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>
515 struct is_floating_point
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>
521 struct is_arithmetic
522 : integral_constant<bool, (is_integral<T>::value || is_floating_point<T>::value)> {};
523
525 template <typename T>
526 struct is_fundamental
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>
556 struct is_trivially_copyable
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>
646 struct aligned_chunk;
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>
702 struct aligned_storage {
703 typedef aligned_chunk<Align> type[Len / sizeof(aligned_chunk<Align>)];
704 };
705
706 #else
707
708 using std::aligned_storage;
709
710 #endif
711
712 #if !defined(__CUDACC_RTC__)
713 template <typename T>
715 struct default_delete {
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
744 ~unique_ptr() {
745 if (_ptr) {
746 _deleter(_ptr);
747 }
748 }
750 pointer get() const noexcept { return _ptr; }
751
753 pointer release() noexcept {
754 pointer p(_ptr);
755 _ptr = nullptr;
756 return p;
757 }
758
760 void reset(pointer p = pointer()) noexcept {
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>
792 void swap(unique_ptr<T, Deleter>& lhs, unique_ptr<T, Deleter>& rhs) noexcept {
793 lhs.swap(rhs);
794 }
795 #endif
796
797 }; // namespace nv_std
nv_std::unique_ptr
std::unique_ptr
Definition: nv_std.h:727
nv_std::alignment_of::pad
Definition: nv_std.h:574
nv_std::unique_ptr::reset
void reset(pointer p=pointer()) noexcept
Replaces the managed object, deleting the old object.
Definition: nv_std.h:760
nv_std::is_base_of_helper::value
static const bool value
Definition: nv_std.h:435
nv_std::operator>
CUTLASS_HOST_DEVICE constexpr bool operator>(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: nv_std.h:240
nv_std::conditional
std::conditional (true specialization)
Definition: nv_std.h:343
nv_std::conditional::type
T type
Definition: nv_std.h:344
nv_std::integral_constant::value_type
value_t value_type
Definition: nv_std.h:281
nv_std::unique_ptr::get_deleter
Deleter & get_deleter() noexcept
Returns the deleter object.
Definition: nv_std.h:772
nv_std::unique_ptr::release
pointer release() noexcept
Releases ownership of the managed object, if any.
Definition: nv_std.h:753
nv_std::enable_if::type
T type
Definition: nv_std.h:334
nv_std::false_type
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
Definition: nv_std.h:300
nv_std::is_pointer
std::is_pointer
Definition: nv_std.h:475
nv_std::unique_ptr::operator->
pointer operator->() const noexcept
Returns a pointer to the managed object.
Definition: nv_std.h:784
nv_std::alignment_of
std::alignment_of
Definition: nv_std.h:573
nv_std::is_trivially_copyable
Definition: nv_std.h:556
nv_std::integral_constant::type
integral_constant< value_t, V > type
Definition: nv_std.h:282
nv_std::alignment_of::pad::byte
char byte
Definition: nv_std.h:576
nv_std::alignment_of::value
Definition: nv_std.h:579
nv_std::is_pointer_helper
Helper for std::is_pointer (false specialization)
Definition: nv_std.h:467
nv_std::unique_ptr::operator[]
T & operator[](size_t i) const
Array access to managed object.
Definition: nv_std.h:787
nv_std::is_base_of_helper::no
char(& no)[2]
Definition: nv_std.h:422
nv_std::less
std::less
Definition: nv_std.h:181
nv_std::unique_ptr::deleter_type
Deleter deleter_type
Definition: nv_std.h:731
nv_std::alignment_of::pad::val
value_t val
Definition: nv_std.h:575
constexpr
#define constexpr
Definition: nv_std.h:129
nv_std::remove_volatile
std::remove_volatile (non-volatile specialization)
Definition: nv_std.h:380
nv_std::integral_constant::value
static const value_t value
Definition: nv_std.h:279
nv_std::operator==
CUTLASS_HOST_DEVICE constexpr bool operator==(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: nv_std.h:219
nv_std::remove_cv
std::remove_cv
Definition: nv_std.h:392
nv_std::is_base_of
std::is_base_of
Definition: nv_std.h:440
nv_std::make_pair
CUTLASS_HOST_DEVICE std::pair< T1, T2 > make_pair(T1 t, T2 u)
Definition: nv_std.h:250
nv_std::integral_constant
std::integral_constant
Definition: nv_std.h:274
nv_std::__align__
struct __align__(1) aligned_chunk< 1 >
Definition: nv_std.h:648
nv_std::default_delete::operator()
void operator()(T *ptr) const
Definition: nv_std.h:716
nv_std::unique_ptr::swap
void swap(unique_ptr &other) noexcept
Swaps the managed objects with *this and another unique_ptr.
Definition: nv_std.h:769
nv_std::remove_const
std::remove_const (non-const specialization)
Definition: nv_std.h:368
nv_std::max
CUTLASS_HOST_DEVICE constexpr const T & max(const T &a, const T &b)
std::max
Definition: nv_std.h:207
nv_std
Definition: nv_std.h:167
nv_std::is_base_of_helper::yes
char(& yes)[1]
Definition: nv_std.h:421
nv_std::remove_volatile::type
T type
Definition: nv_std.h:381
nv_std::operator!=
CUTLASS_HOST_DEVICE constexpr bool operator!=(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: nv_std.h:224
nv_std::is_volatile
std::is_volatile
Definition: nv_std.h:461
nv_std::unique_ptr::element_type
T element_type
Definition: nv_std.h:730
nv_std::plus
nv_std::plus
Definition: nv_std.h:175
nv_std::is_same
std::is_same (false specialization)
Definition: nv_std.h:412
nv_std::default_delete
Default deleter.
Definition: nv_std.h:715
nv_std::unique_ptr::pointer
T * pointer
Definition: nv_std.h:729
nv_std::unique_ptr::get_deleter
Deleter const & get_deleter() const noexcept
Returns the deleter object.
Definition: nv_std.h:775
nv_std::is_integral
std::is_integral
Definition: nv_std.h:483
nv_std::is_base_of_helper
Helper for std::is_base_of.
Definition: nv_std.h:420
nv_std::is_fundamental
std::is_fundamental
Definition: nv_std.h:526
nv_std::swap
void swap(unique_ptr< T, Deleter > &lhs, unique_ptr< T, Deleter > &rhs) noexcept
Specializes the swap algorithm.
Definition: nv_std.h:792
nv_std::is_base_of_helper::dummy
Definition: nv_std.h:425
nv_std::integral_constant::operator()
CUTLASS_HOST_DEVICE const value_type operator()() const
Definition: nv_std.h:286
CUTLASS_HOST_DEVICE
#define CUTLASS_HOST_DEVICE
Definition: cutlass.h:46
noexcept
#define noexcept
noexcept, constexpr
Definition: nv_std.h:126
nv_std::enable_if
std::enable_if (true specialization)
Definition: nv_std.h:333
nv_std::aligned_chunk
Definition: nv_std.h:646
nv_std::unique_ptr::unique_ptr
unique_ptr()
Definition: nv_std.h:741
nv_std::greater
std::greater
Definition: nv_std.h:189
nv_std::is_floating_point
std::is_floating_point
Definition: nv_std.h:515
nullptr
#define nullptr
nullptr
Definition: nv_std.h:136
nv_std::min
CUTLASS_HOST_DEVICE constexpr const T & min(const T &a, const T &b)
std::min
Definition: nv_std.h:201
nv_std::greater::operator()
CUTLASS_HOST_DEVICE constexpr bool operator()(const T &lhs, const T &rhs) const
Definition: nv_std.h:190
nv_std::aligned_storage::type
aligned_chunk< Align > type[Len/sizeof(aligned_chunk< Align >)]
Definition: nv_std.h:703
nv_std::nullptr_t
std::nullptr_t
Definition: nv_std.h:317
nv_std::less::operator()
CUTLASS_HOST_DEVICE constexpr bool operator()(const T &lhs, const T &rhs) const
Definition: nv_std.h:182
nv_std::unique_ptr::unique_ptr
unique_ptr(pointer p)
Definition: nv_std.h:742
nv_std::aligned_storage
std::aligned_storage
Definition: nv_std.h:702
nv_std::remove_cv::type
remove_volatile< typename remove_const< T >::type >::type type
Definition: nv_std.h:393
nv_std::true_type
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
Definition: nv_std.h:297
nv_std::unique_ptr::operator*
T & operator*() const
Dereferences the unique_ptr.
Definition: nv_std.h:781
nv_std::bool_constant
std::bool_constant
Definition: nv_std.h:306
nv_std::is_void
std::is_void
Definition: nv_std.h:479
nv_std::conditional< false, T, F >::type
F type
Definition: nv_std.h:350
nv_std::is_base_of_helper::check
static CUTLASS_HOST_DEVICE yes check(DerivedT *, T)
nv_std::remove_const::type
T type
Definition: nv_std.h:369
nv_std::plus::operator()
CUTLASS_HOST_DEVICE constexpr T operator()(const T &lhs, const T &rhs) const
Definition: nv_std.h:176
nv_std::remove_const< const T >::type
T type
Definition: nv_std.h:375
cutlass.h
Basic include for CUTLASS macros.
nv_std::remove_volatile< volatile T >::type
T type
Definition: nv_std.h:387
nv_std::default_delete< T[]>::operator()
void operator()(T *ptr) const
Definition: nv_std.h:722
nv_std::operator>=
CUTLASS_HOST_DEVICE constexpr bool operator>=(const pair< T1, T2 > &lhs, const pair< T1, T2 > &rhs)
Definition: nv_std.h:245
nv_std::unique_ptr::~unique_ptr
~unique_ptr()
Definition: nv_std.h:744
nv_std::is_arithmetic
std::is_arithmetic
Definition: nv_std.h:521