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
ca144886
Unverified
Commit
ca144886
authored
Nov 15, 2022
by
Quan (Andy) Gan
Committed by
GitHub
Nov 15, 2022
Browse files
Revert "[Kernel] Parallel find edges (#4878)" (#4899)
This reverts commit
00c27cb2
.
parent
5b193f9b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
src/array/cpu/array_index_select.cc
src/array/cpu/array_index_select.cc
+4
-11
No files found.
src/array/cpu/array_index_select.cc
View file @
ca144886
...
@@ -4,7 +4,6 @@
...
@@ -4,7 +4,6 @@
* @brief Array index select CPU implementation
* @brief Array index select CPU implementation
*/
*/
#include <dgl/array.h>
#include <dgl/array.h>
#include <dgl/runtime/parallel_for.h>
namespace
dgl
{
namespace
dgl
{
using
runtime
::
NDArray
;
using
runtime
::
NDArray
;
...
@@ -23,16 +22,10 @@ NDArray IndexSelect(NDArray array, IdArray index) {
...
@@ -23,16 +22,10 @@ NDArray IndexSelect(NDArray array, IdArray index) {
const
int64_t
len
=
index
->
shape
[
0
];
const
int64_t
len
=
index
->
shape
[
0
];
NDArray
ret
=
NDArray
::
Empty
({
len
},
array
->
dtype
,
array
->
ctx
);
NDArray
ret
=
NDArray
::
Empty
({
len
},
array
->
dtype
,
array
->
ctx
);
DType
*
ret_data
=
static_cast
<
DType
*>
(
ret
->
data
);
DType
*
ret_data
=
static_cast
<
DType
*>
(
ret
->
data
);
runtime
::
parallel_for
(
for
(
int64_t
i
=
0
;
i
<
len
;
++
i
)
{
0
,
len
,
1000
,
// Thread scheduling overhead is bigger with tiny grain size.
[
idx_data
,
arr_len
,
ret_data
,
array_data
]
(
size_t
begin
,
size_t
end
)
{
for
(
size_t
i
=
begin
;
i
<
end
;
++
i
)
{
CHECK_LT
(
idx_data
[
i
],
arr_len
)
<<
"Index out of range."
;
CHECK_LT
(
idx_data
[
i
],
arr_len
)
<<
"Index out of range."
;
ret_data
[
i
]
=
array_data
[
idx_data
[
i
]];
ret_data
[
i
]
=
array_data
[
idx_data
[
i
]];
}
}
});
return
ret
;
return
ret
;
}
}
...
...
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