From eee3a351336947f6eaa0a4cf66b52f51cd9b6280 Mon Sep 17 00:00:00 2001 From: Anatoly Baksheev Date: Tue, 24 Aug 2010 09:15:45 +0000 Subject: [PATCH] uploadConstant function for gpu --- modules/gpu/src/cuda/cuda_shared.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/gpu/src/cuda/cuda_shared.hpp b/modules/gpu/src/cuda/cuda_shared.hpp index 675b8dc7b..73304f555 100644 --- a/modules/gpu/src/cuda/cuda_shared.hpp +++ b/modules/gpu/src/cuda/cuda_shared.hpp @@ -67,6 +67,10 @@ namespace cv extern "C" void convert_to(const DevMem2D& src, int sdepth, DevMem2D dst, int ddepth, int channels, double alpha, double beta, const cudaStream_t & stream = 0); } + + template + inline void uploadConstant(const char* name, const T& value) { cudaSafeCall( cudaMemcpyToSymbol(name, &value, sizeof(T)) ); } + } }