Documentation
¶
Overview ¶
Package fpga provides zero-CGo bindings to FPGA runtime libraries via purego/dlopen. It supports Intel FPGA OpenCL Runtime (libintel_fpga_opencl) and Xilinx XRT (libxrt_coreutil) for accelerating ML inference on FPGAs.
Index ¶
- func Available() bool
- func GetDeviceCount() (int, error)
- type Context
- func (c *Context) CreateStream() (*Stream, error)
- func (c *Context) Destroy() error
- func (c *Context) DeviceID() int
- func (c *Context) Free(ptr unsafe.Pointer) error
- func (c *Context) Malloc(size int) (unsafe.Pointer, error)
- func (c *Context) Memcpy(dst, src unsafe.Pointer, count int, kind MemcpyKind) error
- type FPGALib
- type MemcpyKind
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Available ¶
func Available() bool
Available returns true if an FPGA runtime is available on this machine.
func GetDeviceCount ¶
GetDeviceCount returns the number of FPGA accelerator devices.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context holds an FPGA device context, command queue, and related state.
func NewContext ¶
NewContext creates an FPGA context on the specified device.
func (*Context) CreateStream ¶
CreateStream creates a new command queue.
type FPGALib ¶
type FPGALib struct {
// contains filtered or unexported fields
}
FPGALib holds dlopen handles and resolved function pointers for the FPGA runtime. Currently supports Intel FPGA OpenCL Runtime and Xilinx XRT. Function pointers are resolved at Open() time via dlsym.
type MemcpyKind ¶
type MemcpyKind int
MemcpyKind specifies the direction of a memory copy.
const ( MemcpyHostToDevice MemcpyKind = iota MemcpyDeviceToHost MemcpyDeviceToDevice )
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream wraps an FPGA command queue for stream-like semantics.
func (*Stream) Synchronize ¶
Synchronize waits for all commands in the queue to complete.