13 Commits

Author SHA1 Message Date
Fabian Ritter
a2f9ae1421
[AMDGPU] Replace gfx940 and gfx941 with gfx942 in offload and libclc (#125826)
gfx940 and gfx941 are no longer supported. This is one of a series of
PRs to remove them from the code base.

For SWDEV-512631 and SWDEV-512633
2025-02-19 09:56:04 +01:00
Joseph Huber
6d1a51303e
[libc][Docs] Update libc documentation for RPC and others (#120018)
Summary:
A few of these were out of date, update them now that the C library
interface into RPC was deleted.
2024-12-16 09:09:19 -06:00
Joseph Huber
50838851e8 [libc][docs] Update NVPTX using documentation now that linking works
Summary:
I added a wrapper linker awhile back but this still says it doesn't
work.
2024-10-04 18:09:28 -05:00
Joseph Huber
8d8fa01a66 Reapply "[libc] Remove 'packaged' GPU build support (#100208)"
This reverts commit 550b83d658755664a7f0f93b36242e885743a91b.
2024-07-24 10:24:53 -05:00
Joseph Huber
550b83d658 Revert "[libc] Remove 'packaged' GPU build support (#100208)"
Summary:
I forgot that the OpenMP tests still look for this, reverting for now
until I can make a fix.

This reverts commit c1c6ed83e9ac13c511961e5f5791034a63168e7e.
2024-07-24 07:51:47 -05:00
Joseph Huber
c1c6ed83e9
[libc] Remove 'packaged' GPU build support (#100208)
Summary:
Previously, the GPU built the `libc` in a fat binary version that was
used to pass this to the link job in offloading languages like CUDA or
OpenMP. This was mostly required because NVIDIA couldn't consume the
standard static library version. Recent patches have now created the
`clang-nvlink-wrapper` which lets us do that. Now, the C library is just
included implicitly by the toolchain (or passed with -Xoffload-linker
-lc).

This code can be fully removed, which will heavily simplify the build
(and removed some bugs and garbage files I've encoutnered).
2024-07-24 07:22:49 -05:00
Joachim Meyer
8896f21ca9
[NFC] Fix typo in libc/docs/gpu/using.rst 2024-06-04 15:40:45 -07:00
Joseph Huber
6818c7b8ef
[libc] Update GPU testing documentation (#85459)
Summary:
This documentation was lagging reality and didn't contain much. Update
it with some more information now that it's more mature.
2024-03-15 17:49:44 -05:00
Joseph Huber
0cbbcf1ef0
[libc] Update GPU documentation pages (#84076)
Summary:
After the overhaul of the GPU build the documentation pages were a
little stale. This updates them with more in-depth information on
building the GPU runtimes and using them. Specifically using them goes
through the differences between the offloading and direct compilation
modes.
2024-03-06 10:58:39 -06:00
Joseph Huber
69c0b2febe
[libc][NFC] Remove all trailing spaces from libc (#82831)
Summary:
There are a lot of random training spaces on various lines. This patch
just got rid of all of them with `sed 's/\ \+$//g'.
2024-02-23 16:34:00 -06:00
Joseph Huber
47b7c91abe
[libc] Rework the GPU build to be a regular target (#81921)
Summary:
This is a massive patch because it reworks the entire build and
everything that depends on it. This is not split up because various bots
would fail otherwise. I will attempt to describe the necessary changes
here.

This patch completely reworks how the GPU build is built and targeted.
Previously, we used a standard runtimes build and handled both NVPTX and
AMDGPU in a single build via multi-targeting. This added a lot of
divergence in the build system and prevented us from doing various
things like building for the CPU / GPU at the same time, or exporting
the startup libraries or running tests without a full rebuild.

The new appraoch is to handle the GPU builds as strict cross-compiling
runtimes. The first step required
https://github.com/llvm/llvm-project/pull/81557 to allow the `LIBC`
target to build for the GPU without touching the other targets. This
means that the GPU uses all the same handling as the other builds in
`libc`.

The new expected way to build the GPU libc is with
`LLVM_LIBC_RUNTIME_TARGETS=amdgcn-amd-amdhsa;nvptx64-nvidia-cuda`.

The second step was reworking how we generated the embedded GPU library
by moving it into the library install step. Where we previously had one
`libcgpu.a` we now have `libcgpu-amdgpu.a` and `libcgpu-nvptx.a`. This
patch includes the necessary clang / OpenMP changes to make that not
break the bots when this lands.

We unfortunately still require that the NVPTX target has an `internal`
target for tests. This is because the NVPTX target needs to do LTO for
the provided version (The offloading toolchain can handle it) but cannot
use it for the native toolchain which is used for making tests.

This approach is vastly superior in every way, allowing us to treat the
GPU as a standard cross-compiling target. We can now install the GPU
utilities to do things like use the offload tests and other fun things.

Some certain utilities need to be built with 
`--target=${LLVM_HOST_TRIPLE}` as well. I think this is a fine
workaround as we
will always assume that the GPU `libc` is a cross-build with a
functioning host.

Depends on https://github.com/llvm/llvm-project/pull/81557
2024-02-22 15:29:29 -06:00
Joseph Huber
023bfc196b [libc][docs] Fix incorrect CMake argument in GPU documentation
Summary;
This was changed a long time ago to drop the `LLVM_` prefix.

Differential Revision: https://reviews.llvm.org/D150012
2023-05-05 20:16:47 -05:00
Joseph Huber
807f058487 [libc][Docs] Begin improving documentation for the GPU libc
This patch updates some of the documentation for the GPU libc project.
There is a lot of work still to be done, but this sets the general
outline.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D149194
2023-04-26 10:30:54 -05:00