-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[HIP][Clang][Driver] Add Driver support for
hipstdpar
This patch adds the Driver changes needed for enabling HIP parallel algorithm offload on AMDGPU targets. What this change does can be summed up as follows: - add two flags, one for enabling `hipstdpar` compilation, the second enabling the optional allocation interposition mode; - the flags correspond to new LangOpt members; - if we are compiling or linking with --hipstdpar, we enable HIP; in the compilation case C and C++ inputs are treated as HIP inputs; - the ROCm / AMDGPU driver is augmented to look for and include an implementation detail forwarding header; we error out if the user requested `hipstdpar` but the header or its dependencies cannot be found. Tests for the behaviour described above are also added. Reviewed by: MaskRay, yaxunl Differential Revision: https://reviews.llvm.org/D155775
- Loading branch information
Showing
12 changed files
with
141 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// RUN: not %clang -### --hipstdpar -nogpulib -nogpuinc --compile %s 2>&1 | \ | ||
// RUN: FileCheck --check-prefix=HIPSTDPAR-MISSING-LIB %s | ||
// RUN: %clang -### --hipstdpar --hipstdpar-path=%S/Inputs/hipstdpar \ | ||
// RUN: --hipstdpar-thrust-path=%S/Inputs/hipstdpar/thrust \ | ||
// RUN: --hipstdpar-prim-path=%S/Inputs/hipstdpar/rocprim \ | ||
// RUN: -nogpulib -nogpuinc --compile %s 2>&1 | \ | ||
// RUN: FileCheck --check-prefix=HIPSTDPAR-COMPILE %s | ||
// RUN: touch %t.o | ||
// RUN: %clang -### --hipstdpar %t.o 2>&1 | FileCheck --check-prefix=HIPSTDPAR-LINK %s | ||
|
||
// HIPSTDPAR-MISSING-LIB: error: cannot find HIP Standard Parallelism Acceleration library; provide it via '--hipstdpar-path' | ||
// HIPSTDPAR-COMPILE: "-x" "hip" | ||
// HIPSTDPAR-COMPILE: "-idirafter" "{{.*/thrust}}" | ||
// HIPSTDPAR-COMPILE: "-idirafter" "{{.*/rocprim}}" | ||
// HIPSTDPAR-COMPILE: "-idirafter" "{{.*/Inputs/hipstdpar}}" | ||
// HIPSTDPAR-COMPILE: "-include" "hipstdpar_lib.hpp" | ||
// HIPSTDPAR-LINK: "-rpath" | ||
// HIPSTDPAR-LINK: "-l{{.*hip.*}}" |