History log of /llvm-project/libc/src/__support/OSUtil/gpu/io.cpp (Results 1 – 17 of 17)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5
# a6ef0deb 02-Dec-2024 Joseph Huber <huberjn@outlook.com>

[libc][NFC] Rename RPC opcodes to better reflect their usage

Summary:
RPC_ is a generic prefix here, use LIBC_ to indicate that these are
opcodes used to implement the C library


Revision tags: llvmorg-19.1.4, llvmorg-19.1.3
# be0c67c9 15-Oct-2024 Joseph Huber <huberjn@outlook.com>

[libc] Remove dependency on `cpp::function` in `rpc.h` (#112422)

Summary:
I'm going to attempt to move the `rpc.h` header to a separate folder
that we can install and include outside of `libc`. Befo

[libc] Remove dependency on `cpp::function` in `rpc.h` (#112422)

Summary:
I'm going to attempt to move the `rpc.h` header to a separate folder
that we can install and include outside of `libc`. Before doing this I'm
going to try to trim up the file so there's not as many things I need to
copy to make it work. This dependency on `cpp::functional` is a low
hanging fruit. I only did it so that I could overload the argument of
the work function so that passing the id was optional in the lambda,
that's not a *huge* deal and it makes it more explicit I suppose.

show more ...


Revision tags: llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init
# 5ff3ff33 12-Jul-2024 Petr Hosek <phosek@google.com>

[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98597)

This is a part of #97655.


# ce9035f5 12-Jul-2024 Mehdi Amini <joker.eph@gmail.com>

Revert "[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration" (#98593)

Reverts llvm/llvm-project#98075

bots are broken


# 3f30effe 11-Jul-2024 Petr Hosek <phosek@google.com>

[libc] Migrate to using LIBC_NAMESPACE_DECL for namespace declaration (#98075)

This is a part of #97655.


Revision tags: llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2
# b6bc9d72 26-Sep-2023 Guillaume Chatelet <gchatelet@google.com>

[libc] Mass replace enclosing namespace (#67032)

This is step 4 of
https://discourse.llvm.org/t/rfc-customizable-namespace-to-allow-testing-the-libc-when-the-system-libc-is-also-llvms-libc/73079


Revision tags: llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init
# 1f578347 18-Jul-2023 Guillaume Chatelet <gchatelet@google.com>

[libc][NFC] Rename files

This patch mostly renames files so it better reflects the function they declare.

Reviewed By: michaelrj

Differential Revision: https://reviews.llvm.org/D155607


Revision tags: llvmorg-16.0.6
# dcdfc963 06-Jun-2023 Joseph Huber <jhuber6@vols.utk.edu>

[libc] Export GPU extensions to `libc` for external use

The GPU port of the LLVM C library needs to export a few extensions to
the interface such that users can interface with it. This patch adds th

[libc] Export GPU extensions to `libc` for external use

The GPU port of the LLVM C library needs to export a few extensions to
the interface such that users can interface with it. This patch adds the
necessary logic to define a GPU extension. Currently, this only exports
a `rpc_reset_client` function. This allows us to use the server in
D147054 to set up the RPC interface outside of `libc`.

Depends on https://reviews.llvm.org/D147054

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D152283

show more ...


# e6a350df 05-Jun-2023 Joseph Huber <jhuber6@vols.utk.edu>

[libc] Replace the `PRINT_TO_STDERR` opcode for RPC printing.

A previous patch added general support for printing via the RPC
interface. we should consolidate this functionality and get rid of the
o

[libc] Replace the `PRINT_TO_STDERR` opcode for RPC printing.

A previous patch added general support for printing via the RPC
interface. we should consolidate this functionality and get rid of the
old opcode that was used for simple testing.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D152211

show more ...


Revision tags: llvmorg-16.0.5
# e826762a 19-May-2023 Joseph Huber <jhuber6@vols.utk.edu>

[libc] More efficiently send bytes via `send_n` and `recv_n`

Currently we have the `send_n` and `recv_n` routines to stream data,
such as a string to print, to the other side. The first operation is

[libc] More efficiently send bytes via `send_n` and `recv_n`

Currently we have the `send_n` and `recv_n` routines to stream data,
such as a string to print, to the other side. The first operation is to
send the size so the other side knows the number of bytes to recieve.
However, this wasted 56 bytes that could've been sent. This meant that
small values, like the arguments to a function to call on the host for
example, needed to perform an extra send. This patch sends the first 56
bytes in the first packet and continues if necessary.

Depends on D150992

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D151041

show more ...


Revision tags: llvmorg-16.0.4
# 91b6d319 08-May-2023 Joseph Huber <jhuber6@vols.utk.edu>

[libc] Make the opcode parameter a compile time constant

Currently the opcode is only valid if it is the same between all of the
ports. This is possible to violate if the opcode is places into a mem

[libc] Make the opcode parameter a compile time constant

Currently the opcode is only valid if it is the same between all of the
ports. This is possible to violate if the opcode is places into a memory
location and then read in a non-uniform manner by the warp / wavefront.
Moving this to a compile time constant makes it impossible to break this
invariant.

Reviewed By: JonChesterfield

Differential Revision: https://reviews.llvm.org/D150115

show more ...


# 218b50a6 03-May-2023 Jon Chesterfield <jonathanchesterfield@gmail.com>

[libc][rpc] Simplify mailbox state tracking

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 pac

[libc][rpc] Simplify mailbox state tracking

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

show more ...


Revision tags: llvmorg-16.0.3
# 91528d20 28-Apr-2023 Joseph Huber <jhuber6@vols.utk.edu>

[libc] Fix printing on the GPU when given a `cpp::string_ref`

The implementation of the test printing currently expects a null
terminated C-string. However, the `write_to_stderr` interface uses a
st

[libc] Fix printing on the GPU when given a `cpp::string_ref`

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

show more ...


Revision tags: llvmorg-16.0.2
# d0ff5e40 14-Apr-2023 Joseph Huber <jhuber6@vols.utk.edu>

[libc] Update RPC interface for system utilities on the GPU

This patch reworks the RPC interface to allow more generic memory
operations using the shared better. This patch decomposes the entire RPC

[libc] Update RPC interface for system utilities on the GPU

This patch reworks the RPC interface to allow more generic memory
operations using the shared better. This patch decomposes the entire RPC
interface into opening a port and calling `send` or `recv` on it.

The `send` function sends a single packet of the length of the buffer.
The `recv` function is paired with the `send` call to then use the data.
So, any aribtrary combination of sending packets is possible. The only
restriction is that the client initiates the exchange with a `send`
while the server consumes it with a `recv`.

The operation of this is driven by two independent state machines that
tracks the buffer ownership during loads / stores. We keep track of two
so that we can transition between a send state and a recv state without
an extra wait. State transitions are observed via bit toggling, e.g.

This interface supports an efficient `send -> ack -> send -> ack -> send`
interface and allows for the last send to be ignored without checking
the ack.

A following patch will add some more comprehensive testing to this interface. I
I informally made an RPC call that simply incremented an integer and it took
roughly 10 microsends to complete an RPC call.

Reviewed By: jdoerfert

Differential Revision: https://reviews.llvm.org/D148288

show more ...


Revision tags: llvmorg-16.0.1
# 9a99afb4 01-Apr-2023 Guillaume Chatelet <gchatelet@google.com>

[libc] Use string_view for write_to_stderr

This patch makes use of `cpp::string_view` instead of `const char*` for `write_to_stderr`. This helps sending non null-terminated buffers such as a single

[libc] Use string_view for write_to_stderr

This patch makes use of `cpp::string_view` instead of `const char*` for `write_to_stderr`. This helps sending non null-terminated buffers such as a single character, `cpp::string_view` or `cpp::string`.
It also fizes the gpu version that had several bugs (See https://reviews.llvm.org/D145913#4236641).

Differential Revision: https://reviews.llvm.org/D147375

show more ...


# ae30ae23 20-Mar-2023 Joseph Huber <jhuber6@vols.utk.edu>

[libc][NFC] Add some missing comments to the RPC implementation

Summary:
These comments were accidentally dropped from the committed version. Add
them back in.


Revision tags: llvmorg-16.0.0, llvmorg-16.0.0-rc4
# 8e4f9b1f 10-Mar-2023 Joseph Huber <jhuber6@vols.utk.edu>

[libc] Add initial support for an RPC mechanism for the GPU

This patch adds initial support for an RPC client / server architecture.
The GPU is unable to perform several system utilities on its own,

[libc] Add initial support for an RPC mechanism for the GPU

This patch adds initial support for an RPC client / server architecture.
The GPU is unable to perform several system utilities on its own, so in
order to implement features like printing or memory allocation we need
to be able to communicate with the executing process. This is done via a
buffer of "sharable" memory. That is, a buffer with a unified pointer
that both the client and server can use to communicate.

The implementation here is based off of Jon Chesterfields minimal RPC
example in his work. We use an `inbox` and `outbox` to communicate
between if there is an RPC request and to signify when work is done.
We use a fixed-size buffer for the communication channel. This is fixed
size so that we can ensure that there is enough space for all
compute-units on the GPU to issue work to any of the ports. Right now
the implementation is single threaded so there is only a single buffer
that is not shared.

This implementation still has several features missing to be complete.
Such as multi-threaded support and asynchrnonous calls.

Depends on D145912

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D145913

show more ...