Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/include/kompute/Algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ class Algorithm
this->createPipeline();
}

/**
* @brief Make Algorithm uncopyable
*
*/
Algorithm(const Algorithm&) = delete;
Algorithm(const Algorithm&&) = delete;
Algorithm& operator=(const Algorithm&) = delete;
Algorithm& operator=(const Algorithm&&) = delete;


/**
* Destructor for Algorithm which is responsible for freeing and desroying
* respective pipelines and owned parameter groups.
Expand Down
10 changes: 10 additions & 0 deletions src/include/kompute/Image.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,16 @@ class Image : public Memory
{
}


/**
* @brief Make Image uncopyable
*
*/
Image(const Image&) = delete;
Image(const Image&&) = delete;
Image& operator=(const Image&) = delete;
Image& operator=(const Image&&) = delete;

/**
* Destructor which is in charge of freeing vulkan resources unless they
* have been provided externally.
Expand Down
10 changes: 10 additions & 0 deletions src/include/kompute/Manager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ class Manager
std::shared_ptr<vk::PhysicalDevice> physicalDevice,
std::shared_ptr<vk::Device> device);


/**
* @brief Make Manager uncopyable
*
*/
Manager(const Manager&) = delete;
Manager(const Manager&&) = delete;
Manager& operator=(const Manager&) = delete;
Manager& operator=(const Manager&&) = delete;

/**
* Manager destructor which would ensure all owned resources are destroyed
* unless explicitly stated that resources should not be destroyed or freed.
Expand Down
10 changes: 10 additions & 0 deletions src/include/kompute/Memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,16 @@ class Memory
uint32_t x,
uint32_t y);


/**
* @brief Make Memory uncopyable
*
*/
Memory(const Memory&) = delete;
Memory(const Memory&&) = delete;
Memory& operator=(const Memory&) = delete;
Memory& operator=(const Memory&&) = delete;

/**
* Destructor which is in charge of freeing vulkan resources unless they
* have been provided externally.
Expand Down
10 changes: 10 additions & 0 deletions src/include/kompute/Sequence.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,16 @@ class Sequence : public std::enable_shared_from_this<Sequence>
std::shared_ptr<vk::Queue> computeQueue,
uint32_t queueIndex,
uint32_t totalTimestamps = 0) noexcept;

/**
* @brief Make Sequence uncopyable
*
*/
Sequence(const Sequence&) = delete;
Sequence(const Sequence&&) = delete;
Sequence& operator=(const Sequence&) = delete;
Sequence& operator=(const Sequence&&) = delete;

/**
* Destructor for sequence which is responsible for cleaning all subsequent
* owned operations.
Expand Down
19 changes: 19 additions & 0 deletions src/include/kompute/Tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ class Tensor : public Memory
const DataTypes& dataType,
const MemoryTypes& memoryType = MemoryTypes::eDevice);

/**
* @brief Make Tensor uncopyable
*
*/
Tensor(const Tensor&) = delete;
Tensor(const Tensor&&) = delete;
Tensor& operator=(const Tensor&) = delete;
Tensor& operator=(const Tensor&&) = delete;

/**
* Destructor which is in charge of freeing vulkan resources unless they
* have been provided externally.
Expand Down Expand Up @@ -250,6 +259,16 @@ class TensorT : public Tensor
data.size());
}

/**
* @brief Make TensorT uncopyable
*
*/
TensorT(const TensorT&) = delete;
TensorT(const TensorT&&) = delete;
TensorT& operator=(const TensorT&) = delete;
TensorT& operator=(const TensorT&&) = delete;


~TensorT() { KP_LOG_DEBUG("Kompute TensorT destructor"); }

DataTypes dataType() { return Memory::dataType<T>(); }
Expand Down
10 changes: 10 additions & 0 deletions src/include/kompute/operations/OpAlgoDispatch.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,16 @@ class OpAlgoDispatch : public OpBase
}
}

/**
* @brief Make OpAlgoDispatch non-copyable
*
*/
OpAlgoDispatch(const OpAlgoDispatch&) = delete;
OpAlgoDispatch(const OpAlgoDispatch&&) = delete;
OpAlgoDispatch& operator=(const OpAlgoDispatch&) = delete;
OpAlgoDispatch& operator=(const OpAlgoDispatch&&) = delete;


