diff options
author | Vivek Chengalvala | 2017-03-01 15:02:05 -0600 |
---|---|---|
committer | Hongmei Gou | 2017-03-02 10:25:34 -0600 |
commit | 0abedafadbed693592804f23482a9447d81b2dbf (patch) | |
tree | c3c9aa917e675c2e72723a491fae220c96094def | |
parent | 0db24f44b49ad673bcebce5d25a63ea41551ebec (diff) | |
download | gst-plugin-dsp66-master.tar.gz gst-plugin-dsp66-master.tar.xz gst-plugin-dsp66-master.zip |
The file scope of canny_ctx(CL_DEVICE_TYPE_ACCELERATOR) OpenCL context object
resulted in constructor for Context called during g_module_open (g_plugin.c) of
"/usr/lib/gstreamer-1.0/libgstdsp66.so", leading to OpenCL device initialization
and subsequent CMEM error (when CMEM is not installed). The fix is to create the
Context object on the stack, along the lines of oclconv_imgproc
-rw-r--r-- | src/kernels/oclconv/oclconv.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/kernels/oclconv/oclconv.cpp b/src/kernels/oclconv/oclconv.cpp index 2c99bf3..05f884c 100644 --- a/src/kernels/oclconv/oclconv.cpp +++ b/src/kernels/oclconv/oclconv.cpp | |||
@@ -93,13 +93,6 @@ static int oclconv_imgproc(char *kernelName, unsigned char *data_in, unsigned ch | |||
93 | #endif | 93 | #endif |
94 | return 0; | 94 | return 0; |
95 | } | 95 | } |
96 | /*----------------------------------------------------------------------------------------------------------------------*/ | ||
97 | static bool canny_first_call = true; | ||
98 | static Context canny_ctx(CL_DEVICE_TYPE_ACCELERATOR); | ||
99 | static CommandQueue *canny_Q; | ||
100 | static Buffer *canny_gradX, *canny_gradY, *canny_mag, *canny_scratch, *canny_numItems; | ||
101 | static Kernel *canny_K; | ||
102 | static Buffer *canny_input, *canny_output; | ||
103 | 96 | ||
104 | /****************************************************************************** | 97 | /****************************************************************************** |
105 | * Canny Edge Detection - called on ARM, but algorithm dispatched to 1 DSP | 98 | * Canny Edge Detection - called on ARM, but algorithm dispatched to 1 DSP |
@@ -113,9 +106,16 @@ static Buffer *canny_input, *canny_output; | |||
113 | *****************************************************************************/ | 106 | *****************************************************************************/ |
114 | static int ocl_canny(unsigned char *data_in, unsigned char *data_out, unsigned short height, unsigned short width) | 107 | static int ocl_canny(unsigned char *data_in, unsigned char *data_out, unsigned short height, unsigned short width) |
115 | { | 108 | { |
116 | int numelem = (int)height*(int)width; | 109 | int numelem = (int)height*(int)width; |
110 | static bool canny_first_call = true; | ||
111 | CommandQueue *canny_Q; | ||
112 | Buffer *canny_gradX, *canny_gradY, *canny_mag, *canny_scratch, *canny_numItems; | ||
113 | Kernel *canny_K; | ||
114 | Buffer *canny_input, *canny_output; | ||
115 | |||
117 | try | 116 | try |
118 | { | 117 | { |
118 | Context canny_ctx(CL_DEVICE_TYPE_ACCELERATOR); | ||
119 | Event canny_ev, canny_ev1, canny_ev2; | 119 | Event canny_ev, canny_ev1, canny_ev2; |
120 | /*--------------------------------------------------------------------- | 120 | /*--------------------------------------------------------------------- |
121 | * Cache as much OpenCL plumbing on the first call, so the cost is not | 121 | * Cache as much OpenCL plumbing on the first call, so the cost is not |