Skip to content

Commit

Permalink
Remove NDTensors as test dep
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfishman committed Dec 16, 2024
1 parent e38dc08 commit 6484a11
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 87 deletions.
68 changes: 0 additions & 68 deletions TODO.md

This file was deleted.

1 change: 0 additions & 1 deletion ext/BlockSparseArraysGradedUnitRangesExt/test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[deps]
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
1 change: 0 additions & 1 deletion ext/BlockSparseArraysTensorAlgebraExt/test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[deps]
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
4 changes: 0 additions & 4 deletions src/abstractblocksparsearray/abstractblocksparsearray.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
using BlockArrays:
BlockArrays, AbstractBlockArray, Block, BlockIndex, BlockedUnitRange, blocks

# TODO: Delete this. This function was replaced
# by `stored_length` but is still used in `NDTensors`.
function nonzero_keys end

abstract type AbstractBlockSparseArray{T,N} <: AbstractBlockArray{T,N} end

## Base `AbstractArray` interface
Expand Down
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
ArrayLayouts = "4c555306-a7a7-4459-81d9-ec55ddd5c99a"
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e"
Expand All @@ -10,7 +11,6 @@ GradedUnitRanges = "e2de450a-8a67-46c7-b59c-01d5a3d041c5"
JLArrays = "27aeb0d3-9eb9-45fb-866b-73c2ecf80fcb"
LabelledNumbers = "f856a3a6-4152-4ec4-b2a7-02c1a55d7993"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
NDTensors = "23ae76d9-e61a-49c4-8f12-3f1a16adf9cf"
NestedPermutedDimsArrays = "2c2a8ec4-3cfc-4276-aa3e-1307b4294e58"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
21 changes: 9 additions & 12 deletions test/basics/test_basics.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Adapt: adapt
using ArrayLayouts: zero!
using BlockArrays:
Block,
Expand Down Expand Up @@ -28,22 +29,18 @@ using BlockSparseArrays:
blocktype,
view!
using GPUArraysCore: @allowscalar
using JLArrays: JLArray
using LinearAlgebra: Adjoint, Transpose, dot, mul!, norm
using NDTensors.GPUArraysCoreExtensions: cpu
using SparseArraysBase: SparseArrayDOK, SparseMatrixDOK, SparseVectorDOK, storedlength
using TensorAlgebra: contract
using Test: @test, @test_broken, @test_throws, @testset, @inferred
include("TestBlockSparseArraysUtils.jl")

using NDTensors: NDTensors
include(joinpath(pkgdir(NDTensors), "test", "NDTensorsTestUtils", "NDTensorsTestUtils.jl"))
using .NDTensorsTestUtils: devices_list, is_supported_eltype
@testset "BlockSparseArrays (dev=$dev, eltype=$elt)" for dev in devices_list(copy(ARGS)),
arrayts = (Array, JLArray)
@testset "BlockSparseArrays (arraytype=$arrayt, eltype=$elt)" for arrayt in arrayts,
elt in (Float32, Float64, Complex{Float32}, Complex{Float64})

if !is_supported_eltype(dev, elt)
continue
end
dev(a) = adapt(arrayt, a)
@testset "Broken" begin
# TODO: Fix this and turn it into a proper test.
a = dev(BlockSparseArray{elt}([2, 3], [2, 3]))
Expand Down Expand Up @@ -268,7 +265,7 @@ using .NDTensorsTestUtils: devices_list, is_supported_eltype
@test storedlength(a) == 2 * 4 + 3 * 3

# TODO: Broken on GPU.
if dev cpu
if arrayt Array
a = dev(BlockSparseArray{elt}([2, 3], [3, 4]))
@test_broken a[Block(1, 2)] .= 2
end
Expand All @@ -285,7 +282,7 @@ using .NDTensorsTestUtils: devices_list, is_supported_eltype
@test storedlength(a) == 2 * 4

# TODO: Broken on GPU.
if dev cpu
if arrayt Array
a = dev(BlockSparseArray{elt}([2, 3], [3, 4]))
@test_broken a[Block(1, 2)] .= 0
end
Expand Down Expand Up @@ -321,15 +318,15 @@ using .NDTensorsTestUtils: devices_list, is_supported_eltype
@test iszero(b)
@test iszero(storedlength(b))
# TODO: Broken on GPU.
@test iszero(c) broken = dev cpu
@test iszero(c) broken = arrayt Array
@test iszero(storedlength(c))
@allowscalar a[5, 7] = 1
@test !iszero(a)
@test storedlength(a) == 3 * 4
@test !iszero(b)
@test storedlength(b) == 3 * 4
# TODO: Broken on GPU.
@test !iszero(c) broken = dev cpu
@test !iszero(c) broken = arrayt Array
@test storedlength(c) == 3 * 4
d = @view a[1:4, 1:6]
@test iszero(d)
Expand Down

0 comments on commit 6484a11

Please sign in to comment.