mirror of
https://github.com/opencv/opencv.git
synced 2026-07-30 07:43:03 +04:00
cleaned up super_resolution sample from old OCL
This commit is contained in:
@@ -85,10 +85,9 @@ public:
|
||||
OPENGL_BUFFER = 7 << KIND_SHIFT,
|
||||
CUDA_MEM = 8 << KIND_SHIFT,
|
||||
GPU_MAT = 9 << KIND_SHIFT,
|
||||
OCL_MAT =10 << KIND_SHIFT,
|
||||
UMAT =11 << KIND_SHIFT,
|
||||
STD_VECTOR_UMAT =12 << KIND_SHIFT,
|
||||
UEXPR =13 << KIND_SHIFT
|
||||
UMAT =10 << KIND_SHIFT,
|
||||
STD_VECTOR_UMAT =11 << KIND_SHIFT,
|
||||
UEXPR =12 << KIND_SHIFT
|
||||
};
|
||||
|
||||
_InputArray();
|
||||
|
||||
@@ -736,7 +736,7 @@ void convertToD3D11Texture2D(InputArray src, ID3D11Texture2D* pD3D11Texture2D)
|
||||
|
||||
cl_mem clBuffer = (cl_mem)u.handle(ACCESS_READ);
|
||||
|
||||
cl_command_queue q = (cl_command_queue)CommandQueue::getDefault().ptr();
|
||||
cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr();
|
||||
status = clEnqueueAcquireD3D11ObjectsKHR(q, 1, &clImage, 0, NULL, NULL);
|
||||
if (status != CL_SUCCESS)
|
||||
CV_Error(cv::Error::OpenCLApiCallError, "OpenCL: clEnqueueAcquireD3D11ObjectsKHR failed");
|
||||
@@ -795,7 +795,7 @@ void convertFromD3D11Texture2D(ID3D11Texture2D* pD3D11Texture2D, OutputArray dst
|
||||
|
||||
cl_mem clBuffer = (cl_mem)u.handle(ACCESS_READ);
|
||||
|
||||
cl_command_queue q = (cl_command_queue)CommandQueue::getDefault().ptr();
|
||||
cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr();
|
||||
status = clEnqueueAcquireD3D11ObjectsKHR(q, 1, &clImage, 0, NULL, NULL);
|
||||
if (status != CL_SUCCESS)
|
||||
CV_Error(cv::Error::OpenCLApiCallError, "OpenCL: clEnqueueAcquireD3D11ObjectsKHR failed");
|
||||
@@ -884,7 +884,7 @@ void convertToD3D10Texture2D(InputArray src, ID3D10Texture2D* pD3D10Texture2D)
|
||||
|
||||
cl_mem clBuffer = (cl_mem)u.handle(ACCESS_READ);
|
||||
|
||||
cl_command_queue q = (cl_command_queue)CommandQueue::getDefault().ptr();
|
||||
cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr();
|
||||
status = clEnqueueAcquireD3D10ObjectsKHR(q, 1, &clImage, 0, NULL, NULL);
|
||||
if (status != CL_SUCCESS)
|
||||
CV_Error(cv::Error::OpenCLApiCallError, "OpenCL: clEnqueueAcquireD3D10ObjectsKHR failed");
|
||||
@@ -943,7 +943,7 @@ void convertFromD3D10Texture2D(ID3D10Texture2D* pD3D10Texture2D, OutputArray dst
|
||||
|
||||
cl_mem clBuffer = (cl_mem)u.handle(ACCESS_READ);
|
||||
|
||||
cl_command_queue q = (cl_command_queue)CommandQueue::getDefault().ptr();
|
||||
cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr();
|
||||
status = clEnqueueAcquireD3D10ObjectsKHR(q, 1, &clImage, 0, NULL, NULL);
|
||||
if (status != CL_SUCCESS)
|
||||
CV_Error(cv::Error::OpenCLApiCallError, "OpenCL: clEnqueueAcquireD3D10ObjectsKHR failed");
|
||||
@@ -1038,7 +1038,7 @@ void convertToDirect3DSurface9(InputArray src, IDirect3DSurface9* pDirect3DSurfa
|
||||
|
||||
cl_mem clBuffer = (cl_mem)u.handle(ACCESS_READ);
|
||||
|
||||
cl_command_queue q = (cl_command_queue)CommandQueue::getDefault().ptr();
|
||||
cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr();
|
||||
status = clEnqueueAcquireDX9MediaSurfacesKHR(q, 1, &clImage, 0, NULL, NULL);
|
||||
if (status != CL_SUCCESS)
|
||||
CV_Error(cv::Error::OpenCLApiCallError, "OpenCL: clEnqueueAcquireDX9MediaSurfacesKHR failed");
|
||||
@@ -1104,7 +1104,7 @@ void convertFromDirect3DSurface9(IDirect3DSurface9* pDirect3DSurface9, OutputArr
|
||||
|
||||
cl_mem clBuffer = (cl_mem)u.handle(ACCESS_WRITE);
|
||||
|
||||
cl_command_queue q = (cl_command_queue)CommandQueue::getDefault().ptr();
|
||||
cl_command_queue q = (cl_command_queue)Queue::getDefault().ptr();
|
||||
status = clEnqueueAcquireDX9MediaSurfacesKHR(q, 1, &clImage, 0, NULL, NULL);
|
||||
if (status != CL_SUCCESS)
|
||||
CV_Error(cv::Error::OpenCLApiCallError, "OpenCL: clEnqueueAcquireDX9MediaSurfacesKHR failed");
|
||||
|
||||
@@ -1496,11 +1496,6 @@ Size _InputArray::size(int i) const
|
||||
return d_mat->size();
|
||||
}
|
||||
|
||||
if( k == OCL_MAT )
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "This method is not implemented for oclMat yet");
|
||||
}
|
||||
|
||||
CV_Assert( k == CUDA_MEM );
|
||||
//if( k == CUDA_MEM )
|
||||
{
|
||||
@@ -1680,11 +1675,6 @@ int _InputArray::dims(int i) const
|
||||
return 2;
|
||||
}
|
||||
|
||||
if( k == OCL_MAT )
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
CV_Assert( k == CUDA_MEM );
|
||||
//if( k == CUDA_MEM )
|
||||
{
|
||||
@@ -1842,11 +1832,6 @@ bool _InputArray::empty() const
|
||||
if( k == OPENGL_BUFFER )
|
||||
return ((const ogl::Buffer*)obj)->empty();
|
||||
|
||||
if( k == OCL_MAT )
|
||||
{
|
||||
CV_Error(CV_StsNotImplemented, "This method is not implemented for oclMat yet");
|
||||
}
|
||||
|
||||
if( k == GPU_MAT )
|
||||
return ((const cuda::GpuMat*)obj)->empty();
|
||||
|
||||
@@ -1882,7 +1867,7 @@ bool _InputArray::isContinuous(int i) const
|
||||
return vv[i].isContinuous();
|
||||
}
|
||||
|
||||
CV_Error(CV_StsNotImplemented, "This method is not implemented for oclMat yet");
|
||||
CV_Error(CV_StsNotImplemented, "Unknown/unsupported array type");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -3365,7 +3365,7 @@ protected:
|
||||
{
|
||||
CV_DbgAssert(entry.clBuffer_ == NULL);
|
||||
entry.capacity_ = alignSize(size, (int)_allocationGranularity(size));
|
||||
Context2& ctx = Context2::getDefault();
|
||||
Context& ctx = Context::getDefault();
|
||||
cl_int retval = CL_SUCCESS;
|
||||
entry.clBuffer_ = clCreateBuffer((cl_context)ctx.ptr(), CL_MEM_READ_WRITE, entry.capacity_, 0, &retval);
|
||||
CV_Assert(retval == CL_SUCCESS);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
//
|
||||
// * Redistribution's in binary form must reproduce the above copyright notice,
|
||||
// this list of conditions and the following disclaimer in the documentation
|
||||
// and/or other oclMaterials provided with the distribution.
|
||||
// and/or other materials provided with the distribution.
|
||||
//
|
||||
// * The name of the copyright holders may not be used to endorse or promote products
|
||||
// derived from this software without specific prior written permission.
|
||||
|
||||
@@ -119,7 +119,7 @@ CV_EXPORTS void randu(InputOutputArray dst);
|
||||
inline void safeFinish()
|
||||
{
|
||||
if (cv::ocl::useOpenCL())
|
||||
cv::ocl::finish2();
|
||||
cv::ocl::finish();
|
||||
}
|
||||
|
||||
} // namespace perf
|
||||
|
||||
Reference in New Issue
Block a user