Programming Apple GPUs through Go and Metal Shading Language
Investigating Go, Cgo, Metal Shading Language, Metal Performance Shaders, and benchmarking different approaches to matrix multiplicationPhoto by Etienne Martin on UnsplashBelow I’ll describe the process of using cgo to interface between Go and native C, how this can be used to interface with Objective-C bindings for Apple’s Metal Performance Shaders framework, how to interface with custom GPU code (shaders) written in the Metal Shading Language, and finally benchmarking all of that against hand-written and OpenBLAS…