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

import (
	"context"
	"sync"

	"github.com/ehsaniara/joblet/internal/joblet/core/execution"
	"github.com/ehsaniara/joblet/internal/joblet/domain"
	"github.com/ehsaniara/joblet/internal/joblet/gpu"
)

type FakeGPUManager struct {
	AllocateGPUStub        func(context.Context, *domain.Job) (*gpu.GPUAllocation, error)
	allocateGPUMutex       sync.RWMutex
	allocateGPUArgsForCall []struct {
		arg1 context.Context
		arg2 *domain.Job
	}
	allocateGPUReturns struct {
		result1 *gpu.GPUAllocation
		result2 error
	}
	allocateGPUReturnsOnCall map[int]struct {
		result1 *gpu.GPUAllocation
		result2 error
	}
	IsGPUEnabledStub        func() bool
	isGPUEnabledMutex       sync.RWMutex
	isGPUEnabledArgsForCall []struct {
	}
	isGPUEnabledReturns struct {
		result1 bool
	}
	isGPUEnabledReturnsOnCall map[int]struct {
		result1 bool
	}
	ReleaseGPUStub        func(context.Context, string) error
	releaseGPUMutex       sync.RWMutex
	releaseGPUArgsForCall []struct {
		arg1 context.Context
		arg2 string
	}
	releaseGPUReturns struct {
		result1 error
	}
	releaseGPUReturnsOnCall map[int]struct {
		result1 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeGPUManager) AllocateGPU(arg1 context.Context, arg2 *domain.Job) (*gpu.GPUAllocation, error) {
	fake.allocateGPUMutex.Lock()
	ret, specificReturn := fake.allocateGPUReturnsOnCall[len(fake.allocateGPUArgsForCall)]
	fake.allocateGPUArgsForCall = append(fake.allocateGPUArgsForCall, struct {
		arg1 context.Context
		arg2 *domain.Job
	}{arg1, arg2})
	stub := fake.AllocateGPUStub
	fakeReturns := fake.allocateGPUReturns
	fake.recordInvocation("AllocateGPU", []interface{}{arg1, arg2})
	fake.allocateGPUMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeGPUManager) AllocateGPUCallCount() int {
	fake.allocateGPUMutex.RLock()
	defer fake.allocateGPUMutex.RUnlock()
	return len(fake.allocateGPUArgsForCall)
}

func (fake *FakeGPUManager) AllocateGPUCalls(stub func(context.Context, *domain.Job) (*gpu.GPUAllocation, error)) {
	fake.allocateGPUMutex.Lock()
	defer fake.allocateGPUMutex.Unlock()
	fake.AllocateGPUStub = stub
}

func (fake *FakeGPUManager) AllocateGPUArgsForCall(i int) (context.Context, *domain.Job) {
	fake.allocateGPUMutex.RLock()
	defer fake.allocateGPUMutex.RUnlock()
	argsForCall := fake.allocateGPUArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeGPUManager) AllocateGPUReturns(result1 *gpu.GPUAllocation, result2 error) {
	fake.allocateGPUMutex.Lock()
	defer fake.allocateGPUMutex.Unlock()
	fake.AllocateGPUStub = nil
	fake.allocateGPUReturns = struct {
		result1 *gpu.GPUAllocation
		result2 error
	}{result1, result2}
}

func (fake *FakeGPUManager) AllocateGPUReturnsOnCall(i int, result1 *gpu.GPUAllocation, result2 error) {
	fake.allocateGPUMutex.Lock()
	defer fake.allocateGPUMutex.Unlock()
	fake.AllocateGPUStub = nil
	if fake.allocateGPUReturnsOnCall == nil {
		fake.allocateGPUReturnsOnCall = make(map[int]struct {
			result1 *gpu.GPUAllocation
			result2 error
		})
	}
	fake.allocateGPUReturnsOnCall[i] = struct {
		result1 *gpu.GPUAllocation
		result2 error
	}{result1, result2}
}

func (fake *FakeGPUManager) IsGPUEnabled() bool {
	fake.isGPUEnabledMutex.Lock()
	ret, specificReturn := fake.isGPUEnabledReturnsOnCall[len(fake.isGPUEnabledArgsForCall)]
	fake.isGPUEnabledArgsForCall = append(fake.isGPUEnabledArgsForCall, struct {
	}{})
	stub := fake.IsGPUEnabledStub
	fakeReturns := fake.isGPUEnabledReturns
	fake.recordInvocation("IsGPUEnabled", []interface{}{})
	fake.isGPUEnabledMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeGPUManager) IsGPUEnabledCallCount() int {
	fake.isGPUEnabledMutex.RLock()
	defer fake.isGPUEnabledMutex.RUnlock()
	return len(fake.isGPUEnabledArgsForCall)
}

func (fake *FakeGPUManager) IsGPUEnabledCalls(stub func() bool) {
	fake.isGPUEnabledMutex.Lock()
	defer fake.isGPUEnabledMutex.Unlock()
	fake.IsGPUEnabledStub = stub
}

func (fake *FakeGPUManager) IsGPUEnabledReturns(result1 bool) {
	fake.isGPUEnabledMutex.Lock()
	defer fake.isGPUEnabledMutex.Unlock()
	fake.IsGPUEnabledStub = nil
	fake.isGPUEnabledReturns = struct {
		result1 bool
	}{result1}
}

func (fake *FakeGPUManager) IsGPUEnabledReturnsOnCall(i int, result1 bool) {
	fake.isGPUEnabledMutex.Lock()
	defer fake.isGPUEnabledMutex.Unlock()
	fake.IsGPUEnabledStub = nil
	if fake.isGPUEnabledReturnsOnCall == nil {
		fake.isGPUEnabledReturnsOnCall = make(map[int]struct {
			result1 bool
		})
	}
	fake.isGPUEnabledReturnsOnCall[i] = struct {
		result1 bool
	}{result1}
}

func (fake *FakeGPUManager) ReleaseGPU(arg1 context.Context, arg2 string) error {
	fake.releaseGPUMutex.Lock()
	ret, specificReturn := fake.releaseGPUReturnsOnCall[len(fake.releaseGPUArgsForCall)]
	fake.releaseGPUArgsForCall = append(fake.releaseGPUArgsForCall, struct {
		arg1 context.Context
		arg2 string
	}{arg1, arg2})
	stub := fake.ReleaseGPUStub
	fakeReturns := fake.releaseGPUReturns
	fake.recordInvocation("ReleaseGPU", []interface{}{arg1, arg2})
	fake.releaseGPUMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeGPUManager) ReleaseGPUCallCount() int {
	fake.releaseGPUMutex.RLock()
	defer fake.releaseGPUMutex.RUnlock()
	return len(fake.releaseGPUArgsForCall)
}

func (fake *FakeGPUManager) ReleaseGPUCalls(stub func(context.Context, string) error) {
	fake.releaseGPUMutex.Lock()
	defer fake.releaseGPUMutex.Unlock()
	fake.ReleaseGPUStub = stub
}

func (fake *FakeGPUManager) ReleaseGPUArgsForCall(i int) (context.Context, string) {
	fake.releaseGPUMutex.RLock()
	defer fake.releaseGPUMutex.RUnlock()
	argsForCall := fake.releaseGPUArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeGPUManager) ReleaseGPUReturns(result1 error) {
	fake.releaseGPUMutex.Lock()
	defer fake.releaseGPUMutex.Unlock()
	fake.ReleaseGPUStub = nil
	fake.releaseGPUReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeGPUManager) ReleaseGPUReturnsOnCall(i int, result1 error) {
	fake.releaseGPUMutex.Lock()
	defer fake.releaseGPUMutex.Unlock()
	fake.ReleaseGPUStub = nil
	if fake.releaseGPUReturnsOnCall == nil {
		fake.releaseGPUReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.releaseGPUReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeGPUManager) 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 *FakeGPUManager) 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 _ execution.GPUManager = new(FakeGPUManager)
