Overview
Thecutlass::gemm::device::Gemm template provides a device-level interface to efficient CUTLASS GEMM kernels. It maps data types and structural parameters to specific CUTLASS components at compile time, and handles logical-to-kernel argument mapping and kernel launches at runtime.
Header: cutlass/gemm/device/gemm.h
Template Signature
Template Parameters
typename
Element type for A matrix operand. Examples:
float, half_t, int8_ttypename
Layout type for A matrix operand. Examples:
layout::RowMajor, layout::ColumnMajortypename
Element type for B matrix operand
typename
Layout type for B matrix operand
typename
Element type for C and D matrix operands
typename
Layout type for C and D matrix operands
typename
default:"ElementC_"
Element type for internal accumulation
typename
default:"arch::OpClassSimt"
Operator class tag. Examples:
arch::OpClassSimt, arch::OpClassTensorOptypename
default:"arch::Sm70"
Tag indicating architecture to tune for. Minimum SM that supports the intended feature. Examples:
arch::Sm70, arch::Sm75, arch::Sm80typename
Threadblock-level tile size (concept: GemmShape). Defaults depend on configuration.
typename
Warp-level tile size (concept: GemmShape)
typename
Instruction-level tile size (concept: GemmShape)
typename
Epilogue output operator. Example:
epilogue::thread::LinearCombinationtypename
default:"threadblock::GemmIdentityThreadblockSwizzle<>"
Threadblock-level swizzling operator
int
Number of stages used in the pipelined mainloop
int
Access granularity of A matrix in units of elements
int
Access granularity of B matrix in units of elements
bool
default:"false"
If true, kernel supports split-K with serial reduction
typename
Operation performed by GEMM
bool
default:"false"
Gather operand A by using an index array
bool
default:"false"
Gather operand B by using an index array
bool
default:"false"
Scatter result D by using an index array
typename
default:"layout::NoPermute"
Permute result D
Member Types
Arguments Structure
Member Functions
Constructor
can_implement
args: Arguments structure containing problem parameters
Status::kSuccess if the problem can be executed, error code otherwise
get_workspace_size
args: Arguments structure
initialize
args: Arguments structureworkspace: Pointer to workspace memorystream: CUDA stream
update
run
operator()
Usage Example
Frominclude/cutlass/gemm/device/gemm.h:87-114:
Complete Example
Fromexamples/00_basic_gemm/basic_gemm.cu:78-145:
See Also
- TensorRef - Tensor reference type used for matrix operands
- Layout Types - Matrix layout functions
- Epilogue Operators - Output transformation operators