Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle-Lite
提交
1bd2a695
P
Paddle-Lite
项目概览
PaddlePaddle
/
Paddle-Lite
通知
331
Star
4
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
271
列表
看板
标记
里程碑
合并请求
78
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle-Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
271
Issue
271
列表
看板
标记
里程碑
合并请求
78
合并请求
78
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
1bd2a695
编写于
9月 28, 2018
作者:
R
Ray Liu
提交者:
GitHub
9月 28, 2018
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1019 from codeWorm2015/opencl
update cl headers
上级
56b2b094
cc2ac595
变更
22
隐藏空白更改
内联
并排
Showing
22 changed file
with
96 addition
and
12 deletion
+96
-12
src/framework/cl/CL/cl.h
src/framework/cl/CL/cl.h
+0
-0
src/framework/cl/CL/cl_d3d10.h
src/framework/cl/CL/cl_d3d10.h
+0
-0
src/framework/cl/CL/cl_d3d11.h
src/framework/cl/CL/cl_d3d11.h
+0
-0
src/framework/cl/CL/cl_dx9_media_sharing.h
src/framework/cl/CL/cl_dx9_media_sharing.h
+0
-0
src/framework/cl/CL/cl_dx9_media_sharing_intel.h
src/framework/cl/CL/cl_dx9_media_sharing_intel.h
+0
-0
src/framework/cl/CL/cl_egl.h
src/framework/cl/CL/cl_egl.h
+0
-0
src/framework/cl/CL/cl_ext.h
src/framework/cl/CL/cl_ext.h
+0
-0
src/framework/cl/CL/cl_ext_intel.h
src/framework/cl/CL/cl_ext_intel.h
+0
-0
src/framework/cl/CL/cl_gl.h
src/framework/cl/CL/cl_gl.h
+0
-0
src/framework/cl/CL/cl_gl_ext.h
src/framework/cl/CL/cl_gl_ext.h
+0
-0
src/framework/cl/CL/cl_platform.h
src/framework/cl/CL/cl_platform.h
+0
-0
src/framework/cl/CL/cl_va_api_media_sharing_intel.h
src/framework/cl/CL/cl_va_api_media_sharing_intel.h
+0
-0
src/framework/cl/CL/cl_version.h
src/framework/cl/CL/cl_version.h
+0
-0
src/framework/cl/CL/opencl.h
src/framework/cl/CL/opencl.h
+0
-0
src/framework/cl/cl_deleter.h
src/framework/cl/cl_deleter.h
+1
-1
src/framework/cl/cl_engine.cpp
src/framework/cl/cl_engine.cpp
+6
-6
src/framework/cl/cl_engine.h
src/framework/cl/cl_engine.h
+1
-1
src/framework/cl/cl_image.h
src/framework/cl/cl_image.h
+1
-1
src/framework/cl/cl_scope.h
src/framework/cl/cl_scope.h
+1
-1
src/framework/cl/cl_tensor.h
src/framework/cl/cl_tensor.h
+1
-1
src/framework/cl/cl_tool.cpp
src/framework/cl/cl_tool.cpp
+82
-0
src/framework/cl/cl_tool.h
src/framework/cl/cl_tool.h
+3
-1
未找到文件。
src/framework/cl/
open_cl
/cl.h
→
src/framework/cl/
CL
/cl.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_d3d10.h
→
src/framework/cl/
CL
/cl_d3d10.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_d3d11.h
→
src/framework/cl/
CL
/cl_d3d11.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_dx9_media_sharing.h
→
src/framework/cl/
CL
/cl_dx9_media_sharing.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_dx9_media_sharing_intel.h
→
src/framework/cl/
CL
/cl_dx9_media_sharing_intel.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_egl.h
→
src/framework/cl/
CL
/cl_egl.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_ext.h
→
src/framework/cl/
CL
/cl_ext.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_ext_intel.h
→
src/framework/cl/
CL
/cl_ext_intel.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_gl.h
→
src/framework/cl/
CL
/cl_gl.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_gl_ext.h
→
src/framework/cl/
CL
/cl_gl_ext.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_platform.h
→
src/framework/cl/
CL
/cl_platform.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_va_api_media_sharing_intel.h
→
src/framework/cl/
CL
/cl_va_api_media_sharing_intel.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/cl_version.h
→
src/framework/cl/
CL
/cl_version.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/
open_cl
/opencl.h
→
src/framework/cl/
CL
/opencl.h
浏览文件 @
1bd2a695
文件已移动
src/framework/cl/cl_deleter.h
浏览文件 @
1bd2a695
...
@@ -14,7 +14,7 @@ limitations under the License. */
...
@@ -14,7 +14,7 @@ limitations under the License. */
#pragma once
#pragma once
#include "framework/cl/
open_cl
/cl.h"
#include "framework/cl/
CL
/cl.h"
struct
CLKernelDeleter
{
struct
CLKernelDeleter
{
template
<
class
T
>
template
<
class
T
>
...
...
src/framework/cl/cl_engine.cpp
浏览文件 @
1bd2a695
...
@@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
...
@@ -12,9 +12,9 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
See the License for the specific language governing permissions and
limitations under the License. */
limitations under the License. */
#include "framework/cl/CL/cl.h"
#include "framework/cl/cl_tool.h"
#include "framework/cl/cl_tool.h"
#include "framework/cl/cl_engine.h"
#include "framework/cl/cl_engine.h"
#include "framework/cl/cl_header/cl.h"
#include <cstdlib>
#include <cstdlib>
#include <cstring>
#include <cstring>
...
@@ -71,11 +71,6 @@ bool CLEngine::SetPlatform() {
...
@@ -71,11 +71,6 @@ bool CLEngine::SetPlatform() {
}
}
}
}
//bool CLEngine::SetClContext() {
// context_.reset(clCreateContext(NULL, 1, devices_, NULL, NULL, NULL));
// return true;
//}
bool
CLEngine
::
SetClDeviceId
()
{
bool
CLEngine
::
SetClDeviceId
()
{
cl_uint
numDevices
=
0
;
cl_uint
numDevices
=
0
;
devices_
=
NULL
;
devices_
=
NULL
;
...
@@ -92,6 +87,11 @@ bool CLEngine::SetClDeviceId() {
...
@@ -92,6 +87,11 @@ bool CLEngine::SetClDeviceId() {
return
false
;
return
false
;
}
}
//bool CLEngine::SetClContext() {
// context_.reset(clCreateContext(NULL, 1, devices_, NULL, NULL, NULL));
// return true;
//}
//bool CLEngine::LoadKernelFromFile(const char *kernel_file) {
//bool CLEngine::LoadKernelFromFile(const char *kernel_file) {
// size_t size;
// size_t size;
// char *str;
// char *str;
...
...
src/framework/cl/cl_engine.h
浏览文件 @
1bd2a695
...
@@ -20,7 +20,7 @@ limitations under the License. */
...
@@ -20,7 +20,7 @@ limitations under the License. */
#include "common/enforce.h"
#include "common/enforce.h"
#include "framework/cl/cl_deleter.h"
#include "framework/cl/cl_deleter.h"
#include "framework/cl/
open_cl
/cl.h"
#include "framework/cl/
CL
/cl.h"
namespace
paddle_mobile
{
namespace
paddle_mobile
{
namespace
framework
{
namespace
framework
{
...
...
src/framework/cl/cl_image.h
浏览文件 @
1bd2a695
...
@@ -16,7 +16,7 @@ limitations under the License. */
...
@@ -16,7 +16,7 @@ limitations under the License. */
#include "framework/ddim.h"
#include "framework/ddim.h"
#include "framework/tensor.h"
#include "framework/tensor.h"
#include "framework/cl/
open_cl
/cl.h"
#include "framework/cl/
CL
/cl.h"
namespace
paddle_mobile
{
namespace
paddle_mobile
{
namespace
framework
{
namespace
framework
{
...
...
src/framework/cl/cl_scope.h
浏览文件 @
1bd2a695
...
@@ -21,7 +21,7 @@ limitations under the License. */
...
@@ -21,7 +21,7 @@ limitations under the License. */
#include "framework/cl/cl_tool.h"
#include "framework/cl/cl_tool.h"
#include "framework/cl/cl_engine.h"
#include "framework/cl/cl_engine.h"
#include "framework/cl/cl_deleter.h"
#include "framework/cl/cl_deleter.h"
#include "framework/cl/
open_cl
/cl.h"
#include "framework/cl/
CL
/cl.h"
namespace
paddle_mobile
{
namespace
paddle_mobile
{
namespace
framework
{
namespace
framework
{
...
...
src/framework/cl/cl_tensor.h
浏览文件 @
1bd2a695
...
@@ -21,7 +21,7 @@ limitations under the License. */
...
@@ -21,7 +21,7 @@ limitations under the License. */
#include "framework/tensor_base.h"
#include "framework/tensor_base.h"
#include "framework/cl/cl_engine.h"
#include "framework/cl/cl_engine.h"
#include "framework/cl/cl_deleter.h"
#include "framework/cl/cl_deleter.h"
#include "framework/cl/
open_cl
/cl.h"
#include "framework/cl/
CL
/cl.h"
namespace
paddle_mobile
{
namespace
paddle_mobile
{
namespace
framework
{
namespace
framework
{
...
...
src/framework/cl/cl_tool.cpp
0 → 100644
浏览文件 @
1bd2a695
/* Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
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 "cl_tool.h"
namespace
paddle_mobile
{
namespace
framework
{
const
char
*
opencl_error_to_str
(
cl_int
error
)
{
#define CASE_CL_CONSTANT(NAME) case NAME: return #NAME;
// Suppose that no combinations are possible.
switch
(
error
)
{
CASE_CL_CONSTANT
(
CL_SUCCESS
)
CASE_CL_CONSTANT
(
CL_DEVICE_NOT_FOUND
)
CASE_CL_CONSTANT
(
CL_DEVICE_NOT_AVAILABLE
)
CASE_CL_CONSTANT
(
CL_COMPILER_NOT_AVAILABLE
)
CASE_CL_CONSTANT
(
CL_MEM_OBJECT_ALLOCATION_FAILURE
)
CASE_CL_CONSTANT
(
CL_OUT_OF_RESOURCES
)
CASE_CL_CONSTANT
(
CL_OUT_OF_HOST_MEMORY
)
CASE_CL_CONSTANT
(
CL_PROFILING_INFO_NOT_AVAILABLE
)
CASE_CL_CONSTANT
(
CL_MEM_COPY_OVERLAP
)
CASE_CL_CONSTANT
(
CL_IMAGE_FORMAT_MISMATCH
)
CASE_CL_CONSTANT
(
CL_IMAGE_FORMAT_NOT_SUPPORTED
)
CASE_CL_CONSTANT
(
CL_BUILD_PROGRAM_FAILURE
)
CASE_CL_CONSTANT
(
CL_MAP_FAILURE
)
CASE_CL_CONSTANT
(
CL_MISALIGNED_SUB_BUFFER_OFFSET
)
CASE_CL_CONSTANT
(
CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST
)
CASE_CL_CONSTANT
(
CL_INVALID_VALUE
)
CASE_CL_CONSTANT
(
CL_INVALID_DEVICE_TYPE
)
CASE_CL_CONSTANT
(
CL_INVALID_PLATFORM
)
CASE_CL_CONSTANT
(
CL_INVALID_DEVICE
)
CASE_CL_CONSTANT
(
CL_INVALID_CONTEXT
)
CASE_CL_CONSTANT
(
CL_INVALID_QUEUE_PROPERTIES
)
CASE_CL_CONSTANT
(
CL_INVALID_COMMAND_QUEUE
)
CASE_CL_CONSTANT
(
CL_INVALID_HOST_PTR
)
CASE_CL_CONSTANT
(
CL_INVALID_MEM_OBJECT
)
CASE_CL_CONSTANT
(
CL_INVALID_IMAGE_FORMAT_DESCRIPTOR
)
CASE_CL_CONSTANT
(
CL_INVALID_IMAGE_SIZE
)
CASE_CL_CONSTANT
(
CL_INVALID_SAMPLER
)
CASE_CL_CONSTANT
(
CL_INVALID_BINARY
)
CASE_CL_CONSTANT
(
CL_INVALID_BUILD_OPTIONS
)
CASE_CL_CONSTANT
(
CL_INVALID_PROGRAM
)
CASE_CL_CONSTANT
(
CL_INVALID_PROGRAM_EXECUTABLE
)
CASE_CL_CONSTANT
(
CL_INVALID_KERNEL_NAME
)
CASE_CL_CONSTANT
(
CL_INVALID_KERNEL_DEFINITION
)
CASE_CL_CONSTANT
(
CL_INVALID_KERNEL
)
CASE_CL_CONSTANT
(
CL_INVALID_ARG_INDEX
)
CASE_CL_CONSTANT
(
CL_INVALID_ARG_VALUE
)
CASE_CL_CONSTANT
(
CL_INVALID_ARG_SIZE
)
CASE_CL_CONSTANT
(
CL_INVALID_KERNEL_ARGS
)
CASE_CL_CONSTANT
(
CL_INVALID_WORK_DIMENSION
)
CASE_CL_CONSTANT
(
CL_INVALID_WORK_GROUP_SIZE
)
CASE_CL_CONSTANT
(
CL_INVALID_WORK_ITEM_SIZE
)
CASE_CL_CONSTANT
(
CL_INVALID_GLOBAL_OFFSET
)
CASE_CL_CONSTANT
(
CL_INVALID_EVENT_WAIT_LIST
)
CASE_CL_CONSTANT
(
CL_INVALID_EVENT
)
CASE_CL_CONSTANT
(
CL_INVALID_OPERATION
)
CASE_CL_CONSTANT
(
CL_INVALID_GL_OBJECT
)
CASE_CL_CONSTANT
(
CL_INVALID_BUFFER_SIZE
)
CASE_CL_CONSTANT
(
CL_INVALID_MIP_LEVEL
)
CASE_CL_CONSTANT
(
CL_INVALID_GLOBAL_WORK_SIZE
)
CASE_CL_CONSTANT
(
CL_INVALID_PROPERTY
)
default:
return
"UNKNOWN ERROR CODE"
;
}
#undef CASE_CL_CONSTANT
}
}
}
src/framework/cl/cl_tool.h
浏览文件 @
1bd2a695
...
@@ -14,11 +14,13 @@ limitations under the License. */
...
@@ -14,11 +14,13 @@ limitations under the License. */
#pragma once
#pragma once
#include "framework/cl/
cl_header
/cl.h"
#include "framework/cl/
CL
/cl.h"
namespace
paddle_mobile
{
namespace
paddle_mobile
{
namespace
framework
{
namespace
framework
{
const
char
*
opencl_error_to_str
(
cl_int
error
);
#define CL_CHECK_ERRORS(ERR) \
#define CL_CHECK_ERRORS(ERR) \
if(ERR != CL_SUCCESS) \
if(ERR != CL_SUCCESS) \
{ \
{ \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录