From 703df80d7cc891eade6cdda9dee4448a4911481c Mon Sep 17 00:00:00 2001 From: PragmaTwice Date: Sat, 23 Nov 2024 23:08:37 +0800 Subject: [PATCH] Add compiler flag --iree-hip-target --- integrations/pjrt/src/iree_pjrt/rocm/client.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/integrations/pjrt/src/iree_pjrt/rocm/client.cc b/integrations/pjrt/src/iree_pjrt/rocm/client.cc index e22585f3b5b8..de4c0626d4e4 100644 --- a/integrations/pjrt/src/iree_pjrt/rocm/client.cc +++ b/integrations/pjrt/src/iree_pjrt/rocm/client.cc @@ -31,7 +31,18 @@ iree_status_t ROCMClientInstance::CreateDriver(iree_hal_driver_t** out_driver) { } bool ROCMClientInstance::SetDefaultCompilerFlags(CompilerJob* compiler_job) { - return compiler_job->SetFlag("--iree-hal-target-backends=rocm"); + auto flags = { + "--iree-hal-target-backends=rocm", + + // TODO: gfx908 is just a placeholder here to make it work, + // we should instead detect the device target on the fly + "--iree-hip-target=gfx908", + }; + + for (auto flag : flags) { + if (!compiler_job->SetFlag(flag)) return false; + } + return true; } } // namespace iree::pjrt::rocm