char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Ryan Crpc: support apple RDMA as an RPC transport (#26421)b114b4739

char/aliceai-t5-moe
886 B27 linesraw
1#pragma once
2
3#include <cstddef>
4#include <cstdint>
5#include <memory>
6
7struct apple_rdma {
8    // target_gid is 16 bytes in, caps is RPC_CONN_CAPS_SIZE bytes out.
9    static std::unique_ptr<apple_rdma> probe(int fd, const uint8_t * target_gid, uint8_t * caps);
10    ~apple_rdma();
11
12    // Peer endpoint from its caps, which must be non-zero: this blocks on a
13    // readiness handshake over fd that the peer only joins if it also has RDMA.
14    bool activate(const uint8_t * caps);
15
16    bool send(const void * data, size_t size);
17    bool recv(void * data, size_t size);
18    // Post the trailing partial frame; must be called at every message boundary.
19    bool flush();
20    // True once the connection has failed; the caller should drop the socket.
21    bool broken() const;
22
23private:
24    struct impl;
25    explicit apple_rdma(std::unique_ptr<impl> p);
26    std::unique_ptr<impl> pimpl;
27};