From a04da1da55a73ae1788ced8e6ab326ee7fa8f5cc Mon Sep 17 00:00:00 2001 From: Niewiarowski <21334271+Niewiarowski@users.noreply.github.com> Date: Thu, 5 Nov 2026 14:06:44 -0500 Subject: [PATCH] refactor(linux/cuda): take the CUDA function table callback as std::function --- src/platform/linux/cuda.cpp | 4 ++-- src/platform/linux/cuda.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/platform/linux/cuda.cpp b/src/platform/linux/cuda.cpp index 9967020df..f065074cb 100644 --- a/src/platform/linux/cuda.cpp +++ b/src/platform/linux/cuda.cpp @@ -660,7 +660,7 @@ namespace cuda { */ vulkan_shared_memory_t(const vulkan_calls_t &vulkan_calls, cuda_functions_fn cuda_functions): vk {vulkan_calls}, - cu_functions {cuda_functions} { + cu_functions {std::move(cuda_functions)} { } bool supported() override { @@ -995,7 +995,7 @@ namespace cuda { * @return The driver. */ std::unique_ptr make_vulkan_shared_memory(const vulkan_calls_t &calls, cuda_functions_fn cuda_functions) { - return std::make_unique(calls, cuda_functions); + return std::make_unique(calls, std::move(cuda_functions)); } #endif diff --git a/src/platform/linux/cuda.h b/src/platform/linux/cuda.h index a16ba7582..3c5c42010 100644 --- a/src/platform/linux/cuda.h +++ b/src/platform/linux/cuda.h @@ -255,7 +255,7 @@ namespace cuda { /** * @brief Function returning the CUDA function table. */ - using cuda_functions_fn = const ::CudaFunctions *(*)(); + using cuda_functions_fn = std::function; /** * @brief Create a driver that shares plane memory through Vulkan.