gocl

package module
v2.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 10, 2021 License: MIT Imports: 5 Imported by: 0

README

gocl

An abstraction layer on the go-cl library.

Documentation

Index

Constants

View Source
const (
	DeviceTypeCPU         = cl.DeviceTypeCPU
	DeviceTypeGPU         = cl.DeviceTypeGPU
	DeviceTypeAccelerator = cl.DeviceTypeAccelerator
	DeviceTypeDefault     = cl.DeviceTypeDefault
	DeviceTypeAll         = cl.DeviceTypeAll
)

For convenience

Variables

This section is empty.

Functions

This section is empty.

Types

type Argument

type Argument interface {
	// contains filtered or unexported methods
}

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

func (*Buffer) Cleanup

func (b *Buffer) Cleanup()

func (*Buffer) GetData

func (b *Buffer) GetData(dataSize int, dataPtr unsafe.Pointer) error

func (*Buffer) GetDataArr

func (b *Buffer) GetDataArr(dataSize int, dataPtr unsafe.Pointer) error

func (*Buffer) GetDataFloat

func (b *Buffer) GetDataFloat() (float32, error)

func (*Buffer) GetDataFloatArr

func (b *Buffer) GetDataFloatArr() ([]float32, error)

func (*Buffer) GetDataImage

func (b *Buffer) GetDataImage() (image.Image, error)

func (*Buffer) GetDataInt

func (b *Buffer) GetDataInt() (int32, error)

func (*Buffer) GetDataIntArr

func (b *Buffer) GetDataIntArr() ([]int32, error)

type Const

type Const struct {
	// contains filtered or unexported fields
}

func NewConst

func NewConst(data interface{}) (*Const, error)

func (*Const) SetData

func (c *Const) SetData(data interface{}) error

type Program

type Program struct {
	// contains filtered or unexported fields
}

func NewProgram

func NewProgram(src string, kernelName string, platform, device int, kind cl.DeviceType) (*Program, error)

func (*Program) DeviceWorkGroupSize

func (p *Program) DeviceWorkGroupSize() int

DeviceWorkGroupSize gets the device's maximum OpenCL work group size for the kernel

func (*Program) Execute

func (p *Program) Execute(length []int, local []int, args ...Argument) error

Execute executes the kernel. The length should be the [width, height] for an image and [length] for an array.

func (*Program) MaxWorkGroupSize

func (p *Program) MaxWorkGroupSize() (int, error)

MaxWorkGroupSize gets the maximum OpenCL work group size for the kernel

func (*Program) NewBufferFromArr

func (p *Program) NewBufferFromArr(size int, dataPtr unsafe.Pointer, length int) (*Buffer, error)

func (*Program) NewBufferFromData

func (p *Program) NewBufferFromData(size int, dataPtr unsafe.Pointer) (*Buffer, error)

func (*Program) NewBufferFromFloat

func (p *Program) NewBufferFromFloat(data float32) (*Buffer, error)

func (*Program) NewBufferFromFloatArr

func (p *Program) NewBufferFromFloatArr(data []float32) (*Buffer, error)

func (*Program) NewBufferFromImage

func (p *Program) NewBufferFromImage(im image.Image) (*Buffer, error)

func (*Program) NewBufferFromInt

func (p *Program) NewBufferFromInt(data int32) (*Buffer, error)

func (*Program) NewBufferFromIntArr

func (p *Program) NewBufferFromIntArr(data []int32) (*Buffer, error)

func (*Program) NewEmptyFloat32Arr

func (p *Program) NewEmptyFloat32Arr(length int) (*Buffer, error)

func (*Program) PreferredWorkGroupSize

func (p *Program) PreferredWorkGroupSize() (int, error)

PrefferedWorkGroupSize gets the preferred OpenCL local work group size

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL