Created base for opcreatetensor
This commit is contained in:
parent
52ec836de8
commit
49b436f490
5 changed files with 60 additions and 6 deletions
|
|
@ -3,7 +3,8 @@
|
|||
## Principles
|
||||
|
||||
* Non-vulkan naming convention to disambiguate Vulkan vs Kompute components
|
||||
* BYOV: It would play nicely with existing applications with a bring-your-own-Vulkan design
|
||||
* Extends the existing vulkan API with a simpler compute-specific interface
|
||||
* BYOV: Play nice with existing Vulkan applications with a bring-your-own-Vulkan design
|
||||
* TODO
|
||||
|
||||
## Getting Started
|
||||
|
|
|
|||
18
src/OpCreateTensor.cpp
Normal file
18
src/OpCreateTensor.cpp
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
|
||||
#include "OpCreateTensor.hpp"
|
||||
|
||||
namespace kp {
|
||||
|
||||
OpCreateTensor::OpCreateTensor() {
|
||||
|
||||
}
|
||||
|
||||
OpCreateTensor::OpCreateTensor(std::shared_ptr<vk::CommandBuffer> commandBuffer) {
|
||||
this->mCommandBuffer = commandBuffer;
|
||||
}
|
||||
|
||||
OpCreateTensor::~OpCreateTensor() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
35
src/OpCreateTensor.hpp
Normal file
35
src/OpCreateTensor.hpp
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <vulkan/vulkan.hpp>
|
||||
|
||||
// SPDLOG_ACTIVE_LEVEL must be defined before spdlog.h import
|
||||
#if DEBUG
|
||||
#define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG
|
||||
#endif
|
||||
|
||||
#include <spdlog/spdlog.h>
|
||||
|
||||
#include "BaseOp.hpp"
|
||||
|
||||
namespace kp {
|
||||
|
||||
class OpCreateTensor: BaseOp
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
public:
|
||||
OpCreateTensor();
|
||||
|
||||
OpCreateTensor(std::shared_ptr<vk::CommandBuffer> commandBuffer);
|
||||
|
||||
~OpCreateTensor();
|
||||
|
||||
private:
|
||||
|
||||
std::shared_ptr<vk::CommandBuffer> mCommandBuffer;
|
||||
};
|
||||
|
||||
} // End namespace kp
|
||||
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#import "BaseOperator.hpp"
|
||||
#include "BaseOp.hpp"
|
||||
|
||||
namespace kp {
|
||||
|
||||
class OpMult: BaseOperator
|
||||
class OpMult: BaseOp
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
|
||||
public:
|
||||
OpMult();
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ Sequence::~Sequence() {
|
|||
|
||||
if (this->mFreeCommandBuffer) {
|
||||
spdlog::info("Freeing CommandBuffer");
|
||||
this->mDevice->freeCommandBuffers(*this->mCommandPool, 1, this->mCommandBuffer);
|
||||
this->mDevice->freeCommandBuffers(*this->mCommandPool, 1, this->mCommandBuffer.get());
|
||||
SPDLOG_DEBUG("Kompute Manager Freed CommandBuffer");
|
||||
}
|
||||
|
||||
|
|
@ -89,7 +89,7 @@ void Sequence::eval() {
|
|||
}
|
||||
|
||||
const vk::PipelineStageFlags waitStageMask = vk::PipelineStageFlagBits::eTransfer;
|
||||
vk::SubmitInfo submitInfo(0, nullptr, &waitStageMask, 1, this->mCommandBuffer);
|
||||
vk::SubmitInfo submitInfo(0, nullptr, &waitStageMask, 1, this->mCommandBuffer.get());
|
||||
|
||||
vk::Fence fence = this->mDevice->createFence(vk::FenceCreateInfo());
|
||||
this->mComputeQueue->submit(1, &submitInfo, fence);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue