Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 3 additions & 15 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "NestedCrossApproximation"
uuid = "f6207e60-518a-434a-9b8f-688e2ff7cc40"
authors = ["Joshua <joshua.tetzner@uni-rostock.de>"]
version = "0.1.0"
authors = ["Joshua <joshua.tetzner@uni-rostock.de>"]

[deps]
AdaptiveCrossApproximation = "ef3ffb92-1c7b-43b8-a0d7-a7e2ce4fd1e5"
Expand All @@ -18,7 +18,7 @@ AdaptiveCrossApproximation = "0.4"
Aqua = "0.8"
BEAST = "2.8, 2.9, 2.10"
BlockSparseMatrices = "0.3.1"
CompScienceMeshes = "0.11, 0.12, 0.13"
CompScienceMeshes = "0.11, 0.12, 0.13, 1"
ExplicitImports = "1"
H2Trees = "0.4"
JET = "0.9, 0.10, 0.11, 0.12, 0.13"
Expand Down Expand Up @@ -49,16 +49,4 @@ TestItemRunner = "f8b46487-2199-4994-9208-9a1283c18c0a"
TestItems = "1c621080-faea-4a02-84b6-bbd5e436b8fe"

[targets]
test = [
"Aqua",
"BEAST",
"CompScienceMeshes",
"ExplicitImports",
"JET",
"JuliaFormatter",
"ParallelKMeans",
"Random",
"Test",
"TestItemRunner",
"TestItems",
]
test = ["Aqua", "BEAST", "CompScienceMeshes", "ExplicitImports", "JET", "JuliaFormatter", "ParallelKMeans", "Random", "Test", "TestItemRunner", "TestItems"]
2 changes: 1 addition & 1 deletion examples/batchedbottomup_compression_validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function compare_backends(; nrefine=8, minvalues=80, maxrank=30, device=0, devic
ng = min(length(selected), length(rows))
@assert length(shards) == ng
@assert [stack.device for stack in shards] == selected[1:ng]
@assert [extension.nblocks(stack) for stack in shards] == [div(g * 3, ng) - div((g-1) * 3, ng) for g in 1:ng]
@assert [extension.nblocks(stack) for stack in shards] == [div(g * 3, ng) - div((g - 1) * 3, ng) for g in 1:ng]
packed = Matrix{ComplexF64}[]
for stack in shards
CUDA.device!(stack.device)
Expand Down
2 changes: 1 addition & 1 deletion examples/batchedbottomup_gpu_vs_cpu.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ println("MVP:")
@time ycpu = Acpu * x;
##
## GPU: BatchedBottomUp + GPUBEASTKernelMatrix far matrix
ndevices=4
ndevices = 4
println("=== GPU (BatchedBottomUp) with $ndevices devices===")
testcompressor_gpu, trialcompressor_gpu = buildcompressors();
##
Expand Down
6 changes: 3 additions & 3 deletions ext/NestedCrossApproximationCUDAExt/compresslevel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ function _gather_solve_tensors!(A, B, buffer, offsets, ranks, rowpivots, colpivo
pivot = mod(localindex, mr) + 1
row = div(localindex, mr) + 1
@inbounds B[pivot, row, block] =
if pivot <= r && row <= offsets[block + 1]-offset
if pivot <= r && row <= offsets[block + 1] - offset
buffer[offset + row, colpivots[pivot, block]]
else
zero(eltype(B))
Expand Down Expand Up @@ -105,7 +105,7 @@ function _solve_transposed_factors(
rows_d = _deviceindices(rowpivots)
cols_d = _deviceindices(colpivots)
total = length(A) + length(B)
@cuda threads=256 blocks=cld(total, 256) _gather_solve_tensors!(
@cuda threads = 256 blocks = cld(total, 256) _gather_solve_tensors!(
A, B, stack.buffer, offsets_d, ranks_d, rows_d, cols_d
)

Expand Down Expand Up @@ -140,7 +140,7 @@ end
function _compress(cfg, stacks::AbstractVector{<:DistributedBlockStack})
tasks = Task[]
@sync for stack in stacks
let stack=stack
let stack = stack
push!(tasks, Threads.@spawn _compress(cfg, stack))
end
end
Expand Down
6 changes: 3 additions & 3 deletions ext/NestedCrossApproximationCUDAExt/distributedblockstack.jl
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ function _assemble_level_resident(
tasks = Task[]
@sync for g in 1:ng
idcs = (div((g - 1) * nb, ng) + 1):div(g * nb, ng)
let functor=farmatrix.functors[g],
rows=view(rowidcs, idcs),
cols=view(colidcs, idcs)
let functor = farmatrix.functors[g],
rows = view(rowidcs, idcs),
cols = view(colidcs, idcs)

push!(
tasks,
Expand Down
10 changes: 5 additions & 5 deletions test/compressors/test_trialassembly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using OhMyThreads

struct TrialAssemblyKernel end
Base.eltype(::TrialAssemblyKernel) = ComplexF64
(::TrialAssemblyKernel)(x, y) = (1 + im*x[1] + x[2]^2) * (exp(2y[2]) + im*y[3])
(::TrialAssemblyKernel)(x, y) = (1 + im * x[1] + x[2]^2) * (exp(2y[2]) + im * y[3])

@testset "Trial assembly for nonsymmetric and rectangular operators" begin
for (nt, ns) in ((160, 160), (96, 160), (160, 96))
Expand All @@ -20,8 +20,8 @@ Base.eltype(::TrialAssemblyKernel) = ComplexF64
kernel = TrialAssemblyKernel()
dense = [kernel(x, y) for x in testpts, y in trialpts]
matrix = AbstractKernelMatrix(kernel, testpts, trialpts)
owntrial = [[ns-4, ns-3, ns-2, ns-1, ns], [2, 4, 6, 8]]
fartest = [[1, 3, 5], [nt-1, nt]]
owntrial = [[ns - 4, ns - 3, ns - 2, ns - 1, ns], [2, 4, 6, 8]]
fartest = [[1, 3, 5], [nt - 1, nt]]
blocks = NestedCrossApproximation.assemble_level(
matrix, owntrial, fartest; maxrank=10, transposed=true
)
Expand Down Expand Up @@ -69,7 +69,7 @@ Base.eltype(::TrialAssemblyKernel) = ComplexF64
)
x = randn(rng, ComplexF64, ns)
y = randn(rng, ComplexF64, nt)
@test norm(A*x - dense*x) / norm(dense*x) < 1e-10
@test norm(adjoint(A)*y - adjoint(dense)*y) / norm(adjoint(dense)*y) < 1e-10
@test norm(A * x - dense * x) / norm(dense * x) < 1e-10
@test norm(adjoint(A) * y - adjoint(dense) * y) / norm(adjoint(dense) * y) < 1e-10
end
end
2 changes: 1 addition & 1 deletion test/gpu/test_trialassembly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ using LinearAlgebra
trialspace = raviartthomas(trialmesh)
@test length(testspace) == 120
@test length(trialspace) == 270
op = Maxwell3D.singlelayer(; wavenumber=2π/8)
op = Maxwell3D.singlelayer(; wavenumber=2π / 8)
quadrature = BEAST.DoubleNumQStrat(2, 3)
cpu = AbstractKernelMatrix(op, testspace, trialspace; matrixdata=quadrature)
owntrial = [collect(241:270), collect(11:60), collect(70:149)]
Expand Down
Loading