"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "35e9209601fede76558cb1a97cbf656df0c8075d"
Unverified Commit ca144886 authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by GitHub
Browse files

Revert "[Kernel] Parallel find edges (#4878)" (#4899)

This reverts commit 00c27cb2.
parent 5b193f9b
......@@ -4,7 +4,6 @@
* @brief Array index select CPU implementation
*/
#include <dgl/array.h>
#include <dgl/runtime/parallel_for.h>
namespace dgl {
using runtime::NDArray;
......@@ -23,16 +22,10 @@ NDArray IndexSelect(NDArray array, IdArray index) {
const int64_t len = index->shape[0];
NDArray ret = NDArray::Empty({len}, array->dtype, array->ctx);
DType* ret_data = static_cast<DType*>(ret->data);
runtime::parallel_for(
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.";
ret_data[i] = array_data[idx_data[i]];
}
});
for (int64_t i = 0; i < len; ++i) {
CHECK_LT(idx_data[i], arr_len) << "Index out of range.";
ret_data[i] = array_data[idx_data[i]];
}
return ret;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment