@@ -34,7 +34,24 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "cutlass/cutlass.h"
|
||||
// __grid_constant__ was introduced in CUDA 11.7.
|
||||
#if ((__CUDACC_VER_MAJOR__ >= 12) || ((__CUDACC_VER_MAJOR__ == 11) && (__CUDACC_VER_MINOR__ >= 7)))
|
||||
# define CUTLASS_GRID_CONSTANT_SUPPORTED
|
||||
#endif
|
||||
|
||||
// __grid_constant__ can be enabled only on SM70+
|
||||
#if defined(CUTLASS_GRID_CONSTANT_SUPPORTED) && defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 700)
|
||||
# define CUTLASS_GRID_CONSTANT_ENABLED
|
||||
#endif
|
||||
|
||||
#if ! defined(CUTLASS_GRID_CONSTANT)
|
||||
# if defined(CUTLASS_GRID_CONSTANT_ENABLED)
|
||||
# define CUTLASS_GRID_CONSTANT __grid_constant__
|
||||
# else
|
||||
# define CUTLASS_GRID_CONSTANT
|
||||
# endif
|
||||
#endif
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace cutlass {
|
||||
@@ -75,5 +92,22 @@ void Kernel2(typename Operator::Params params) {
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
} /// namespace cutlass
|
||||
//
|
||||
// 3.0 specific launch
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/// Generic CUTLASS kernel template.
|
||||
template <typename Operator>
|
||||
__global__ __launch_bounds__(Operator::MaxThreadsPerBlock, Operator::MinBlocksPerMultiprocessor)
|
||||
void device_kernel(CUTLASS_GRID_CONSTANT typename Operator::Params const params)
|
||||
{
|
||||
// Dynamic shared memory base pointer
|
||||
extern __shared__ char smem[];
|
||||
|
||||
Operator op;
|
||||
op(params, smem);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
} /// namespace cutlass
|
||||
|
||||
Reference in New Issue
Block a user