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.2k
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.3k
着信時氏名表示させたいエンジニア vs 簡単には着信時氏名表示できない電話番号 (iOS13対応版) / iosdcjapan-2020-lt-calldirectory
kotetuco
2
970
UIImage and CIImage for Image Processing
kotetuco
9
6k
Preparing for Swift 5 Ownership
kotetuco
0
4.7k
プログラミング言語RustとOS開発/rust-os-develop-introduction
kotetuco
0
1.6k
Sansan iOSアプリと R&Dとの共同研究について/sansan-ios-and-reearch
kotetuco
0
540
OS Developer として Rustを使ってみる/using-rust-for-os-developer
kotetuco
0
580
Other Decks in Programming
See All in Programming
Mastering Developer Experience: A Roadmap for Success 【開発生産性Conference 2024】
findyinc
1
380
DMMプラットフォームにおけるTiDBの導入から運用まで
pospome
7
3k
Javaの現状2024夏 / Java current status 2024 summer
kishida
4
1.4k
日付と正規化
megmogmog1965
0
140
【Go言語】ジェネリクス
tomo1227
0
170
APIのない大学ログインWebサービスをWKWebViewとJavaScriptでアプリ化した話
akidon0000
1
330
Exploring the Gradually Lost Technical Skills in the Cloud Native Era
hwchiu
2
3.9k
Google's Recipe for Scaling (Web) Security – LocoMocoSec 2024
lweichselbaum
0
170
Introduction to GitOps
hwchiu
0
110
入社1ヶ月でここまでやった!Findy Toolsインフラ支援の最適化
rvirus0817
6
1.4k
英語
s_shimotori
1
220
유연한 Composable 설계
l2hyunwoo
0
380
Featured
See All Featured
Reflections from 52 weeks, 52 projects
jeffersonlam
346
19k
5 minutes of I Can Smell Your CMS
philhawksworth
200
19k
Side Projects
sachag
451
42k
Building an army of robots
kneath
301
42k
Build The Right Thing And Hit Your Dates
maggiecrowley
28
2.2k
What’s in a name? Adding method to the madness
productmarketing
PRO
21
2.9k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
277
13k
Bash Introduction
62gerente
607
210k
Code Reviewing Like a Champion
maltzj
517
39k
Design by the Numbers
sachag
277
18k
Faster Mobile Websites
deanohume
303
30k
Making Projects Easy
brettharned
111
5.7k
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