parent
381d7851b7
commit
5ecf759742
32 changed files with 1279 additions and 79 deletions
@ -0,0 +1,59 @@ |
|||||||
|
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||||
|
//
|
||||||
|
// By downloading, copying, installing or using the software you agree to this license.
|
||||||
|
// If you do not agree to this license, do not download, install,
|
||||||
|
// copy or use the software.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// License Agreement
|
||||||
|
// For Open Source Computer Vision Library
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
|
||||||
|
// Third party copyrights are property of their respective owners.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
// are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// * Redistribution's of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// * 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 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.
|
||||||
|
//
|
||||||
|
// This software is provided by the copyright holders and contributors "as is" and
|
||||||
|
// any express or implied warranties, including, but not limited to, the implied
|
||||||
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||||
|
// In no event shall the OpenCV Foundation or contributors be liable for any direct,
|
||||||
|
// indirect, incidental, special, exemplary, or consequential damages
|
||||||
|
// (including, but not limited to, procurement of substitute goods or services;
|
||||||
|
// loss of use, data, or profits; or business interruption) however caused
|
||||||
|
// and on any theory of liability, whether in contract, strict liability,
|
||||||
|
// or tort (including negligence or otherwise) arising in any way out of
|
||||||
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
|
//
|
||||||
|
//M*/
|
||||||
|
|
||||||
|
#ifndef __OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP__ |
||||||
|
#define __OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP__ |
||||||
|
|
||||||
|
#ifdef HAVE_CLAMDBLAS |
||||||
|
|
||||||
|
#ifndef CL_RUNTIME_EXPORT |
||||||
|
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE) |
||||||
|
#define CL_RUNTIME_EXPORT __declspec(dllimport) |
||||||
|
#else |
||||||
|
#define CL_RUNTIME_EXPORT |
||||||
|
#endif |
||||||
|
#endif |
||||||
|
|
||||||
|
#include "autogenerated/opencl_clamdblas.hpp" |
||||||
|
|
||||||
|
#endif // HAVE_CLAMDBLAS
|
||||||
|
|
||||||
|
#endif // __OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP__
|
@ -0,0 +1,59 @@ |
|||||||
|
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||||
|
//
|
||||||
|
// By downloading, copying, installing or using the software you agree to this license.
|
||||||
|
// If you do not agree to this license, do not download, install,
|
||||||
|
// copy or use the software.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// License Agreement
|
||||||
|
// For Open Source Computer Vision Library
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
|
||||||
|
// Third party copyrights are property of their respective owners.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
// are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// * Redistribution's of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// * 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 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.
|
||||||
|
//
|
||||||
|
// This software is provided by the copyright holders and contributors "as is" and
|
||||||
|
// any express or implied warranties, including, but not limited to, the implied
|
||||||
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||||
|
// In no event shall the OpenCV Foundation or contributors be liable for any direct,
|
||||||
|
// indirect, incidental, special, exemplary, or consequential damages
|
||||||
|
// (including, but not limited to, procurement of substitute goods or services;
|
||||||
|
// loss of use, data, or profits; or business interruption) however caused
|
||||||
|
// and on any theory of liability, whether in contract, strict liability,
|
||||||
|
// or tort (including negligence or otherwise) arising in any way out of
|
||||||
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
|
//
|
||||||
|
//M*/
|
||||||
|
|
||||||
|
#ifndef __OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP__ |
||||||
|
#define __OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP__ |
||||||
|
|
||||||
|
#ifdef HAVE_CLAMDFFT |
||||||
|
|
||||||
|
#ifndef CL_RUNTIME_EXPORT |
||||||
|
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE) |
||||||
|
#define CL_RUNTIME_EXPORT __declspec(dllimport) |
||||||
|
#else |
||||||
|
#define CL_RUNTIME_EXPORT |
||||||
|
#endif |
||||||
|
#endif |
||||||
|
|
||||||
|
#include "autogenerated/opencl_clamdfft.hpp" |
||||||
|
|
||||||
|
#endif // HAVE_CLAMDFFT
|
||||||
|
|
||||||
|
#endif // __OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP__
|
@ -0,0 +1,83 @@ |
|||||||
|
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||||
|
//
|
||||||
|
// By downloading, copying, installing or using the software you agree to this license.
|
||||||
|
// If you do not agree to this license, do not download, install,
|
||||||
|
// copy or use the software.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// License Agreement
|
||||||
|
// For Open Source Computer Vision Library
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
|
||||||
|
// Third party copyrights are property of their respective owners.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
// are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// * Redistribution's of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// * 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 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.
|
||||||
|
//
|
||||||
|
// This software is provided by the copyright holders and contributors "as is" and
|
||||||
|
// any express or implied warranties, including, but not limited to, the implied
|
||||||
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||||
|
// In no event shall the OpenCV Foundation or contributors be liable for any direct,
|
||||||
|
// indirect, incidental, special, exemplary, or consequential damages
|
||||||
|
// (including, but not limited to, procurement of substitute goods or services;
|
||||||
|
// loss of use, data, or profits; or business interruption) however caused
|
||||||
|
// and on any theory of liability, whether in contract, strict liability,
|
||||||
|
// or tort (including negligence or otherwise) arising in any way out of
|
||||||
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
|
//
|
||||||
|
//M*/
|
||||||
|
|
||||||
|
#ifndef __OPENCV_CORE_OCL_RUNTIME_OPENCL_CORE_HPP__ |
||||||
|
#define __OPENCV_CORE_OCL_RUNTIME_OPENCL_CORE_HPP__ |
||||||
|
|
||||||
|
#ifdef HAVE_OPENCL |
||||||
|
|
||||||
|
#if defined(HAVE_OPENCL_STATIC) |
||||||
|
|
||||||
|
#if defined __APPLE__ |
||||||
|
#include <OpenCL/cl.h> |
||||||
|
#else |
||||||
|
#include <CL/cl.h> |
||||||
|
#endif |
||||||
|
|
||||||
|
#else // HAVE_OPENCL_STATIC
|
||||||
|
|
||||||
|
#ifndef CL_RUNTIME_EXPORT |
||||||
|
#if (defined(BUILD_SHARED_LIBS) || defined(OPENCV_CORE_SHARED)) && (defined WIN32 || defined _WIN32 || defined WINCE) |
||||||
|
#define CL_RUNTIME_EXPORT __declspec(dllimport) |
||||||
|
#else |
||||||
|
#define CL_RUNTIME_EXPORT |
||||||
|
#endif |
||||||
|
#endif |
||||||
|
|
||||||
|
#include "autogenerated/opencl_core.hpp" |
||||||
|
|
||||||
|
#endif // HAVE_OPENCL_STATIC
|
||||||
|
|
||||||
|
#ifndef CL_DEVICE_DOUBLE_FP_CONFIG |
||||||
|
#define CL_DEVICE_DOUBLE_FP_CONFIG 0x1032 |
||||||
|
#endif |
||||||
|
|
||||||
|
#ifndef CL_DEVICE_HALF_FP_CONFIG |
||||||
|
#define CL_DEVICE_HALF_FP_CONFIG 0x1033 |
||||||
|
#endif |
||||||
|
|
||||||
|
#ifndef CL_VERSION_1_2 |
||||||
|
#define CV_REQUIRE_OPENCL_1_2_ERROR CV_ErrorNoReturn(cv::Error::OpenCLApiCallError, "OpenCV compiled without OpenCL v1.2 support, so we can't use functionality from OpenCL v1.2") |
||||||
|
#endif |
||||||
|
|
||||||
|
#endif // HAVE_OPENCL
|
||||||
|
|
||||||
|
#endif // __OPENCV_CORE_OCL_RUNTIME_OPENCL_CORE_HPP__
|
@ -0,0 +1,47 @@ |
|||||||
|
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||||
|
//
|
||||||
|
// By downloading, copying, installing or using the software you agree to this license.
|
||||||
|
// If you do not agree to this license, do not download, install,
|
||||||
|
// copy or use the software.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// License Agreement
|
||||||
|
// For Open Source Computer Vision Library
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
|
||||||
|
// Third party copyrights are property of their respective owners.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
// are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// * Redistribution's of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// * 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 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.
|
||||||
|
//
|
||||||
|
// This software is provided by the copyright holders and contributors "as is" and
|
||||||
|
// any express or implied warranties, including, but not limited to, the implied
|
||||||
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||||
|
// In no event shall the OpenCV Foundation or contributors be liable for any direct,
|
||||||
|
// indirect, incidental, special, exemplary, or consequential damages
|
||||||
|
// (including, but not limited to, procurement of substitute goods or services;
|
||||||
|
// loss of use, data, or profits; or business interruption) however caused
|
||||||
|
// and on any theory of liability, whether in contract, strict liability,
|
||||||
|
// or tort (including negligence or otherwise) arising in any way out of
|
||||||
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
|
//
|
||||||
|
//M*/
|
||||||
|
|
||||||
|
#ifndef __OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP__ |
||||||
|
#define __OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP__ |
||||||
|
|
||||||
|
#include "autogenerated/opencl_core_wrappers.hpp" |
||||||
|
|
||||||
|
#endif // __OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP__
|
@ -0,0 +1,176 @@ |
|||||||
|
//clAmdBlasAddScratchImage |
||||||
|
//clAmdBlasCaxpy |
||||||
|
//clAmdBlasCcopy |
||||||
|
//clAmdBlasCdotc |
||||||
|
//clAmdBlasCdotu |
||||||
|
//clAmdBlasCgbmv |
||||||
|
//clAmdBlasCgemm |
||||||
|
clAmdBlasCgemmEx |
||||||
|
//clAmdBlasCgemv |
||||||
|
//clAmdBlasCgemvEx |
||||||
|
//clAmdBlasCgerc |
||||||
|
//clAmdBlasCgeru |
||||||
|
//clAmdBlasChbmv |
||||||
|
//clAmdBlasChemm |
||||||
|
//clAmdBlasChemv |
||||||
|
//clAmdBlasCher |
||||||
|
//clAmdBlasCher2 |
||||||
|
//clAmdBlasCher2k |
||||||
|
//clAmdBlasCherk |
||||||
|
//clAmdBlasChpmv |
||||||
|
//clAmdBlasChpr |
||||||
|
//clAmdBlasChpr2 |
||||||
|
//clAmdBlasCrotg |
||||||
|
//clAmdBlasCscal |
||||||
|
//clAmdBlasCsrot |
||||||
|
//clAmdBlasCsscal |
||||||
|
//clAmdBlasCswap |
||||||
|
//clAmdBlasCsymm |
||||||
|
//clAmdBlasCsyr2k |
||||||
|
//clAmdBlasCsyr2kEx |
||||||
|
//clAmdBlasCsyrk |
||||||
|
//clAmdBlasCsyrkEx |
||||||
|
//clAmdBlasCtbmv |
||||||
|
//clAmdBlasCtbsv |
||||||
|
//clAmdBlasCtpmv |
||||||
|
//clAmdBlasCtpsv |
||||||
|
//clAmdBlasCtrmm |
||||||
|
//clAmdBlasCtrmmEx |
||||||
|
//clAmdBlasCtrmv |
||||||
|
//clAmdBlasCtrsm |
||||||
|
//clAmdBlasCtrsmEx |
||||||
|
//clAmdBlasCtrsv |
||||||
|
//clAmdBlasDasum |
||||||
|
//clAmdBlasDaxpy |
||||||
|
//clAmdBlasDcopy |
||||||
|
//clAmdBlasDdot |
||||||
|
//clAmdBlasDgbmv |
||||||
|
//clAmdBlasDgemm |
||||||
|
clAmdBlasDgemmEx |
||||||
|
//clAmdBlasDgemv |
||||||
|
//clAmdBlasDgemvEx |
||||||
|
//clAmdBlasDger |
||||||
|
//clAmdBlasDnrm2 |
||||||
|
//clAmdBlasDrot |
||||||
|
//clAmdBlasDrotg |
||||||
|
//clAmdBlasDrotm |
||||||
|
//clAmdBlasDrotmg |
||||||
|
//clAmdBlasDsbmv |
||||||
|
//clAmdBlasDscal |
||||||
|
//clAmdBlasDspmv |
||||||
|
//clAmdBlasDspr |
||||||
|
//clAmdBlasDspr2 |
||||||
|
//clAmdBlasDswap |
||||||
|
//clAmdBlasDsymm |
||||||
|
//clAmdBlasDsymv |
||||||
|
//clAmdBlasDsymvEx |
||||||
|
//clAmdBlasDsyr |
||||||
|
//clAmdBlasDsyr2 |
||||||
|
//clAmdBlasDsyr2k |
||||||
|
//clAmdBlasDsyr2kEx |
||||||
|
//clAmdBlasDsyrk |
||||||
|
//clAmdBlasDsyrkEx |
||||||
|
//clAmdBlasDtbmv |
||||||
|
//clAmdBlasDtbsv |
||||||
|
//clAmdBlasDtpmv |
||||||
|
//clAmdBlasDtpsv |
||||||
|
//clAmdBlasDtrmm |
||||||
|
//clAmdBlasDtrmmEx |
||||||
|
//clAmdBlasDtrmv |
||||||
|
//clAmdBlasDtrsm |
||||||
|
//clAmdBlasDtrsmEx |
||||||
|
//clAmdBlasDtrsv |
||||||
|
//clAmdBlasDzasum |
||||||
|
//clAmdBlasDznrm2 |
||||||
|
//clAmdBlasGetVersion |
||||||
|
//clAmdBlasRemoveScratchImage |
||||||
|
//clAmdBlasSasum |
||||||
|
//clAmdBlasSaxpy |
||||||
|
//clAmdBlasScasum |
||||||
|
//clAmdBlasScnrm2 |
||||||
|
//clAmdBlasScopy |
||||||
|
//clAmdBlasSdot |
||||||
|
clAmdBlasSetup |
||||||
|
//clAmdBlasSgbmv |
||||||
|
//clAmdBlasSgemm |
||||||
|
clAmdBlasSgemmEx |
||||||
|
//clAmdBlasSgemv |
||||||
|
//clAmdBlasSgemvEx |
||||||
|
//clAmdBlasSger |
||||||
|
//clAmdBlasSnrm2 |
||||||
|
//clAmdBlasSrot |
||||||
|
//clAmdBlasSrotg |
||||||
|
//clAmdBlasSrotm |
||||||
|
//clAmdBlasSrotmg |
||||||
|
//clAmdBlasSsbmv |
||||||
|
//clAmdBlasSscal |
||||||
|
//clAmdBlasSspmv |
||||||
|
//clAmdBlasSspr |
||||||
|
//clAmdBlasSspr2 |
||||||
|
//clAmdBlasSswap |
||||||
|
//clAmdBlasSsymm |
||||||
|
//clAmdBlasSsymv |
||||||
|
//clAmdBlasSsymvEx |
||||||
|
//clAmdBlasSsyr |
||||||
|
//clAmdBlasSsyr2 |
||||||
|
//clAmdBlasSsyr2k |
||||||
|
//clAmdBlasSsyr2kEx |
||||||
|
//clAmdBlasSsyrk |
||||||
|
//clAmdBlasSsyrkEx |
||||||
|
//clAmdBlasStbmv |
||||||
|
//clAmdBlasStbsv |
||||||
|
//clAmdBlasStpmv |
||||||
|
//clAmdBlasStpsv |
||||||
|
//clAmdBlasStrmm |
||||||
|
//clAmdBlasStrmmEx |
||||||
|
//clAmdBlasStrmv |
||||||
|
//clAmdBlasStrsm |
||||||
|
//clAmdBlasStrsmEx |
||||||
|
//clAmdBlasStrsv |
||||||
|
clAmdBlasTeardown |
||||||
|
//clAmdBlasZaxpy |
||||||
|
//clAmdBlasZcopy |
||||||
|
//clAmdBlasZdotc |
||||||
|
//clAmdBlasZdotu |
||||||
|
//clAmdBlasZdrot |
||||||
|
//clAmdBlasZdscal |
||||||
|
//clAmdBlasZgbmv |
||||||
|
//clAmdBlasZgemm |
||||||
|
clAmdBlasZgemmEx |
||||||
|
//clAmdBlasZgemv |
||||||
|
//clAmdBlasZgemvEx |
||||||
|
//clAmdBlasZgerc |
||||||
|
//clAmdBlasZgeru |
||||||
|
//clAmdBlasZhbmv |
||||||
|
//clAmdBlasZhemm |
||||||
|
//clAmdBlasZhemv |
||||||
|
//clAmdBlasZher |
||||||
|
//clAmdBlasZher2 |
||||||
|
//clAmdBlasZher2k |
||||||
|
//clAmdBlasZherk |
||||||
|
//clAmdBlasZhpmv |
||||||
|
//clAmdBlasZhpr |
||||||
|
//clAmdBlasZhpr2 |
||||||
|
//clAmdBlasZrotg |
||||||
|
//clAmdBlasZscal |
||||||
|
//clAmdBlasZswap |
||||||
|
//clAmdBlasZsymm |
||||||
|
//clAmdBlasZsyr2k |
||||||
|
//clAmdBlasZsyr2kEx |
||||||
|
//clAmdBlasZsyrk |
||||||
|
//clAmdBlasZsyrkEx |
||||||
|
//clAmdBlasZtbmv |
||||||
|
//clAmdBlasZtbsv |
||||||
|
//clAmdBlasZtpmv |
||||||
|
//clAmdBlasZtpsv |
||||||
|
//clAmdBlasZtrmm |
||||||
|
//clAmdBlasZtrmmEx |
||||||
|
//clAmdBlasZtrmv |
||||||
|
//clAmdBlasZtrsm |
||||||
|
//clAmdBlasZtrsmEx |
||||||
|
//clAmdBlasZtrsv |
||||||
|
//clAmdBlasiCamax |
||||||
|
//clAmdBlasiDamax |
||||||
|
//clAmdBlasiSamax |
||||||
|
//clAmdBlasiZamax |
||||||
|
#total 175 |
@ -0,0 +1,33 @@ |
|||||||
|
clAmdFftBakePlan |
||||||
|
//clAmdFftCopyPlan |
||||||
|
clAmdFftCreateDefaultPlan |
||||||
|
clAmdFftDestroyPlan |
||||||
|
clAmdFftEnqueueTransform |
||||||
|
//clAmdFftGetLayout |
||||||
|
//clAmdFftGetPlanBatchSize |
||||||
|
//clAmdFftGetPlanContext |
||||||
|
//clAmdFftGetPlanDim |
||||||
|
//clAmdFftGetPlanDistance |
||||||
|
//clAmdFftGetPlanInStride |
||||||
|
//clAmdFftGetPlanLength |
||||||
|
//clAmdFftGetPlanOutStride |
||||||
|
//clAmdFftGetPlanPrecision |
||||||
|
//clAmdFftGetPlanScale |
||||||
|
//clAmdFftGetPlanTransposeResult |
||||||
|
//clAmdFftGetResultLocation |
||||||
|
clAmdFftGetTmpBufSize |
||||||
|
//clAmdFftGetVersion |
||||||
|
clAmdFftSetLayout |
||||||
|
clAmdFftSetPlanBatchSize |
||||||
|
//clAmdFftSetPlanDim |
||||||
|
clAmdFftSetPlanDistance |
||||||
|
clAmdFftSetPlanInStride |
||||||
|
//clAmdFftSetPlanLength |
||||||
|
clAmdFftSetPlanOutStride |
||||||
|
//clAmdFftSetPlanPrecision |
||||||
|
clAmdFftSetPlanScale |
||||||
|
//clAmdFftSetPlanTransposeResult |
||||||
|
clAmdFftSetResultLocation |
||||||
|
clAmdFftSetup |
||||||
|
clAmdFftTeardown |
||||||
|
#total 32 |
@ -0,0 +1,89 @@ |
|||||||
|
clBuildProgram |
||||||
|
clCompileProgram |
||||||
|
clCreateBuffer |
||||||
|
clCreateCommandQueue |
||||||
|
clCreateContext |
||||||
|
clCreateContextFromType |
||||||
|
clCreateImage |
||||||
|
clCreateImage2D |
||||||
|
clCreateImage3D |
||||||
|
clCreateKernel |
||||||
|
clCreateKernelsInProgram |
||||||
|
clCreateProgramWithBinary |
||||||
|
clCreateProgramWithBuiltInKernels |
||||||
|
clCreateProgramWithSource |
||||||
|
clCreateSampler |
||||||
|
clCreateSubBuffer |
||||||
|
clCreateSubDevices |
||||||
|
clCreateUserEvent |
||||||
|
clEnqueueBarrier |
||||||
|
clEnqueueBarrierWithWaitList |
||||||
|
clEnqueueCopyBuffer |
||||||
|
clEnqueueCopyBufferRect |
||||||
|
clEnqueueCopyBufferToImage |
||||||
|
clEnqueueCopyImage |
||||||
|
clEnqueueCopyImageToBuffer |
||||||
|
clEnqueueFillBuffer |
||||||
|
clEnqueueFillImage |
||||||
|
clEnqueueMapBuffer |
||||||
|
clEnqueueMapImage |
||||||
|
clEnqueueMarker |
||||||
|
clEnqueueMarkerWithWaitList |
||||||
|
clEnqueueMigrateMemObjects |
||||||
|
clEnqueueNDRangeKernel |
||||||
|
clEnqueueNativeKernel |
||||||
|
clEnqueueReadBuffer |
||||||
|
clEnqueueReadBufferRect |
||||||
|
clEnqueueReadImage |
||||||
|
clEnqueueTask |
||||||
|
clEnqueueUnmapMemObject |
||||||
|
clEnqueueWaitForEvents |
||||||
|
clEnqueueWriteBuffer |
||||||
|
clEnqueueWriteBufferRect |
||||||
|
clEnqueueWriteImage |
||||||
|
clFinish |
||||||
|
clFlush |
||||||
|
clGetCommandQueueInfo |
||||||
|
clGetContextInfo |
||||||
|
clGetDeviceIDs |
||||||
|
clGetDeviceInfo |
||||||
|
clGetEventInfo |
||||||
|
clGetEventProfilingInfo |
||||||
|
clGetExtensionFunctionAddress |
||||||
|
clGetExtensionFunctionAddressForPlatform |
||||||
|
clGetImageInfo |
||||||
|
clGetKernelArgInfo |
||||||
|
clGetKernelInfo |
||||||
|
clGetKernelWorkGroupInfo |
||||||
|
clGetMemObjectInfo |
||||||
|
clGetPlatformIDs |
||||||
|
clGetPlatformInfo |
||||||
|
clGetProgramBuildInfo |
||||||
|
clGetProgramInfo |
||||||
|
clGetSamplerInfo |
||||||
|
clGetSupportedImageFormats |
||||||
|
clLinkProgram |
||||||
|
clReleaseCommandQueue |
||||||
|
clReleaseContext |
||||||
|
clReleaseDevice |
||||||
|
clReleaseEvent |
||||||
|
clReleaseKernel |
||||||
|
clReleaseMemObject |
||||||
|
clReleaseProgram |
||||||
|
clReleaseSampler |
||||||
|
clRetainCommandQueue |
||||||
|
clRetainContext |
||||||
|
clRetainDevice |
||||||
|
clRetainEvent |
||||||
|
clRetainKernel |
||||||
|
clRetainMemObject |
||||||
|
clRetainProgram |
||||||
|
clRetainSampler |
||||||
|
clSetEventCallback |
||||||
|
clSetKernelArg |
||||||
|
clSetMemObjectDestructorCallback |
||||||
|
clSetUserEventStatus |
||||||
|
clUnloadCompiler |
||||||
|
clUnloadPlatformCompiler |
||||||
|
clWaitForEvents |
||||||
|
#total 88 |
@ -1,6 +1,6 @@ |
|||||||
#!/bin/bash -e |
#!/bin/bash -e |
||||||
echo "Generate files for CL runtime..." |
echo "Generate files for CL runtime..." |
||||||
cat sources/cl.h | python parser_cl.py cl_runtime_opencl |
python parser_cl.py opencl_core < sources/cl.h |
||||||
cat sources/clAmdBlas.h | python parser_clamdblas.py |
python parser_clamdblas.py < sources/clAmdBlas.h |
||||||
cat sources/clAmdFft.h | python parser_clamdfft.py |
python parser_clamdfft.py < sources/clAmdFft.h |
||||||
echo "Generate files for CL runtime... Done" |
echo "Generate files for CL runtime... Done" |
||||||
|
@ -0,0 +1,11 @@ |
|||||||
|
#ifndef __OPENCV_CORE_OCL_RUNTIME_CLAMDBLAS_HPP__ |
||||||
|
#error "Invalid usage" |
||||||
|
#endif |
||||||
|
|
||||||
|
@CLAMDBLAS_REMAP_ORIGIN@ |
||||||
|
|
||||||
|
#include <clAmdBlas.h> |
||||||
|
|
||||||
|
@CLAMDBLAS_REMAP_DYNAMIC@ |
||||||
|
|
||||||
|
@CLAMDBLAS_FN_DECLARATIONS@ |
@ -0,0 +1,15 @@ |
|||||||
|
#ifndef ADDITIONAL_FN_DEFINITIONS |
||||||
|
#define ADDITIONAL_FN_DEFINITIONS |
||||||
|
#endif |
||||||
|
|
||||||
|
@CL_FN_ENUMS@ |
||||||
|
|
||||||
|
namespace { |
||||||
|
@CL_FN_SWITCH@ |
||||||
|
} |
||||||
|
|
||||||
|
@CL_FN_ENTRY_DEFINITIONS@ |
||||||
|
|
||||||
|
@CL_FN_ENTRY_LIST@ |
||||||
|
|
||||||
|
@CL_NUMBER_OF_ENABLED_FUNCTIONS@ |
@ -0,0 +1,11 @@ |
|||||||
|
#ifndef __OPENCV_CORE_OCL_RUNTIME_CLAMDFFT_HPP__ |
||||||
|
#error "Invalid usage" |
||||||
|
#endif |
||||||
|
|
||||||
|
@CLAMDFFT_REMAP_ORIGIN@ |
||||||
|
|
||||||
|
#include <clAmdFft.h> |
||||||
|
|
||||||
|
@CLAMDFFT_REMAP_DYNAMIC@ |
||||||
|
|
||||||
|
@CLAMDFFT_FN_DECLARATIONS@ |
@ -0,0 +1,15 @@ |
|||||||
|
#ifndef ADDITIONAL_FN_DEFINITIONS |
||||||
|
#define ADDITIONAL_FN_DEFINITIONS |
||||||
|
#endif |
||||||
|
|
||||||
|
@CL_FN_ENUMS@ |
||||||
|
|
||||||
|
namespace { |
||||||
|
@CL_FN_SWITCH@ |
||||||
|
} |
||||||
|
|
||||||
|
@CL_FN_ENTRY_DEFINITIONS@ |
||||||
|
|
||||||
|
@CL_FN_ENTRY_LIST@ |
||||||
|
|
||||||
|
@CL_NUMBER_OF_ENABLED_FUNCTIONS@ |
@ -0,0 +1,15 @@ |
|||||||
|
#ifndef __OPENCV_CORE_OCL_RUNTIME_OPENCL_CORE_HPP__ |
||||||
|
#error "Invalid usage" |
||||||
|
#endif |
||||||
|
|
||||||
|
@CL_REMAP_ORIGIN@ |
||||||
|
|
||||||
|
#if defined __APPLE__ |
||||||
|
#include <OpenCL/cl.h> |
||||||
|
#else |
||||||
|
#include <CL/cl.h> |
||||||
|
#endif |
||||||
|
|
||||||
|
@CL_REMAP_DYNAMIC@ |
||||||
|
|
||||||
|
@CL_FN_DECLARATIONS@ |
@ -0,0 +1,16 @@ |
|||||||
|
|
||||||
|
#ifndef ADDITIONAL_FN_DEFINITIONS |
||||||
|
#define ADDITIONAL_FN_DEFINITIONS |
||||||
|
#endif |
||||||
|
|
||||||
|
@CL_FN_ENUMS@ |
||||||
|
|
||||||
|
namespace { |
||||||
|
@CL_FN_SWITCH@ |
||||||
|
} // anonymous namespace
|
||||||
|
|
||||||
|
@CL_FN_ENTRY_DEFINITIONS@ |
||||||
|
|
||||||
|
@CL_FN_ENTRY_LIST@ |
||||||
|
|
||||||
|
@CL_NUMBER_OF_ENABLED_FUNCTIONS@ |
@ -0,0 +1,5 @@ |
|||||||
|
#ifndef __OPENCV_CORE_OCL_RUNTIME_OPENCL_WRAPPERS_HPP__ |
||||||
|
#error "Invalid usage" |
||||||
|
#endif |
||||||
|
|
||||||
|
@CL_FN_INLINE_WRAPPERS@ |
@ -0,0 +1,125 @@ |
|||||||
|
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||||
|
//
|
||||||
|
// By downloading, copying, installing or using the software you agree to this license.
|
||||||
|
// If you do not agree to this license, do not download, install,
|
||||||
|
// copy or use the software.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// License Agreement
|
||||||
|
// For Open Source Computer Vision Library
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
|
||||||
|
// Third party copyrights are property of their respective owners.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
// are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// * Redistribution's of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// * 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 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.
|
||||||
|
//
|
||||||
|
// This software is provided by the copyright holders and contributors "as is" and
|
||||||
|
// any express or implied warranties, including, but not limited to, the implied
|
||||||
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||||
|
// In no event shall the OpenCV Foundation or contributors be liable for any direct,
|
||||||
|
// indirect, incidental, special, exemplary, or consequential damages
|
||||||
|
// (including, but not limited to, procurement of substitute goods or services;
|
||||||
|
// loss of use, data, or profits; or business interruption) however caused
|
||||||
|
// and on any theory of liability, whether in contract, strict liability,
|
||||||
|
// or tort (including negligence or otherwise) arising in any way out of
|
||||||
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
|
//
|
||||||
|
//M*/
|
||||||
|
|
||||||
|
#include "precomp.hpp" |
||||||
|
|
||||||
|
#ifdef HAVE_CLAMDBLAS |
||||||
|
|
||||||
|
#include "opencv2/core/opencl/runtime/opencl_core.hpp" |
||||||
|
#include "opencv2/core/opencl/runtime/opencl_clamdblas.hpp" |
||||||
|
|
||||||
|
#if defined(_WIN32) |
||||||
|
#include <windows.h> |
||||||
|
|
||||||
|
static void* WinGetProcAddress(const char* name) |
||||||
|
{ |
||||||
|
static HMODULE opencl_module = NULL; |
||||||
|
if (!opencl_module) |
||||||
|
{ |
||||||
|
opencl_module = GetModuleHandleA("clAmdBlas.dll"); |
||||||
|
if (!opencl_module) |
||||||
|
{ |
||||||
|
opencl_module = LoadLibraryA("clAmdBlas.dll"); |
||||||
|
if (!opencl_module) |
||||||
|
return NULL; |
||||||
|
} |
||||||
|
} |
||||||
|
return (void*)GetProcAddress(opencl_module, name); |
||||||
|
} |
||||||
|
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name) |
||||||
|
#endif // _WIN32
|
||||||
|
|
||||||
|
#if defined(linux) |
||||||
|
#include <dlfcn.h> |
||||||
|
#include <stdio.h> |
||||||
|
|
||||||
|
static void* GetProcAddress (const char* name) |
||||||
|
{ |
||||||
|
static void* h = NULL; |
||||||
|
if (!h) |
||||||
|
{ |
||||||
|
h = dlopen("libclAmdBlas.so", RTLD_LAZY | RTLD_GLOBAL); |
||||||
|
if (!h) |
||||||
|
return NULL; |
||||||
|
} |
||||||
|
|
||||||
|
return dlsym(h, name); |
||||||
|
} |
||||||
|
#define CV_CL_GET_PROC_ADDRESS(name) GetProcAddress(name) |
||||||
|
#endif |
||||||
|
|
||||||
|
#ifndef CV_CL_GET_PROC_ADDRESS |
||||||
|
#define CV_CL_GET_PROC_ADDRESS(name) NULL |
||||||
|
#endif |
||||||
|
|
||||||
|
static void* openclamdblas_check_fn(int ID); |
||||||
|
|
||||||
|
#include "runtime_common.hpp" |
||||||
|
|
||||||
|
//
|
||||||
|
// BEGIN OF CUSTOM FUNCTIONS
|
||||||
|
//
|
||||||
|
|
||||||
|
#define CUSTOM_FUNCTION_ID 1000 |
||||||
|
|
||||||
|
#undef ADDITIONAL_FN_DEFINITIONS |
||||||
|
|
||||||
|
//
|
||||||
|
// END OF CUSTOM FUNCTIONS HERE
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "autogenerated/opencl_clamdblas_impl.hpp" |
||||||
|
|
||||||
|
static void* openclamdblas_check_fn(int ID) |
||||||
|
{ |
||||||
|
ID = (ID <= CUSTOM_FUNCTION_ID) ? ID : ID - CUSTOM_FUNCTION_ID; |
||||||
|
assert(ID >= 0 && ID < (int)(sizeof(openclamdblas_fn)/sizeof(openclamdblas_fn[0]))); |
||||||
|
const struct DynamicFnEntry* e = openclamdblas_fn[ID]; |
||||||
|
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); |
||||||
|
if (!func) |
||||||
|
{ |
||||||
|
CV_Error(cv::Error::OpenCLApiCallError, cv::format("OpenCL AMD BLAS function is not available: [%s]", e->fnName)); |
||||||
|
} |
||||||
|
*(e->ppFn) = func; |
||||||
|
return func; |
||||||
|
} |
||||||
|
|
||||||
|
#endif |
@ -0,0 +1,125 @@ |
|||||||
|
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||||
|
//
|
||||||
|
// By downloading, copying, installing or using the software you agree to this license.
|
||||||
|
// If you do not agree to this license, do not download, install,
|
||||||
|
// copy or use the software.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// License Agreement
|
||||||
|
// For Open Source Computer Vision Library
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
|
||||||
|
// Third party copyrights are property of their respective owners.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
// are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// * Redistribution's of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// * 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 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.
|
||||||
|
//
|
||||||
|
// This software is provided by the copyright holders and contributors "as is" and
|
||||||
|
// any express or implied warranties, including, but not limited to, the implied
|
||||||
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||||
|
// In no event shall the OpenCV Foundation or contributors be liable for any direct,
|
||||||
|
// indirect, incidental, special, exemplary, or consequential damages
|
||||||
|
// (including, but not limited to, procurement of substitute goods or services;
|
||||||
|
// loss of use, data, or profits; or business interruption) however caused
|
||||||
|
// and on any theory of liability, whether in contract, strict liability,
|
||||||
|
// or tort (including negligence or otherwise) arising in any way out of
|
||||||
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
|
//
|
||||||
|
//M*/
|
||||||
|
|
||||||
|
#include "precomp.hpp" |
||||||
|
|
||||||
|
#ifdef HAVE_CLAMDFFT |
||||||
|
|
||||||
|
#include "opencv2/core/opencl/runtime/opencl_core.hpp" |
||||||
|
#include "opencv2/core/opencl/runtime/opencl_clamdfft.hpp" |
||||||
|
|
||||||
|
#if defined(_WIN32) |
||||||
|
#include <windows.h> |
||||||
|
|
||||||
|
static void* WinGetProcAddress(const char* name) |
||||||
|
{ |
||||||
|
static HMODULE opencl_module = NULL; |
||||||
|
if (!opencl_module) |
||||||
|
{ |
||||||
|
opencl_module = GetModuleHandleA("clAmdFft.Runtime.dll"); |
||||||
|
if (!opencl_module) |
||||||
|
{ |
||||||
|
opencl_module = LoadLibraryA("clAmdFft.Runtime.dll"); |
||||||
|
if (!opencl_module) |
||||||
|
return NULL; |
||||||
|
} |
||||||
|
} |
||||||
|
return (void*)GetProcAddress(opencl_module, name); |
||||||
|
} |
||||||
|
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name) |
||||||
|
#endif // _WIN32
|
||||||
|
|
||||||
|
#if defined(linux) |
||||||
|
#include <dlfcn.h> |
||||||
|
#include <stdio.h> |
||||||
|
|
||||||
|
static void* GetProcAddress (const char* name) |
||||||
|
{ |
||||||
|
static void* h = NULL; |
||||||
|
if (!h) |
||||||
|
{ |
||||||
|
h = dlopen("libclAmdFft.Runtime.so", RTLD_LAZY | RTLD_GLOBAL); |
||||||
|
if (!h) |
||||||
|
return NULL; |
||||||
|
} |
||||||
|
|
||||||
|
return dlsym(h, name); |
||||||
|
} |
||||||
|
#define CV_CL_GET_PROC_ADDRESS(name) GetProcAddress(name) |
||||||
|
#endif |
||||||
|
|
||||||
|
#ifndef CV_CL_GET_PROC_ADDRESS |
||||||
|
#define CV_CL_GET_PROC_ADDRESS(name) NULL |
||||||
|
#endif |
||||||
|
|
||||||
|
static void* openclamdfft_check_fn(int ID); |
||||||
|
|
||||||
|
#include "runtime_common.hpp" |
||||||
|
|
||||||
|
//
|
||||||
|
// BEGIN OF CUSTOM FUNCTIONS
|
||||||
|
//
|
||||||
|
|
||||||
|
#define CUSTOM_FUNCTION_ID 1000 |
||||||
|
|
||||||
|
#undef ADDITIONAL_FN_DEFINITIONS |
||||||
|
|
||||||
|
//
|
||||||
|
// END OF CUSTOM FUNCTIONS HERE
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "autogenerated/opencl_clamdfft_impl.hpp" |
||||||
|
|
||||||
|
static void* openclamdfft_check_fn(int ID) |
||||||
|
{ |
||||||
|
ID = (ID <= CUSTOM_FUNCTION_ID) ? ID : ID - CUSTOM_FUNCTION_ID; |
||||||
|
assert(ID >= 0 && ID < (int)(sizeof(openclamdfft_fn)/sizeof(openclamdfft_fn[0]))); |
||||||
|
const struct DynamicFnEntry* e = openclamdfft_fn[ID]; |
||||||
|
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); |
||||||
|
if (!func) |
||||||
|
{ |
||||||
|
CV_Error(cv::Error::OpenCLApiCallError, cv::format("OpenCL AMD FFT function is not available: [%s]", e->fnName)); |
||||||
|
} |
||||||
|
*(e->ppFn) = func; |
||||||
|
return func; |
||||||
|
} |
||||||
|
|
||||||
|
#endif |
@ -0,0 +1,200 @@ |
|||||||
|
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||||
|
//
|
||||||
|
// By downloading, copying, installing or using the software you agree to this license.
|
||||||
|
// If you do not agree to this license, do not download, install,
|
||||||
|
// copy or use the software.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// License Agreement
|
||||||
|
// For Open Source Computer Vision Library
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
|
||||||
|
// Third party copyrights are property of their respective owners.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
// are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// * Redistribution's of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// * 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 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.
|
||||||
|
//
|
||||||
|
// This software is provided by the copyright holders and contributors "as is" and
|
||||||
|
// any express or implied warranties, including, but not limited to, the implied
|
||||||
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||||
|
// In no event shall the OpenCV Foundation or contributors be liable for any direct,
|
||||||
|
// indirect, incidental, special, exemplary, or consequential damages
|
||||||
|
// (including, but not limited to, procurement of substitute goods or services;
|
||||||
|
// loss of use, data, or profits; or business interruption) however caused
|
||||||
|
// and on any theory of liability, whether in contract, strict liability,
|
||||||
|
// or tort (including negligence or otherwise) arising in any way out of
|
||||||
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
|
//
|
||||||
|
//M*/
|
||||||
|
|
||||||
|
#include "precomp.hpp" |
||||||
|
|
||||||
|
#if defined(HAVE_OPENCL) && !defined(HAVE_OPENCL_STATIC) |
||||||
|
|
||||||
|
#include "opencv2/core.hpp" // CV_Error |
||||||
|
|
||||||
|
#include "opencv2/core/opencl/runtime/opencl_core.hpp" |
||||||
|
|
||||||
|
static const char* funcToCheckOpenCL1_1 = "clEnqueueReadBufferRect"; |
||||||
|
#define ERROR_MSG_CANT_LOAD "Failed to load OpenCL runtime\n" |
||||||
|
#define ERROR_MSG_INVALID_VERSION "Failed to load OpenCL runtime (expected version 1.1+)\n" |
||||||
|
|
||||||
|
#if defined(__APPLE__) |
||||||
|
#include <dlfcn.h> |
||||||
|
|
||||||
|
static void* AppleCLGetProcAddress(const char* name) |
||||||
|
{ |
||||||
|
static bool initialized = false; |
||||||
|
static void* handle = NULL; |
||||||
|
if (!handle) |
||||||
|
{ |
||||||
|
if(!initialized) |
||||||
|
{ |
||||||
|
initialized = true; |
||||||
|
const char* path = "/System/Library/Frameworks/OpenCL.framework/Versions/Current/OpenCL"; |
||||||
|
const char* envPath = getenv("OPENCV_OPENCL_RUNTIME"); |
||||||
|
if (envPath) |
||||||
|
path = envPath; |
||||||
|
handle = dlopen(oclpath, RTLD_LAZY | RTLD_GLOBAL); |
||||||
|
if (handle == NULL) |
||||||
|
{ |
||||||
|
fprintf(stderr, ERROR_MSG_CANT_LOAD); |
||||||
|
} |
||||||
|
else if (dlsym(handle, funcToCheckOpenCL1_1) == NULL) |
||||||
|
{ |
||||||
|
fprintf(stderr, ERROR_MSG_INVALID_VERSION); |
||||||
|
handle = NULL; |
||||||
|
} |
||||||
|
} |
||||||
|
if (!handle) |
||||||
|
return NULL; |
||||||
|
} |
||||||
|
return dlsym(handle, name); |
||||||
|
} |
||||||
|
#define CV_CL_GET_PROC_ADDRESS(name) AppleCLGetProcAddress(name) |
||||||
|
#endif // __APPLE__
|
||||||
|
|
||||||
|
#if defined(_WIN32) |
||||||
|
#include <windows.h> |
||||||
|
|
||||||
|
static void* WinGetProcAddress(const char* name) |
||||||
|
{ |
||||||
|
static bool initialized = false; |
||||||
|
static HMODULE handle = NULL; |
||||||
|
if (!handle) |
||||||
|
{ |
||||||
|
if(!initialized) |
||||||
|
{ |
||||||
|
initialized = true; |
||||||
|
handle = GetModuleHandleA("OpenCL.dll"); |
||||||
|
if (!handle) |
||||||
|
{ |
||||||
|
const char* path = "OpenCL.dll"; |
||||||
|
const char* envPath = getenv("OPENCV_OPENCL_RUNTIME"); |
||||||
|
if (envPath) |
||||||
|
path = envPath; |
||||||
|
handle = LoadLibraryA(path); |
||||||
|
if (!handle) |
||||||
|
{ |
||||||
|
fprintf(stderr, ERROR_MSG_CANT_LOAD); |
||||||
|
} |
||||||
|
else if (GetProcAddress(handle, funcToCheckOpenCL1_1) == NULL) |
||||||
|
{ |
||||||
|
fprintf(stderr, ERROR_MSG_INVALID_VERSION); |
||||||
|
handle = NULL; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
|
if (!handle) |
||||||
|
return NULL; |
||||||
|
} |
||||||
|
return (void*)GetProcAddress(handle, name); |
||||||
|
} |
||||||
|
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name) |
||||||
|
#endif // _WIN32
|
||||||
|
|
||||||
|
#if defined(linux) |
||||||
|
#include <dlfcn.h> |
||||||
|
#include <stdio.h> |
||||||
|
|
||||||
|
static void* GetProcAddress(const char* name) |
||||||
|
{ |
||||||
|
static bool initialized = false; |
||||||
|
static void* handle = NULL; |
||||||
|
if (!handle) |
||||||
|
{ |
||||||
|
if(!initialized) |
||||||
|
{ |
||||||
|
initialized = true; |
||||||
|
const char* path = "libOpenCL.so"; |
||||||
|
const char* envPath = getenv("OPENCV_OPENCL_RUNTIME"); |
||||||
|
if (envPath) |
||||||
|
path = envPath; |
||||||
|
handle = dlopen(path, RTLD_LAZY | RTLD_GLOBAL); |
||||||
|
if (handle == NULL) |
||||||
|
{ |
||||||
|
fprintf(stderr, ERROR_MSG_CANT_LOAD); |
||||||
|
} |
||||||
|
else if (dlsym(handle, funcToCheckOpenCL1_1) == NULL) |
||||||
|
{ |
||||||
|
fprintf(stderr, ERROR_MSG_INVALID_VERSION); |
||||||
|
handle = NULL; |
||||||
|
} |
||||||
|
} |
||||||
|
if (!handle) |
||||||
|
return NULL; |
||||||
|
} |
||||||
|
return dlsym(handle, name); |
||||||
|
} |
||||||
|
#define CV_CL_GET_PROC_ADDRESS(name) GetProcAddress(name) |
||||||
|
#endif |
||||||
|
|
||||||
|
#ifndef CV_CL_GET_PROC_ADDRESS |
||||||
|
#define CV_CL_GET_PROC_ADDRESS(name) NULL |
||||||
|
#endif |
||||||
|
|
||||||
|
static void* opencl_check_fn(int ID); |
||||||
|
|
||||||
|
#include "runtime_common.hpp" |
||||||
|
|
||||||
|
//
|
||||||
|
// BEGIN OF CUSTOM FUNCTIONS
|
||||||
|
//
|
||||||
|
|
||||||
|
#define CUSTOM_FUNCTION_ID 1000 |
||||||
|
|
||||||
|
#undef ADDITIONAL_FN_DEFINITIONS |
||||||
|
|
||||||
|
//
|
||||||
|
// END OF CUSTOM FUNCTIONS HERE
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "autogenerated/opencl_core_impl.hpp" |
||||||
|
|
||||||
|
static void* opencl_check_fn(int ID) |
||||||
|
{ |
||||||
|
ID = (ID <= CUSTOM_FUNCTION_ID) ? ID : ID - CUSTOM_FUNCTION_ID; |
||||||
|
assert(ID >= 0 && ID < (int)(sizeof(opencl_fn_list)/sizeof(opencl_fn_list[0]))); |
||||||
|
const struct DynamicFnEntry* e = opencl_fn_list[ID]; |
||||||
|
void* func = CV_CL_GET_PROC_ADDRESS(e->fnName); |
||||||
|
if (!func) |
||||||
|
{ |
||||||
|
CV_Error(cv::Error::OpenCLApiCallError, cv::format("OpenCL function is not available: [%s]", e->fnName)); |
||||||
|
} |
||||||
|
*(e->ppFn) = func; |
||||||
|
return func; |
||||||
|
} |
||||||
|
|
||||||
|
#endif |
@ -0,0 +1,57 @@ |
|||||||
|
/*M///////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
//
|
||||||
|
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
|
||||||
|
//
|
||||||
|
// By downloading, copying, installing or using the software you agree to this license.
|
||||||
|
// If you do not agree to this license, do not download, install,
|
||||||
|
// copy or use the software.
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// License Agreement
|
||||||
|
// For Open Source Computer Vision Library
|
||||||
|
//
|
||||||
|
// Copyright (C) 2010-2013, Advanced Micro Devices, Inc., all rights reserved.
|
||||||
|
// Third party copyrights are property of their respective owners.
|
||||||
|
//
|
||||||
|
// Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
// are permitted provided that the following conditions are met:
|
||||||
|
//
|
||||||
|
// * Redistribution's of source code must retain the above copyright notice,
|
||||||
|
// this list of conditions and the following disclaimer.
|
||||||
|
//
|
||||||
|
// * 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 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.
|
||||||
|
//
|
||||||
|
// This software is provided by the copyright holders and contributors "as is" and
|
||||||
|
// any express or implied warranties, including, but not limited to, the implied
|
||||||
|
// warranties of merchantability and fitness for a particular purpose are disclaimed.
|
||||||
|
// In no event shall the OpenCV Foundation or contributors be liable for any direct,
|
||||||
|
// indirect, incidental, special, exemplary, or consequential damages
|
||||||
|
// (including, but not limited to, procurement of substitute goods or services;
|
||||||
|
// loss of use, data, or profits; or business interruption) however caused
|
||||||
|
// and on any theory of liability, whether in contract, strict liability,
|
||||||
|
// or tort (including negligence or otherwise) arising in any way out of
|
||||||
|
// the use of this software, even if advised of the possibility of such damage.
|
||||||
|
//
|
||||||
|
//M*/
|
||||||
|
|
||||||
|
#ifndef __OPENCV_CORE_OCL_RUNTIME_COMMON_HPP__ |
||||||
|
#define __OPENCV_CORE_OCL_RUNTIME_COMMON_HPP__ |
||||||
|
|
||||||
|
namespace cv { namespace ocl { namespace runtime { |
||||||
|
|
||||||
|
struct DynamicFnEntry |
||||||
|
{ |
||||||
|
const char* fnName; // "clCreateContext"
|
||||||
|
void** ppFn; // &clCreateContext_pfn
|
||||||
|
}; |
||||||
|
|
||||||
|
} } } // namespace cv::ocl::runtime
|
||||||
|
|
||||||
|
using namespace cv::ocl::runtime; |
||||||
|
|
||||||
|
#endif // __OPENCV_CORE_OCL_RUNTIME_COMMON_HPP__
|
Loading…
Reference in new issue