# Apple M1 GPU from Julia?

**URL:** <https://discourse.julialang.org/t/apple-m1-gpu-from-julia/69563>\
**Category:** GPU\
**Tags:** question\
**Created:** [October 11, 2021, 12:22pm UTC](https://discourse.julialang.org/t/apple-m1-gpu-from-julia/69563 "2021-10-11T12:22:30Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Per](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/per/32/10387_2.png) [@Per](https://discourse.julialang.org/u/Per)\
**Post date:** [December 2, 2021, 1:55pm UTC](https://discourse.julialang.org/t/apple-m1-gpu-from-julia/69563/5 "2021-12-02T13:55:48Z")

</div>

Since my use-case is a bit different, I created a new package, [SetBlasInt](https://github.com/perrutquist/SetBlasInt.jl), based on the idea in AppleAccelerateLinAlgWrapper, but which just replaces Julia’s BLAS methods instead of keeping the Int32 versions separate. This way, it is possible to switch to Accelerate without modifying existing code.

This is just a hack, but it does what I need it to do, for now.

Example:

```nohighlight
using LinearAlgebra, BenchmarkTools, SetBlasInt
BLAS.lbt_forward("/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate")
A = rand(Float32, 1000, 1000)
@btime A*A # 8.954 ms (2 allocations: 3.81 MiB)
setblasint(Int32, :sgemm)
@btime A*A # 1.592 ms (2 allocations: 3.81 MiB)

```

---

_[View the full topic](https://discourse.julialang.org/t/apple-m1-gpu-from-julia/69563)._
