diff options
author | Joseph Huber <jhuber6@vols.utk.edu> | 2023-03-16 11:42:57 -0500 |
---|---|---|
committer | Joseph Huber <jhuber6@vols.utk.edu> | 2023-03-17 12:55:32 -0500 |
commit | 39e91098b58bfbef973bc759803fbfcc6064b42b (patch) | |
tree | be9222b9067fef316b46777a254afd00b34cf450 /libc/startup | |
parent | 8e4f9b1fcbfd5e747b0df9a2de511b43bfa13348 (diff) | |
download | llvm-39e91098b58bfbef973bc759803fbfcc6064b42b.zip llvm-39e91098b58bfbef973bc759803fbfcc6064b42b.tar.gz llvm-39e91098b58bfbef973bc759803fbfcc6064b42b.tar.bz2 |
[libc] Enable integration tests targeting the GPU
This patch enables integration tests running on the GPU. This uses the
RPC interface implemented in D145913 to compile the necessary
dependencies for the integration test object. We can then use this to
compile the objects for the GPU directly and execute them using the AMD
HSA loader combined with its RPC server. For example, the compiler is
performing the following actions to execute the integration tests.
```
$ clang++ --target=amdgcn-amd-amdhsa -mcpu=gfx1030 -nostdlib -flto -ffreestanding \
crt1.o io.o quick_exit.o test.o rpc_client.o args_test.o -o image
$ ./amdhsa_loader image 1 2 5
args_test.cpp:24: Expected 'my_streq(argv[3], "3")' to be true, but is false
```
This currently only works with a single threaded client implementation
running on AMDGPU. Further work will implement multiple clients for AMD
and the ability to run on NVPTX as well.
Depends on D145913
Reviewed By: sivachandra, JonChesterfield
Differential Revision: https://reviews.llvm.org/D146256
Diffstat (limited to 'libc/startup')
-rw-r--r-- | libc/startup/gpu/amdgpu/CMakeLists.txt | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libc/startup/gpu/amdgpu/CMakeLists.txt b/libc/startup/gpu/amdgpu/CMakeLists.txt index d1c6fc7..891d209 100644 --- a/libc/startup/gpu/amdgpu/CMakeLists.txt +++ b/libc/startup/gpu/amdgpu/CMakeLists.txt @@ -16,5 +16,10 @@ add_startup_object( get_fq_target_name(crt1 fq_name) # Ensure that clang uses the correct linker for this object type. -target_link_libraries(${fq_name} PUBLIC - "--target=${LIBC_GPU_TARGET_TRIPLE}" "-flto") +target_link_libraries( + ${fq_name} + PUBLIC + "-mcpu=${LIBC_GPU_TARGET_ARCHITECTURE}" + "--target=${LIBC_GPU_TARGET_TRIPLE}" + "-flto" +) |