一 使用
1.1 makefile
compile:nvcc -arch=sm_90a -lcuda -lcublas -std=c++17 matmul_h100_optimal.cu -o testrun:./test
加入-lcublas,不然會有函數無法被識別
二 代碼分析
2.1 kernel外參數分析
2.1.1 基本參數
constexpr int BM = 64*2;constexpr int BN = 256;constexpr int BK = 64;constexpr int NUM_THREADS = 128*3;constexpr int QSIZE = 3;constexpr int CLUSTER_M = 2;constexpr int CLUSTER_N = 1;constexpr int NUM_SM = 128;static_assert(NUM_SM % (CLUSTER_M*CLUSTER_N) == 0);
2.1.2 SMem結構體
template <int BM, int BN, int BK, int QSIZE&