mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Add a clearQueueTillFirstFailure interface to DeferredDeleter, which iterates the queue from the front and delete the allocations in the queue till a failure. It is called by defer deletion of allocations occupied by mutliple contexts to unlock the execution in main thread Related-To: NEO-7532 Signed-off-by: HeFan2017 <fan.f.he@intel.com>
27 lines
488 B
C++
27 lines
488 B
C++
/*
|
|
* Copyright (C) 2018-2023 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "shared/source/memory_manager/deferrable_deletion.h"
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
namespace NEO {
|
|
class MockDeferrableDeletion : public DeferrableDeletion {
|
|
public:
|
|
bool apply() override;
|
|
|
|
~MockDeferrableDeletion() override;
|
|
|
|
void setTrialTimes(int times) { trialTimes = times; }
|
|
int applyCalled = 0;
|
|
|
|
private:
|
|
int trialTimes = 1;
|
|
};
|
|
} // namespace NEO
|