Skip to content

Commit d40adca

Browse files
Add midding hipStream SWIG typedef to fix ROCm memleak in Python (#3760)
Summary: Pull Request resolved: #3760 This fixes the memleak and the warning received after running Python tests under ROCm since no destructor was declared and objects would remain allocated. Reviewed By: gtwang01 Differential Revision: D61357579 fbshipit-source-id: cf73bbd7a7002565a4224c1f0af0aa6ea5edebdb
1 parent afe9c40 commit d40adca

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

faiss/python/swigfaiss.swig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,8 @@ void gpu_sync_all_devices()
352352
%include <faiss/gpu-rocm/GpuResources.h>
353353
%include <faiss/gpu-rocm/StandardGpuResources.h>
354354

355+
typedef ihipStream_t* hipStream_t;
356+
355357
%inline %{
356358

357359
// interop between pytorch exposed hipStream_t and faiss

0 commit comments

Comments
 (0)