fix: Add asserts to ensure NonCopyable and NonMovable n/n

Related-To: NEO-14068

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2025-02-18 17:32:35 +00:00
committed by Compute-Runtime-Automation
parent aeff5513c3
commit b60c02d597
36 changed files with 71 additions and 51 deletions

View File

@@ -68,6 +68,7 @@ class Context : public BaseObject<_cl_context> {
const StackVec<NEO::GraphicsAllocation *, 1> &getAllocationsVector();
};
static_assert(NEO::NonCopyable<AbstractBuffersPool<BufferPool, Buffer, MemObj>>);
class BufferPoolAllocator : public AbstractBuffersAllocator<BufferPool, Buffer, MemObj> {
using BaseType = AbstractBuffersAllocator<BufferPool, Buffer, MemObj>;

View File

@@ -78,6 +78,7 @@ class Event : public BaseObject<_cl_event>, public IDNode<Event> {
int32_t callbackExecutionStatusTarget; // minimum event execution status that will triger this callback
void *userData;
};
static_assert(NEO::NonCopyableAndNonMovable<IFList<Callback, true, true>>);
struct ProfilingInfo {
uint64_t cpuTimeInNs;

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -24,6 +24,7 @@ struct TrackedEvent : IFNode<TrackedEvent> {
Event *ev = nullptr;
int64_t eventId = 1;
};
static_assert(NEO::NonCopyableAndNonMovable<IFList<TrackedEvent, true, true>>);
class EventsTracker {

View File

@@ -31,6 +31,8 @@ namespace NEO {
template void KernelOperation::ResourceCleaner::operator()<LinearStream>(LinearStream *);
template void KernelOperation::ResourceCleaner::operator()<IndirectHeap>(IndirectHeap *);
static_assert(NEO::NonCopyableAndNonMovable<DecRefInternalAtScopeEnd<MemObj>>);
CommandMapUnmap::CommandMapUnmap(MapOperationType operationType, MemObj &memObj, MemObjSizeArray &copySize, MemObjOffsetArray &copyOffset, bool readOnly,
CommandQueue &commandQueue)
: Command(commandQueue), memObj(memObj), copySize(copySize), copyOffset(copyOffset), readOnly(readOnly), operationType(operationType) {