# Emulate GPU on CPU with CUDA.jl

**URL:** <https://discourse.julialang.org/t/emulate-gpu-on-cpu-with-cuda-jl/105961>\
**Category:** GPU\
**Tags:** gpu, cuda\
**Created:** [November 8, 2023, 4:37pm UTC](https://discourse.julialang.org/t/emulate-gpu-on-cpu-with-cuda-jl/105961 "2023-11-08T16:37:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![A112s](https://avatars.discourse-cdn.com/v4/letter/a/59ef9b/32.png) [@A112s](https://discourse.julialang.org/u/A112s)\
**Post date:** [November 8, 2023, 4:37pm UTC](https://discourse.julialang.org/t/emulate-gpu-on-cpu-with-cuda-jl/105961/1 "2023-11-08T16:37:25Z")

</div>

Pretty much as in the title. I am almost sure I heard about such option in one of the lectures on CUDA.jl, however I can’t find a way to achieve it.

I want to run my unit tests in github actions, but having to use actual GPU complicates things and drives the prices up.

---

<div class="post-metadata">

**Author:** ![jw3126](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jw3126/32/3086_2.png) [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Post date:** [November 8, 2023, 7:39pm UTC](https://discourse.julialang.org/t/emulate-gpu-on-cpu-with-cuda-jl/105961/2 "2023-11-08T19:39:20Z")

</div>

[KernelAbstractions.jl](https://github.com/JuliaGPU/KernelAbstractions.jl) allows to write code that runs on CPU and GPU.

---

<div class="post-metadata">

**Author:** ![simsurace](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/simsurace/32/30216_2.png) [@simsurace](https://discourse.julialang.org/u/simsurace)\
**Post date:** [November 8, 2023, 7:56pm UTC](https://discourse.julialang.org/t/emulate-gpu-on-cpu-with-cuda-jl/105961/3 "2023-11-08T19:56:40Z")

</div>

There‘s also JLArrays.jl, which was designed specifically to test GPU code on the CPU. It is registered but lives inside the GPUArrays repo.
