Skip to content

Commit

Permalink
fix other GPU bug
Browse files Browse the repository at this point in the history
  • Loading branch information
korbinian90 committed Oct 10, 2023
1 parent 371d44a commit 34b7e05
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ This implementation doesn't support data with an oblique angle acquisition yet.
```julia
using QuantitativeSusceptibilityMappingTGV
sz = (20, 20, 20)
res = [1, 1, 1]
TE = 0.01
sz = (20, 20, 20);
res = [1, 1, 1];
TE = 0.01;
phase = randn(sz)
mask = trues(sz)
phase = randn(sz);
mask = trues(sz);
chi = qsm_tgv(phase, mask, res; TE)
chi = qsm_tgv(phase, mask, res; TE);
```

## Settings to reproduce the original version
Expand Down
8 changes: 4 additions & 4 deletions src/tgv.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,16 +165,16 @@ end
function select_device(library::Module)
if Symbol(library) == :CUDA
println("Using the GPU via CUDA")
return CUDA.CUDAKernels.CUDABackend(), CUDA.cu
return library.CUDAKernels.CUDABackend(), library.cu
elseif Symbol(library) == :AMDGPU
println("Using the GPU via AMDGPU")
return AMDGPU.ROCKernels.ROCBackend(), AMDGPU.ROCArray
return library.ROCKernels.ROCBackend(), library.ROCArray
elseif Symbol(library) == :oneAPI
println("Using the GPU via oneAPI")
return oneAPI.oneAPIKernels.oneAPIBackend(), oneAPI.oneArray
return library.oneAPIKernels.oneAPIBackend(), library.oneArray
elseif Symbol(library) == :Metal
println("Using the GPU via Metal")
return Metal.MetalKernels.MetalBackend(), Metal.MtlArray
return library.MetalKernels.MetalBackend(), library.MtlArray
else
println("Using $(Threads.nthreads()) CPU cores")
return CPU(), identity
Expand Down

0 comments on commit 34b7e05

Please sign in to comment.