Base working compilation

This commit is contained in:
Alejandro Saucedo 2020-08-19 18:58:22 +01:00
parent 5596b6f029
commit 7c3af1189f
8 changed files with 40 additions and 37 deletions

50
src/OpBase.hpp Normal file
View file

@ -0,0 +1,50 @@
#pragma once
#include <string>
#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 "Tensor.hpp"
namespace kp {
class OpBase
{
private:
public:
OpBase() {}
OpBase(std::shared_ptr<vk::PhysicalDevice> physicalDevice,
std::shared_ptr<vk::Device> device,
std::shared_ptr<vk::CommandBuffer> commandBuffer) {
SPDLOG_DEBUG("Compute OpBase constructor started");
this->mPhysicalDevice = physicalDevice;
this->mDevice = device;
this->mCommandBuffer = commandBuffer;
}
~OpBase()
{
SPDLOG_DEBUG("Compute OpBase destructor started");
}
virtual void init(std::shared_ptr<Tensor> tensor, ...) = 0;
virtual void record() = 0;
protected:
std::shared_ptr<vk::PhysicalDevice> mPhysicalDevice;
std::shared_ptr<vk::Device> mDevice;
std::shared_ptr<vk::CommandBuffer> mCommandBuffer;
};
} // End namespace kp