Skip to content

Commit

Permalink
Possible fix for ANN
Browse files Browse the repository at this point in the history
  • Loading branch information
viclafargue committed Jan 26, 2021
1 parent 6b5e7ff commit 6004bd9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions cpp/include/cuml/neighbors/knn.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ struct knnIndex {
~knnIndex() {
delete index;
delete gpu_res;

// to check that destructor is not called twice
index = nullptr;
gpu_res = nullptr;
}
};

Expand Down
5 changes: 3 additions & 2 deletions cpp/src_prims/selection/knn.cuh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019-2020, NVIDIA CORPORATION.
* Copyright (c) 2019-2021, NVIDIA CORPORATION.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -270,7 +270,8 @@ void approx_knn_build_index(ML::knnIndex *index, ML::knnIndexParam *params,

faiss::gpu::StandardGpuResources *gpu_res =
new faiss::gpu::StandardGpuResources();
gpu_res->noTempMemory();
//gpu_res->noTempMemory();
gpu_res->setTempMemory(3000000000);
gpu_res->setCudaMallocWarning(false);
gpu_res->setDefaultStream(device, userStream);
index->gpu_res = gpu_res;
Expand Down

0 comments on commit 6004bd9

Please sign in to comment.