Skip to content

Commit

Permalink
[Build or bug?] Fix VS2019 compilation error in randomwalk GPU kernel (
Browse files Browse the repository at this point in the history
…dmlc#3788)

* Update randomwalk_gpu.cu

* Update randomwalk_gpu.cu
  • Loading branch information
BarclayII authored Feb 28, 2022
1 parent 8425c93 commit 6e1c699
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/graph/sampling/randomwalks/randomwalk_gpu.cu
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ std::pair<IdArray, IdArray> RandomWalkUniform(
IdType *traces_data = traces.Ptr<IdType>();
IdType *eids_data = eids.Ptr<IdType>();

GraphKernelData<IdType> h_graphs[num_etypes];
std::vector<GraphKernelData<IdType>> h_graphs(num_etypes);
DGLContext ctx;
for (int64_t etype = 0; etype < num_etypes; ++etype) {
const CSRMatrix &csr = hg->GetCSRMatrix(etype);
Expand All @@ -127,7 +127,7 @@ std::pair<IdArray, IdArray> RandomWalkUniform(
device->AllocWorkspace(ctx, (num_etypes) * sizeof(GraphKernelData<IdType>)));
auto d_metapath_data = metapath_data;
// copy graph metadata pointers to GPU
device->CopyDataFromTo(h_graphs, 0, d_graphs, 0,
device->CopyDataFromTo(h_graphs.data(), 0, d_graphs, 0,
(num_etypes) * sizeof(GraphKernelData<IdType>),
DGLContext{kDLCPU, 0},
ctx,
Expand Down

0 comments on commit 6e1c699

Please sign in to comment.