Files
compute-runtime/runtime/helpers/flush_stamp.h
Jobczyk, Lukasz 2e8e6bdb18 Move majority of utilities to the core dir
Related-To: NEO-3677

Change-Id: If2e876028b765ad3ecf5f75db8755623b82955b8
Signed-off-by: Jobczyk, Lukasz <lukasz.jobczyk@intel.com>
2019-09-12 15:07:02 +02:00

49 lines
1.1 KiB
C++

/*
* Copyright (C) 2017-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "core/utilities/reference_tracked_object.h"
#include "core/utilities/stackvec.h"
#include "runtime/helpers/completion_stamp.h"
namespace NEO {
struct FlushStampTrackingObj : public ReferenceTrackedObject<FlushStampTrackingObj> {
FlushStamp flushStamp = 0;
std::atomic<bool> initialized{false};
};
class FlushStampTracker {
public:
FlushStampTracker() = delete;
FlushStampTracker(bool allocateStamp);
~FlushStampTracker();
FlushStamp peekStamp() const;
void setStamp(FlushStamp stamp);
void replaceStampObject(FlushStampTrackingObj *stampObj);
// Temporary. Method will be removed
FlushStampTrackingObj *getStampReference() {
return flushStampSharedHandle;
}
protected:
FlushStampTrackingObj *flushStampSharedHandle = nullptr;
};
class FlushStampUpdateHelper {
public:
void insert(FlushStampTrackingObj *stampObj);
void updateAll(FlushStamp &flushStamp);
size_t size() const;
private:
StackVec<FlushStampTrackingObj *, 64> flushStampsToUpdate;
};
} // namespace NEO