|
| 1 | +diff -Nuarp opencv-2.4.13.7.orig/modules/core/src/gpumat.cpp opencv-2.4.13.7/modules/core/src/gpumat.cpp |
| 2 | +--- opencv-2.4.13.7.orig/modules/core/src/gpumat.cpp 2018-07-02 05:41:56.000000000 +0800 |
| 3 | ++++ opencv-2.4.13.7/modules/core/src/gpumat.cpp 2021-05-12 13:05:39.939811441 +0800 |
| 4 | +@@ -222,40 +222,40 @@ static bool loadCudaSupportLib() |
| 5 | + |
| 6 | + #endif |
| 7 | + |
| 8 | +-static GpuFuncTable* gpuFuncTable() |
| 9 | +-{ |
| 10 | + #ifdef DYNAMIC_CUDA_SUPPORT |
| 11 | +- static EmptyFuncTable stub; |
| 12 | +- static GpuFuncTable* libFuncTable = loadCudaSupportLib() ? gpuFactory(): (GpuFuncTable*)&stub; |
| 13 | +- static GpuFuncTable *funcTable = libFuncTable ? libFuncTable : (GpuFuncTable*)&stub; |
| 14 | ++static EmptyFuncTable g_GpuFuncTable_stub; |
| 15 | ++static GpuFuncTable* g_GpuFuncTable_libFuncTable = loadCudaSupportLib() ? gpuFactory(): (GpuFuncTable*)&g_GpuFuncTable_stub; |
| 16 | ++static GpuFuncTable *g_GpuFuncTable_funcTable = g_GpuFuncTable_libFuncTable ? g_GpuFuncTable_libFuncTable : (GpuFuncTable*)&g_GpuFuncTable_stub; |
| 17 | + #else |
| 18 | + # ifdef USE_CUDA |
| 19 | +- static CudaFuncTable impl; |
| 20 | +- static GpuFuncTable* funcTable = &impl; |
| 21 | ++static CudaFuncTable g_GpuFuncTable_impl; |
| 22 | ++static GpuFuncTable* g_GpuFuncTable_funcTable = &g_GpuFuncTable_impl; |
| 23 | + #else |
| 24 | +- static EmptyFuncTable stub; |
| 25 | +- static GpuFuncTable* funcTable = &stub; |
| 26 | ++static EmptyFuncTable g_GpuFuncTable_stub; |
| 27 | ++static GpuFuncTable* g_GpuFuncTable_funcTable = &g_GpuFuncTable_stub; |
| 28 | + #endif |
| 29 | + #endif |
| 30 | +- return funcTable; |
| 31 | ++static GpuFuncTable* gpuFuncTable() |
| 32 | ++{ |
| 33 | ++ return g_GpuFuncTable_funcTable; |
| 34 | + } |
| 35 | + |
| 36 | +-static DeviceInfoFuncTable* deviceInfoFuncTable() |
| 37 | +-{ |
| 38 | + #ifdef DYNAMIC_CUDA_SUPPORT |
| 39 | +- static EmptyDeviceInfoFuncTable stub; |
| 40 | +- static DeviceInfoFuncTable* libFuncTable = loadCudaSupportLib() ? deviceInfoFactory(): (DeviceInfoFuncTable*)&stub; |
| 41 | +- static DeviceInfoFuncTable* funcTable = libFuncTable ? libFuncTable : (DeviceInfoFuncTable*)&stub; |
| 42 | ++static EmptyDeviceInfoFuncTable g_DeviceInfoFuncTable_stub; |
| 43 | ++static DeviceInfoFuncTable* g_DeviceInfoFuncTable_libFuncTable = loadCudaSupportLib() ? deviceInfoFactory(): (DeviceInfoFuncTable*)&g_DeviceInfoFuncTable_stub; |
| 44 | ++static DeviceInfoFuncTable* g_DeviceInfoFuncTable_funcTable = g_DeviceInfoFuncTable_libFuncTable ? g_DeviceInfoFuncTable_libFuncTable : (DeviceInfoFuncTable*)&g_DeviceInfoFuncTable_stub; |
| 45 | + #else |
| 46 | + # ifdef USE_CUDA |
| 47 | +- static CudaDeviceInfoFuncTable impl; |
| 48 | +- static DeviceInfoFuncTable* funcTable = &impl; |
| 49 | ++static CudaDeviceInfoFuncTable g_DeviceInfoFuncTable_impl; |
| 50 | ++static DeviceInfoFuncTable* g_DeviceInfoFuncTable_funcTable = &g_DeviceInfoFuncTable_impl; |
| 51 | + #else |
| 52 | +- static EmptyDeviceInfoFuncTable stub; |
| 53 | +- static DeviceInfoFuncTable* funcTable = &stub; |
| 54 | ++static EmptyDeviceInfoFuncTable g_DeviceInfoFuncTable_stub; |
| 55 | ++static DeviceInfoFuncTable* g_DeviceInfoFuncTable_funcTable = &g_DeviceInfoFuncTable_stub; |
| 56 | + #endif |
| 57 | + #endif |
| 58 | +- return funcTable; |
| 59 | ++static DeviceInfoFuncTable* deviceInfoFuncTable() |
| 60 | ++{ |
| 61 | ++ return g_DeviceInfoFuncTable_funcTable; |
| 62 | + } |
| 63 | + |
| 64 | + |
| 65 | +diff -Nuarp opencv-2.4.13.7.orig/modules/core/src/matop.cpp opencv-2.4.13.7/modules/core/src/matop.cpp |
| 66 | +--- opencv-2.4.13.7.orig/modules/core/src/matop.cpp 2018-07-02 05:41:56.000000000 +0800 |
| 67 | ++++ opencv-2.4.13.7/modules/core/src/matop.cpp 2021-05-12 14:09:01.821745993 +0800 |
| 68 | +@@ -203,10 +203,10 @@ public: |
| 69 | + static void makeExpr(MatExpr& res, int method, int ndims, const int* sizes, int type, double alpha=1); |
| 70 | + }; |
| 71 | + |
| 72 | ++static MatOp_Initializer g_MatOp_initializer; |
| 73 | + static MatOp_Initializer* getGlobalMatOpInitializer() |
| 74 | + { |
| 75 | +- static MatOp_Initializer initializer; |
| 76 | +- return &initializer; |
| 77 | ++ return &g_MatOp_initializer; |
| 78 | + } |
| 79 | + |
| 80 | + static inline bool isIdentity(const MatExpr& e) { return e.op == &g_MatOp_Identity; } |
0 commit comments