Download modules/dnn/src/vkcom/vulkan/vk_loader.cpp from tgollogly/test: direct link, hf CLI and curl.
- Browser
- Download file 4.51 kB
-
https://huggingface.co/tgollogly/test/resolve/main/modules/dnn/src/vkcom/vulkan/vk_loader.cpp
- Command line
-
hf download hf://tgollogly/test/modules/dnn/src/vkcom/vulkan/vk_loader.cpp
-
curl -L -o vk_loader.cpp https://huggingface.co/tgollogly/test/resolve/main/modules/dnn/src/vkcom/vulkan/vk_loader.cpp
4.51 kB
| // This file is part of OpenCV project. | |
| // It is subject to the license terms in the LICENSE file found in the top-level directory | |
| // of this distribution and at http://opencv.org/license.html. | |
| // | |
| // Copyright (C) 2018, Intel Corporation, all rights reserved. | |
| // Third party copyrights are property of their respective owners. | |
| typedef HMODULE VulkanHandle; | |
| typedef void* VulkanHandle; | |
| typedef void* VulkanHandle; | |
| namespace cv { namespace dnn { namespace vkcom { | |
| static VulkanHandle handle = nullptr; | |
| bool loadVulkanFunctions(VkInstance& instance) | |
| { | |
| return true; | |
| } | |
| bool loadVulkanGlobalFunctions() | |
| { | |
| return true; | |
| } | |
| bool loadVulkanEntry() | |
| { | |
| if (handle == nullptr) | |
| return false; | |
| vkGetInstanceProcAddr = GET_VK_ENTRY_POINT(handle); | |
| if (!vkGetInstanceProcAddr) | |
| { | |
| fprintf(stderr, "Could not load Vulkan entry function: vkGetInstanceProcAddr!\n"); | |
| return false; | |
| } | |
| return true; | |
| } | |
| bool loadVulkanLibrary() | |
| { | |
| if (handle != nullptr) | |
| return true; | |
| const char* path; | |
| const char* envPath = getenv("OPENCV_VULKAN_RUNTIME"); | |
| if (envPath) | |
| { | |
| path = envPath; | |
| } | |
| else | |
| { | |
| path = DEFAULT_VK_LIBRARY_PATH; | |
| } | |
| handle = LOAD_VK_LIBRARY(path); | |
| if( handle == nullptr ) | |
| { | |
| fprintf(stderr, "Could not load Vulkan library: %s!\n", path); | |
| fprintf(stderr, "Please download the Vulkan SDK and set the environment variable of OPENCV_VULKAN_RUNTIME according " | |
| "to your system environment.\n"); | |
| fprintf(stderr, "For M1 Mac and IOS, we use MoltenVK to map the Vulkan code to native apple Metal code.\n"); | |
| fprintf(stderr, "You can download the SDK from https://vulkan.lunarg.com/sdk/home.\n"); | |
| fprintf(stderr, "The following are some examples:\n"); | |
| fprintf(stderr, "For Windows, OPENCV_VULKAN_RUNTIME=D:\\VulkanSDK\\1.3.236.0\\Bin\\vulkan-1.dll\n"); | |
| fprintf(stderr, "For Linux, OPENCV_VULKAN_RUNTIME=/opt/vulkan/1.3.236.0/x86_64/libvulkan.so\n"); | |
| fprintf(stderr, "For MacOS of x86, OPENCV_VULKAN_RUNTIME=/opt/vulkan/1.3.236.0/x86_64/libvulkan.dylib\n"); | |
| fprintf(stderr, "For MacOS of M1 or IOS, OPENCV_VULKAN_RUNTIME=/opt/VulkanSDK/1.3.231.1/MoltenVK/dylib/macOS/libMoltenVK.dylib\n"); | |
| return false; | |
| } | |
| return true; | |
| } | |
| }}} // namespace cv::dnn::vkcom | |