Idris2Doc : Spidr.Compiler.Xla.PJRT.C.PjrtCApi

Spidr.Compiler.Xla.PJRT.C.PjrtCApi

For internal spidr use, and use by plugin developers.

The Idris API for PJRT.

Reexports

import public Control.Monad.Either

Definitions

data PjrtApi : Type
  For use by plugin developers.

A minimal wrapper round a C `PJRT_Api` struct pointer. The memory should be owned by the
code producing the pointer.

Totality: total
Visibility: public export
Constructor: 
MkPjrtApi : AnyPtr -> PjrtApi
data PjrtErrorCode : Type
  The cause of a `PjrtError`.

Totality: total
Visibility: public export
Constructors:
PJRT_Error_Code_CANCELLED : PjrtErrorCode
PJRT_Error_Code_UNKNOWN : PjrtErrorCode
PJRT_Error_Code_INVALID_ARGUMENT : PjrtErrorCode
PJRT_Error_Code_DEADLINE_EXCEEDED : PjrtErrorCode
PJRT_Error_Code_NOT_FOUND : PjrtErrorCode
PJRT_Error_Code_ALREADY_EXISTS : PjrtErrorCode
PJRT_Error_Code_PERMISSION_DENIED : PjrtErrorCode
PJRT_Error_Code_RESOURCE_EXHAUSTED : PjrtErrorCode
PJRT_Error_Code_FAILED_PRECONDITION : PjrtErrorCode
PJRT_Error_Code_ABORTED : PjrtErrorCode
PJRT_Error_Code_OUT_OF_RANGE : PjrtErrorCode
PJRT_Error_Code_UNIMPLEMENTED : PjrtErrorCode
PJRT_Error_Code_INTERNAL : PjrtErrorCode
PJRT_Error_Code_UNAVAILABLE : PjrtErrorCode
PJRT_Error_Code_DATA_LOSS : PjrtErrorCode
PJRT_Error_Code_UNAUTHENTICATED : PjrtErrorCode

Hint: 
Show PjrtErrorCode
record PjrtError : Type
  Indicates an error in the PJRT C layer, either due to internal errors or user error.

Totality: total
Visibility: public export
Constructor: 
MkPjrtError : String -> Maybe PjrtErrorCode -> PjrtError

Projections:
.code : PjrtError -> Maybe PjrtErrorCode
  The error cause code, if one exists.
.message : PjrtError -> String
  The error message.

Hint: 
Show PjrtError
.message : PjrtError -> String
  The error message.

Totality: total
Visibility: public export
message : PjrtError -> String
  The error message.

Totality: total
Visibility: public export
.code : PjrtError -> Maybe PjrtErrorCode
  The error cause code, if one exists.

Totality: total
Visibility: public export
code : PjrtError -> Maybe PjrtErrorCode
  The error cause code, if one exists.

Totality: total
Visibility: public export
0 Pjrt : Type -> Type
  A `Pjrt a` produces an `a` or an error from the PJRT layer.

Totality: total
Visibility: public export
data PjrtEvent : Type
  For internal spidr use only.

Totality: total
Visibility: export
Constructor: 
MkPjrtEvent : AnyPtr -> PjrtEvent
pjrtEventAwait : PjrtApi -> PjrtEvent -> Pjrt ()
  For internal spidr use only.

Totality: total
Visibility: export
data PjrtClient : Type
  For use by plugin developers.

Totality: total
Visibility: export
Constructor: 
MkPjrtClient : GCAnyPtr -> PjrtClient
pjrtClientCreate : PjrtApi -> Pjrt PjrtClient
  For use by plugin developers.

Create a `PjrtClient`.

Totality: total
Visibility: export
data PjrtProgram : Type
  For internal spidr use only.

Totality: total
Visibility: export
Constructor: 
MkPjrtProgram : AnyPtr -> PjrtProgram
delete : HasIO io => PjrtProgram -> io ()
Totality: total
Visibility: export
mkPjrtProgram : HasIO io => CppString -> io PjrtProgram
  For internal spidr use only.

The `CppString` must live as long as the `PjrtProgram`.
It is up to the caller to deallocate the `PjrtProgram`.

Totality: total
Visibility: export
data PjrtLoadedExecutable : Type
  For internal spidr use only.

Totality: total
Visibility: export
Constructor: 
MkPjrtLoadedExecutable : AnyPtr -> PjrtLoadedExecutable
pjrtLoadedExecutableDestroy : HasIO io => PjrtApi -> PjrtLoadedExecutable -> io ()
  For internal spidr use only.

Totality: total
Visibility: export
pjrtClientCompile : PjrtApi -> PjrtClient -> PjrtProgram -> CppString -> Pjrt PjrtLoadedExecutable
  For internal spidr use only.

It is up to the caller to deallocate the `PjrtLoadedExecutable`.

Totality: total
Visibility: export
data PjrtBuffer : Type
  For internal spidr use only.

Totality: total
Visibility: export
Constructor: 
MkPjrtBuffer : AnyPtr -> PjrtBuffer
pjrtBufferDestroy : HasIO io => PjrtApi -> PjrtBuffer -> io ()
  For internal spidr use only.

Totality: total
Visibility: export
pjrtLoadedExecutableExecute : PjrtApi -> PjrtLoadedExecutable -> (outputs : Nat) -> Pjrt (Vect outputs PjrtBuffer)
  For internal spidr use only.

It is up to the caller to deallocate the `PjrtBuffer`s.

Totality: total
Visibility: export
pjrtEventDestroy : HasIO io => PjrtApi -> PjrtEvent -> io ()
  For internal spidr use only.

Totality: total
Visibility: export
pjrtBufferToHostBuffer : PjrtApi -> PjrtBuffer -> ArrayType a => Array a -> Pjrt ()
  For internal spidr use only.

This is a synchronous variant of PJRT's `PJRT_Buffer_ToHostBuffer`.
Unlike the PJRT API, it also handles zero-byte arrays.

Totality: total
Visibility: export