From c40e622966a5264c7520ae8aa8a6d8aac0823f94 Mon Sep 17 00:00:00 2001 From: Xu Han Date: Tue, 3 Sep 2024 20:10:19 +0000 Subject: [PATCH] [inductor] add openmp config for intel conpiler on Linux. (#134973) Config `openmp` for Intel Compiler on Linux. Base on this PR, we can confirm the Intel optimized libraries are work built well. image Pull Request resolved: https://github.com/pytorch/pytorch/pull/134973 Approved by: https://github.com/jgong5, https://github.com/jansel --- torch/_inductor/cpp_builder.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/torch/_inductor/cpp_builder.py b/torch/_inductor/cpp_builder.py index 45aaa2f399daef..7cfefbc1d84af9 100644 --- a/torch/_inductor/cpp_builder.py +++ b/torch/_inductor/cpp_builder.py @@ -959,6 +959,8 @@ def _get_openmp_args( # TODO: fix issue, can't find omp.h cflags.append("fopenmp") libs.append("gomp") + elif _is_intel_compiler(cpp_compiler): + cflags.append("fiopenmp") else: cflags.append("fopenmp") libs.append("gomp")