This is an archive of the discontinued LLVM Phabricator instance.

[CUDA][HIP] Support '--offload-arch=native' for the new driver
ClosedPublic

Authored by jhuber6 on Jan 5 2023, 10:45 AM.

Details

Summary

This patch applies the same handling for the `--offload-arch=native'
string to the new driver. The support for OpenMP will require some extra
logic to infer the triples from the derived architecture strings.

Depends on D141051

Diff Detail

Event Timeline

jhuber6 created this revision.Jan 5 2023, 10:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 5 2023, 10:45 AM
jhuber6 requested review of this revision.Jan 5 2023, 10:45 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 5 2023, 10:45 AM
tra accepted this revision.Jan 5 2023, 10:57 AM
tra added inline comments.
clang/test/Driver/amdgpu-hip-system-arch.c
17

Nit: I'd reformat it a bit to make it painfully obvious that it's the combination of --offload-arch=native and --amdgpu-arch-tool=%t/amdgpu_arch_fail that makes the test hermetic.
Put them on a RUN line of their own?

This revision is now accepted and ready to land.Jan 5 2023, 10:57 AM
jhuber6 added inline comments.Jan 5 2023, 10:58 AM
clang/test/Driver/amdgpu-hip-system-arch.c
17

Will do.

arsenm added a subscriber: arsenm.Jan 5 2023, 11:17 AM
arsenm added inline comments.
clang/lib/Driver/Driver.cpp
4286

should explicitly handle the different triple cases, rather than assume ! NVPTX is AMDGPU

4286

why not just take the canonical triple arch name

jhuber6 added inline comments.Jan 5 2023, 11:20 AM
clang/lib/Driver/Driver.cpp
4286

Yeah I should probably just use the triple. I was trying to keep the old tests the same but I should just change them.

jhuber6 updated this revision to Diff 486741.Jan 5 2023, 7:47 PM

Change error to use canonical arch string from the triple.