// Code generated by counterfeiter. DO NOT EDIT.
package gpufakes

import (
	"sync"

	"github.com/ehsaniara/joblet/internal/joblet/gpu"
)

type FakeGPUDiscoveryInterface struct {
	DiscoverGPUsStub        func() ([]*gpu.GPU, error)
	discoverGPUsMutex       sync.RWMutex
	discoverGPUsArgsForCall []struct {
	}
	discoverGPUsReturns struct {
		result1 []*gpu.GPU
		result2 error
	}
	discoverGPUsReturnsOnCall map[int]struct {
		result1 []*gpu.GPU
		result2 error
	}
	RefreshGPUsStub        func() error
	refreshGPUsMutex       sync.RWMutex
	refreshGPUsArgsForCall []struct {
	}
	refreshGPUsReturns struct {
		result1 error
	}
	refreshGPUsReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeGPUDiscoveryInterface) DiscoverGPUs() ([]*gpu.GPU, error) {
	fake.discoverGPUsMutex.Lock()
	ret, specificReturn := fake.discoverGPUsReturnsOnCall[len(fake.discoverGPUsArgsForCall)]
	fake.discoverGPUsArgsForCall = append(fake.discoverGPUsArgsForCall, struct {
	}{})
	stub := fake.DiscoverGPUsStub
	fakeReturns := fake.discoverGPUsReturns
	fake.recordInvocation("DiscoverGPUs", []interface{}{})
	fake.discoverGPUsMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeGPUDiscoveryInterface) DiscoverGPUsCallCount() int {
	fake.discoverGPUsMutex.RLock()
	defer fake.discoverGPUsMutex.RUnlock()
	return len(fake.discoverGPUsArgsForCall)
}

func (fake *FakeGPUDiscoveryInterface) DiscoverGPUsCalls(stub func() ([]*gpu.GPU, error)) {
	fake.discoverGPUsMutex.Lock()
	defer fake.discoverGPUsMutex.Unlock()
	fake.DiscoverGPUsStub = stub
}

func (fake *FakeGPUDiscoveryInterface) DiscoverGPUsReturns(result1 []*gpu.GPU, result2 error) {
	fake.discoverGPUsMutex.Lock()
	defer fake.discoverGPUsMutex.Unlock()
	fake.DiscoverGPUsStub = nil
	fake.discoverGPUsReturns = struct {
		result1 []*gpu.GPU
		result2 error
	}{result1, result2}
}

func (fake *FakeGPUDiscoveryInterface) DiscoverGPUsReturnsOnCall(i int, result1 []*gpu.GPU, result2 error) {
	fake.discoverGPUsMutex.Lock()
	defer fake.discoverGPUsMutex.Unlock()
	fake.DiscoverGPUsStub = nil
	if fake.discoverGPUsReturnsOnCall == nil {
		fake.discoverGPUsReturnsOnCall = make(map[int]struct {
			result1 []*gpu.GPU
			result2 error
		})
	}
	fake.discoverGPUsReturnsOnCall[i] = struct {
		result1 []*gpu.GPU
		result2 error
	}{result1, result2}
}

func (fake *FakeGPUDiscoveryInterface) RefreshGPUs() error {
	fake.refreshGPUsMutex.Lock()
	ret, specificReturn := fake.refreshGPUsReturnsOnCall[len(fake.refreshGPUsArgsForCall)]
	fake.refreshGPUsArgsForCall = append(fake.refreshGPUsArgsForCall, struct {
	}{})
	stub := fake.RefreshGPUsStub
	fakeReturns := fake.refreshGPUsReturns
	fake.recordInvocation("RefreshGPUs", []interface{}{})
	fake.refreshGPUsMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeGPUDiscoveryInterface) RefreshGPUsCallCount() int {
	fake.refreshGPUsMutex.RLock()
	defer fake.refreshGPUsMutex.RUnlock()
	return len(fake.refreshGPUsArgsForCall)
}

func (fake *FakeGPUDiscoveryInterface) RefreshGPUsCalls(stub func() error) {
	fake.refreshGPUsMutex.Lock()
	defer fake.refreshGPUsMutex.Unlock()
	fake.RefreshGPUsStub = stub
}

func (fake *FakeGPUDiscoveryInterface) RefreshGPUsReturns(result1 error) {
	fake.refreshGPUsMutex.Lock()
	defer fake.refreshGPUsMutex.Unlock()
	fake.RefreshGPUsStub = nil
	fake.refreshGPUsReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeGPUDiscoveryInterface) RefreshGPUsReturnsOnCall(i int, result1 error) {
	fake.refreshGPUsMutex.Lock()
	defer fake.refreshGPUsMutex.Unlock()
	fake.RefreshGPUsStub = nil
	if fake.refreshGPUsReturnsOnCall == nil {
		fake.refreshGPUsReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.refreshGPUsReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeGPUDiscoveryInterface) Invocations() map[string][][]interface{} {
	fake.invocationsMutex.RLock()
	defer fake.invocationsMutex.RUnlock()
	copiedInvocations := map[string][][]interface{}{}
	for key, value := range fake.invocations {
		copiedInvocations[key] = value
	}
	return copiedInvocations
}

func (fake *FakeGPUDiscoveryInterface) recordInvocation(key string, args []interface{}) {
	fake.invocationsMutex.Lock()
	defer fake.invocationsMutex.Unlock()
	if fake.invocations == nil {
		fake.invocations = map[string][][]interface{}{}
	}
	if fake.invocations[key] == nil {
		fake.invocations[key] = [][]interface{}{}
	}
	fake.invocations[key] = append(fake.invocations[key], args)
}

var _ gpu.GPUDiscoveryInterface = new(FakeGPUDiscoveryInterface)
