Skip to content

Commit

Permalink
[inductor] add openmp config for intel conpiler on Linux. (pytorch#13…
Browse files Browse the repository at this point in the history
…4973)

Config `openmp` for Intel Compiler on Linux.

Base on this PR, we can confirm the Intel optimized libraries are work built well.
<img width="1039" alt="image" src="https://github.com/user-attachments/assets/838d5114-c778-4961-9cfe-39a814647089">

Pull Request resolved: pytorch#134973
Approved by: https://github.com/jgong5, https://github.com/jansel
  • Loading branch information
xuhancn authored and pytorchmergebot committed Sep 3, 2024
1 parent 272f3b9 commit c40e622
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torch/_inductor/cpp_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit c40e622

Please sign in to comment.