[flang-commits] [flang] [Flang][OpenMP][Driver][Test] Fix the omp-driver-offload-test commands (PR #66926)

via flang-commits flang-commits at lists.llvm.org
Thu Sep 21 06:59:02 PDT 2023


agozillon wrote:

> Thanks for sending this! TBH, it's hard to follow without knowing/understanding the semantics of the relevant options. Looking at:
> 
> ```
> ! RUN: %flang -### %s -o %t 2>&1 \
> ! RUN: -fopenmp --offload-arch=gfx90a \
> ! RUN: -fopenmp-targets=amdgcn-amd-amdhsa \
> ```
> 
> what is significant about ` --offload-arch=gfx90a` that makes the driver not fail? IIUC, that's the main thing that's changing here.

I believe the amdgcn-amd-amdhsa command is more of a: "we're compiling for this generic amd gpu hardware triple,", so we don't know the specific GPU architecture just yet. Whereas defining --offload-arch=gfx90a is defining the architecture we're specifically targeting. Without the --offload-arch=gfx90a command it appears that with the right combination of AMD libraries in tow in your environment the GPU on your system can be identified (which on AMD systems like mine is a gfx of some variety) and the command will succeed. But the test has been trained in a past commit to expect failure for the return code, which is correct in most cases, unless you have the correct libraries in the environment and an AMD GPU (or other AMD offload arch) as it turns out. So it creates a scenario where we'll pass most of the time, but occasionally it'll fail when the stars align, even though the test is finding the correct information. So specifying the offload-arch just means the information is always available regardless of environment, so no chance failures. 

Maybe I'm incorrect, this is just my understanding from diagnosing the test failures @jhuber6 can likely correct me if I'm wrong.

https://github.com/llvm/llvm-project/pull/66926


More information about the flang-commits mailing list