"vscode:/vscode.git/clone" did not exist on "401e7aeea6776cd2b50334614d3002d6c4d8984c"
Unverified Commit 7d19b33c authored by mozga-intel's avatar mozga-intel Committed by GitHub
Browse files

OMP pragma was added to support hetero_graph loop. (#2148)



* OMP pragma was added to support hetero_graph loop, as follows:
pragma omp parallel for

* OMP pragma will be enabled iff the gpu is used for
Co-authored-by: default avatarZihao Ye <expye@outlook.com>
parent 8a4520d5
......@@ -605,7 +605,10 @@ DGL_REGISTER_GLOBAL("heterograph_index._CAPI_DGLHeteroCreateFormat")
.set_body([] (DGLArgs args, DGLRetValue* rv) {
HeteroGraphRef hg = args[0];
dgl_format_code_t code = hg->GetRelationGraph(0)->GetAllowedFormats();
for (dgl_type_t etype = 0; etype < hg->NumEdgeTypes(); ++etype) {
#if !defined(DGL_USE_CUDA)
#pragma omp parallel for
#endif
for (int64_t etype = 0; etype < hg->NumEdgeTypes(); ++etype) {
auto bg = std::dynamic_pointer_cast<UnitGraph>(hg->GetRelationGraph(etype));
for (auto format : CodeToSparseFormats(code))
bg->GetFormat(format);
......
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