SGEMM repos (upstream_ref/sgemm_cuda/, 41 files): siboehm/SGEMM_CUDA: kernel 1-12, runner, CMake, cuBLAS benchmark wangzyon/NVIDIA_SGEMM_PRACTICE: kernel 1-7 (Chinese comments), utils edtallison/sgemm-cuda: kernel 01-09 (learning notes), Makefile xllm kernels (ex_engine/xllm_kernels/cuda/): fused_qknorm_rope.cu + bind — saves 128 kernel launches/fwd xattention/ — 6 files from upstream xllm headers: corex_compat_utils.h, topk_last_dim.cuh ilu/CMakeLists.txt SO_BUILD_MANIFEST.md — complete .so inventory and call chain analysis
26 lines
936 B
Plaintext
26 lines
936 B
Plaintext
#pragma once
|
|
#include <cublas_v2.h>
|
|
#include <cuda_runtime.h>
|
|
#include <fstream>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <sys/time.h>
|
|
#include <time.h>
|
|
#include <unistd.h>
|
|
|
|
void cudaCheck(cudaError_t error, const char *file,
|
|
int line); // CUDA error check
|
|
void CudaDeviceInfo(); // print CUDA information
|
|
|
|
void range_init_matrix(float *mat, int N);
|
|
void randomize_matrix(float *mat, int N);
|
|
void zero_init_matrix(float *mat, int N);
|
|
void copy_matrix(const float *src, float *dest, int N);
|
|
void print_matrix(const float *A, int M, int N, std::ofstream &fs);
|
|
bool verify_matrix(float *mat1, float *mat2, int N);
|
|
|
|
float get_current_sec(); // Get the current moment
|
|
float cpu_elapsed_time(float &beg, float &end); // Calculate time difference
|
|
|
|
void run_kernel(int kernel_num, int m, int n, int k, float alpha, float *A,
|
|
float *B, float beta, float *C, cublasHandle_t handle); |