COSCUP x RubyConf TW 2021

在 Golang 召喚 SIMD 加速魔法
年7月31日, 10:00–10:30 (Asia/Taipei), TR209
語言: 漢語


英文演講標題

How to develop fast application with SIMD in Golang

演講摘要

SIMD 是常見的硬體加速手段,透過 SIMD 指令集的加速,我們可以將多筆資料進行平行運算,進而達到加速的效果。通常若是要使用 SIMD 的話我們都會透過 C 語言 inline 組合語言或者使用 C 語言的 intrinsics 去呼叫。相同的手法在 golang 中可以簡單地透過 cgo 完成,但是呼叫 cgo 所造成的時間成本在極度要求效率的場景下會造成不小的問題,好死不死會應用 SIMD 的場合就是需要極度在意效率的狀況,在此我們以 ARM64 為例子,以組合語言試著跟大家分享如何在 golang 中實做出 SIMD 的演算法,去避免 cgo 造成的時間成本。

演講長度

20

英文演講摘要

SIMD is a well-known hardware-specific technique to accelerate applications. SIMD allows applications to run several operations parallelly. Normally, we would develop SIMD applications in C language with inline assembly or intrinsics. We can simply conduct inline assembly or intrinsics with cgo, but call overhead of cgo would a critical issue in performance-sensitive cases, which is the exact case that we would use SIMD. Here we are going to share how to write assembly in Golang to facilitate SIMD technique without call overhead.

您是否知悉並同意如採遠端形式分享,需提供預錄影片(您需同意大會才能接受您的稿件) – True 內容難易度

中階

hackmd url

https://hackmd.io/@coscup/HyHyr6PR_/%2F%40coscup%2FBy22VTw0d

slido url

https://app.sli.do/event/sarjtvpb