mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 08:53:55 +08:00
fix: explicitly remove assign operators when not needed
when class defines copy/move ctor then corresponding assign operator(s) should be defined or deleted Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3fdcf049bf
commit
a420e34b10
@@ -7,7 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/device_bitfield.h"
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
#include "shared/source/memory_manager/multi_graphics_allocation.h"
|
||||
#include "shared/source/utilities/spinlock.h"
|
||||
|
||||
@@ -26,7 +25,7 @@ class MemoryManager;
|
||||
namespace L0 {
|
||||
struct Device;
|
||||
|
||||
struct HostPointerData : NEO::NonAssignableClass {
|
||||
struct HostPointerData {
|
||||
HostPointerData(uint32_t maxRootDeviceIndex)
|
||||
: hostPtrAllocations(maxRootDeviceIndex),
|
||||
maxRootDeviceIndex(maxRootDeviceIndex) {
|
||||
@@ -41,6 +40,7 @@ struct HostPointerData : NEO::NonAssignableClass {
|
||||
}
|
||||
}
|
||||
}
|
||||
HostPointerData &operator=(const HostPointerData &) = delete;
|
||||
NEO::MultiGraphicsAllocation hostPtrAllocations;
|
||||
void *basePtr = nullptr;
|
||||
size_t size = 0u;
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
#include "shared/source/os_interface/linux/sys_calls.h"
|
||||
|
||||
#include "level_zero/ze_api.h"
|
||||
@@ -44,10 +43,11 @@ class FdCache {
|
||||
void eraseLeastUsedEntryFromCache();
|
||||
};
|
||||
|
||||
class FsAccess : NEO::NonAssignableClass {
|
||||
class FsAccess {
|
||||
public:
|
||||
static FsAccess *create();
|
||||
FsAccess(const FsAccess &fsAccess);
|
||||
FsAccess &operator=(const FsAccess &) = delete;
|
||||
virtual ~FsAccess() = default;
|
||||
|
||||
virtual ze_result_t canRead(const std::string file);
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
#include "shared/source/os_interface/linux/sys_calls.h"
|
||||
|
||||
#include "level_zero/ze_api.h"
|
||||
@@ -44,10 +43,11 @@ class FdCache {
|
||||
void eraseLeastUsedEntryFromCache();
|
||||
};
|
||||
|
||||
class FsAccess : NEO::NonAssignableClass {
|
||||
class FsAccess {
|
||||
public:
|
||||
static FsAccess *create();
|
||||
FsAccess(const FsAccess &fsAccess);
|
||||
FsAccess &operator=(const FsAccess &) = delete;
|
||||
virtual ~FsAccess() = default;
|
||||
|
||||
virtual ze_result_t canRead(const std::string file);
|
||||
|
||||
@@ -26,11 +26,4 @@ class NonCopyableClass {
|
||||
NonCopyableClass(NonCopyableClass &&) = default;
|
||||
NonCopyableClass &operator=(NonCopyableClass &&) = default;
|
||||
};
|
||||
|
||||
class NonAssignableClass {
|
||||
public:
|
||||
NonAssignableClass() = default;
|
||||
NonAssignableClass &operator=(const NonAssignableClass &) = delete;
|
||||
NonAssignableClass &operator=(NonAssignableClass &&) = delete;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
#include "shared/source/memory_manager/allocation_type.h"
|
||||
#include "shared/source/utilities/stackvec.h"
|
||||
|
||||
@@ -18,11 +17,13 @@ namespace NEO {
|
||||
class MigrationSyncData;
|
||||
class GraphicsAllocation;
|
||||
|
||||
class MultiGraphicsAllocation : NonAssignableClass {
|
||||
class MultiGraphicsAllocation {
|
||||
public:
|
||||
MultiGraphicsAllocation(uint32_t maxRootDeviceIndex);
|
||||
MultiGraphicsAllocation(const MultiGraphicsAllocation &multiGraphicsAllocation);
|
||||
MultiGraphicsAllocation(MultiGraphicsAllocation &&);
|
||||
MultiGraphicsAllocation &operator=(const MultiGraphicsAllocation &) = delete;
|
||||
MultiGraphicsAllocation &operator=(MultiGraphicsAllocation &&) = delete;
|
||||
~MultiGraphicsAllocation();
|
||||
|
||||
GraphicsAllocation *getDefaultGraphicsAllocation() const;
|
||||
|
||||
@@ -32,7 +32,7 @@ struct SmallBuffersParams {
|
||||
};
|
||||
|
||||
template <typename PoolT, typename BufferType, typename BufferParentType = BufferType>
|
||||
struct AbstractBuffersPool : public SmallBuffersParams<PoolT>, public NonCopyableClass, NonAssignableClass {
|
||||
struct AbstractBuffersPool : public SmallBuffersParams<PoolT>, public NonCopyableClass {
|
||||
// The prototype of a function allocating the `mainStorage` is not specified.
|
||||
// That would be an unnecessary limitation here - it is completely up to derived class implementation.
|
||||
// Perhaps the allocating function needs to leverage `HeapAllocator::allocate()` and also
|
||||
@@ -48,6 +48,7 @@ struct AbstractBuffersPool : public SmallBuffersParams<PoolT>, public NonCopyabl
|
||||
|
||||
AbstractBuffersPool(MemoryManager *memoryManager, OnChunkFreeCallback onChunkFreeCallback);
|
||||
AbstractBuffersPool(AbstractBuffersPool<PoolT, BufferType, BufferParentType> &&bufferPool);
|
||||
AbstractBuffersPool &operator=(AbstractBuffersPool &&) = delete;
|
||||
void tryFreeFromPoolBuffer(BufferParentType *possiblePoolBuffer, size_t offset, size_t size);
|
||||
bool isPoolBuffer(const BufferParentType *buffer) const;
|
||||
void drain();
|
||||
|
||||
@@ -6,15 +6,12 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
|
||||
#include <iterator>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
template <typename DataType>
|
||||
struct Range : NonAssignableClass {
|
||||
struct Range {
|
||||
using iterator = DataType *;
|
||||
using const_iterator = const DataType *;
|
||||
using reverse_iterator = std::reverse_iterator<iterator>;
|
||||
@@ -37,6 +34,7 @@ struct Range : NonAssignableClass {
|
||||
Range(T (&base)[S])
|
||||
: Range(&base[0], S) {
|
||||
}
|
||||
Range &operator=(const Range &) = delete;
|
||||
|
||||
iterator begin() {
|
||||
return begIt;
|
||||
|
||||
Reference in New Issue
Block a user