Categorygithub.com/opencl-pure/pureCL
modulepackage
0.0.0-20240829091007-6499d46d737b
Repository: https://github.com/opencl-pure/purecl.git
Documentation: pkg.go.dev

# README

pure

This is fork and simplify of Zyko0's opencl, big thank.
This package provide low level wrapper to OpenCL, that means it is 1:1 wrapper C:GO - no GO error handling only GO types map OpenCL function and cl_types without cgo, powered by purego and inspired by libopencl-stub. This package use constantsCL
Thank to both of them!

goal

  • low level wrap of OpenCL for
  • be minimalistic
  • try to have all functions of OpenCL (so if you have some, give PR)
  • easy to multiplatform (thank purego)
  • easy find path (custumize path to openclLib shared library)
  • easy to compile, we do not need cgo and not need knowing link to shared library
  • try purego and bring opencl on android without complicate link

not goal

  • be faster as cgo version, purego is using same mechanism as cgo

examples

you can also use to your package independent from others ..., you can also use as this:

example

package main

import (
	"errors"
	constants "github.com/opencl-pure/constantsCL"
	pure "github.com/opencl-pure/pureCL"
	"log"
)

func main() {
  //init with version of OpenCL and variadic special paths (if you know)
	err := pure.Init(pure.Version2_0/*, "special_path1/openclLib.dll", "special_path1/openclLib.so" */) 
	if err != nil {
		log.Println(err)
		return
	}
	numPlatforms := uint32(0)
	st := pure.GetPlatformIDs(0, nil, &numPlatforms)
	if st != constants.CL_SUCCESS {
		log.Println(errors.New("oops platform error"))
		return
	}

	platformIDs := make([]pure.Platform, numPlatforms)
	st = pure.GetPlatformIDs(numPlatforms, platformIDs, nil)
	if st != constants.CL_SUCCESS {
		log.Println(errors.New("oops none ...."))
		return
	}
	// ....
}    

# Functions

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Constants

Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
Common OpenCl errors.
TODO: Not exhaustive.
OpenCL.
TODO: Not exhaustive.
Nvidia.
TODO: Not exhaustive.
TODO: Not exhaustive.
TODO: Not exhaustive.
TODO: Not exhaustive.
TODO: Not exhaustive.

# Variables

BuildProgram this wrap opencl clBuildProgram and do builds (compiles & links) a program executable from the program source or binary.
CreateBuffer this wrap opencl clCreateBuffer and do creates a buffer object.
CreateCommandQueue this wrap opencl clCreateCommandQueue and do creates a command-queue on a specific device.
CreateCommandQueueWithProperties this wrap opencl clCreateCommandQueueWithProperties and do creates a command-queue on a specific device with specified properties.
CreateContext this wrap opencl clCreateContext and do creates an OpenCL context.
CreateFromGLTexture this wrap opencl clCreateFromGLTexture and do creates a 2D image object from an OpenGL texture object.
CreateImage this wrap opencl clCreateImage and do creates a image object.
CreateImage2D this wrap opencl clCreateImage2D and do creates a 2D image object.
CreateImage3D this wrap opencl clCreateImage3D and do creates a 3D image object.
CreateKernel this wrap opencl clCreateKernel and do creates a kernel object.
CreateProgramWithSource this wrap opencl clCreateProgramWithSource and do creates a program object for a context.
EnqueueAcquireGLObjects this wrap opencl clEnqueueAcquireGLObjects and do enqueue commands to acquire OpenCL memory objects that have been created from OpenGL objects.
EnqueueBarrier this wrap opencl clEnqueueBarrier and do inserts a barrier command.
EnqueueMapBuffer this wrap opencl clEnqueueMapBuffer and do enqueue a command to map a buffer object into the host address space.
EnqueueMapImage this wrap opencl clEnqueueMapImage and do enqueue a command to map a 2D or 3D image object into the host address space.
EnqueueNDRangeKernel this wrap opencl clEnqueueNDRangeKernel and do enqueue a kernel to execute on a device.
EnqueueReadBuffer this wrap opencl clEnqueueReadBuffer and do enqueue a command to read from a buffer object to host memory.
EnqueueReadImage this wrap opencl clEnqueueReadImage and do enqueue a command to read from a 2D or 3D image object to host memory.
EnqueueReleaseGLObjects this wrap opencl clEnqueueReleaseGLObjects and do enqueue commands to release OpenCL memory objects that have been created from OpenGL objects.
EnqueueUnmapMemObject this wrap opencl clEnqueueUnmapMemObject and do enqueue a command to unmap a previously mapped buffer object.
EnqueueWriteBuffer this wrap opencl clEnqueueWriteBuffer and do enqueue a command to write to a buffer object from host memory.
EnqueueWriteImage this wrap opencl clEnqueueWriteImage and do enqueue a command to write from host memory to a 2D or 3D image object.
FinishCommandQueue this wrap opencl clFinish and do issues all previously queued OpenCL commands in a command-queue to the device.
FlushCommandQueue this wrap opencl clFlush and do ensures that all previously queued OpenCL commands in a command-queue are submitted to the device.
GetDeviceIDs this wrap opencl clGetDeviceIDs and do returns a list of available OpenCL devices.
GetDeviceInfo this wrap opencl clGetDeviceInfo and do queries information about a specific device.
GetGLObjectInfo this wrap opencl clGetGLObjectInfo and do returns information about the OpenCL memory object and OpenGL object.
GetGLTextureInfo this wrap opencl clGetGLTextureInfo and do returns information about the OpenGL texture object associated with a memory object.
GetMemObjectInfo this wrap opencl clGetMemObjectInfo and do queries information about a memory object.
GetPlatformIDs this wrap opencl clGetPlatformIDs and do returns a list of available OpenCL platforms.
GetPlatformInfo this wrap opencl clGetPlatformInfo and do queries information about a specific platform.
GetProgramBuildInfo this wrap opencl clGetProgramBuildInfo and do returns build information for each device in the program object.
GetProgramInfo this wrap opencl clGetProgramInfo and do queries information about a program object.
ReleaseCommandQueue this wrap opencl clReleaseCommandQueue and do releases a kernel object.
ReleaseContext this wrap opencl clReleaseContext and do releases the OpenCL context.
ReleaseDevice this wrap opencl clReleaseDevice and do releases the OpenCL device.
ReleaseEvent this wrap opencl clReleaseEvent and do releases an OpenCL event.
ReleaseKernel this wrap opencl clReleaseKernel and do releases a kernel object.
ReleaseMemObject this wrap opencl clReleaseMemObject and do releases an OpenCL memory object.
ReleaseProgram this wrap opencl clReleaseProgram and do releases the OpenCL program object.
SetKernelArg this wrap opencl clSetKernelArg and do sets the argument value for a specific argument of a kernel.
WaitForEvents this wrap opencl clWaitForEvents and do waits on the host thread for commands identified by num_events to complete.

# Structs

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author

# Interfaces

No description provided by the author

# Type aliases

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author