Skip to content

Commit e4f2715

Browse files
jeffdailymsaroufim
andauthored
remove rocm source files when not building for rocm (#2385)
* remove rocm source files when not building for rocm fixes #2297 * lint --------- Co-authored-by: Mark Saroufim <marksaroufim@gmail.com>
1 parent 5239ce7 commit e4f2715

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

setup.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,13 @@ def get_extensions():
491491
print("Currently only gfx942 is supported. Compiling only for gfx942.")
492492
extra_compile_args["nvcc"].append("--offload-arch=gfx942")
493493
sources += rocm_sources
494+
else:
495+
# Remove ROCm-based sources from the sources list.
496+
extensions_rocm_dir = os.path.join(extensions_dir, "rocm")
497+
rocm_sources = list(
498+
glob.glob(os.path.join(extensions_rocm_dir, "**/*.cpp"), recursive=True)
499+
)
500+
sources = [s for s in sources if s not in rocm_sources]
494501

495502
use_cutlass = False
496503
cutlass_90a_sources = None

0 commit comments

Comments
 (0)