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

import (
	"context"
	"sync"

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

type FakeCUDAVerifierInterface struct {
	CheckGPUsUsableStub        func(context.Context, []int) error
	checkGPUsUsableMutex       sync.RWMutex
	checkGPUsUsableArgsForCall []struct {
		arg1 context.Context
		arg2 []int
	}
	checkGPUsUsableReturns struct {
		result1 error
	}
	checkGPUsUsableReturnsOnCall map[int]struct {
		result1 error
	}
	IsAvailableStub        func() bool
	isAvailableMutex       sync.RWMutex
	isAvailableArgsForCall []struct {
	}
	isAvailableReturns struct {
		result1 bool
	}
	isAvailableReturnsOnCall map[int]struct {
		result1 bool
	}
	VerifyStub        func(context.Context) (*gpu.CUDAVerificationResult, error)
	verifyMutex       sync.RWMutex
	verifyArgsForCall []struct {
		arg1 context.Context
	}
	verifyReturns struct {
		result1 *gpu.CUDAVerificationResult
		result2 error
	}
	verifyReturnsOnCall map[int]struct {
		result1 *gpu.CUDAVerificationResult
		result2 error
	}
	invocations      map[string][][]interface{}
	invocationsMutex sync.RWMutex
}

func (fake *FakeCUDAVerifierInterface) CheckGPUsUsable(arg1 context.Context, arg2 []int) error {
	var arg2Copy []int
	if arg2 != nil {
		arg2Copy = make([]int, len(arg2))
		copy(arg2Copy, arg2)
	}
	fake.checkGPUsUsableMutex.Lock()
	ret, specificReturn := fake.checkGPUsUsableReturnsOnCall[len(fake.checkGPUsUsableArgsForCall)]
	fake.checkGPUsUsableArgsForCall = append(fake.checkGPUsUsableArgsForCall, struct {
		arg1 context.Context
		arg2 []int
	}{arg1, arg2Copy})
	stub := fake.CheckGPUsUsableStub
	fakeReturns := fake.checkGPUsUsableReturns
	fake.recordInvocation("CheckGPUsUsable", []interface{}{arg1, arg2Copy})
	fake.checkGPUsUsableMutex.Unlock()
	if stub != nil {
		return stub(arg1, arg2)
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeCUDAVerifierInterface) CheckGPUsUsableCallCount() int {
	fake.checkGPUsUsableMutex.RLock()
	defer fake.checkGPUsUsableMutex.RUnlock()
	return len(fake.checkGPUsUsableArgsForCall)
}

func (fake *FakeCUDAVerifierInterface) CheckGPUsUsableCalls(stub func(context.Context, []int) error) {
	fake.checkGPUsUsableMutex.Lock()
	defer fake.checkGPUsUsableMutex.Unlock()
	fake.CheckGPUsUsableStub = stub
}

func (fake *FakeCUDAVerifierInterface) CheckGPUsUsableArgsForCall(i int) (context.Context, []int) {
	fake.checkGPUsUsableMutex.RLock()
	defer fake.checkGPUsUsableMutex.RUnlock()
	argsForCall := fake.checkGPUsUsableArgsForCall[i]
	return argsForCall.arg1, argsForCall.arg2
}

func (fake *FakeCUDAVerifierInterface) CheckGPUsUsableReturns(result1 error) {
	fake.checkGPUsUsableMutex.Lock()
	defer fake.checkGPUsUsableMutex.Unlock()
	fake.CheckGPUsUsableStub = nil
	fake.checkGPUsUsableReturns = struct {
		result1 error
	}{result1}
}

func (fake *FakeCUDAVerifierInterface) CheckGPUsUsableReturnsOnCall(i int, result1 error) {
	fake.checkGPUsUsableMutex.Lock()
	defer fake.checkGPUsUsableMutex.Unlock()
	fake.CheckGPUsUsableStub = nil
	if fake.checkGPUsUsableReturnsOnCall == nil {
		fake.checkGPUsUsableReturnsOnCall = make(map[int]struct {
			result1 error
		})
	}
	fake.checkGPUsUsableReturnsOnCall[i] = struct {
		result1 error
	}{result1}
}

func (fake *FakeCUDAVerifierInterface) IsAvailable() bool {
	fake.isAvailableMutex.Lock()
	ret, specificReturn := fake.isAvailableReturnsOnCall[len(fake.isAvailableArgsForCall)]
	fake.isAvailableArgsForCall = append(fake.isAvailableArgsForCall, struct {
	}{})
	stub := fake.IsAvailableStub
	fakeReturns := fake.isAvailableReturns
	fake.recordInvocation("IsAvailable", []interface{}{})
	fake.isAvailableMutex.Unlock()
	if stub != nil {
		return stub()
	}
	if specificReturn {
		return ret.result1
	}
	return fakeReturns.result1
}

func (fake *FakeCUDAVerifierInterface) IsAvailableCallCount() int {
	fake.isAvailableMutex.RLock()
	defer fake.isAvailableMutex.RUnlock()
	return len(fake.isAvailableArgsForCall)
}

func (fake *FakeCUDAVerifierInterface) IsAvailableCalls(stub func() bool) {
	fake.isAvailableMutex.Lock()
	defer fake.isAvailableMutex.Unlock()
	fake.IsAvailableStub = stub
}

func (fake *FakeCUDAVerifierInterface) IsAvailableReturns(result1 bool) {
	fake.isAvailableMutex.Lock()
	defer fake.isAvailableMutex.Unlock()
	fake.IsAvailableStub = nil
	fake.isAvailableReturns = struct {
		result1 bool
	}{result1}
}

func (fake *FakeCUDAVerifierInterface) IsAvailableReturnsOnCall(i int, result1 bool) {
	fake.isAvailableMutex.Lock()
	defer fake.isAvailableMutex.Unlock()
	fake.IsAvailableStub = nil
	if fake.isAvailableReturnsOnCall == nil {
		fake.isAvailableReturnsOnCall = make(map[int]struct {
			result1 bool
		})
	}
	fake.isAvailableReturnsOnCall[i] = struct {
		result1 bool
	}{result1}
}

func (fake *FakeCUDAVerifierInterface) Verify(arg1 context.Context) (*gpu.CUDAVerificationResult, error) {
	fake.verifyMutex.Lock()
	ret, specificReturn := fake.verifyReturnsOnCall[len(fake.verifyArgsForCall)]
	fake.verifyArgsForCall = append(fake.verifyArgsForCall, struct {
		arg1 context.Context
	}{arg1})
	stub := fake.VerifyStub
	fakeReturns := fake.verifyReturns
	fake.recordInvocation("Verify", []interface{}{arg1})
	fake.verifyMutex.Unlock()
	if stub != nil {
		return stub(arg1)
	}
	if specificReturn {
		return ret.result1, ret.result2
	}
	return fakeReturns.result1, fakeReturns.result2
}

func (fake *FakeCUDAVerifierInterface) VerifyCallCount() int {
	fake.verifyMutex.RLock()
	defer fake.verifyMutex.RUnlock()
	return len(fake.verifyArgsForCall)
}

func (fake *FakeCUDAVerifierInterface) VerifyCalls(stub func(context.Context) (*gpu.CUDAVerificationResult, error)) {
	fake.verifyMutex.Lock()
	defer fake.verifyMutex.Unlock()
	fake.VerifyStub = stub
}

func (fake *FakeCUDAVerifierInterface) VerifyArgsForCall(i int) context.Context {
	fake.verifyMutex.RLock()
	defer fake.verifyMutex.RUnlock()
	argsForCall := fake.verifyArgsForCall[i]
	return argsForCall.arg1
}

func (fake *FakeCUDAVerifierInterface) VerifyReturns(result1 *gpu.CUDAVerificationResult, result2 error) {
	fake.verifyMutex.Lock()
	defer fake.verifyMutex.Unlock()
	fake.VerifyStub = nil
	fake.verifyReturns = struct {
		result1 *gpu.CUDAVerificationResult
		result2 error
	}{result1, result2}
}

func (fake *FakeCUDAVerifierInterface) VerifyReturnsOnCall(i int, result1 *gpu.CUDAVerificationResult, result2 error) {
	fake.verifyMutex.Lock()
	defer fake.verifyMutex.Unlock()
	fake.VerifyStub = nil
	if fake.verifyReturnsOnCall == nil {
		fake.verifyReturnsOnCall = make(map[int]struct {
			result1 *gpu.CUDAVerificationResult
			result2 error
		})
	}
	fake.verifyReturnsOnCall[i] = struct {
		result1 *gpu.CUDAVerificationResult
		result2 error
	}{result1, result2}
}

func (fake *FakeCUDAVerifierInterface) 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 *FakeCUDAVerifierInterface) 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.CUDAVerifierInterface = new(FakeCUDAVerifierInterface)
