Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdelrahman912 committed Oct 15, 2024
1 parent 626dec2 commit fbc1b4b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions docs/src/literate-tutorials/gpu_qp_heat_equation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@ K = allocate_matrix(SparseMatrixCSC{Float32, Int32},dh);

# Allocate GPU matrix
## commented to pass the test
Kgpu = CUSPARSE.CuSparseMatrixCSC(K);
fgpu = CUDA.zeros(ndofs(dh));
## Kgpu = CUSPARSE.CuSparseMatrixCSC(K);
## fgpu = CUDA.zeros(ndofs(dh));

n_cells = dh |> get_grid |> getncells

Expand Down
5 changes: 2 additions & 3 deletions test/GPU/test_kernellauncher.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,16 +20,15 @@ end
A = CUDA.fill(1.0f0, N)
B = CUDA.fill(2.0f0, N)
C = CUDA.fill(0.0f0, N)

# Test with Int32
test_launch_kernel!(Int32(N), Int32(2), A, B, C, N)
CUDA.synchronize()
@test all(Array(C) .== 3.0f0)

# Test with Int64
fill!(C, 0.0f0) # reset C array
test_launch_kernel!(Int64(N), Int64(2), A, B, C, N)
CUDA.synchronize()
@test all(Array(C) .== 3.0f0)
end

2 changes: 1 addition & 1 deletion test/GPU/test_utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ function generate_problem()
close!(dh)

return dh, cellvalues
end
end

0 comments on commit fbc1b4b

Please sign in to comment.