giving a chance for OpenCL 1.1 devices

This commit is contained in:
Andrey Pavlenko
2015-08-27 14:04:08 +03:00
parent 8031742817
commit 74fcefedcb
2 changed files with 8 additions and 7 deletions

View File

@@ -1,4 +1,5 @@
#define __CL_ENABLE_EXCEPTIONS
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS /*let's give a chance for OpenCL 1.1 devices*/
#include <CL/cl.hpp>
#include <EGL/egl.h>
@@ -182,12 +183,12 @@ void procOCL_I2I(int texIn, int texOut, int w, int h)
LOGD("enqueueReleaseGLObjects() costs %d ms", getTimeInterval(t));
}
void procOCL_OCV(int tex, int w, int h)
void procOCL_OCV(int texIn, int texOut, int w, int h)
{
if(!haveOpenCL) return;
int64_t t = getTimeMs();
cl::ImageGL imgIn (theContext, CL_MEM_READ_ONLY, GL_TEXTURE_2D, 0, tex);
cl::ImageGL imgIn (theContext, CL_MEM_READ_ONLY, GL_TEXTURE_2D, 0, texIn);
std::vector < cl::Memory > images(1, imgIn);
theQueue.enqueueAcquireGLObjects(&images);
theQueue.finish();
@@ -204,7 +205,7 @@ void procOCL_OCV(int tex, int w, int h)
LOGD("OpenCV processing costs %d ms", getTimeInterval(t));
t = getTimeMs();
cl::ImageGL imgOut(theContext, CL_MEM_WRITE_ONLY, GL_TEXTURE_2D, 0, tex);
cl::ImageGL imgOut(theContext, CL_MEM_WRITE_ONLY, GL_TEXTURE_2D, 0, texOut);
images.clear();
images.push_back(imgOut);
theQueue.enqueueAcquireGLObjects(&images);