From 515a8ff8a2a0851ca7c16d7825e2b1fe5c129f71 Mon Sep 17 00:00:00 2001 From: CompatHelper Julia Date: Mon, 2 Nov 2026 04:53:13 +0000 Subject: [PATCH 1/2] CompatHelper: bump compat for CompScienceMeshes in [extras] to 1, (keep existing compat) --- Project.toml | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/Project.toml b/Project.toml index 44fd409..be0a27b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "NestedCrossApproximation" uuid = "f6207e60-518a-434a-9b8f-688e2ff7cc40" -authors = ["Joshua "] version = "0.1.0" +authors = ["Joshua "] [deps] AdaptiveCrossApproximation = "ef3ffb92-1c7b-43b8-a0d7-a7e2ce4fd1e5" @@ -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" @@ -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"] From 57cabb41f6892e6f6a5619a6649b70e40c634029 Mon Sep 17 00:00:00 2001 From: Joshua Tetzner Date: Fri, 6 Nov 2026 15:03:50 +0100 Subject: [PATCH 2/2] Apply JuliaFormatter formatting - Fix formatting flagged by JuliaFormatter 2.14 in tests, examples and CUDA ext --- examples/batchedbottomup_compression_validation.jl | 2 +- examples/batchedbottomup_gpu_vs_cpu.jl | 2 +- ext/NestedCrossApproximationCUDAExt/compresslevel.jl | 6 +++--- .../distributedblockstack.jl | 6 +++--- test/compressors/test_trialassembly.jl | 10 +++++----- test/gpu/test_trialassembly.jl | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/batchedbottomup_compression_validation.jl b/examples/batchedbottomup_compression_validation.jl index 5973961..6c3fde0 100644 --- a/examples/batchedbottomup_compression_validation.jl +++ b/examples/batchedbottomup_compression_validation.jl @@ -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) diff --git a/examples/batchedbottomup_gpu_vs_cpu.jl b/examples/batchedbottomup_gpu_vs_cpu.jl index c58eab2..c558daf 100644 --- a/examples/batchedbottomup_gpu_vs_cpu.jl +++ b/examples/batchedbottomup_gpu_vs_cpu.jl @@ -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(); ## diff --git a/ext/NestedCrossApproximationCUDAExt/compresslevel.jl b/ext/NestedCrossApproximationCUDAExt/compresslevel.jl index f3b8870..ae5aef9 100644 --- a/ext/NestedCrossApproximationCUDAExt/compresslevel.jl +++ b/ext/NestedCrossApproximationCUDAExt/compresslevel.jl @@ -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)) @@ -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 ) @@ -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 diff --git a/ext/NestedCrossApproximationCUDAExt/distributedblockstack.jl b/ext/NestedCrossApproximationCUDAExt/distributedblockstack.jl index f1febb7..e8a0027 100644 --- a/ext/NestedCrossApproximationCUDAExt/distributedblockstack.jl +++ b/ext/NestedCrossApproximationCUDAExt/distributedblockstack.jl @@ -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, diff --git a/test/compressors/test_trialassembly.jl b/test/compressors/test_trialassembly.jl index e3f8329..48aad98 100644 --- a/test/compressors/test_trialassembly.jl +++ b/test/compressors/test_trialassembly.jl @@ -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)) @@ -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 ) @@ -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 diff --git a/test/gpu/test_trialassembly.jl b/test/gpu/test_trialassembly.jl index 8c3c811..40425d1 100644 --- a/test/gpu/test_trialassembly.jl +++ b/test/gpu/test_trialassembly.jl @@ -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)]