15 #include "DeviceMemory.h"
17 namespace faiss {
namespace gpu {
22 typename IndexT = int,
23 template <
typename U>
class PtrTraits = traits::DefaultPtrTraits>
26 typedef IndexT IndexType;
27 typedef typename PtrTraits<T>::PtrType DataPtrType;
52 const IndexT sizes[Dim],
55 std::initializer_list<IndexT> sizes,
61 const IndexT sizes[Dim]);
63 std::initializer_list<IndexT> sizes);
68 const IndexT sizes[Dim],
83 zero(cudaStream_t stream);
105 #include "DeviceTensor-inl.cuh"
__host__ DeviceTensor< T, Dim, Contig, IndexT, PtrTraits > & operator=(DeviceTensor< T, Dim, Contig, IndexT, PtrTraits > &&t)
Move assignment.
__host__ __device__ DataPtrType data()
Returns a raw pointer to the start of our data.
__host__ DeviceTensor()
Default constructor.
__host__ DeviceTensor< T, Dim, Contig, IndexT, PtrTraits > & zero(cudaStream_t stream)
Call to zero out memory.
__host__ ~DeviceTensor()
Destructor.
__host__ __device__ const IndexT * strides() const
Returns the stride array.
__host__ __device__ const IndexT * sizes() const
Returns the size array.
Manages temporary memory allocations on a GPU device.