Conversation
Contributor
|
Your PR requires formatting changes to meet the project's style guidelines. Click here to view the suggested changes.diff --git a/src/host/sparse.jl b/src/host/sparse.jl
index 349e1f1..2335368 100644
--- a/src/host/sparse.jl
+++ b/src/host/sparse.jl
@@ -902,12 +902,12 @@ function Broadcast.copy(bc::Broadcasted{<:Union{GPUSparseVecStyle,GPUSparseMatSt
args = (bc.f, output, offsets, bc.args...)
kernel = sparse_to_sparse_broadcast_kernel(get_backend(bc.args[first(sparse_args)]))
ndrange = if sparse_typ <: AbstractGPUSparseVector
- output.nnz
- elseif sparse_typ <: AbstractGPUSparseMatrixCSC
- size(output, 2)
- else
- size(output, 1)
- end
+ output.nnz
+ elseif sparse_typ <: AbstractGPUSparseMatrixCSC
+ size(output, 2)
+ else
+ size(output, 1)
+ end
else
args = sparse_typ <: AbstractGPUSparseVector ? (sparse_typ, bc.f, output, offsets, bc.args...) :
(sparse_typ, bc.f, output, bc.args...)
diff --git a/test/testsuite/sparse.jl b/test/testsuite/sparse.jl
index 3e0d92f..fd1dbad 100644
--- a/test/testsuite/sparse.jl
+++ b/test/testsuite/sparse.jl
@@ -285,13 +285,13 @@ function broadcasting_matrix(AT, eltypes)
@test z == SparseMatrixCSC(dz)
# create a matrix with nnz < leading_dim
- x = spdiagm(m, m, 2=>rand(ET, m - 2))
+ x = spdiagm(m, m, 2 => rand(ET, m - 2))
dx = AT(x)
y = ET(3) * x
dy = ET(3) * dx
@test y == SparseMatrixCSC(dy)
- x = spdiagm(m, m, -2=>rand(ET, m - 2))
+ x = spdiagm(m, m, -2 => rand(ET, m - 2))
dx = AT(x)
y = ET(3) * x
dy = ET(3) * dx |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.