Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
7402c3b3
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
7402c3b3
编写于
11月 08, 2022
作者:
C
chenyuyan
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' into idlDocs
Change-Id: If08ec2f1200e7145677a05eaf8fcce563e8b730a
上级
c21dc497
71a00d66
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
19 addition
and
19 deletion
+19
-19
zh-cn/application-dev/IDL/idl-guidelines.md
zh-cn/application-dev/IDL/idl-guidelines.md
+2
-2
zh-cn/application-dev/media/camera.md
zh-cn/application-dev/media/camera.md
+6
-6
zh-cn/application-dev/napi/mindspore-lite-guidelines.md
zh-cn/application-dev/napi/mindspore-lite-guidelines.md
+1
-1
zh-cn/application-dev/reference/apis/js-apis-worker.md
zh-cn/application-dev/reference/apis/js-apis-worker.md
+6
-6
zh-cn/application-dev/reference/native-apis/_mind_spore.md
zh-cn/application-dev/reference/native-apis/_mind_spore.md
+3
-3
zh-cn/application-dev/reference/native-apis/context_8h.md
zh-cn/application-dev/reference/native-apis/context_8h.md
+1
-1
未找到文件。
zh-cn/application-dev/IDL/idl-guidelines.md
浏览文件 @
7402c3b3
...
...
@@ -211,8 +211,8 @@ export default class IdlTestServiceStub extends rpc.RemoteObject implements IIdl
super
(
des
);
}
onRemoteRequest
(
code
:
number
,
data
,
reply
,
option
):
boolean
{
console
.
log
(
"
onRemoteRequest called, code =
"
+
code
);
async
onRemoteRequestEx
(
code
:
number
,
data
,
reply
,
option
):
Promise
<
boolean
>
{
console
.
log
(
"
onRemoteRequest
Ex
called, code =
"
+
code
);
switch
(
code
)
{
case
IdlTestServiceStub
.
COMMAND_TEST_INT_TRANSACTION
:
{
let
_data
=
data
.
readInt
();
...
...
zh-cn/application-dev/media/camera.md
浏览文件 @
7402c3b3
...
...
@@ -89,22 +89,22 @@ if (!cameraOutputCap) {
console
.
info
(
"
outputCapability:
"
+
JSON
.
stringify
(
cameraOutputCap
));
}
let
previewProfilesArray
=
cameraOutputCap
.
previewProfiles
;
let
previewProfilesArray
=
cameraOutputCap
.
GetPreviewProfiles
()
;
if
(
!
previewProfilesArray
)
{
console
.
error
(
"
createOutput previewProfilesArray == null || undefined
"
)
}
let
photoProfilesArray
=
cameraOutputCap
.
photoProfiles
;
let
photoProfilesArray
=
cameraOutputCap
.
GetPhotoProfiles
()
;
if
(
!
photoProfilesArray
)
{
console
.
error
(
"
createOutput photoProfilesArray == null || undefined
"
)
}
let
videoProfilesArray
=
cameraOutputCap
.
videoProfiles
;
let
videoProfilesArray
=
cameraOutputCap
.
GetVideoProfiles
()
;
if
(
!
videoProfilesArray
)
{
console
.
error
(
"
createOutput videoProfilesArray == null || undefined
"
)
}
let
metadataObjectTypesArray
=
cameraOutputCap
.
supportedMetadataObjectTypes
;
let
metadataObjectTypesArray
=
cameraOutputCap
.
GetSupportedMetadataObjectType
()
;
if
(
!
metadataObjectTypesArray
)
{
console
.
error
(
"
createOutput metadataObjectTypesArray == null || undefined
"
)
}
...
...
@@ -115,7 +115,7 @@ if (!previewOutput) {
console
.
error
(
"
Failed to create the PreviewOutput instance.
"
)
}
// 创建ImageReceiver对象,并设置照片参数
// 创建ImageReceiver对象,并设置照片参数
:分辨率大小是根据前面 photoProfilesArray 获取的当前设备所支持的拍照分辨率大小去设置
let
imageReceiver
=
await
image
.
createImageReceiver
(
1920
,
1080
,
4
,
8
)
// 获取照片显示SurfaceId
let
photoSurfaceId
=
await
imageReceiver
.
getReceivingSurfaceId
()
...
...
@@ -188,7 +188,7 @@ build() {
controller
:
this
.
mXComponentController
})
.
onload
(()
=>
{
// 设置onload回调
// 设置Surface宽高(1920*1080)
// 设置Surface宽高(1920*1080)
,预览尺寸设置参考前面 previewProfilesArray 获取的当前设备所支持的预览分辨率大小去设置
this
.
mXComponentController
.
setXComponentSurfaceSize
({
surfaceWidth
:
1920
,
surfaceHeight
:
1080
})
// 获取Surface ID
globalThis
.
surfaceId
=
mXComponentController
.
getXComponentSurfaceId
()
...
...
zh-cn/application-dev/napi/mindspore-lite-guidelines.md
浏览文件 @
7402c3b3
...
...
@@ -24,7 +24,7 @@ MindSpore Lite是一款AI引擎,它提供了面向不同硬件设备AI模型
| ------------------ | ----------------- |
|OH_AI_ContextHandle OH_AI_ContextCreate()|创建一个上下文的对象。|
|void OH_AI_ContextSetThreadNum(OH_AI_ContextHandle context, int32_t thread_num)|设置运行时的线程数量。|
| void OH_AI_ContextSetThreadAffinityMode(OH_AI_ContextHandle context, int mode)|设置运行时线程绑定CPU核心的策略
。一般情况下CPU会按照频率分为大小核,即频率较高的为大核,频率较低的为小核。|
| void OH_AI_ContextSetThreadAffinityMode(OH_AI_ContextHandle context, int mode)|设置运行时线程绑定CPU核心的策略
,按照CPU物理核频率分为大、中、小三种类型的核心,并且仅需绑大核或者绑中核,不需要绑小核。
|OH_AI_DeviceInfoHandle OH_AI_DeviceInfoCreate(OH_AI_DeviceType device_type)|创建一个运行时设备信息对象。|
|void OH_AI_ContextDestroy(OH_AI_ContextHandle
*
context)|释放上下文对象。|
|void OH_AI_DeviceInfoSetEnableFP16(OH_AI_DeviceInfoHandle device_info, bool is_fp16)|设置是否开启Float16推理模式,仅CPU/GPU设备可用。|
...
...
zh-cn/application-dev/reference/apis/js-apis-worker.md
浏览文件 @
7402c3b3
...
...
@@ -1495,7 +1495,7 @@ workerInstance.onexit = function() {
}
```
```
js
// worker.
j
s
// worker.
t
s
import
worker
from
'
@ohos.worker
'
;
// 创建worker线程中与主线程通信的对象
...
...
@@ -1508,7 +1508,7 @@ const parentPort = worker.workerPort
parentPort
.
onmessage
=
function
(
e
)
{
// data:主线程发送的信息
let
data
=
e
.
data
;
console
.
log
(
"
worker.
j
s onmessage
"
);
console
.
log
(
"
worker.
t
s onmessage
"
);
// worker线程向主线程发送信息
parentPort
.
postMessage
(
"
123
"
)
...
...
@@ -1516,7 +1516,7 @@ parentPort.onmessage = function(e) {
// worker线程发生error的回调
parentPort
.
onerror
=
function
(
e
)
{
console
.
log
(
"
worker.
j
s onerror
"
);
console
.
log
(
"
worker.
t
s onerror
"
);
}
```
build-profile.json5 配置 :
...
...
@@ -1557,7 +1557,7 @@ workerInstance.onexit = function() {
}
```
```
js
// worker.
j
s
// worker.
t
s
import
worker
from
'
@ohos.worker
'
;
// 创建worker线程中与主线程通信的对象
...
...
@@ -1567,7 +1567,7 @@ const parentPort = worker.workerPort
parentPort
.
onmessage
=
function
(
e
)
{
// data:主线程发送的信息
let
data
=
e
.
data
;
console
.
log
(
"
worker.
j
s onmessage
"
);
console
.
log
(
"
worker.
t
s onmessage
"
);
// worker线程向主线程发送信息
parentPort
.
postMessage
(
"
123
"
)
...
...
@@ -1575,7 +1575,7 @@ parentPort.onmessage = function(e) {
// worker线程发生error的回调
parentPort
.
onerror
=
function
(
e
)
{
console
.
log
(
"
worker.
j
s onerror
"
);
console
.
log
(
"
worker.
t
s onerror
"
);
}
```
build-profile.json5 配置:
...
...
zh-cn/application-dev/reference/native-apis/_mind_spore.md
浏览文件 @
7402c3b3
...
...
@@ -84,7 +84,7 @@
|
[
OH_AI_ContextDestroy
](
#oh_ai_contextdestroy
)
(
OH_AI_ContextHandle
\*
context) | 释放上下文对象。 |
|
[
OH_AI_ContextSetThreadNum
](
#oh_ai_contextsetthreadnum
)
(
OH_AI_ContextHandle
context, int32_t thread_num) | 设置运行时的线程数量。 |
|
[
OH_AI_ContextGetThreadNum
](
#oh_ai_contextgetthreadnum
)
(
const
OH_AI_ContextHandle context) | 获取线程数量。 |
|
[
OH_AI_ContextSetThreadAffinityMode
](
#oh_ai_contextsetthreadaffinitymode
)
(
OH_AI_ContextHandle
context, int mode) | 设置运行时线程绑定CPU核心的策略,按照CPU物理核频率分为大
核与
小核。 |
|
[
OH_AI_ContextSetThreadAffinityMode
](
#oh_ai_contextsetthreadaffinitymode
)
(
OH_AI_ContextHandle
context, int mode) | 设置运行时线程绑定CPU核心的策略,按照CPU物理核频率分为大
、中、小三种类型的核心,并且仅需绑大核或者绑中核,不需要绑
小核。 |
|
[
OH_AI_ContextGetThreadAffinityMode
](
#oh_ai_contextgetthreadaffinitymode
)
(
const
OH_AI_ContextHandle context) | 获取运行时线程绑定CPU核心的策略。 |
|
[
OH_AI_ContextSetThreadAffinityCoreList
](
#oh_ai_contextsetthreadaffinitycorelist
)
(
OH_AI_ContextHandle
context, const int32_t
\*
core_list,
<br/>
size_t core_num) | 设置运行时线程绑定CPU核心的列表。 |
|
[
OH_AI_ContextGetThreadAffinityCoreList
](
#oh_ai_contextgetthreadaffinitycorelist
)
(
const
OH_AI_ContextHandle context, size_t
\*
core_num) | 获取CPU绑核列表。 |
...
...
@@ -649,14 +649,14 @@ OH_AI_API void OH_AI_ContextSetThreadAffinityMode (OH_AI_ContextHandle context,
**描述:**
设置运行时线程绑定CPU核心的策略,按照CPU物理核频率分为大
核与
小核。
设置运行时线程绑定CPU核心的策略,按照CPU物理核频率分为大
、中、小三种类型的核心,并且仅需绑大核或者绑中核,不需要绑
小核。
**参数:**
| 名称 | 描述 |
| -------- | -------- |
| context | 指向上下文信息实例的
[
OH_AI_ContextHandle
](
#oh_ai_contexthandle
)
。 |
| mode | 绑核策略。一共有三种策略,0为不绑核, 1为大核优先, 2为
小
核优先。 |
| mode | 绑核策略。一共有三种策略,0为不绑核, 1为大核优先, 2为
中
核优先。 |
### OH_AI_ContextSetThreadNum()
...
...
zh-cn/application-dev/reference/native-apis/context_8h.md
浏览文件 @
7402c3b3
...
...
@@ -33,7 +33,7 @@
|
[
OH_AI_ContextDestroy
](
_mind_spore.md#oh_ai_contextdestroy
)
(
OH_AI_ContextHandle
\*
context) | 释放上下文对象。 |
|
[
OH_AI_ContextSetThreadNum
](
_mind_spore.md#oh_ai_contextsetthreadnum
)
(
OH_AI_ContextHandle
context, int32_t thread_num) | 设置运行时的线程数量。 |
|
[
OH_AI_ContextGetThreadNum
](
_mind_spore.md#oh_ai_contextgetthreadnum
)
(
const
OH_AI_ContextHandle context) | 获取线程数量。 |
|
[
OH_AI_ContextSetThreadAffinityMode
](
_mind_spore.md#oh_ai_contextsetthreadaffinitymode
)
(
OH_AI_ContextHandle
context, int mode) | 设置运行时线程绑定CPU核心的策略,按照CPU物理核频率分为大
核与
小核。 |
|
[
OH_AI_ContextSetThreadAffinityMode
](
_mind_spore.md#oh_ai_contextsetthreadaffinitymode
)
(
OH_AI_ContextHandle
context, int mode) | 设置运行时线程绑定CPU核心的策略,按照CPU物理核频率分为大
、中、小三种类型的核心,并且仅需绑大核或者绑中核,不需要绑
小核。 |
|
[
OH_AI_ContextGetThreadAffinityMode
](
_mind_spore.md#oh_ai_contextgetthreadaffinitymode
)
(
const
OH_AI_ContextHandle context) | 获取运行时线程绑定CPU核心的策略。 |
|
[
OH_AI_ContextSetThreadAffinityCoreList
](
_mind_spore.md#oh_ai_contextsetthreadaffinitycorelist
)
(
OH_AI_ContextHandle
context, const int32_t
\*
core_list, size_t core_num) | 设置运行时线程绑定CPU核心的列表。 |
|
[
OH_AI_ContextGetThreadAffinityCoreList
](
_mind_spore.md#oh_ai_contextgetthreadaffinitycorelist
)
(
const
OH_AI_ContextHandle context, size_t
\*
core_num) | 获取CPU绑核列表。 |
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录