Documentation
¶
Overview ¶
Package sycl provides zero-CGo bindings to the SYCL runtime via purego/dlopen. It supports Intel oneAPI (libsycl.so) for accelerating ML inference on Intel GPUs, CPUs, and FPGAs through the SYCL standard.
Index ¶
- func Available() bool
- func GetDeviceCount() (int, error)
- func KernelsAvailable() bool
- func ScaledSoftmaxF32(input, output unsafe.Pointer, outer, inner, axisSize int, scale float32, ...) error
- func ScaledSoftmaxF32Available() bool
- func SgemvM1(y, A, x unsafe.Pointer, M, N int, stream unsafe.Pointer) error
- func SgemvM1Available() bool
- 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 MemcpyKind
- type SYCLKernelLib
- type SYCLLib
- type Stream
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Available ¶
func Available() bool
Available returns true if a SYCL runtime is available on this machine.
func GetDeviceCount ¶
GetDeviceCount returns the number of SYCL-capable devices.
func KernelsAvailable ¶
func KernelsAvailable() bool
KernelsAvailable returns true if the SYCL kernel library has been loaded.
func ScaledSoftmaxF32 ¶
func ScaledSoftmaxF32( input, output unsafe.Pointer, outer, inner, axisSize int, scale float32, stream unsafe.Pointer, ) error
ScaledSoftmaxF32 applies fused scaled softmax: output = softmax(input * scale).
func ScaledSoftmaxF32Available ¶
func ScaledSoftmaxF32Available() bool
ScaledSoftmaxF32Available returns true if the SYCL ScaledSoftmaxF32 kernel is available.
func SgemvM1 ¶
SgemvM1 computes y = A*x for M=1 decode (single-token GEMV). y[M], A[M x N] row-major, x[N]. All FP32.
func SgemvM1Available ¶
func SgemvM1Available() bool
SgemvM1Available returns true if the SYCL SgemvM1 kernel is available.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context holds a SYCL platform, device, context, and queue.
func NewContext ¶
NewContext creates a SYCL context on the specified device.
func (*Context) CreateStream ¶
CreateStream creates a new SYCL queue.
type MemcpyKind ¶
type MemcpyKind int
MemcpyKind specifies the direction of a memory copy.
const ( MemcpyHostToDevice MemcpyKind = iota MemcpyDeviceToHost MemcpyDeviceToDevice )
type SYCLKernelLib ¶
type SYCLKernelLib struct {
// contains filtered or unexported fields
}
SYCLKernelLib holds dlopen'd function pointers for custom SYCL kernels compiled into libsycl_kernels.so.
type SYCLLib ¶
type SYCLLib struct {
// contains filtered or unexported fields
}
SYCLLib holds dlopen handles and resolved function pointers for the SYCL runtime. Currently supports Intel oneAPI Level Zero runtime via libsycl.so. Function pointers are resolved at Open() time via dlsym.
type Stream ¶
type Stream struct {
// contains filtered or unexported fields
}
Stream wraps a SYCL queue for stream-like semantics.
func (*Stream) Synchronize ¶
Synchronize waits for all commands in the queue to complete.