| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
| |
This reverts commit fb6faf4798b1cb327e719898e2ea6eff7f597c49 as the
aarch64 builders are failing.
|
|
|
|
|
|
|
|
|
|
| |
A target for the test named ${fq_target_name} has been added. It depends
on ${fq_target_name}.__unit__ and ${fq_target_name}.__hermetic__ as
relevant.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D149730
|
|
|
|
|
|
|
|
|
|
|
|
| |
We use a bump pointer to implement malloc for the hermetic tests.
Currently, we bump the pointer up by any amount. This means that calling
`malloc(1)` will misalign the buffer so any following `malloc(8)`
accesses will not be aligned. This causes problems in architectures
which require alignment.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149863
|
|
|
|
|
|
|
|
|
|
| |
Will be necessary for correct locking on volta.
API-only change to help with rebasing the rest of the stack on this.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D149871
|
|
|
|
|
|
|
|
|
| |
Now that a large amount of GPU tests can be run in parallel, we should
document spurious failures. It is a well-known issue that launching many
GPU applications in parallel can lead to various problems, the worst of
which being an indefinite hang.
Differential Revision: https://reviews.llvm.org/D149857
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous patches added the necessary support for global constructors
used to register tests. This patch enables the NVPTX target to build
and run the unit tests on the GPU. Currently this only tests the ctype
tests, but adding more should be straightforward from here on.
This ran all the ctest unit tests when run on an sm_70.
Depends on D149517 D149527
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149532
|
|
|
|
|
|
|
|
| |
Reduces line noise and localises changes needed for volta
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D149845
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the necessary hacks to support global constructors and
destructors. This is an incredibly hacky process caused by the primary
fact that Nvidia does not provide any binary tools and very little
linker support. We first had to emit references to these functions and
their priority in D149451. Then we dig them out of the module once it's
loaded to manually create the list that the linker should have made for
us. This patch also contains a few Nvidia specific hacks, but it passes
the test, albeit with a stack size warning from `ptxas` for the
callback. But this should be fine given the resource usage of a common
test.
This also adds a dependency on LLVM to the NVPTX loader, which hopefully doesn't
cause problems with our CUDA buildbot.
Depends on D149451
Reviewed By: tra
Differential Revision: https://reviews.llvm.org/D149527
|
|
|
|
|
|
|
|
| |
Left out of D149788 to simplify the diff
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D149807
|
|
|
|
|
|
|
|
|
|
|
| |
The previous patches added the necessary support for global constructors
used to register tests. This patch enables the AMDGPU target to build
and run the unit tests on the GPU. Currently this only tests the `ctype`
tests, but adding more should be straightforward from here on.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149517
|
|
|
|
|
|
|
|
| |
Noticed in passing. Either way compiles.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D149808
|
|
|
|
|
|
|
| |
The `-v` flag means verbose and not version.
With `clang` this flag prints the version and exits successfully.
Under `GCC` this is not a valid command line so the binary exits with
an error.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removes the redundant Ack/Data bit manipulation.
Represents the inbox/outbox state with one bit instead of two. This will
be useful if we change to a packed representation and otherwise cuts the
runtime state space from 16 to 4.
Further simplification is possible, this patch is intentionally minimal.
- can_{send,recv}_data are now in == out
- {client,server}::try_open can be factored into Process:try_open
This implements the state machine of D148191, modulo differences in atomic
ordering and fences.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D149788
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Prevent operation reordering with fence instead of a comment.
The mailboxes are in shared memory and the locks structure in device memory.
If the mailboxes are read and then the lock taken, the lock says nothing
about the current or future state of those mail boxes. The relaxed atomic
fetch_or can be reordered before the relaxed atomic loads of unrelated
variables unless there is a fence preventing this.
Patches both Client::try_open and Server::try_open, one of which is missing
an optimisation and the other is missing the comment, but which otherwise
could be Process::try_open followed by buffer->opcode = opcode in Client.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D149790
|
|
|
|
|
|
|
|
|
|
|
| |
Decimal long doubles are not commonly used, and aren't currently
supported by the algorithm used for decimal float conversions. To avoid
giving incorrect answers, this patch adds a temporary exception to print
long doubles in hexadecimal even when decimal is requested.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D148179
|
|
|
|
|
|
|
|
|
|
| |
This patch adds the function "socket" from the header "sys/socket". It's
a simple syscall wrapper, and I plan on adding the related functions in
a followup patch.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149622
|
|
|
|
|
|
|
|
|
| |
We got rid of the rounding mode here so that the hermetic tests wouldn't
depend on the system fenv.h. But this seemed to cause some bots to
break. Getting rid of this change for now, it should be fine for the CPU
builds.
Differential Revision: https://reviews.llvm.org/D149767
|
|
|
|
|
|
|
|
|
|
|
| |
We previously changed this to use `nolibc` to allow it to link in
compiler builtins for the CPU build. However, these options are unused
on the GPU and create a lot of noise. Furthermore, we want to use
`nogpulib` to prevent the linking in of the vendor libraries.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149753
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch updates the `__support` unit tests to be built as hermetic
tests. The only tests we needed to disable were because of the use of
`realloc` which is not implemented correctly as it doesn't copy the
memory.
Depends on D149745
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149750
|
|
|
|
|
|
|
|
|
|
|
|
| |
The FPEceptMatcher.cpp file uses system utilities and includes C++
libraries. This patch pulls it out of the main `FPTestHelpers` target so
we can exclude it from hermetic only tests.
Depends on D149705
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149745
|
|
|
|
|
|
|
|
|
|
|
| |
This changes the `stdlib` tests to the new `add_libc_test` framework.
This applies to all but the exit tests.
Depends on D149691
Reviewed By: sivachandra, michaelrj
Differential Revision: https://reviews.llvm.org/D149705
|
|
|
|
|
|
|
|
|
| |
We previously used a more stricter -nostdlib option which was also removing
compiler-rt/libgcc.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D149683
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `add_libc_test` option allows us to enable both kinds of tests in a
single option. However, some tests cannot be made hermetic with the
current approach. Such as tests that rely on system utilities or
libraries. This patch adds two options `UNIT_TEST_ONLY` and
`HERMETIC_TEST_ONLY` to offer more fine-grained control over which
version gets built. This makes it explicit which version a test supports
and why.
Depends on D149662
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149691
|
|
|
|
|
|
|
|
|
|
|
|
| |
This changes over the string unit tests to the new `add_libc_test`
framework. The one test that wasn't changes was the memory utils because
it overran the static buffer used for the hermetic test's bump pointer.
Depends on D149656
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149662
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently we use `assert` as a stand-in for the typical test assertions.
This is because these functions exist outside of the base test class so
we can't use the typical assertion methods. The presence of these
asserts makes it difficult to compile these tests in a standalone
format. This patch removes all occurrences.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149656
|
|
|
|
|
|
|
|
|
|
|
| |
This patch addresses some of the flags and features that are currently
missing from the hermetic test support. This mostly just fixes the
`add_libc_test` option failing to find a few dependencies or missing
arguments from the previous unit test support.
Reviewed By: lntue
Differential Revision: https://reviews.llvm.org/D149629
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch makes the necessary changes to support calling global
constructors and destructors on the GPU. The patch in D149340 allows the
`lld` linker to create the symbols pointing us to these globals. These
should be executed by a single thread, which is more difficult on the
GPU because all threads are active. I chose to use an atomic counter to
sync every thread on the GPU. This is very slow if you use more than a
few thousand threads, but for testing purposes it should be sufficient.
Depends on D149340 D149363
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149398
|
|
|
|
|
|
|
|
|
|
|
|
| |
The implementation of the test printing currently expects a null
terminated C-string. However, the `write_to_stderr` interface uses a
string view, which doesn't need to be null terminated. This patch
changes the printing interface to directly use `fwrite` instead rather
than relying on a null terminator.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149493
|
|
|
|
|
|
|
|
|
|
|
| |
The time functions have not yet been updated to match our new coding
patterns. This patch removes some unnecessary includes, adjusts the
names of the test targets, and adds several TODO comments. It is my
intention to follow this patch up with additional cleanup.
Reviewed By: sivachandra, rtenneti
Differential Revision: https://reviews.llvm.org/D149487
|
|
|
|
|
|
|
|
|
|
|
| |
The differential fuzzer for atof found a bug in glibc's handling of
hexadecimal rounding. Since we can't easily update glibc and we want to
avoid false positives when running the fuzzer, I've added an exception
to skip all hexadecimal subnormal cases.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149359
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch implements the `exit` function on the GPU. This required
breaking the entrypoints calling eachother on `linux` since this doesn't
work with a non-aliased target. This is only partial support because
full support requires a malloc / free implementation for the exit
callbacks array.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149363
|
|
|
|
|
|
|
|
|
| |
This patch simply enables building the integer `abs` functions for the
GPU.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149317
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch enables us to use the existing `libc` support for string
conversion functions on the GPU. This required setting the `fenv_t` and
long double configuration. As far as I am aware, long doubles are
converted to doubles on the GPU and the floating point environment is
just an `uint32_t`.
This code is still untested as we are still working out how to run the
unit tests on the GPU.
Reviewed By: michaelrj
Differential Revision: https://reviews.llvm.org/D149306
|
|
|
|
|
|
|
| |
Summary:
This patch adds a way to get the total number of blocks and implement
the wave sync intrinsic for AMDGPU. This is a no-op, but that may change
in the future so we might as well implement it right.
|
|
|
|
|
|
|
|
|
|
| |
The existing LibcTestMain has been renamed to LibcUnitTestMain.
Hermetic tests are linked to LibcHermeticTestMain and unit tests are
linked to LibcUnitTestMain.
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D149303
|
|
|
|
|
|
|
| |
Summary:
This patch makes this only apply to the GPU build. This should be
handled more intelligently in the future so it's common between all of t
hem.
|
|
|
|
|
|
|
| |
Summary:
This is a little broken, what we really need is a separate target to use
with the hermetic tests, but this is a stop-gap to get the bots green
again.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The `atexit` function controls registering functions to call at the end
of the program. This is difficult to do in general on the GPU because of
the lack of a real mutex implementation. We primarily provide this for
testing where we can explicitly restrict how the `atexit` registration
functions are called. So we simply create a passthrough Mutex to get
past the usage of it as per @sivachandra's suggestion.
Depends on D149225
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149226
|
|
|
|
|
|
|
|
|
| |
We need to perform the GPU build separately. The `CXX_STANDARD` option
was not being passed properly.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149225
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The previous patch in D149216 allows us to use the internal `<stdlib.h>`
include for the GPU build. However, we currently don't provide the
memory functions so the header wasn't resolving them. This patch adds
these as entrypoints. They don't cause any entrypoints to be emitted
because they are not implemented, but they provide it in the header so
that we can rely on the test's implementation of them.
Depends on D149216
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149217
|
|
|
|
|
|
|
|
|
|
| |
The generated header files live in the build directory's include path.
When targeting a hermetic build we want to make sure we only use headers
generated by the project itself if availible.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149216
|
|
|
|
|
|
|
|
|
|
|
| |
This patch adds targets for printf and fprintf to the bazel build.
Additionally, it adds support for the build system to specify where
files should be written for testing purposes. This was necessary to
enable the fprintf test under bazel.
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D147008
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
| |
Previously used SYS_sched_get_priority_min. This also updates the tests
for SCHED_RR and SCHED_FIFO to check max_priority > min_priority, rather
than >= in order to catch future breakages.
Reviewed By: michaelrj, goldstein.w.n
Differential Revision: https://reviews.llvm.org/D149102
|
|
|
|
|
|
| |
Summary:
This causes problems when included. Fix this to hopefully get the bots
working again.
|
|
|
|
|
|
|
|
| |
Summary:
The previous GPU `libc` patch added support for `atoi`. However, it
didn't also enable generating the errno header. This caused including it
to use the system's header which invariably will cause compiler
problems.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The 'errno' value is most likely not useful on the GPU and it prevents
us from providing certain functions on the GPU that depend on it, like
`atoi`. This patch makes the necessary changes to support `errno` by
simple replacing it with a consumer class.
Supporting `errno` on the GPU is possible in some aspects. The first
approach would be to use a buffer of shared memory that has enough space
for all threads. Another option would be to change code generation to
support `thread_local` using `address_space(5)` memory allocated at
kernel launch. The former could look like the following, which could be
implemented in a later patch:
```
template <typename T>
using SharedBuffer = T[gpu::MAX_THREADS] [[clang::address_space(3)]];
template <typename T> struct ErrnoSetter {
constexpr ErrnoSetter(SharedBuffer<T> &storage) : storage(storage) {}
SharedBuffer<T> &storage;
void operator=(const T &val) { storage[gpu::get_thread_id()] = val; }
};
static SharedBuffer<int> thread_local_buffer [[clang::loader_uninitialized]];
ErrnoSetter<int> __llvmlibc_internal_errno(thread_local_buffer);
```
Reviewed By: sivachandra
Differential Revision: https://reviews.llvm.org/D149107
|
| |
|
|
|
|
|
|
| |
The bots are timing out because they are trying to run this test.
Differential Revision: https://reviews.llvm.org/D149108
|
|
|
|
|
|
| |
Reviewed By: jhuber6
Differential Revision: https://reviews.llvm.org/D149105
|