Faiss
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends
GpuIndex.cu
1 
2 /**
3  * Copyright (c) 2015-present, Facebook, Inc.
4  * All rights reserved.
5  *
6  * This source code is licensed under the CC-by-NC license found in the
7  * LICENSE file in the root directory of this source tree.
8  */
9 
10 // Copyright 2004-present Facebook. All Rights Reserved.
11 
12 #include "GpuIndex.h"
13 #include "../FaissAssert.h"
14 #include "GpuResources.h"
15 #include "utils/DeviceUtils.h"
16 
17 namespace faiss { namespace gpu {
18 
19 GpuIndex::GpuIndex(GpuResources* resources,
20  int device,
21  int dims,
22  faiss::MetricType metric) :
23  Index(dims, metric),
24  resources_(resources),
25  device_(device) {
26  FAISS_ASSERT(device_ < getNumDevices());
27 
28  FAISS_ASSERT(resources_);
29  resources_->initializeForDevice(device_);
30 }
31 
32 } } // namespace
MetricType
Some algorithms support both an inner product vetsion and a L2 search version.
Definition: Index.h:44