Path: blob/master/modules/dnn/src/vkcom/include/buffer.hpp
16345 views
// This file is part of OpenCV project.1// It is subject to the license terms in the LICENSE file found in the top-level directory2// of this distribution and at http://opencv.org/license.html.3//4// Copyright (C) 2018, Intel Corporation, all rights reserved.5// Third party copyrights are property of their respective owners.67#ifndef OPENCV_DNN_VKCOM_BUFFER_HPP8#define OPENCV_DNN_VKCOM_BUFFER_HPP910#ifdef HAVE_VULKAN11#include <vulkan/vulkan.h>12#endif // HAVE_VULKAN1314namespace cv { namespace dnn { namespace vkcom {1516#ifdef HAVE_VULKAN1718class Buffer19{20public:21Buffer(VkDevice& device)22: device_(device), buffer_(VK_NULL_HANDLE), memory_(VK_NULL_HANDLE){};23Buffer(VkDevice& device, size_t size_in_bytes, const char* data);24~Buffer();25VkDeviceMemory getVkMemory() { return memory_; }26VkBuffer getVkBuffer() { return buffer_; }2728private:29Buffer();30bool init(size_t size_in_bytes, const char* data);31VkDevice device_;32VkBuffer buffer_;33VkDeviceMemory memory_;34};3536#endif // HAVE_VULKAN3738}}} // namespace cv::dnn::vkcom3940#endif // OPENCV_DNN_VKCOM_BUFFER_HPP414243