/**
* Default destructor, which is in charge of destroying the algorithm
* components but does not destroy the underlying tensors
Expand Down
15 changes: 15 additions & 0 deletions src/include/kompute/operations/OpBase.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ namespace kp {
class OpBase
{
public:
/**
* @brief Construct a new OpBase object
*
*/
OpBase() = default;

/**
* @brief Make OpBase non-copyable
*
*/
OpBase(const OpBase&) = delete;
OpBase(const OpBase&&) = delete;
OpBase& operator=(const OpBase&) = delete;
OpBase& operator=(const OpBase&&) = delete;

/**
* Default destructor for OpBase class. This OpBase destructor class should
* always be called to destroy and free owned resources unless it is
Expand Down
9 changes: 9 additions & 0 deletions src/include/kompute/operations/OpCopy.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ class OpCopy : public OpBase
*/
OpCopy(const std::vector<std::shared_ptr<Memory>>& memObjects);

/**
* @brief Make OpCopy non-copyable
*
*/
OpCopy(const OpCopy&) = delete;
OpCopy(const OpCopy&&) = delete;
OpCopy& operator=(const OpCopy&) = delete;
OpCopy& operator=(const OpCopy&&) = delete;

/**
* Default destructor. This class does not manage memory so it won't be
* expecting the parent to perform a release.
Expand Down
9 changes: 9 additions & 0 deletions src/include/kompute/operations/OpMemoryBarrier.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,15 @@ class OpMemoryBarrier : public OpBase
const vk::PipelineStageFlagBits& dstStageMask,
bool barrierOnPrimary = true) noexcept;

/**
* @brief Make OpMemoryBarrier non-copyable
*
*/
OpMemoryBarrier(const OpMemoryBarrier&) = delete;
OpMemoryBarrier(const OpMemoryBarrier&&) = delete;
OpMemoryBarrier& operator=(const OpMemoryBarrier&) = delete;
OpMemoryBarrier& operator=(const OpMemoryBarrier&&) = delete;

/**
* Default destructor, which is in charge of destroying the reference to the
* tensors and all the relevant access / stage masks created
Expand Down
9 changes: 9 additions & 0 deletions src/include/kompute/operations/OpMult.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,15 @@ class OpMult : public OpAlgoDispatch
algorithm->rebuild<>(memObjects, spirv);
}

/**
* @brief Make OpMult non-copyable
*
*/
OpMult(const OpMult&) = delete;
OpMult(const OpMult&&) = delete;
OpMult& operator=(const OpMult&) = delete;
OpMult& operator=(const OpMult&&) = delete;

/**
* Default destructor, which is in charge of destroying the algorithm
* components but does not destroy the underlying tensors
Expand Down
10 changes: 10 additions & 0 deletions src/include/kompute/operations/OpSyncDevice.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,16 @@ class OpSyncDevice : public OpBase
*/
OpSyncDevice(const std::vector<std::shared_ptr<Memory>>& memObjects);

/**
* @brief Make OpSyncDevice non-copyable
*
*/
OpSyncDevice(const OpSyncDevice&) = delete;
OpSyncDevice(const OpSyncDevice&&) = delete;
OpSyncDevice& operator=(const OpSyncDevice&) = delete;
OpSyncDevice& operator=(const OpSyncDevice&&) = delete;


/**
* Default destructor. This class does not manage memory so it won't be
* expecting the parent to perform a release.
Expand Down
9 changes: 9 additions & 0 deletions src/include/kompute/operations/OpSyncLocal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,15 @@ class OpSyncLocal : public OpBase
*/
OpSyncLocal(const std::vector<std::shared_ptr<Memory>>& memObjects);

/**
* @brief Make OpSyncLocal non-copyable
*
*/
OpSyncLocal(const OpSyncLocal&) = delete;
OpSyncLocal(const OpSyncLocal&&) = delete;
OpSyncLocal& operator=(const OpSyncLocal&) = delete;
OpSyncLocal& operator=(const OpSyncLocal&&) = delete;

/**
* Default destructor. This class does not manage memory so it won't be
* expecting the parent to perform a release.
Expand Down