Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MetalでiOSアプリに宿る生命

1ae8fc4f63ab4770dd4545006489234c?s=47 yuky_az
December 14, 2016

 MetalでiOSアプリに宿る生命

AppleのMetalテクノロジーによるGPUコンピューティングに関して。
より詳しい内容はこちらでどうぞ。
http://qiita.com/yuky_az/items/ece9b64befc635e89f1a
http://qiita.com/yuky_az/items/ce5920f28c08e743418b

スライド中の動画のリンクはこちら
https://youtu.be/cAUOJ-wmeUA
https://youtu.be/GjdrYERYKVc
https://youtu.be/WlMiJDzC2f4

1ae8fc4f63ab4770dd4545006489234c?s=128

yuky_az

December 14, 2016
Tweet

Transcript

  1. .FUBMͰJ04ΞϓϦʹ॓Δੜ໋ :VLJOBHB"[VNB !ZVLZ@B[ TIJCVZBTXJGU

  2. ࣗݾ঺հ :VLJOBHB"[VNB
 ʢզ࠺޾௕ʣ J04ΤϯδχΞ 3% !ZVLZ@B[ ਓ޻஌ೳɺਓ޻ੜ໋ɺੜ෺ֶɺ ϓϩάϥϛϯάڭҭɺ
 ϒϥδϦΞϯॊज़ ଞͷڵຯͷର৅

    ·Ͱ73ؔ࿈ͷϕϯνϟʔʹۈ຿
 J0%$Ͱ͸εϚϗ޲͚73ΞϓϦͷ։ൃʹ͍ͭͯൃද
  3. Metal Advent Calendar

  4. Metalͱ͸ʁ Φʔόʔϔουͷখ͍͞ϩʔϨϕϧͳ ίϯϐϡʔλάϥϑΟοΫε"1* 0QFO(-ͱ0QFO$-ʹࣅͨػೳΛҰͭͷ"1*ʹ౷߹

  5. ࠓճͷൃද಺༰ 1. ඳըॲཧ 2. ฒྻԋࢉ MetalʹΑΔ

  6. GPUฒྻԋࢉͱ͸ʁ GPUͷԋࢉϦιʔεΛը૾ॲཧҎ֎ʹར༻

  7. CPUͱGPUͷ࿈ܞ EFWFMPQFSBQQMFDPNNFUBM

  8. Metal CPUଆͷొ৔ਓ෺ 1 .5-%FWJDF୯Ұͷ(16ͷΠϯλʔϑΣΠε .FUBMؔ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΍ΓͱΓΛ࠷খݶʹ͢Δ͜ͱ͕େࣄ

  14. ࣮૷ํ๏ɺಛੑ͕෼͔͖ͬͯͨͱ͜ΖͰ Կ͔Ԡ༻ͯ͠ΈΑ͏ʂ

  15. ܈஌ೳͱ͸ʁ ਓ޻஌ೳͷҰछɺूஂͱͯ͠ߴ౓ͳৼΔ෣͍

  16. ܈Εͷ3ͭͷϧʔϧ B౳ڑ཭֤ݸମ͕౳ڑ཭ΛอͭΑ͏ʹಈ͘ Cฒߦ֤ݸମ͕ଞͷݸମͱಉ͡޲͖ʹͳΔΑ͏ʹಈ͘ D౳଎֤ݸମ͸ଞͷݸମͱಉ͡଎౓ʹͳΔΑ͏ʹಈ͘

  17. ਺ࣜԽ B౳ڑ཭ Cฒߦ D౳଎౓

  18. γΣʔμʔͷίʔυ LFSOFMWPJENPWF ʜ GPS VJOUJJOPEF$PVOUJ \ ʜ ౳ڑ཭ qPBUBUUSBDUJPOFYQ C

     EJTUBODFB EJTUBODFB  qPBUSFQVMTJPOFYQ C EJTUBODF EJTUBODF  E"OHMF BMQIB  OFBS"OHMF BUUSBDUJPO GBS"OHMF SFQVMTJPO JOUFSWBM ฒߦ qPBUQBSBMMFM"OHMF%JGHFU3BOHFE"OHMF OPEFBOHMFDVSSFOU/PEFBOHMF  E"OHMF CFUB QBSBMMFM"OHMF%JG FYQ C EJTUBODF EJTUBODF  JOUFSWBM ౳଎౓ qPBUOPEF7FMPDJUZTRSU OPEFWFMPDJUZ9 OPEFWFMPDJUZ9 OPEFWFMPDJUZ: OPEFWFMPDJUZ:  WFMPDJUZ HBNNB  OPEF7FMPDJUZWFMPDJUZ  FYQ C EJTUBODF EJTUBODF  ^
  19. ߏ੒ ʢ6**NBHF7JFXͷαϒΫϥεʣ 7JFX$POUSPMMFSTXJGU .FUBM.BOBHFSTXJGU 4IBEFSNFUBM

  20. ࣮ԋ case1 IUUQTZPVUVCFD"60+XNF6" ЋЌ—Ѝ

  21. ࣮ԋ case2 IUUQTZPVUVCF(KES:&3:,7D ЋЌЍ

  22. ࣮ԋ case3 IUUQTZPVUVCF8M.J+%[$G ЋЌЍ

  23. ύϑΥʔϚϯεʹ͍ͭͯ ͷݸମΛ࢖༻ɺͦΕͧΕͷ૬ޓ࡞༻Λߟ͑ͨͷͰ YͰճͷԋࢉΛຖϑϨʔϜ͝ͱ ඵؒʹճ࣮ߦ GQTΛΩʔϓɺ$16઎༗཰ఔ౓ FYQؔ਺͚ͩͰສճඵʢʣ

  24. ·ͱΊ ຊ೔ͷൃද಺༰ɺৄࡉ͸2JJUBͰ .FUBMͰϋΠύϑΥʔϚϯεͳ(16ฒྻԋࢉ͕Մೳ ෳࡶͳݱ৅ΛJ1IPOF಺ʹ࠶ݱͰ͖Δ ਓ޻஌ೳͳͲ΁ͷԠ༻ɺظ଴େ IUUQRJJUBDPNZVLZ@B[

  25. ͯͯ͘͘ษڧձ #tekutekustudy ҟछΤϯδχΞ͕ू·Δษڧձ

  26. ιʔείʔυ HJUIVCDPNZVLJOBHB4XBSN*OUFMMJHFODF