# L-17 MCS 572 Fri 4 Oct 2024 : mmmulmeta.jl # The CUDA version of the example is copied from the # Julia for High-Performance Scientific Computing web site. # https://enccs.github.io/Julia-for-HPC/GPU # and adjusted to use on M1 MacBook Air: # (1) using Metal instead of using CUDA # (2) work with Float32 instead of Float64 # (3) use MtlArray instead of CuArray using Metal using BenchmarkTools dim = 2^10 A_h = rand(Float32, dim, dim); A_d = MtlArray(A_h); @btime $A_h * $A_h; @btime $A_d * $A_d;