1 // This file is part of OpenCV project. 2 // It is subject to the license terms in the LICENSE file found in the top-level directory 3 // of this distribution and at http://opencv.org/license.html. 4 // 5 // Copyright (C) 2018, Intel Corporation, all rights reserved. 6 // Third party copyrights are property of their respective owners. 7 8 #ifndef OPENCV_DNN_VKCOM_BUFFER_HPP 9 #define OPENCV_DNN_VKCOM_BUFFER_HPP 10 11 #ifdef HAVE_VULKAN 12 #include <vulkan/vulkan.h> 13 #endif // HAVE_VULKAN 14 15 namespace cv { namespace dnn { namespace vkcom { 16 17 #ifdef HAVE_VULKAN 18 19 class Buffer 20 { 21 public: Buffer(VkDevice & device)22 Buffer(VkDevice& device) 23 : device_(device), buffer_(VK_NULL_HANDLE), memory_(VK_NULL_HANDLE){}; 24 Buffer(VkDevice& device, size_t size_in_bytes, const char* data); 25 ~Buffer(); getVkMemory()26 VkDeviceMemory getVkMemory() { return memory_; } getVkBuffer()27 VkBuffer getVkBuffer() { return buffer_; } 28 29 private: 30 Buffer(); 31 bool init(size_t size_in_bytes, const char* data); 32 VkDevice device_; 33 VkBuffer buffer_; 34 VkDeviceMemory memory_; 35 }; 36 37 #endif // HAVE_VULKAN 38 39 }}} // namespace cv::dnn::vkcom 40 41 #endif // OPENCV_DNN_VKCOM_BUFFER_HPP 42