Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdelrahman912 committed Dec 5, 2024
1 parent 4381a76 commit 63bbffe
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions test/GPU/test_adapt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ function dofs_cpu(dh, cv)
end


function dofs_gpu_kernel(dofs, dh, cv)
function dofs_gpu_kernel(dofs, dh, cv; mem_alloc)
nbasefuncs = cv |> getnbasefunctions
for cell in CellIterator(dh, convert(Int32, nbasefuncs))
for cell in CellIterator(dh, mem_alloc)
cdofs = celldofs(cell)
dofs[:, cellid(cell)] .= cdofs
end
Expand All @@ -34,9 +34,9 @@ function nodes_cpu(grid)
return hcat(nodes...)
end

function nodes_gpu_kernel(nodes, dh, cv)
function nodes_gpu_kernel(nodes, dh, cv; mem_alloc)
nbasefuncs = cv |> getnbasefunctions
for cell in CellIterator(dh, convert(Int32, nbasefuncs))
for cell in CellIterator(dh, mem_alloc)
cnodes = getnodes(cell)
nodes[:, cellid(cell)] .= cnodes
end
Expand Down
8 changes: 4 additions & 4 deletions test/GPU/test_iterator.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ function getalldofs(dh)
end


function dof_kernel_kernel!(dofs, dh, n_basefuncs)
function dof_kernel_kernel!(dofs, dh, n_basefuncs; mem_alloc)
# this kernel is used to get all the dofs of the grid, which then
# can be validated against the correct dofs (i.e. CPU version).
for cell in CellIterator(dh, convert(Int32, n_basefuncs))
for cell in CellIterator(dh, mem_alloc)
cid = cellid(cell)
cdofs = celldofs(cell)
for i in 1:n_basefuncs
Expand Down Expand Up @@ -65,9 +65,9 @@ function assemble_element_cpu!(Ke, fe, cellvalues)
return Ke, fe
end

function localkefe_kernel!(kes, fes, cv, dh)
function localkefe_kernel!(kes, fes, cv, dh; mem_alloc)
nbasefuncs = getnbasefunctions(cv)
for cell in CellIterator(dh, convert(Int32, nbasefuncs))
for cell in CellIterator(dh, mem_alloc)
Ke = cellke(cell)
fe = cellfe(cell)
assemble_element_gpu!(Ke, fe, cv, cell)
Expand Down
2 changes: 1 addition & 1 deletion test/GPU/test_kernellauncher.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Sample CUDA Kernel (adding two vectors)
function kernel_add(A, B, C, n)
function kernel_add(A, B, C, n; mem_alloc)
i = threadIdx().x + (blockIdx().x - 1) * blockDim().x
if i <= n
C[i] = A[i] + B[i]
Expand Down

0 comments on commit 63bbffe

Please sign in to comment.