--- pristine-0.1.40.4/include/strata/hip_compat/cublas_v2.h 2026-10-08 13:23:15.000000000 +0800 +++ /home/user/Strata/.bench/0.1.40.4/include/strata/hip_compat/cublas_v2.h 2026-10-09 20:39:39.768455736 +0800 @@ -1,4 +1,10 @@ #pragma once +// 本地补丁(社区基准报告):ROCm 6.2 的 hipBLAS 2.2 要定义 HIPBLAS_V2 才暴露新版 +// hipDataType / HIPBLAS_COMPUTE_32F 接口;0.1.39 的兼容头有这一行,0.1.40.x 删掉了 +// (它假设 ROCm 7)。不加会报 "no known conversion from 'hipDataType' to 'hipblasDatatype_t'"。 +#ifndef HIPBLAS_V2 +#define HIPBLAS_V2 +#endif #include #include @@ -55,6 +61,12 @@ #define cublasHandle_t hipblasHandle_t #define cublasSetMathMode hipblasSetMathMode #define cublasSetStream hipblasSetStream +// 本地补丁(社区基准报告):hipBLAS 2.2(ROCm 6.2)没有 hipblasSetWorkspace,这个 API +// 是更新版本才有的。像 0.1.39 的兼容头一样接受并忽略——workspace 由 hipBLAS 自己管理。 +#if hipblasVersionMajor < 3 +#define cublasSetWorkspace(handle, ptr, bytes) HIPBLAS_STATUS_SUCCESS +#else #define cublasSetWorkspace hipblasSetWorkspace +#endif #define cublasStatus_t hipblasStatus_t #endif