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.8k
着信時氏名表示させたいエンジニア vs 簡単には着信時氏名表示できない電話番号 (iOS13対応版) / iosdcjapan-2020-lt-calldirectory
kotetuco
2
1.2k
UIImage and CIImage for Image Processing
kotetuco
9
6.7k
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
610
OS Developer として Rustを使ってみる/using-rust-for-os-developer
kotetuco
0
600
Other Decks in Programming
See All in Programming
「兵法」から見る質とスピード
ickx
0
240
カクヨムAndroidアプリのリブート
numeroanddev
0
230
レガシーシステムの機能調査・開発におけるAI利活用
takuya_ohtonari
0
280
Practical Domain-Driven Design - Workshop at NDC 2025
mufrid
0
140
無関心の谷
kanayannet
0
120
がんばりすぎないコーディングルール運用術
tsukakei
1
210
インターフェース設計のコツとツボ
togishima
2
670
20250528 AWS Startupイベント登壇資料:AIコーディングの取り組み
procrustes5
0
130
型安全なDrag and Dropの設計を考える
yudppp
5
700
コードに語らせよう――自己ドキュメント化が内包する楽しさについて / Let the Code Speak
nrslib
6
1.3k
バリデーションライブラリ徹底比較
nayuta999999
1
560
MLOps Japan 勉強会 #52 - 特徴量を言語を越えて一貫して管理する, 『特徴量ドリブン』な MLOps の実現への試み
taniiicom
2
610
Featured
See All Featured
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
106
19k
4 Signs Your Business is Dying
shpigford
183
22k
Docker and Python
trallard
44
3.4k
[RailsConf 2023] Rails as a piece of cake
palkan
55
5.6k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.3k
Facilitating Awesome Meetings
lara
54
6.4k
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
Building Applications with DynamoDB
mza
95
6.4k
Designing for humans not robots
tammielis
253
25k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Done Done
chrislema
184
16k
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