Documentation ¶
Index ¶
- Constants
- func Initialize() error
- func InitializeGLSharing() error
- type Buffer
- type BufferData
- type BufferType
- type CLGLObjectType
- type CLGLTextureInfo
- type CommandQueue
- func (cq CommandQueue) EnqueueAcquireGLObjects(objects []Buffer) error
- func (cq CommandQueue) EnqueueBarrier() error
- func (cq CommandQueue) EnqueueMapBuffer(buffer Buffer, blockingMap bool, flags []MapFlag, data *BufferData) error
- func (cq CommandQueue) EnqueueMapImage(image Buffer, blockingMap bool, flags []MapFlag, data *ImageData) error
- func (cq CommandQueue) EnqueueNDRangeKernel(kernel Kernel, workDim uint, ...) error
- func (cq CommandQueue) EnqueueReadBuffer(buffer Buffer, blockingRead bool, data *BufferData) error
- func (cq CommandQueue) EnqueueReadImage(image Buffer, blockingRead bool, data *ImageData) error
- func (cq CommandQueue) EnqueueReleaseGLObjects(objects []Buffer) error
- func (cq CommandQueue) EnqueueUnmapBuffer(buffer Buffer, data *BufferData) error
- func (cq CommandQueue) EnqueueWriteBuffer(buffer Buffer, blockingWrite bool, data *BufferData) error
- func (cq CommandQueue) Finish() error
- func (cq CommandQueue) Flush() error
- func (cq CommandQueue) Release() error
- type CommandQueueProperty
- type Context
- func (c Context) CreateBuffer(flags []MemFlag, size uint) (Buffer, error)
- func (c Context) CreateCommandQueue(device Device) (CommandQueue, error)
- func (c Context) CreateCommandQueueWithProperties(device Device, properties []CommandQueueProperty) (CommandQueue, error)
- func (c Context) CreateFromGLTexture(flags []MemFlag, target GLEnum, texture GLUint) (Buffer, error)
- func (c Context) CreateImage2D(flags []MemFlag, format ImageFormat, width, height int) (Buffer, error)
- func (c Context) CreateProgram(source string) (Program, error)
- func (c Context) Release() error
- type ContextProperties
- type Device
- type DeviceType
- type Event
- type Extension
- type GLEnum
- type GLInt
- type GLUint
- type ImageChannelOrder
- type ImageChannelType
- type ImageData
- type ImageFormat
- type Kernel
- type KernelArg
- type MapFlag
- type MemFlag
- type Platform
- func (p Platform) GetDevices(deviceType DeviceType) ([]Device, error)
- func (p Platform) GetExtensions() ([]Extension, error)
- func (p Platform) GetName() (string, error)
- func (p Platform) GetProfile() (string, error)
- func (p Platform) GetVendor() (string, error)
- func (p Platform) GetVersion() (string, error)
- type Program
- type ProgramBuildOptions
- type Version
Constants ¶
View Source
const (
CL_SUCCESS = 0
)
View Source
const (
MemInfoSize memInfo = 0x1102
)
Variables ¶
This section is empty.
Functions ¶
func Initialize ¶
func Initialize() error
func InitializeGLSharing ¶
func InitializeGLSharing() error
Types ¶
type Buffer ¶
type Buffer uint
func (Buffer) GetGLObjectInfo ¶
func (b Buffer) GetGLObjectInfo() (CLGLObjectType, error)
func (Buffer) GetGLTextureInfo ¶
func (b Buffer) GetGLTextureInfo(info CLGLTextureInfo) (uint32, error)
type BufferData ¶
func GetBufferData ¶
func GetBufferData[T BufferType](data []T) *BufferData
type BufferType ¶
type CLGLObjectType ¶
type CLGLObjectType uint32
const ( CLGLObjectBuffer CLGLObjectType = 0x2000 CLGLObjectTexture2D CLGLObjectType = 0x2001 CLGLObjectTexture3D CLGLObjectType = 0x2002 CLGLObjectRenderBuffer CLGLObjectType = 0x2003 // ... CLGLObjectTextureBuffer CLGLObjectType = 0x2011 )
type CLGLTextureInfo ¶
type CLGLTextureInfo uint32
const ( CLGLTextureTarget CLGLTextureInfo = 0x2004 CLGLTextureMipmapLevel CLGLTextureInfo = 0x2005 )
type CommandQueue ¶
type CommandQueue uint
func (CommandQueue) EnqueueAcquireGLObjects ¶
func (cq CommandQueue) EnqueueAcquireGLObjects(objects []Buffer) error
func (CommandQueue) EnqueueBarrier ¶
func (cq CommandQueue) EnqueueBarrier() error
func (CommandQueue) EnqueueMapBuffer ¶
func (cq CommandQueue) EnqueueMapBuffer(buffer Buffer, blockingMap bool, flags []MapFlag, data *BufferData) error
func (CommandQueue) EnqueueMapImage ¶
func (CommandQueue) EnqueueNDRangeKernel ¶
func (cq CommandQueue) EnqueueNDRangeKernel(kernel Kernel, workDim uint, globalOffsets, globalWorkSizes, localWorkSizes []uint64) error
func (CommandQueue) EnqueueReadBuffer ¶
func (cq CommandQueue) EnqueueReadBuffer(buffer Buffer, blockingRead bool, data *BufferData) error
func (CommandQueue) EnqueueReadImage ¶
func (cq CommandQueue) EnqueueReadImage(image Buffer, blockingRead bool, data *ImageData) error
func (CommandQueue) EnqueueReleaseGLObjects ¶
func (cq CommandQueue) EnqueueReleaseGLObjects(objects []Buffer) error
func (CommandQueue) EnqueueUnmapBuffer ¶
func (cq CommandQueue) EnqueueUnmapBuffer(buffer Buffer, data *BufferData) error
func (CommandQueue) EnqueueWriteBuffer ¶
func (cq CommandQueue) EnqueueWriteBuffer(buffer Buffer, blockingWrite bool, data *BufferData) error
func (CommandQueue) Finish ¶
func (cq CommandQueue) Finish() error
func (CommandQueue) Flush ¶
func (cq CommandQueue) Flush() error
func (CommandQueue) Release ¶
func (cq CommandQueue) Release() error
type CommandQueueProperty ¶
type CommandQueueProperty uint32
const ( CommandQueueOutOfOrderExecModeEnable CommandQueueProperty = (1 << 0) CommandQueueProfilingEnable CommandQueueProperty = (1 << 1) CommandQueueOnDevice CommandQueueProperty = (1 << 2) CommandQueueOnDeviceDefault CommandQueueProperty = (1 << 3) )
type Context ¶
type Context uint
func (Context) CreateBuffer ¶
func (Context) CreateCommandQueue ¶
func (c Context) CreateCommandQueue(device Device) (CommandQueue, error)
func (Context) CreateCommandQueueWithProperties ¶
func (c Context) CreateCommandQueueWithProperties(device Device, properties []CommandQueueProperty) (CommandQueue, error)
func (Context) CreateFromGLTexture ¶
func (Context) CreateImage2D ¶
type ContextProperties ¶
type Device ¶
type Device uint
func (Device) CreateContext ¶
func (d Device) CreateContext(properties *ContextProperties) (Context, error)
func (Device) GetExtensions ¶
type DeviceType ¶
type DeviceType uint32
const ( DeviceTypeDefault DeviceType = 1 << 0 DeviceTypeCPU DeviceType = 1 << 1 DeviceTypeGPU DeviceType = 1 << 2 DeviceTypeAccelerator DeviceType = 1 << 3 DeviceTypeCustom DeviceType = 1 << 4 DeviceTypeAll DeviceType = 0xFFFFFFFF )
type ImageChannelOrder ¶
type ImageChannelOrder uint32
const ( ImageChannelOrder_R ImageChannelOrder = 0x10B0 ImageChannelOrder_A ImageChannelOrder = 0x10B1 ImageChannelOrder_RG ImageChannelOrder = 0x10B2 ImageChannelOrder_RA ImageChannelOrder = 0x10B3 ImageChannelOrder_RGB ImageChannelOrder = 0x10B4 ImageChannelOrder_RGBA ImageChannelOrder = 0x10B5 ImageChannelOrder_BGRA ImageChannelOrder = 0x10B6 ImageChannelOrder_ARGB ImageChannelOrder = 0x10B7 ImageChannelOrder_Intensity ImageChannelOrder = 0x10B8 ImageChannelOrder_Luminance ImageChannelOrder = 0x10B9 )
type ImageChannelType ¶
type ImageChannelType uint32
const ( ImageChannelType_SNormInt8 ImageChannelType = 0x10D0 ImageChannelType_SNormInt16 ImageChannelType = 0x10D1 ImageChannelType_UNormInt8 ImageChannelType = 0x10D2 ImageChannelType_UNormInt16 ImageChannelType = 0x10D3 ImageChannelType_UNormShort565 ImageChannelType = 0x10D4 ImageChannelType_UNormShort555 ImageChannelType = 0x10D5 ImageChannelType_UNormInt101010 ImageChannelType = 0x10D6 ImageChannelType_SignedInt8 ImageChannelType = 0x10D7 ImageChannelType_SignedInt16 ImageChannelType = 0x10D8 ImageChannelType_SignedInt32 ImageChannelType = 0x10D9 ImageChannelType_UnsignedInt8 ImageChannelType = 0x10DA ImageChannelType_UnsignedInt16 ImageChannelType = 0x10DB ImageChannelType_UnsignedInt32 ImageChannelType = 0x10DC ImageChannelType_HalfFloat ImageChannelType = 0x10DD ImageChannelType_Float ImageChannelType = 0x10DE // CL_VERSION 2.1 ImageChannelType_UNormInt101010_2 ImageChannelType = 0x10E0 )
type ImageData ¶
type ImageData struct { *BufferData Origin [3]uint Region [3]uint RowPitch uint SlicePitch uint }
func GetImageBufferData ¶
type ImageFormat ¶
type ImageFormat struct { ChannelOrder ImageChannelOrder ChannelType ImageChannelType }
type KernelArg ¶
type KernelArg struct {
// contains filtered or unexported fields
}
func NewKernelArg ¶
type MemFlag ¶
type MemFlag uint32
const ( MemFlagsReadWrite MemFlag = 1 << 0 MemFlagsWriteOnly MemFlag = 1 << 1 MemFlagsReadOnly MemFlag = 1 << 2 MemFlagsUseHostPtr MemFlag = 1 << 3 MemFlagsAllocHostPtr MemFlag = 1 << 4 MemFlagsCopyHostPtr MemFlag = 1 << 5 // reserved MemFlagsHostWriteOnly MemFlag = 1 << 7 MemFlagsHostReadOnly MemFlag = 1 << 8 MemFlagsHostNoAccess MemFlag = 1 << 9 )
type Platform ¶
type Platform uint
func GetPlatforms ¶
func (Platform) GetDevices ¶
func (p Platform) GetDevices(deviceType DeviceType) ([]Device, error)
func (Platform) GetExtensions ¶
func (Platform) GetProfile ¶
func (Platform) GetVersion ¶
type Program ¶
type Program uint
type ProgramBuildOptions ¶
type ProgramBuildOptions struct { // Preprocessor options Warnings bool Macros map[string]string DirectoryIncludes []string Version Version // Math intrinsics options SinglePrecisionConstant bool MadEnable bool NoSignedZeros bool FastRelaxedMaths bool // Extensions NvidiaVerbose bool }
func (*ProgramBuildOptions) String ¶
func (po *ProgramBuildOptions) String() string
Click to show internal directories.
Click to hide internal directories.