Documentation
¶
Overview ¶
Package internal provides support for the driver implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device struct { ID int Type DeviceType UnifiedGPUIDs []int ActualGPUs []*Device // contains filtered or unexported fields }
A device is a CPU or GPU managed by the driver.
func (*Device) SetTotalMemSize ¶
type DeviceType ¶
type DeviceType int
DeviceType marks the type of a device.
const ( DeviceTypeInvalid DeviceType = iota DeviceTypeCPU DeviceTypeGPU DeviceTypeUnifiedGPU )
Defines supported devices.
type MemoryAllocator ¶
type MemoryAllocator interface { RegisterDevice(device *Device) GetDeviceIDByPAddr(pAddr uint64) int Allocate(pid ca.PID, byteSize uint64, deviceID int) uint64 AllocateUnified(pid ca.PID, byteSize uint64) uint64 Free(vAddr uint64) Remap(pid ca.PID, pageVAddr, byteSize uint64, deviceID int) RemovePage(vAddr uint64) AllocatePageWithGivenVAddr( pid ca.PID, deviceID int, vAddr uint64, unified bool, ) vm.Page }
A MemoryAllocator can allocate memory on the CPU and GPUs
func NewMemoryAllocator ¶
func NewMemoryAllocator( pageTable vm.PageTable, log2PageSize uint64, ) MemoryAllocator
NewMemoryAllocator creates a new memory allocator.
Click to show internal directories.
Click to hide internal directories.