Skip to content

Commit c0bd7ba

Browse files
author
xiaying
committed
MNN:Feature: Add FFRT
1 parent 8710289 commit c0bd7ba

300 files changed

Lines changed: 46386 additions & 5 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3rd_party/ffrt/.autocorrectignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Copyright (c) 2024 Huawei Device Co., Ltd.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
docs/

3rd_party/ffrt/.autocorrectrc

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Copyright (c) 2024 Huawei Device Co., Ltd.
2+
# Licensed under the Apache License, Version 2.0 (the "License");
3+
# you may not use this file except in compliance with the License.
4+
# You may obtain a copy of the License at
5+
#
6+
# http://www.apache.org/licenses/LICENSE-2.0
7+
#
8+
# Unless required by applicable law or agreed to in writing, software
9+
# distributed under the License is distributed on an "AS IS" BASIS,
10+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11+
# See the License for the specific language governing permissions and
12+
# limitations under the License.
13+
14+
# yaml-language-server: $schema=https://huacnlee.github.io/autocorrect/schema.json
15+
rules:
16+
# Auto add spacing between CJK (Chinese, Japanese, Korean) and English words.
17+
# 0 - off, 1 - error, 2 - warning
18+
space-word: 1
19+
# Add space between some punctuations.
20+
space-punctuation: 1
21+
# Add space between brackets (), [] when near the CJK.
22+
space-bracket: 1
23+
# Add space between ``, when near the CJK.
24+
space-backticks: 1
25+
# Add space between dash `-`
26+
space-dash: 1
27+
# Convert to fullwidth.
28+
fullwidth: 1
29+
# To remove space near the fullwidth punctuations.
30+
no-space-fullwidth: 1
31+
# To remove space arouned the fullwidth quotes “”, ''.
32+
no-space-fullwidth-quote: 1
33+
# Fullwidth alphanumeric characters to halfwidth.
34+
halfwidth-word: 1
35+
# Fullwidth punctuations to halfwidth in english.
36+
halfwidth-punctuation: 1
37+
# Spellcheck
38+
spellcheck: 0
39+
# Enable or disable in spatial context
40+
context:
41+
# Enable or disable to format codeblock in Markdown or AsciiDoc etc.
42+
codeblock: 1
43+
textRules:
44+
# No default text rules.
45+
spellcheck:
46+
words:
47+
# Please do not add a general English word (eg. apple, python) here.
48+
# Users can add their special words to their .autocorrectrc file by their need.
49+
fileTypes:
50+
# ext: grammar_name
51+
# YAML
52+
yaml: yaml
53+
yml: yaml
54+
# JSON
55+
json: json
56+
json5: json
57+
# Markdown
58+
markdown: markdown
59+
md: markdown
60+
mdx: markdown
61+
# C / C++
62+
cc: c
63+
cpp: c
64+
c: c
65+
# XML
66+
xml: xml
67+
# Shell
68+
sh: ruby
69+
shell: ruby
70+
# Text
71+
text: text
72+
plain: text
73+
txt: text

3rd_party/ffrt/.clang-format

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
BasedOnStyle: Google
3+
IndentWidth: 4
4+
ColumnLimit: 120
5+
---
6+
Language: Cpp
7+
AccessModifierOffset: -4
8+
AllowShortIfStatementsOnASingleLine: Never
9+
AlwaysBreakBeforeMultilineStrings: false
10+
DerivePointerAlignment: false
11+
IncludeBlocks: Preserve
12+
IndentCaseBlocks: true
13+
PackConstructorInitializers: CurrentLine
14+
SpacesBeforeTrailingComments: 1
15+
---

3rd_party/ffrt/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#ignore files
2+
.vscode
3+
ffrt.cfg
4+
build
5+
test/build
6+
benchmarks/output
7+
output
8+
trace.json

3rd_party/ffrt/.markdownlint.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"MD013": false,
3+
"MD024": {
4+
"siblings_only": true
5+
}
6+
}

3rd_party/ffrt/BENCHMARKS.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Benchmarks
2+
3+
## 测试场景
4+
5+
1. `fork_join`:通过构造 fork/join 执行时间,模拟线程创建和堵塞场景;
6+
2. `fib`:通过构造斐波那契序列,模拟嵌套调用场景;
7+
3. `face_story`:通过构造人脸数据,模拟人脸检测场景;
8+
9+
## 测试方法
10+
11+
```shell
12+
cd benchmarks
13+
./benchmarks count # count 表明执行次数
14+
```
15+
16+
## 测试结果
17+
18+
1. 测试数据和分析归档到 `benchmarks/output/tag_${stamp}/benchmark_${stamp}.svg`,其中 `stamp` 是最近一次 commit 提交时间
19+
2. 测试结果已取平均

0 commit comments

Comments
 (0)