| 1 |
// REQUIRES: x86-registered-target |
| 2 |
// REQUIRES: amdgpu-registered-target |
| 3 |
// UNSUPPORTED: target={{.*}}-aix{{.*}} |
| 4 |
|
| 5 |
// RUN: %clang -v --rocm-path=%S/Inputs/rocm 2>&1 \ |
| 6 |
// RUN: | FileCheck -check-prefixes=FOUND %s |
| 7 |
|
| 8 |
// RUN: env ROCM_PATH=%S/Inputs/rocm %clang -v 2>&1 \ |
| 9 |
// RUN: | FileCheck -check-prefixes=FOUND %s |
| 10 |
|
| 11 |
// RUN: %clang -v --rocm-path=%S/Inputs/rocm 2>&1 \ |
| 12 |
// RUN: --target=amdgcn-amd-amdhsa \ |
| 13 |
// RUN: | FileCheck -check-prefixes=FOUND %s |
| 14 |
|
| 15 |
// RUN: %clang -v --hip-path=%S/Inputs/rocm 2>&1 \ |
| 16 |
// RUN: | FileCheck -check-prefixes=FOUND %s |
| 17 |
|
| 18 |
// RUN: env HIP_PATH=%S/Inputs/rocm %clang -v 2>&1 \ |
| 19 |
// RUN: | FileCheck -check-prefixes=FOUND %s |
| 20 |
|
| 21 |
// RUN: rm -rf %t/Inputs |
| 22 |
// RUN: mkdir -p %t/Inputs |
| 23 |
// RUN: cp -r %S/Inputs/rocm %t/Inputs |
| 24 |
// RUN: mkdir -p %t/Inputs/rocm/share/hip |
| 25 |
// RUN: mkdir -p %t/Inputs/rocm/hip |
| 26 |
// RUN: mv %t/Inputs/rocm/bin/.hipVersion %t/Inputs/rocm/share/hip/version |
| 27 |
// RUN: %clang -v --rocm-path=%t/Inputs/rocm 2>&1 \ |
| 28 |
// RUN: | FileCheck -check-prefixes=FOUND %s |
| 29 |
// RUN: %clang -v --hip-path=%t/Inputs/rocm 2>&1 \ |
| 30 |
// RUN: | FileCheck -check-prefixes=FOUND %s |
| 31 |
// RUN: %clang -v --hip-path=%t/Inputs/rocm/hip 2>&1 \ |
| 32 |
// RUN: | FileCheck -check-prefixes=HIP-PATH %s |
| 33 |
|
| 34 |
// FOUND: Found HIP installation: {{.*Inputs.*rocm}}, version 3.6.20214-a2917cd |
| 35 |
// HIP-PATH: Found HIP installation: {{.*Inputs.*rocm.*hip}}, version 3.6.20214-a2917cd |
| 36 |
|
| 37 |
// When --rocm-path is set and .hipVersion is not found, use default version |
| 38 |
|
| 39 |
// RUN: %clang -v --rocm-path=%S 2>&1 \ |
| 40 |
// RUN: | FileCheck -check-prefixes=DEFAULT %s |
| 41 |
|
| 42 |
// When --hip-path is set and .hipVersion is not found, use default version |
| 43 |
|
| 44 |
// RUN: %clang -v --hip-path=%S 2>&1 \ |
| 45 |
// RUN: | FileCheck -check-prefixes=DEFAULT %s |
| 46 |
|
| 47 |
// RUN: %clang -v --rocm-path=%S 2>&1 \ |
| 48 |
// RUN: --target=amdgcn-amd-amdhsa \ |
| 49 |
// RUN: | FileCheck -check-prefixes=DEFAULT %s |
| 50 |
|
| 51 |
// DEFAULT: Found HIP installation: {{.*Driver}}, version 3.5. |
| 52 |
|
| 53 |
// RUN: %clang -v --rocm-path=%S --hip-version=3.7.0 2>&1 \ |
| 54 |
// RUN: | FileCheck -check-prefixes=SPECIFIED %s |
| 55 |
|
| 56 |
// RUN: %clang -v --rocm-path=%S --hip-version=3.7.0 2>&1 \ |
| 57 |
// RUN: --target=amdgcn-amd-amdhsa \ |
| 58 |
// RUN: | FileCheck -check-prefixes=SPECIFIED %s |
| 59 |
|
| 60 |
// SPECIFIED: Found HIP installation: {{.*Driver}}, version 3.7.0 |
| 61 |
|
| 62 |
// RUN: %clang -v --rocm-path=%S --hip-version=3.7 2>&1 \ |
| 63 |
// RUN: | FileCheck -check-prefixes=SPECIFIED2 %s |
| 64 |
|
| 65 |
// SPECIFIED2: Found HIP installation: {{.*Driver}}, version 3.7.0 |
| 66 |
|
| 67 |
// RUN: %clang -v --rocm-path=%S --hip-version=4.0.21025 2>&1 \ |
| 68 |
// RUN: | FileCheck -check-prefixes=SPECIFIED3 %s |
| 69 |
|
| 70 |
// SPECIFIED3: Found HIP installation: {{.*Driver}}, version 4.0.21025 |
| 71 |
|
| 72 |
// RUN: %clang -v --rocm-path=%S --hip-version=4 2>&1 \ |
| 73 |
// RUN: | FileCheck -check-prefixes=SPECIFIED4 %s |
| 74 |
|
| 75 |
// SPECIFIED4: Found HIP installation: {{.*Driver}}, version 4.0.0 |
| 76 |
|
| 77 |
// RUN: not %clang -v --rocm-path=%S --hip-version=x.y 2>&1 \ |
| 78 |
// RUN: | FileCheck -check-prefixes=INVALID %s |
| 79 |
|
| 80 |
// INVALID: error: invalid value 'x.y' in '--hip-version=x.y' |