14 #include "DeviceMemory.h"
15 #include "MemorySpace.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;
45 MemorySpace space = MemorySpace::Device);
47 MemorySpace space = MemorySpace::Device);
54 const IndexT sizes[Dim],
56 MemorySpace space = MemorySpace::Device);
58 std::initializer_list<IndexT> sizes,
60 MemorySpace space = MemorySpace::Device);
65 const IndexT sizes[Dim],
66 MemorySpace space = MemorySpace::Device);
68 std::initializer_list<IndexT> sizes,
69 MemorySpace space = MemorySpace::Device);
74 const IndexT sizes[Dim],
76 MemorySpace space = MemorySpace::Device);
81 MemorySpace space = MemorySpace::Device);
88 MemorySpace space = MemorySpace::Device);
92 zero(cudaStream_t stream);
115 #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.