Skip to content

Commit 3efccfe

Browse files
add USE_ROCM ifdef
Signed-off-by: Takeshi Yoshimura <[email protected]>
1 parent a0b0eb2 commit 3efccfe

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

fastsafetensors/cpp/ext.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,10 @@ void init_gil_release_from_env() {
301301

302302
int is_gds_supported(int deviceId)
303303
{
304-
cudaError_t err;
305-
int driverVersion = 0;
304+
#ifndef USE_ROCM
306305
int gdr_support = 1;
306+
int driverVersion = 0;
307+
cudaError_t err;
307308

308309
err = cuda_fns.cudaDriverGetVersion(&driverVersion);
309310
if (err != cudaSuccess) {
@@ -319,6 +320,9 @@ int is_gds_supported(int deviceId)
319320
}
320321
}
321322
return gdr_support;
323+
#endif
324+
// ROCm does not have GDS
325+
return 0;
322326
}
323327

324328
int init_gds()

0 commit comments

Comments
 (0)