Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdelrahman912 committed Dec 4, 2024
1 parent 441c9fb commit 52f1479
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions docs/src/literate-tutorials/gpu_qp_heat_equation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,8 +171,6 @@ gpu_kernel()
## cpu_kernel()


Adapt.adapt_structure(CUSPARSE.CuSparseDeviceMatrixCSC, Kgpu)

## commented to pass the test
## norm(Kgpu)

Expand Down
4 changes: 2 additions & 2 deletions ext/GPU/CUDAKernelLauncher.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ function Ferrite.init_kernel(::Type{BackendCUDA}, n_cells::Ti, n_basefuncs::Ti,
threads = convert(Ti, min(n_cells, 256))
shared_mem = _calculate_shared_memory(threads, n_basefuncs)
blocks = _calculate_nblocks(threads, n_cells)
_adapted_args = _adapt_args(CuArray, args)
_adapted_args = _adapt_args(args)

if (_can_use_dynshmem(shared_mem) && false)
if (_can_use_dynshmem(shared_mem))
Ke = DynamicSharedMemFunction{3, Float32, Int32}((threads, n_basefuncs, n_basefuncs), Int32(0))
fe = DynamicSharedMemFunction{2, Float32, Int32}((threads, n_basefuncs), sizeof(Float32) * threads * n_basefuncs * n_basefuncs |> Int32)
mem_alloc = SharedMemAlloc(Ke, fe, shared_mem)
Expand Down
3 changes: 1 addition & 2 deletions ext/GPU/adapt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
Adapt.@adapt_structure GPUGrid
Adapt.@adapt_structure GPUDofHandler

function _adapt_args(to, args)
@show "Hi do you see me?"
function _adapt_args(args)
return tuple(((_adapt(arg) for arg in args) |> collect)...)
end

Expand Down

0 comments on commit 52f1479

Please sign in to comment.