Documentation ¶
Index ¶
- Constants
- Variables
- func Init() (err error)
- func VulkanError(res vk.Result) error
- type Device
- type Engine
- func (e *Engine) Accessible(mem tensor.Memory) (tensor.Memory, error)
- func (e *Engine) Alloc(size int64) (tensor.Memory, error)
- func (e *Engine) AllocAccessible() bool
- func (e *Engine) Destroy()
- func (e *Engine) Free(mem tensor.Memory, size int64) error
- func (e *Engine) FreeTensor(t tensor.Tensor) error
- func (e *Engine) MatMul(a, b, prealloc tensor.Tensor) (err error)
- func (e *Engine) Memclr(mem tensor.Memory)
- func (e *Engine) Memcpy(dst, src tensor.Memory) error
- func (e *Engine) Memset(mem tensor.Memory, val interface{}) error
- func (e *Engine) NonStdAlloc()
- func (e Engine) WorksWith(order tensor.DataOrder) bool
- type Manager
- type ManagerOpts
- type Op
- type PointerWrapper
Constants ¶
const MaxInt = int(MaxUint >> 1)
const MaxUint = ^uint(0)
const MinInt = -MaxInt - 1
const MinUint = 0
Variables ¶
var ErrMemoryManagedByOtherEngine = errors.New("this tensor's memory is not managed by Gorgonia's Vulkan engine")
var ErrNoCompatiblePhysicalDevices = errors.New("failed to find GPUs with Vulkan support that satisfy Gorgonia's requirements")
var ErrNoMatchingPhysicalDeviceMemory = errors.New("could not find a memory type that matches the requirements")
var ErrNoVulkanPhysicalDevices = errors.New("failed to find GPUs with Vulkan support")
var ErrPartialMemoryFreeNotSupported = errors.New("freeing only a part, or more than the size of memory is not supported")
var ErrQueueFamilyNotFound = errors.New("could not find required queue family on this device")
var ErrSpirvDataNotMultipleOf4Bytes = errors.New("the loaded SPIR-V data must have a length that is a multiple of 4 bytes")
var ErrUnknownMemory = errors.New("the memory is not known to this engine")
Functions ¶
func Init ¶
func Init() (err error)
Init the bindings with the Vulkan library. It must be called *once* before any other calls. If your application initializes its own bindings through vulkan-go, this call can be skipped. This can be the case when the app makes use of Vulkan for other purposes like a game graphics alongside the use of Vulkan for computing through Gorgonia
func VulkanError ¶
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device represents a physical device such as a GPU
func (*Device) ApiVersion ¶
ApiVersion returns the Vulkan API version supported by the device
func (*Device) SatisfiesRequirements ¶
SatisfiesRequirements returns true if the device satisfies the minimum requirements for Gorgonia
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (*Engine) AllocAccessible ¶
func (*Engine) NonStdAlloc ¶
func (e *Engine) NonStdAlloc()
NonStdAlloc nothing instead of running the default built in allocator
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager stores the Vulkan instance of the application and allows creation of devices and inspection of the requirements
func NewManager ¶
func NewManager(opts ...ManagerOpts) (*Manager, error)
NewManager creates a Manager that has a Vulkan instance configured with Gorgonia's requirements and the requirements specified through opts
func NewManagerFromInstance ¶
NewManagerFromInstance allows you to create a manager while providing your own Vulkan instance. Registering validation layers and debugging callbacks is your own responsibility
func (*Manager) AllPhysicalDevices ¶
AllPhysicalDevices lists all available Vulkan devices. Note that the returned devices do not necessarily fulfill all Gorgonia's requirements. If you need only supported devices, use CompatiblePhysicalDevices instead
func (*Manager) CompatiblePhysicalDevices ¶
CompatiblePhysicalDevices lists all available Vulkan devices which satisfy the requirements of Gorgonia
func (*Manager) DefaultPhysicalDevice ¶
DefaultPhysicalDevice returns a computing device/gpu that looks most promising for use with Gorgonia. If you need to make a manual choice or want to use multiple GPUs at once, use AllPhysicalDevices() or CompatiblePhysicalDevices() instead
type PointerWrapper ¶
type PointerWrapper uintptr
func (PointerWrapper) MemSize ¶
func (p PointerWrapper) MemSize() uintptr
func (PointerWrapper) Uintptr ¶
func (p PointerWrapper) Uintptr() uintptr
Uintptr returns the wrapped uintptr