Skip to content

Commit d6f998a

Browse files
authored
fix hipMemcpyKind enum (#35)
Signed-off-by: tjtanaa <[email protected]>
1 parent 1de5f13 commit d6f998a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fastsafetensors/cpp/ext.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,12 @@ typedef struct CUfileError { CUfileOpError err; } CUfileError_t;
3939
// Define minimal CUDA/HIP types for both platforms to avoid compile-time dependencies
4040
// We load all GPU functions dynamically at runtime via dlopen()
4141
typedef enum cudaError { cudaSuccess = 0, cudaErrorMemoryAllocation = 2 } cudaError_t;
42+
// Platform-specific enum values - CUDA and HIP have different values for HostToDevice
43+
#ifdef USE_ROCM
44+
enum cudaMemcpyKind { cudaMemcpyHostToDevice=1, cudaMemcpyDefault = 4 };
45+
#else
4246
enum cudaMemcpyKind { cudaMemcpyHostToDevice=2, cudaMemcpyDefault = 4 };
47+
#endif
4348

4449

4550
typedef enum CUfileFeatureFlags {

0 commit comments

Comments
 (0)