Open cjnolet opened 5 years ago
Where would you get the cudastream_t from? Is it some typedef of int?
From what I know, cudaStream_t
is defined by the CUDA runtime API, in the header cuda_runtime_api.h
.
It is defined in the CUDA SDK driver_types.h
as a pointer:
typedef __device_builtin__ struct CUstream_st *cudaStream_t;
We should get this to work so we can pass whatever the PyTorch stream equivalent as this pointer type.
In the meantime, if you want everything to be ordered wrt the default (null) stream, you can call
res.setDefaultNullStreamAllDevices()
I would suggest setting the Faiss stream to the default for now.
Otherwise SWIG handles unknown pointers smoothly. Just expose the function that produces the pointer and the one that consumes it in a header parsed by swig and the pointers will be passed around as expected.
The Python SWIG client exposes the setDefaultStream() function on the GPU resources object but it does not seem to provide any type conversion options to pass in a Python equivalent to the C++ cudastream_t.
Is there a recommended way to accomplish this?
Running on:
Interface: