Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Xiaomi
Mace
提交
354cd5b0
Mace
项目概览
Xiaomi
/
Mace
通知
106
Star
40
Fork
27
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Mace
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
354cd5b0
编写于
3月 08, 2018
作者:
刘
刘琦
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'qcom-perf-hints' into 'master'
Add Adreno performance hints See merge request !275
上级
66b4d7bc
776748e3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
38 addition
and
3 deletion
+38
-3
mace/core/runtime/opencl/opencl_extension.h
mace/core/runtime/opencl/opencl_extension.h
+28
-0
mace/core/runtime/opencl/opencl_runtime.cc
mace/core/runtime/opencl/opencl_runtime.cc
+10
-3
未找到文件。
mace/core/runtime/opencl/opencl_extension.h
0 → 100644
浏览文件 @
354cd5b0
//
// Copyright (c) 2017 XiaoMi All rights reserved.
//
#ifndef MACE_CORE_RUNTIME_OPENCL_EXTENSION_H_
#define MACE_CORE_RUNTIME_OPENCL_EXTENSION_H_
#include "mace/core/runtime/opencl/cl2_header.h"
// Adreno extensions
// Adreno performance hints
typedef
cl_uint
cl_perf_hint
;
#define CL_CONTEXT_PERF_HINT_QCOM 0x40C2
#define CL_PERF_HINT_HIGH_QCOM 0x40C3
#define CL_PERF_HINT_NORMAL_QCOM 0x40C4
#define CL_PERF_HINT_LOW_QCOM 0x40C5
// Adreno priority hints
typedef
cl_uint
cl_priority_hint
;
#define CL_PRIORITY_HINT_NONE_QCOM 0
#define CL_CONTEXT_PRIORITY_HINT_QCOM 0x40C9
#define CL_PRIORITY_HINT_HIGH_QCOM 0x40CA
#define CL_PRIORITY_HINT_NORMAL_QCOM 0x40CB
#define CL_PRIORITY_HINT_LOW_QCOM 0x40CC
#endif // MACE_CORE_RUNTIME_OPENCL_EXTENSION_H_
mace/core/runtime/opencl/opencl_runtime.cc
浏览文件 @
354cd5b0
...
...
@@ -7,6 +7,7 @@
#include <memory>
#include <mutex>
#include "mace/core/runtime/opencl/opencl_extension.h"
#include "mace/core/runtime/opencl/opencl_runtime.h"
#include "mace/public/mace.h"
#include "mace/utils/tuner.h"
...
...
@@ -108,9 +109,15 @@ OpenCLRuntime::OpenCLRuntime() {
properties
|=
CL_QUEUE_PROFILING_ENABLE
;
}
// a context is like a "runtime link" to the device and platform;
// i.e. communication is possible
cl
::
Context
context
({
gpu_device
});
// TODO (heliangliang) Make this configurable (e.g.HIGH for benchmark,
// disabled for Mali)
cl_context_properties
context_properties
[]
=
{
// Set context perf hint to normal
CL_CONTEXT_PERF_HINT_QCOM
,
CL_PERF_HINT_NORMAL_QCOM
,
// Set context priority hint to low
CL_CONTEXT_PRIORITY_HINT_QCOM
,
CL_PRIORITY_HINT_LOW_QCOM
,
0
};
cl
::
Context
context
({
gpu_device
},
context_properties
);
cl
::
CommandQueue
command_queue
(
context
,
gpu_device
,
properties
);
const
char
*
kernel_path
=
getenv
(
"MACE_KERNEL_PATH"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录