diff --git a/CMakeLists.txt b/CMakeLists.txt index 2b3e6227acb58b3d8b3bf132fecf60c5298f172f..7b63f25001efd0b637107ef56402427ecf0e3f6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,6 +15,9 @@ file(GLOB_RECURSE PADDLE_MOBILE_CC src/*.cc src/*.cpp src/*.c src/*.mm) file(GLOB_RECURSE PADDLE_MOBILE_H src/*.h) include_directories(src/) +include_directories(third_party/opecl/OpenCL-Headers) + + if(IS_IOS) set(CMAKE_CXX_FLAGS "-mfpu=neon -marm -fobjc-abi-version=2 -fobjc-arc -std=gnu++11 -stdlib=libc++ -O3 -s -isysroot ${CMAKE_OSX_SYSROOT} ${CMAKE_CXX_FLAGS}") else() diff --git a/src/framework/cl/cl_deleter.h b/src/framework/cl/cl_deleter.h index ce8bf5ac0020a33b6d48fea5409dabe5ac379fee..f475997a75eb9df3e3f533156bfbc5dce8f315fb 100644 --- a/src/framework/cl/cl_deleter.h +++ b/src/framework/cl/cl_deleter.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once -#include "framework/cl/CL/cl.h" +#include "CL/cl.h" struct CLKernelDeleter { template diff --git a/src/framework/cl/cl_engine.cpp b/src/framework/cl/cl_engine.cpp index 9aae49d21664da9095b7e3a3acc90f9904f3c975..b98b8ed8a3e0185a5d21c73a026f382ca94e5efb 100644 --- a/src/framework/cl/cl_engine.cpp +++ b/src/framework/cl/cl_engine.cpp @@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -#include "framework/cl/CL/cl.h" +#include "CL/cl.h" #include "framework/cl/cl_tool.h" #include "framework/cl/cl_engine.h" diff --git a/src/framework/cl/cl_engine.h b/src/framework/cl/cl_engine.h index 14167f0edf846e20511d19e8b235005f52a7cae0..7e18f612245b19ba7ee0f279dd21e9e095ffd94e 100644 --- a/src/framework/cl/cl_engine.h +++ b/src/framework/cl/cl_engine.h @@ -19,7 +19,7 @@ limitations under the License. */ #include "common/enforce.h" #include "framework/cl/cl_deleter.h" -#include "framework/cl/CL/cl.h" +#include "CL/cl.h" namespace paddle_mobile { namespace framework { diff --git a/src/framework/cl/cl_image.h b/src/framework/cl/cl_image.h index eab4bd87e38c9afe118b482011b9bca446d396ac..c1f1cd6422f76176d99a09dcef7ea42c5e5acec4 100644 --- a/src/framework/cl/cl_image.h +++ b/src/framework/cl/cl_image.h @@ -16,7 +16,7 @@ limitations under the License. */ #include "framework/ddim.h" #include "framework/tensor.h" -#include "framework/cl/CL/cl.h" +#include "CL/cl.h" namespace paddle_mobile { namespace framework { diff --git a/src/framework/cl/cl_scope.h b/src/framework/cl/cl_scope.h index dccf28a2e418bcf66f4609ec1010285e768eb8a5..e7f961d05857a0f74936324b5cdcd8afad61dbea 100644 --- a/src/framework/cl/cl_scope.h +++ b/src/framework/cl/cl_scope.h @@ -21,7 +21,7 @@ limitations under the License. */ #include "framework/cl/cl_tool.h" #include "framework/cl/cl_engine.h" #include "framework/cl/cl_deleter.h" -#include "framework/cl/CL/cl.h" +#include "CL/cl.h" namespace paddle_mobile { namespace framework { diff --git a/src/framework/cl/cl_tensor.h b/src/framework/cl/cl_tensor.h index b31c3fce0aafe244e97e1b0c6eb8c0ad9a0bdf09..e4d12494b25ea55ab7c8cea5fc7a4ce27e6d8c40 100644 --- a/src/framework/cl/cl_tensor.h +++ b/src/framework/cl/cl_tensor.h @@ -21,7 +21,7 @@ limitations under the License. */ #include "framework/tensor_base.h" #include "framework/cl/cl_engine.h" #include "framework/cl/cl_deleter.h" -#include "framework/cl/CL/cl.h" +#include "CL/cl.h" namespace paddle_mobile { namespace framework { diff --git a/src/framework/cl/cl_tool.h b/src/framework/cl/cl_tool.h index aceee00173ce3b5e784a46077386b74f34d31901..3244c796e54076cae40e45adb30ec9a9f774eac9 100644 --- a/src/framework/cl/cl_tool.h +++ b/src/framework/cl/cl_tool.h @@ -14,7 +14,7 @@ limitations under the License. */ #pragma once -#include "framework/cl/CL/cl.h" +#include "CL/cl.h" namespace paddle_mobile { namespace framework { diff --git a/src/framework/cl/CL/cl.h b/third_party/opecl/OpenCL-Headers/CL/cl.h similarity index 99% rename from src/framework/cl/CL/cl.h rename to third_party/opecl/OpenCL-Headers/CL/cl.h index 2cb2bf299b7b0c3ef46838c871924b1a65bd6993..7224ed38faad33d8ed9c25acaeee26400c716aa6 100644 --- a/src/framework/cl/CL/cl.h +++ b/third_party/opecl/OpenCL-Headers/CL/cl.h @@ -31,7 +31,7 @@ #ifdef __APPLE__ #include -#include +#include #else #include #include diff --git a/src/framework/cl/CL/cl_d3d10.h b/third_party/opecl/OpenCL-Headers/CL/cl_d3d10.h similarity index 100% rename from src/framework/cl/CL/cl_d3d10.h rename to third_party/opecl/OpenCL-Headers/CL/cl_d3d10.h diff --git a/src/framework/cl/CL/cl_d3d11.h b/third_party/opecl/OpenCL-Headers/CL/cl_d3d11.h similarity index 100% rename from src/framework/cl/CL/cl_d3d11.h rename to third_party/opecl/OpenCL-Headers/CL/cl_d3d11.h diff --git a/src/framework/cl/CL/cl_dx9_media_sharing.h b/third_party/opecl/OpenCL-Headers/CL/cl_dx9_media_sharing.h similarity index 100% rename from src/framework/cl/CL/cl_dx9_media_sharing.h rename to third_party/opecl/OpenCL-Headers/CL/cl_dx9_media_sharing.h diff --git a/src/framework/cl/CL/cl_dx9_media_sharing_intel.h b/third_party/opecl/OpenCL-Headers/CL/cl_dx9_media_sharing_intel.h similarity index 100% rename from src/framework/cl/CL/cl_dx9_media_sharing_intel.h rename to third_party/opecl/OpenCL-Headers/CL/cl_dx9_media_sharing_intel.h diff --git a/src/framework/cl/CL/cl_egl.h b/third_party/opecl/OpenCL-Headers/CL/cl_egl.h similarity index 100% rename from src/framework/cl/CL/cl_egl.h rename to third_party/opecl/OpenCL-Headers/CL/cl_egl.h diff --git a/src/framework/cl/CL/cl_ext.h b/third_party/opecl/OpenCL-Headers/CL/cl_ext.h similarity index 99% rename from src/framework/cl/CL/cl_ext.h rename to third_party/opecl/OpenCL-Headers/CL/cl_ext.h index 288715b1fbd03a5bf78f441f51c6f4d464787893..af3ce461f3a48e7707caca966e704dfe5eb58e30 100644 --- a/src/framework/cl/CL/cl_ext.h +++ b/third_party/opecl/OpenCL-Headers/CL/cl_ext.h @@ -37,7 +37,7 @@ extern "C" { #endif #ifdef __APPLE__ - #include + #include #include #else #include diff --git a/src/framework/cl/CL/cl_ext_intel.h b/third_party/opecl/OpenCL-Headers/CL/cl_ext_intel.h similarity index 99% rename from src/framework/cl/CL/cl_ext_intel.h rename to third_party/opecl/OpenCL-Headers/CL/cl_ext_intel.h index 6d96d1d93d9211f6cb872eee1d2d5837cefbdc20..1c358cfc10c5c01fa5b5bfcc65d4e5904f830a9e 100644 --- a/src/framework/cl/CL/cl_ext_intel.h +++ b/third_party/opecl/OpenCL-Headers/CL/cl_ext_intel.h @@ -53,8 +53,8 @@ Notes: #define __CL_EXT_INTEL_H #ifdef __APPLE__ - #include - #include + #include + #include #else #include #include diff --git a/src/framework/cl/CL/cl_gl.h b/third_party/opecl/OpenCL-Headers/CL/cl_gl.h similarity index 99% rename from src/framework/cl/CL/cl_gl.h rename to third_party/opecl/OpenCL-Headers/CL/cl_gl.h index 2e3183cd6b0a5f64425920429803a7fdee062a94..58b6449f9b4e98d561ee9a6f8b3daa6caede9f44 100644 --- a/src/framework/cl/CL/cl_gl.h +++ b/third_party/opecl/OpenCL-Headers/CL/cl_gl.h @@ -30,7 +30,7 @@ #define __OPENCL_CL_GL_H #ifdef __APPLE__ -#include +#include #else #include #endif diff --git a/src/framework/cl/CL/cl_gl_ext.h b/third_party/opecl/OpenCL-Headers/CL/cl_gl_ext.h similarity index 98% rename from src/framework/cl/CL/cl_gl_ext.h rename to third_party/opecl/OpenCL-Headers/CL/cl_gl_ext.h index 60346b7779f882d2d78e9c2d997dc6036760e234..e3c14c6408c44160103bcb4c0dcd230a674643a5 100644 --- a/src/framework/cl/CL/cl_gl_ext.h +++ b/third_party/opecl/OpenCL-Headers/CL/cl_gl_ext.h @@ -39,7 +39,7 @@ extern "C" { #endif #ifdef __APPLE__ - #include + #include #else #include #endif diff --git a/src/framework/cl/CL/cl_platform.h b/third_party/opecl/OpenCL-Headers/CL/cl_platform.h similarity index 100% rename from src/framework/cl/CL/cl_platform.h rename to third_party/opecl/OpenCL-Headers/CL/cl_platform.h diff --git a/src/framework/cl/CL/cl_va_api_media_sharing_intel.h b/third_party/opecl/OpenCL-Headers/CL/cl_va_api_media_sharing_intel.h similarity index 100% rename from src/framework/cl/CL/cl_va_api_media_sharing_intel.h rename to third_party/opecl/OpenCL-Headers/CL/cl_va_api_media_sharing_intel.h diff --git a/src/framework/cl/CL/cl_version.h b/third_party/opecl/OpenCL-Headers/CL/cl_version.h similarity index 100% rename from src/framework/cl/CL/cl_version.h rename to third_party/opecl/OpenCL-Headers/CL/cl_version.h diff --git a/src/framework/cl/CL/opencl.h b/third_party/opecl/OpenCL-Headers/CL/opencl.h similarity index 94% rename from src/framework/cl/CL/opencl.h rename to third_party/opecl/OpenCL-Headers/CL/opencl.h index 36816d73fa4540bb71396b5664ef56bb56b83a04..9855cd75e7da064e094658b660851997c38a8c56 100644 --- a/src/framework/cl/CL/opencl.h +++ b/third_party/opecl/OpenCL-Headers/CL/opencl.h @@ -37,10 +37,10 @@ extern "C" { #ifdef __APPLE__ -#include -#include -#include -#include +#include +#include +#include +#include #else diff --git a/third_party/opecl/OpenCL-Headers/LICENSE b/third_party/opecl/OpenCL-Headers/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..020ce65fcac2a60e44dab1626fa4924dec17ea23 --- /dev/null +++ b/third_party/opecl/OpenCL-Headers/LICENSE @@ -0,0 +1,25 @@ +Copyright (c) 2008-2015 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS +KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS +SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT + https://www.khronos.org/registry/ + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. diff --git a/third_party/opecl/OpenCL-Headers/README.md b/third_party/opecl/OpenCL-Headers/README.md new file mode 100644 index 0000000000000000000000000000000000000000..757e56e152f8bc2fed68d2cdf38164c3171f929d --- /dev/null +++ b/third_party/opecl/OpenCL-Headers/README.md @@ -0,0 +1,50 @@ +# OpenCLTM API Headers + +This repository contains C language headers for the OpenCL API. + +The authoritative public repository for these headers is located at: + +https://github.com/KhronosGroup/OpenCL-Headers + +Issues, proposed fixes for issues, and other suggested changes should be +created using Github. + +## Branch Structure + +The OpenCL API headers in this repository are Unified headers and are designed +to work with all released OpenCL versions. This differs from previous OpenCL +API headers, where version-specific API headers either existed in separate +branches, or in separate folders in a branch. + +## Compiling for a Specific OpenCL Version + +By default, the OpenCL API headers in this repository are for the latest +OpenCL version (currently OpenCL 2.2). To use these API headers to target +a different OpenCL version, an application may `#define` the preprocessor +value `CL_TARGET_OPENCL_VERSION` before including the OpenCL API headers. +The `CL_TARGET_OPENCL_VERSION` is a three digit decimal value representing +the OpenCL API version. + +For example, to enforce usage of no more than the OpenCL 1.2 APIs, you may +include the OpenCL API headers as follows: + +``` +#define CL_TARGET_OPENCL_VERSION 120 +#include +``` + +## Directory Structure + +``` +README.md This file +LICENSE Source license for the OpenCL API headers +CL/ Unified OpenCL API headers tree +``` + +## License + +See [LICENSE](LICENSE). + +--- + +OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos.