cache

package
v1.1.5 Latest Latest
Warning

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

Go to latest
Published: May 10, 2021 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 8 more Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Devices []string
	Cores   int64
	Memory  int64
}

Info contains infomations aboud GPU

type PodCache

type PodCache struct {
	PodGPUMapping map[string]containerToInfo
}

PodCache represents a list of pod to GPU mappings.

func NewAllocateCache

func NewAllocateCache() *PodCache

NewAllocateCache creates new PodCache

func (*PodCache) Delete

func (pgpu *PodCache) Delete(uid string)

Delete removes GPU info in PodCache

func (*PodCache) GetCache

func (pgpu *PodCache) GetCache(podUID string) map[string]*Info

GetCache returns GPU of pod if exist

func (*PodCache) Insert

func (pgpu *PodCache) Insert(podUID, contName string, cache *Info)

Insert adds GPU info of pod into PodCache if not exist

func (*PodCache) Pods

func (pgpu *PodCache) Pods() []string

Pods returns all pods in PodCache

Jump to

Keyboard shortcuts

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