Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Metal for data-parallel computations
Search
kotetu (kotetuco)
September 02, 2018
Programming
1
1.4k
Metal for data-parallel computations
グラフィックス以外の分野でのMetalの可能性
iOSDC 2018 LT 発表資料
kotetu (kotetuco)
September 02, 2018
Tweet
Share
More Decks by kotetu (kotetuco)
See All by kotetu (kotetuco)
認証体験向上のために passkeys (パスキー) に対応する 〜 メリット・対応方法について / iosdcjapan-2023-passkeys
kotetuco
3
1.7k
着信時氏名表示させたいエンジニア vs 簡単には着信時氏名表示できない電話番号 (iOS13対応版) / iosdcjapan-2020-lt-calldirectory
kotetuco
2
1.2k
UIImage and CIImage for Image Processing
kotetuco
9
6.6k
Preparing for Swift 5 Ownership
kotetuco
0
4.9k
プログラミング言語RustとOS開発/rust-os-develop-introduction
kotetuco
0
1.7k
Sansan iOSアプリと R&Dとの共同研究について/sansan-ios-and-reearch
kotetuco
0
600
OS Developer として Rustを使ってみる/using-rust-for-os-developer
kotetuco
0
600
Other Decks in Programming
See All in Programming
ComposeでWebアプリを作る技術
tbsten
0
110
gen_statem - OTP's Unsung Hero
whatyouhide
1
210
Memory API : Patterns, Performance et Cas d'Utilisation
josepaumard
0
140
The Nature of Complexity in John Ousterhout’s Philosophy of Software Design
philipschwarz
PRO
0
110
Chrome Extension Techniques from Hell
moznion
1
160
監視 やばい
syossan27
10
9.5k
RuboCop: Modularity and AST Insights
koic
2
1.3k
AHC045_解説
shun_pi
0
540
Thank you <💅>, What's the Next?
ahoxa
1
480
Cursor/Devin全社導入の理想と現実
saitoryc
11
5.3k
大LLM時代にこの先生きのこるには-ITエンジニア編
fumiyakume
7
3k
On-the-fly Suggestions of Rewriting Method Deprecations
ohbarye
1
2.7k
Featured
See All Featured
Fashionably flexible responsive web design (full day workshop)
malarkey
407
66k
Speed Design
sergeychernyshev
29
900
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
233
17k
GitHub's CSS Performance
jonrohan
1030
460k
Practical Orchestrator
shlominoach
186
11k
Scaling GitHub
holman
459
140k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
251
21k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.2k
Building Applications with DynamoDB
mza
94
6.3k
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
23
2.6k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
26k
Transcript
άϥϑΟοΫεҎ֎ͷ ͰͷMetalͷՄೳੑ iOSDC 2018 (2018/9/2) @kotetu
Kuriyama Toru (܀ࢁప) iOS / Android developer ɹɹɹɹɹɹɹɹat Sansan app
(iOS/Android) Twitter: @kotetuɹɹɹɹɹɹ Github, Qiita: @kotetuco
Metal • GPUΛ͏ͨΊͷFramework • ओʹ3DάϥϑΟοΫεͰ༻ • άϥϑΟοΫεͰ͔͑͠ͳ ͍Θ͚Ͱͳ͍ 3 /
14
Metalͷ༻్ “Render advanced 3D graphics and perform data-parallel computations using
the GPU.” ʮGPUΛͬͨߴͳ3DϨϯμϦϯάͱฒྻॲཧʯ https://developer.apple.com/documentation/metal 4 / 14
Metalͷ༻్ “Render advanced 3D graphics and perform data-parallel computations using
the GPU.” ʮGPUΛͬͨߴͳ3DϨϯμϦϯάͱฒྻॲཧʯ https://developer.apple.com/documentation/metal 4 / 14 3DάϥϑΟοΫεҎ֎ͷ༻్ఆ
GPUͷಛੑ • 1ίΞ͋ͨΓͷੑೳCPUͷํ͕ߴ͍͕ίΞ CPUΑΓଟ͍ • ʮCPUεϙʔπΧʔɺGPUόεʯ • ฒྻॲཧʹ͍ͨΞʔΩςΫνϟ Ҿ༻ɿiOSDC 2017ʮඈͼಓ۩Ͱͳ͍Metalʯ(@shu223͞Μ)
ൃදࢿྉ 5 / 14
ฒྻॲཧͷԸܙΛड͚ͦ͏ͳɹ • ը૾ॲཧ • ػցֶश(ਪ) • ཧγϛϡϨʔγϣϯ 6 /
14
ฒྻॲཧͷԸܙΛड͚ͦ͏ͳɹ • ը૾ॲཧ • ػցֶश(ਪ) • ཧγϛϡϨʔγϣϯ 6 /
14
ը૾ॲཧ • Core Image (Core Imageͷը૾ॲཧͷҰ෦ ෦ͰMetalΛ༻͍ͯ͠Δ) • Core Image͕αϙʔτ͍ͯ͠ͳ͍ը૾ॲཧ
OpenCVͳͲͷը૾ॲཧϥΠϒϥϦΛ͏ 7 / 14
OpenCV • ը૾ॲཧɾίϯϐϡʔλϏδϣϯϥΠϒϥϦ • PCͷGPUʹରԠ͍ͯ͠Δ͕MetalʹରԠ ͍ͯ͠ͳ͍ • iOS্ͰGPUͷԸܙΛड͚ΒΕͳ͍ 8 /
14
࣮ݧɿը૾ॲཧͷॲཧ࣌ؒɹɹ Λൺֱɹɹ • OpenCV (CPU) • Metal (GPU) • Metal
Performance Shader ɹɹɹɹɹ (MetalΛͬͨը૾ɾฒྻॲཧϥΠϒϥϦ) 9 / 14
༻ͨ͠ը૾ https://pixabay.com/photo-3599450/ ը૾αΠζɿ5984 × 3989 ϑΝΠϧαΠζɿ6.9MB (JPEG) 10 / 14
ൺֱʹ༻͍ͨը૾ॲཧ 11 / 14 1. ೋԽ (നࠇը૾ม) 2. ը૾ͷॖখ 3.
ॖখ + ΅͔͠
ݕূ༻ΞϓϦ • githubʹ͋Γ·͢(Լهࢀর) • Xcode 10 (beta 6) • iOS11+
(࣮ػ͕ඞཁ) • OpenCV 3.4.2 12 / 14 https://github.com/kotetuco/ComparisonOfMetalAndOpenCV
ݕূ݁Ռ 13 / 14 ※ ୯ҐϛϦඵɺ༻ iPhone 8 Plusɹ(iOS11.3.1)
ݕূ݁Ռ 13 / 14 ※ ୯ҐϛϦඵɺ༻ iPhone 8 Plusɹ(iOS11.3.1) Metal͕
͍
·ͱΊ • MetalΛ͑ඞͣ͘ͳΔΘ͚Ͱͳ͍ • ୯७ͳฒྻॲཧͰGPU༻ϝϞϦͷίϐʔ CPU-GPUؒ௨৴ͷ࣌ؒΛແࢹͰ͖ͳ͍ • ෳͷॲཧΛ·ͱΊͯߦ͍͍ͨ߹ʹMetal͕༗ར • Metal(GPU)ʹ͍͍ͯΔ͔Ͳ͏͔ͷݟۃΊ͕େࣄ
14 / 14