[libc-commits] [PATCH] D149517: [libc] Enable running libc unit tests on AMDGPU
Siva Chandra via Phabricator via libc-commits
libc-commits at lists.llvm.org
Sun Apr 30 01:30:28 PDT 2023
sivachandra added inline comments.
================
Comment at: libc/cmake/modules/LLVMLibCCheckCpuFeatures.cmake:47
+if(LIBC_TARGET_ARCHITECTURE_IS_GPU)
+ return()
----------------
jhuber6 wrote:
> sivachandra wrote:
> > Why was this moved?
> Previously it prevented the above functions from being defined which are queried in the test setup.
Ah! This is not ideal but I think doing it correctly is beyond the scope of this patch.
================
Comment at: libc/cmake/modules/LLVMLibCTestRules.cmake:74
function(create_libc_unittest fq_target_name)
- if(NOT LLVM_INCLUDE_TESTS)
+ if(NOT LLVM_INCLUDE_TESTS OR NOT LIBC_ENABLE_UNITTESTS)
return()
----------------
jhuber6 wrote:
> sivachandra wrote:
> > Do we ever want to run unit tests the GPU? If no, then I think the right thing to do is to convert the unit test targets to `add_libc_test` targets which will then do the right thing.
> I mostly did this because it was much less noise than converting everything to the new format. Since I figured that would be dependent on the rest of the `libc` project contributors to transition to the new test framework. This was the easy stopgap.
What we should be doing is, when adding an entrypoint to the GPU's `entrypoints.txt`, convert the entrypoint's unit tests to `add_libc_test`.
================
Comment at: libc/test/src/CMakeLists.txt:17
if(NOT LIBC_TESTS_CAN_USE_MPFR)
message("WARNING: Math test ${name} will be skipped as MPFR library is not available.")
return()
----------------
If it is just this annoying warning, you can modify this to:
```
message(VERBOSE "Math test ...")
```
Then, that warning will only be displayed if `--log-level` is set to `VERBOSE` or lower.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149517/new/
https://reviews.llvm.org/D149517
More information about the libc-commits
mailing list