Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
6897f55a
Unverified
Commit
6897f55a
authored
Nov 26, 2020
by
IzabelaMazur
Committed by
GitHub
Nov 26, 2020
Browse files
[Performance]: Remove indptr correction for CooToCSR (#2356)
parent
00edb949
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
8 deletions
+1
-8
src/array/cpu/spmat_op_impl_coo.cc
src/array/cpu/spmat_op_impl_coo.cc
+1
-8
No files found.
src/array/cpu/spmat_op_impl_coo.cc
View file @
6897f55a
...
...
@@ -341,6 +341,7 @@ CSRMatrix COOToCSR(COOMatrix coo) {
}
else
{
// compute indptr
IdType
*
Bp
=
static_cast
<
IdType
*>
(
ret_indptr
->
data
);
*
(
Bp
++
)
=
0
;
std
::
fill
(
Bp
,
Bp
+
N
,
0
);
for
(
int64_t
i
=
0
;
i
<
NNZ
;
++
i
)
{
Bp
[
row_data
[
i
]]
++
;
...
...
@@ -352,7 +353,6 @@ CSRMatrix COOToCSR(COOMatrix coo) {
Bp
[
i
]
=
cumsum
;
cumsum
+=
temp
;
}
Bp
[
N
]
=
NNZ
;
// compute indices and data
ret_indices
=
NDArray
::
Empty
({
NNZ
},
coo
.
row
->
dtype
,
coo
.
row
->
ctx
);
...
...
@@ -366,13 +366,6 @@ CSRMatrix COOToCSR(COOMatrix coo) {
Bx
[
Bp
[
r
]]
=
data
?
data
[
i
]
:
i
;
Bp
[
r
]
++
;
}
// correct the indptr
for
(
int64_t
i
=
0
,
last
=
0
;
i
<=
N
;
++
i
)
{
IdType
temp
=
Bp
[
i
];
Bp
[
i
]
=
last
;
last
=
temp
;
}
}
return
CSRMatrix
(
coo
.
num_rows
,
coo
.
num_cols
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment