Files
compute-runtime/core/helpers/flush_stamp.h
Mateusz Hoppe b6825933f8 Replace Event::eventNotReady with CompletionStamp::levelNotReady
- move some files to core
- remove unnecessary includes

Related-To: NEO-4175

Change-Id: Ib33dff644452c7cfd6fda7e9bb4b68cd6eb3a61c
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2020-01-23 16:16:23 +01:00

49 lines
1.1 KiB
C++

/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "core/helpers/completion_stamp.h"
#include "core/utilities/reference_tracked_object.h"
#include "core/utilities/stackvec.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(const FlushStamp &flushStamp);
size_t size() const;
private:
StackVec<FlushStampTrackingObj *, 64> flushStampsToUpdate;
};
} // namespace NEO