pie 0.1.1

Programmable Inference Engine (PIE)
Documentation
interface allocate {

    use core.{queue};

    type object-id = u32;   // Object identifier type (unsigned 32-bit integer)

    // Get the size of a KV page
    get-kv-page-size: func(queue: borrow<queue>) -> u32;

    // List all exported KV pages with their names and page counts
    get-all-exported-kv-pages: func(queue: borrow<queue>) -> list<tuple<string, u32>>;

    // Allocate a number of KV pages and return their object IDs
    allocate-kv-pages: func(queue: borrow<queue>, kv-page-ids: list<object-id>);

    // Deallocate the given KV page IDs
    deallocate-kv-pages: func(queue: borrow<queue>, kv-page-ids: list<object-id>);

    // Allocate a number of embed objects and return their object IDs
    allocate-embeds: func(queue: borrow<queue>, embed-ids: list<object-id>);

    // Deallocate the given embed object IDs
    deallocate-embeds: func(queue: borrow<queue>, embed-ids: list<object-id>);

    // Copy data between two KV pages with specified offsets and size
    copy-kv-page: func(queue: borrow<queue>, src-kv-page-id: object-id, dst-kv-page-id: object-id, src-offset: u32, dst-offset: u32, size: u32);

    // Export KV pages under a given name
    export-kv-pages: func(queue: borrow<queue>, src-kv-page-ids: list<object-id>, name: string, persistent: bool);

    // Undo the export of KV pages under a given name
    unexport-kv-pages: func(queue: borrow<queue>, name: string);

    // Import KV pages by name into specified destination IDs
    import-kv-pages: func(queue: borrow<queue>, dst-kv-page-ids: list<object-id>, name: string);
}