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.3k
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.1k
UIImage and CIImage for Image Processing
kotetuco
9
6.5k
Preparing for Swift 5 Ownership
kotetuco
0
4.8k
プログラミング言語RustとOS開発/rust-os-develop-introduction
kotetuco
0
1.6k
Sansan iOSアプリと R&Dとの共同研究について/sansan-ios-and-reearch
kotetuco
0
580
OS Developer として Rustを使ってみる/using-rust-for-os-developer
kotetuco
0
600
Other Decks in Programming
See All in Programming
dbt Pythonモデルで実現するSnowflake活用術
trsnium
0
270
JAWS Days 2025のインフラ
komakichi
1
260
Serverless Rust: Your Low-Risk Entry Point to Rust in Production (and the benefits are huge)
lmammino
1
160
ファインディLT_ポケモン対戦の定量的分析
fufufukakaka
0
950
自力でTTSモデルを作った話
zgock999
0
120
仕様変更に耐えるための"今の"DRY原則を考える
mkmk884
9
3.2k
From the Wild into the Clouds - Laravel Meetup Talk
neverything
0
180
Better Code Design in PHP
afilina
0
180
pylint custom ruleで始めるレビュー自動化
shogoujiie
0
160
PRレビューのお供にDanger
stoticdev
1
240
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.2k
CDK開発におけるコーディング規約の運用
yamanashi_ren01
2
260
Featured
See All Featured
Building Applications with DynamoDB
mza
93
6.2k
We Have a Design System, Now What?
morganepeng
51
7.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
38
7.1k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
40
2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
27
1.6k
Writing Fast Ruby
sferik
628
61k
How to Think Like a Performance Engineer
csswizardry
22
1.4k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.2k
How to Ace a Technical Interview
jacobian
276
23k
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