"examples/git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "5c48fe1fb087ef2cc7c1645c06e246349dd66a49"
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 @@
#define DGL_ARRAY_CPU_ARRAY_UTILS_H_
#include <dgl/aten/types.h>
#include <dgl/runtime/parallel_for.h>
#include <parallel_hashmap/phmap.h>
#include <unordered_map>
......@@ -82,13 +81,9 @@ class IdHashMap {
const IdType* ids_data = static_cast<IdType*>(ids->data);
const int64_t len = ids->shape[0];
IdArray values = NewIdArray(len, ids->ctx, ids->dtype.bits);
IdType* values_data = values.Ptr<IdType>();
runtime::parallel_for(
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);
}
});
IdType* values_data = static_cast<IdType*>(values->data);
for (int64_t i = 0; i < len; ++i)
values_data[i] = Map(ids_data[i], default_val);
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