From 5234a76ee8d40e2d561dd62d3771eccfe1020e8f Mon Sep 17 00:00:00 2001 From: rraminen Date: Mon, 30 Oct 2023 22:02:21 +0000 Subject: [PATCH] Added __HIP_PLATFORM_AMD__=1 for non JIT build --- op_builder/builder.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/op_builder/builder.py b/op_builder/builder.py index 62683774f20a..aa818547bd21 100644 --- a/op_builder/builder.py +++ b/op_builder/builder.py @@ -614,6 +614,9 @@ def builder(self): if not self.build_for_cpu and self.enable_bf16: compile_args['cxx'].append("-DBF16_AVAILABLE") + if self.is_rocm_pytorch(): + compile_args['cxx'].append("-D__HIP_PLATFORM_AMD__=1") + cuda_ext = ExtensionBuilder(name=self.absolute_name(), sources=self.strip_empty_entries(self.sources()), include_dirs=self.strip_empty_entries(self.include_paths()),