From 6407cc70b3cee80e5e613b8a21ff587daf2a6108 Mon Sep 17 00:00:00 2001 From: "hao.wang" Date: Thu, 19 Nov 2026 11:07:11 +0800 Subject: [PATCH] engine: the gfx906 compat layer maps the two stream-priority CUDA names (a gfx906 build blocker: dflash2.cpp and verify.cpp use them) The gfx906 source build of docs/AMD_HIP.md stops at: engine/src/core/dflash2.cpp:222:5: error: use of undeclared identifier 'cudaDeviceGetStreamPriorityRange'; did you mean 'hipDeviceGetStreamPriorityRange'? engine/src/core/dflash2.cpp:223:9: error: use of undeclared identifier 'cudaStreamCreateWithPriority'; did you mean 'hipStreamCreateWithPriority'? The same two names appear in engine/src/core/verify.cpp (1202, 1221, 1227, 4611). Every other CUDA name those files use is already in the compat layer; these two were missing, so `cmake -S engine -DSTRATA_HIP_GFX906=ON` - the documented gfx906 build - does not compile. The HIP signatures match (hipDeviceGetStreamPriorityRange(int*, int*) and hipStreamCreateWithPriority(hipStream_t*, unsigned int, int)), so they are plain aliases next to cudaStreamCreateWithFlags and the other cudaDevice* names. --- engine/include/strata/platform/hip_compat/strata_hip.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/include/strata/platform/hip_compat/strata_hip.h b/engine/include/strata/platform/hip_compat/strata_hip.h index 180a1f6d68..ee9b225992 100644 --- a/engine/include/strata/platform/hip_compat/strata_hip.h +++ b/engine/include/strata/platform/hip_compat/strata_hip.h @@ -98,6 +98,7 @@ inline hipError_t strata_device_get_attribute(int* v, hipDeviceAttribute_t a, in #define cudaDeviceCanAccessPeer hipDeviceCanAccessPeer #define cudaDeviceEnablePeerAccess hipDeviceEnablePeerAccess #define cudaDeviceDisablePeerAccess hipDeviceDisablePeerAccess +#define cudaDeviceGetStreamPriorityRange hipDeviceGetStreamPriorityRange #define cudaDriverGetVersion hipDriverGetVersion #define cudaRuntimeGetVersion hipRuntimeGetVersion #define cudaSetDeviceFlags hipSetDeviceFlags @@ -130,6 +131,7 @@ template inline hipError_t strata_host_alloc(T** p, size_t bytes, u #define cudaHostGetDevicePointer hipHostGetDevicePointer #define cudaStreamCreate hipStreamCreate #define cudaStreamCreateWithFlags hipStreamCreateWithFlags +#define cudaStreamCreateWithPriority hipStreamCreateWithPriority #define cudaStreamDestroy hipStreamDestroy #define cudaStreamSynchronize hipStreamSynchronize #define cudaStreamQuery hipStreamQuery