docs/simt__policy_8h_source.html
| | CUTLASS
CUDA Templates for Linear Algebra Subroutines and Solvers |
simt_policy.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 **************************************************************************************************/
31 #pragma once
32
33 #include "cutlass/matrix_shape.h"
34 #include "cutlass/layout/matrix.h"
35
37
38 namespace cutlass {
39 namespace epilogue {
40 namespace warp {
41
43
44 template <
45typename WarpShape,
46typename Operator,
47typename Layout,
48typename MmaSimtPolicy
49 >
50 struct SimtPolicy;
51
53
55 template <
56typename WarpShape_,
57typename Operator_,
58typename MmaSimtPolicy_
59 >
[60](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html) struct SimtPolicy<WarpShape_, Operator_, layout::RowMajor, MmaSimtPolicy_> {
61
[62](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#ab8d75b7d38429d35b460bc11859aa5ec)using [WarpShape](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#ab8d75b7d38429d35b460bc11859aa5ec) = WarpShape_;
[63](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#aefd4108108bd3d5d3a6bebcad295ee16)using Operator = Operator_;
[64](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#a07ecea6a8c3407343add0be43bb2beba)using [MmaSimtPolicy](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#a07ecea6a8c3407343add0be43bb2beba) = MmaSimtPolicy_;
65
66static_assert(!(WarpShape::kM % MmaSimtPolicy::WarpShape::kRow), "Divisibility");
67static_assert(!(WarpShape::kN % MmaSimtPolicy::WarpShape::kColumn), "Divisibility");
68
[70](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#ab00111b3e6511568121e457f10085f85)static int const kIterations = WarpShape::kM / MmaSimtPolicy::WarpShape::kRow;
71
[73](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#adbc8b3fe881c629baa6b45d44f838ca2)static int const kElementsPerIteration =
74 (WarpShape::kN / MmaSimtPolicy::WarpShape::kColumn);
75
[77](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#a5dd1a5071c51e16afb984b14d96e9a0e)static int const kAccumulatorElementCount = kElementsPerIteration * kIterations;
78
[80](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#abd3b551e211168087a609f2867154bd9)static int const kElementsPerAccess = MmaSimtPolicy::LaneMmaShape::kN;
81
[83](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#aae132aaa130374b137c885bb6bdac147)static int const kRowsPerIteration = MmaSimtPolicy::WarpShape::kRow;
84
[86](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#aba347419d996527f17d0775a1fa8ab73)static int const kAccessesPerIteration = kElementsPerIteration / kElementsPerAccess;
87 };
88
90
91 } // namespace warp
92 } // namespace epilogue
93 } // namespace cutlass
94
Definition: aligned_buffer.h:35
cutlass::epilogue::warp::SimtPolicy
Definition: simt_policy.h:50
[cutlass::epilogue::warp::SimtPolicy< WarpShape_, Operator_, layout::RowMajor, MmaSimtPolicy_ >::MmaSimtPolicy](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#a07ecea6a8c3407343add0be43bb2beba)
MmaSimtPolicy_ MmaSimtPolicy
Definition: simt_policy.h:64
Defines a Shape template for matrix tiles.
#define static_assert(__e, __m)
Definition: platform.h:153
Defines layout functions used by TensorRef and derived classes.
[cutlass::epilogue::warp::SimtPolicy< WarpShape_, Operator_, layout::RowMajor, MmaSimtPolicy_ >::WarpShape](structcutlass_1_1epilogue_1_1warp_1_1SimtPolicy_3_01WarpShape 00_01Operator 00_01layout_1_1Rcef1c60e23e997017ae176c92931151d.html#ab8d75b7d38429d35b460bc11859aa5ec)
WarpShape_ WarpShape
Definition: simt_policy.h:62
Generated by 1.8.11