Unverified Commit 5b193f9b authored by Quan (Andy) Gan's avatar Quan (Andy) Gan Committed by GitHub
Browse files

Revert "[Performance] Make IdHashMap parallel (#4881)" (#4898)

This reverts commit 56962858.
parent 56962858
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#define DGL_ARRAY_CPU_ARRAY_UTILS_H_ #define DGL_ARRAY_CPU_ARRAY_UTILS_H_
#include <dgl/aten/types.h> #include <dgl/aten/types.h>
#include <dgl/runtime/parallel_for.h>
#include <parallel_hashmap/phmap.h> #include <parallel_hashmap/phmap.h>
#include <unordered_map> #include <unordered_map>
...@@ -82,13 +81,9 @@ class IdHashMap { ...@@ -82,13 +81,9 @@ class IdHashMap {
const IdType* ids_data = static_cast<IdType*>(ids->data); const IdType* ids_data = static_cast<IdType*>(ids->data);
const int64_t len = ids->shape[0]; const int64_t len = ids->shape[0];
IdArray values = NewIdArray(len, ids->ctx, ids->dtype.bits); IdArray values = NewIdArray(len, ids->ctx, ids->dtype.bits);
IdType* values_data = values.Ptr<IdType>(); IdType* values_data = static_cast<IdType*>(values->data);
runtime::parallel_for( for (int64_t i = 0; i < len; ++i)
0, len, 1000, [=] (size_t begin, size_t end) {
for (size_t i = begin; i < end; ++i) {
values_data[i] = Map(ids_data[i], default_val); values_data[i] = Map(ids_data[i], default_val);
}
});
return values; return values;
} }
......
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