func (p *simplePolicy) Allocate(available []*Device, required []*Device, size int) []*Device {
	if size <= 0 {
		return []*Device{}
	}
	if len(available) < size {
		return []*Device{}
	}
	if len(required) > size {
		return []*Device{}
	}
	availableSet := NewDeviceSet(available...)
	if !availableSet.ContainsAll(required) {
		return []*Device{}
	}
	availableSet.Delete(required...)
	allocated := append([]*Device{}, required...)
	allocated = append(allocated, availableSet.SortedSlice()[:size-len(allocated)]...)
	return allocated
}
Allocate GPUs following a simple policy.
package gpuallocator
type simplePolicy struct{}
func NewSimplePolicy() Policy {
	return &simplePolicy{}
}