All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
GpuIndex.h
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the CC-by-NC license found in the
* LICENSE file in the root directory of this source tree.
*/
// Copyright 2004-present Facebook. All Rights Reserved.
#pragma once
#include "../Index.h"
namespace faiss { namespace gpu {
class GpuResources;
class GpuIndex : public faiss::Index {
public:
GpuIndex(GpuResources* resources,
int device,
int dims,
faiss::MetricType metric);
inline int getDevice() const {
return device_;
}
GpuResources* getResources() {
return resources_;
}
// redeclare an abstract method to quiet SWIG warning
virtual void add(faiss::Index::idx_t,float const *) = 0;
protected:
/// Manages streans, cuBLAS handles and scratch memory for devices
GpuResources* resources_;
/// The GPU device we are resident on
int device_;
};
} } // namespace
faiss::gpu::GpuResources
Definition: GpuResources.h:24
faiss::gpu::GpuIndex
Definition: GpuIndex.h:20
faiss::gpu::GpuIndex::device_
int device_
The GPU device we are resident on.
Definition: GpuIndex.h:43
faiss::gpu::GpuIndex::add
virtual void add(faiss::Index::idx_t, float const *)=0
faiss::gpu::GpuIndex::resources_
GpuResources * resources_
Manages streans, cuBLAS handles and scratch memory for devices.
Definition: GpuIndex.h:40
faiss::Index::idx_t
long idx_t
all indices are this type
Definition: Index.h:64
faiss::Index
Definition: Index.h:61
faiss::MetricType
MetricType
Some algorithms support both an inner product vetsion and a L2 search version.
Definition: Index.h:44