gpu

package
v0.0.0-...-ddc071b Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2023 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OK   = 0
	ACK  = 1
	WAIT = 2
	RUN  = 3
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputeGPU

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

func New_ComputeGPU

func New_ComputeGPU(mCompute *ComputeGPU, descriptor *compute.Descriptor, context *OpenCL) *ComputeGPU

Go will release the referenced C pointer device objects so high level code

must retrieve the context and pass down contextually to the GPU class

func (ComputeGPU) AddSourceFile

func (cp ComputeGPU) AddSourceFile(filename string) error

Creates source from file

func (ComputeGPU) AddSourceString

func (cp ComputeGPU) AddSourceString(source string, key string) error

func (ComputeGPU) BuildProgram

func (cp ComputeGPU) BuildProgram(include_dir string) error

func (ComputeGPU) Context

func (cp ComputeGPU) Context() *OpenCL

func (ComputeGPU) Descriptor

func (cp ComputeGPU) Descriptor() compute.Descriptor

func (ComputeGPU) Get

func (cp ComputeGPU) Get() compute.Descriptor

func (ComputeGPU) HasDeviceContext

func (cp ComputeGPU) HasDeviceContext() bool

State Booleans

func (ComputeGPU) Log

func (cp ComputeGPU) Log() string

func (ComputeGPU) PassFloatBuffer

func (cp ComputeGPU) PassFloatBuffer(cpu_buffer []float32, name string) error

func (ComputeGPU) PassIntBuffer

func (cp ComputeGPU) PassIntBuffer(cpu_buffer []int, name string) error

func (ComputeGPU) PassLayoutBuffer

func (cp ComputeGPU) PassLayoutBuffer(data interface{}, bytes int, name string) error

func (ComputeGPU) Queue

func (cp ComputeGPU) Queue(name string) error
-------------------------------------------
   GPU Contextual Commands - Execution Path

-------------------------------------------

func (ComputeGPU) ReadFloatBuffer

func (cp ComputeGPU) ReadFloatBuffer(cpu_buffer []float32, name string) error

func (ComputeGPU) ReadIntBuffer

func (cp ComputeGPU) ReadIntBuffer(cpu_buffer []int, name string) error

func (ComputeGPU) RegisterBuffer

func (cp ComputeGPU) RegisterBuffer(bytes_size int, t int, name string) error

Buffer Routines first argument is the GPU Mapped Buffer ID which also maps to a Buffer Address Copy Functions copy from GPU memory to CPU Memory. Pass copies from CPU

func (ComputeGPU) RegisterGLBuffer

func (cp ComputeGPU) RegisterGLBuffer(gl_buffer_id uint32, size int, name string) error

func (ComputeGPU) RegisterKernel

func (cp ComputeGPU) RegisterKernel(name string) bool
----------------------------------------

Kernels() - Maps a list of compiled Kernel functions to their referent integer IDs for recall and identification @return map[string]int the list of compiled kernel functions and their unique refrence IDs ----------------------------------------

func (ComputeGPU) Set

func (cp ComputeGPU) Set(d compute.Descriptor)

func (ComputeGPU) SetArgs

func (cp ComputeGPU) SetArgs(name string, args ...interface{}) error

func (ComputeGPU) SetDescriptor

func (p ComputeGPU) SetDescriptor(desc *compute.Descriptor)

func (ComputeGPU) ValidState

func (cp ComputeGPU) ValidState() bool

Pseudo Valid State

type OpenCL

type OpenCL struct {
	Context *cl.Context
	Device  *cl.Device
	Program *cl.Program
	Buffers map[string]*cl.MemObject
	Kernels map[string]*cl.Kernel
	Devices []*cl.Device
	Queue   *cl.CommandQueue
}

func InitOpenCL

func InitOpenCL(opencl *OpenCL) *OpenCL

Jump to

Keyboard shortcuts

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