mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
refactor: reduce TBX download timeout for unit tests
Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
eec841b662
commit
dd8460beba
@@ -31,6 +31,9 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
|
||||
uint32_t getMaskAndValueForPollForCompletion() const;
|
||||
bool getpollNotEqualValueForPollForCompletion() const;
|
||||
void flushSubmissionsAndDownloadAllocations(TaskCountType taskCount, bool skipAllocationsDownload);
|
||||
MOCKABLE_VIRTUAL uint64_t getNonBlockingDownloadTimeoutMs() const {
|
||||
return 2000; // 2s
|
||||
}
|
||||
|
||||
public:
|
||||
using CommandStreamReceiverSimulatedCommonHw<GfxFamily>::initAdditionalMMIO;
|
||||
|
||||
@@ -578,7 +578,6 @@ void TbxCommandStreamReceiverHw<GfxFamily>::downloadAllocationTbx(GraphicsAlloca
|
||||
template <typename GfxFamily>
|
||||
void TbxCommandStreamReceiverHw<GfxFamily>::downloadAllocations(bool blockingWait, TaskCountType taskCount) {
|
||||
volatile TagAddressType *pollAddress = this->getTagAddress();
|
||||
constexpr uint64_t timeoutMs = 1000 * 2; // 2s
|
||||
|
||||
auto waitTaskCount = std::min(taskCount, this->latestFlushedTaskCount.load());
|
||||
|
||||
@@ -593,7 +592,7 @@ void TbxCommandStreamReceiverHw<GfxFamily>::downloadAllocations(bool blockingWai
|
||||
if (!blockingWait) {
|
||||
// Additional delay to reach PC in case of Event wait
|
||||
timeDiff = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::high_resolution_clock::now() - startTime).count();
|
||||
if (timeDiff > timeoutMs) {
|
||||
if (timeDiff > getNonBlockingDownloadTimeoutMs()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -111,6 +111,11 @@ struct MockTbxCsrRegisterDownloadedAllocations : TbxCommandStreamReceiverHw<GfxF
|
||||
obtainUniqueOwnershipCalled++;
|
||||
return TbxCommandStreamReceiverHw<GfxFamily>::obtainUniqueOwnership();
|
||||
}
|
||||
|
||||
uint64_t getNonBlockingDownloadTimeoutMs() const override {
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::set<GraphicsAllocation *> downloadedAllocations;
|
||||
bool flushBatchedSubmissionsCalled = false;
|
||||
bool flushTagCalled = false;
|
||||
|
||||
Reference in New Issue
Block a user