<divclass="line"><aname="l00002"></a><spanclass="lineno"> 2</span> <spanclass="comment"> * Copyright (c) Facebook, Inc. and its affiliates.</span></div>
<divclass="line"><aname="l00004"></a><spanclass="lineno"> 4</span> <spanclass="comment"> * This source code is licensed under the MIT license found in the</span></div>
<divclass="line"><aname="l00005"></a><spanclass="lineno"> 5</span> <spanclass="comment"> * LICENSE file in the root directory of this source tree.</span></div>
<divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="comment"> /// GPU device on which the index is resident</span></div>
<divclass="line"><aname="l00027"></a><spanclass="lineno"> 27</span> <spanclass="comment"> /// What memory space to use for primary storage.</span></div>
<divclass="line"><aname="l00028"></a><spanclass="lineno"> 28</span> <spanclass="comment"> /// On Pascal and above (CC 6+) architectures, allows GPUs to use</span></div>
<divclass="line"><aname="l00029"></a><spanclass="lineno"> 29</span> <spanclass="comment"> /// more memory than is available on the GPU.</span></div>
<divclass="line"><aname="l00048"></a><spanclass="lineno"> 48</span> <spanclass="comment"> /// Set the minimum data size for searches (in MiB) for which we use</span></div>
<divclass="line"><aname="l00049"></a><spanclass="lineno"> 49</span> <spanclass="comment"> /// CPU -> GPU paging</span></div>
<divclass="line"><aname="l00052"></a><spanclass="lineno"> 52</span> <spanclass="comment"> /// Returns the current minimum data size for paged searches</span></div>
<divclass="line"><aname="l00055"></a><spanclass="lineno"> 55</span> <spanclass="comment"> /// `x` can be resident on the CPU or any GPU; copies are performed</span></div>
<divclass="line"><aname="l00056"></a><spanclass="lineno"> 56</span> <spanclass="comment"> /// as needed</span></div>
<divclass="line"><aname="l00057"></a><spanclass="lineno"> 57</span> <spanclass="comment"> /// Handles paged adds if the add set is too large; calls addInternal_</span></div>
<divclass="line"><aname="l00060"></a><spanclass="lineno"> 60</span> <spanclass="comment"> /// `x` and `ids` can be resident on the CPU or any GPU; copies are</span></div>
<divclass="line"><aname="l00061"></a><spanclass="lineno"> 61</span> <spanclass="comment"> /// performed as needed</span></div>
<divclass="line"><aname="l00062"></a><spanclass="lineno"> 62</span> <spanclass="comment"> /// Handles paged adds if the add set is too large; calls addInternal_</span></div>
<divclass="line"><aname="l00067"></a><spanclass="lineno"> 67</span> <spanclass="comment"> /// `x`, `distances` and `labels` can be resident on the CPU or any</span></div>
<divclass="line"><aname="l00068"></a><spanclass="lineno"> 68</span> <spanclass="comment"> /// GPU; copies are performed as needed</span></div>
<divclass="line"><aname="l00076"></a><spanclass="lineno"> 76</span> <spanclass="comment"> /// Does addImpl_ require IDs? If so, and no IDs are provided, we will</span></div>
<divclass="line"><aname="l00077"></a><spanclass="lineno"> 77</span> <spanclass="comment"> /// generate them sequentially based on the order in which the IDs are added</span></div>
<divclass="line"><aname="l00080"></a><spanclass="lineno"> 80</span> <spanclass="comment"> /// Overridden to actually perform the add</span></div>
<divclass="line"><aname="l00081"></a><spanclass="lineno"> 81</span> <spanclass="comment"> /// All data is guaranteed to be resident on our device</span></div>
<divclass="line"><aname="l00086"></a><spanclass="lineno"> 86</span> <spanclass="comment"> /// Overridden to actually perform the search</span></div>
<divclass="line"><aname="l00087"></a><spanclass="lineno"> 87</span> <spanclass="comment"> /// All data is guaranteed to be resident on our device</span></div>
<divclass="line"><aname="l00095"></a><spanclass="lineno"> 95</span> <spanclass="comment"> /// Handles paged adds if the add set is too large, passes to</span></div>
<divclass="line"><aname="l00096"></a><spanclass="lineno"> 96</span> <spanclass="comment"> /// addImpl_ to actually perform the add for the current page</span></div>
<divclass="line"><aname="l00101"></a><spanclass="lineno"> 101</span> <spanclass="comment"> /// Calls addImpl_ for a single page of GPU-resident data</span></div>
<divclass="line"><aname="l00106"></a><spanclass="lineno"> 106</span> <spanclass="comment"> /// Calls searchImpl_ for a single page of GPU-resident data</span></div>
<divclass="line"><aname="l00113"></a><spanclass="lineno"> 113</span> <spanclass="comment"> /// Calls searchImpl_ for a single page of GPU-resident data,</span></div>
<divclass="line"><aname="l00114"></a><spanclass="lineno"> 114</span> <spanclass="comment"> /// handling paging of the data and copies from the CPU</span></div>
<divclass="line"><aname="l00128"></a><spanclass="lineno"> 128</span> <spanclass="comment"> /// The memory space of our primary storage on the GPU</span></div>
<divclass="line"><aname="l00131"></a><spanclass="lineno"> 131</span> <spanclass="comment"> /// Size above which we page copies from the CPU to GPU</span></div>
<divclass="ttc"id="classfaiss_1_1gpu_1_1GpuIndex_html_adbdc96814ff2d4390dfd860bd5918203"><divclass="ttname"><ahref="classfaiss_1_1gpu_1_1GpuIndex.html#adbdc96814ff2d4390dfd860bd5918203">faiss::gpu::GpuIndex::getMinPagingSize</a></div><divclass="ttdeci">size_t getMinPagingSize() const </div><divclass="ttdoc">Returns the current minimum data size for paged searches. </div><divclass="ttdef"><b>Definition:</b><ahref="GpuIndex_8cu_source.html#l00074">GpuIndex.cu:74</a></div></div>
<divclass="ttc"id="classfaiss_1_1gpu_1_1GpuIndex_html_a184c443785b715fd692b2b67aa71d687"><divclass="ttname"><ahref="classfaiss_1_1gpu_1_1GpuIndex.html#a184c443785b715fd692b2b67aa71d687">faiss::gpu::GpuIndex::searchImpl_</a></div><divclass="ttdeci">virtual void searchImpl_(int n, const float *x, int k, float *distances, Index::idx_t *labels) const =0</div></div>
<divclass="ttc"id="structfaiss_1_1gpu_1_1GpuIndexConfig_html_aab05a0aa7b42feae7df4e556a52ead57"><divclass="ttname"><ahref="structfaiss_1_1gpu_1_1GpuIndexConfig.html#aab05a0aa7b42feae7df4e556a52ead57">faiss::gpu::GpuIndexConfig::device</a></div><divclass="ttdeci">int device</div><divclass="ttdoc">GPU device on which the index is resident. </div><divclass="ttdef"><b>Definition:</b><ahref="GpuIndex_8h_source.html#l00025">GpuIndex.h:25</a></div></div>
<divclass="ttc"id="classfaiss_1_1gpu_1_1GpuIndex_html_a47f6969fe60d82b8e3407557ba9eec88"><divclass="ttname"><ahref="classfaiss_1_1gpu_1_1GpuIndex.html#a47f6969fe60d82b8e3407557ba9eec88">faiss::gpu::GpuIndex::add_with_ids</a></div><divclass="ttdeci">void add_with_ids(Index::idx_t n, const float *x, const Index::idx_t *ids) override</div><divclass="ttdef"><b>Definition:</b><ahref="GpuIndex_8cu_source.html#l00085">GpuIndex.cu:85</a></div></div>
<divclass="ttc"id="structfaiss_1_1Index_html_ad3f0d3071f987baabbdd3da4500c87ea"><divclass="ttname"><ahref="structfaiss_1_1Index.html#ad3f0d3071f987baabbdd3da4500c87ea">faiss::Index::idx_t</a></div><divclass="ttdeci">long idx_t</div><divclass="ttdoc">all indices are this type </div><divclass="ttdef"><b>Definition:</b><ahref="Index_8h_source.html#l00062">Index.h:62</a></div></div>
<divclass="ttc"id="classfaiss_1_1gpu_1_1GpuIndex_html_a67750633faa35677ee505a1e61cfe142"><divclass="ttname"><ahref="classfaiss_1_1gpu_1_1GpuIndex.html#a67750633faa35677ee505a1e61cfe142">faiss::gpu::GpuIndex::device_</a></div><divclass="ttdeci">const int device_</div><divclass="ttdoc">The GPU device we are resident on. </div><divclass="ttdef"><b>Definition:</b><ahref="GpuIndex_8h_source.html#l00126">GpuIndex.h:126</a></div></div>
<divclass="ttc"id="classfaiss_1_1gpu_1_1GpuIndex_html_a17b82a8a11783da6eb1b07c9aab98c36"><divclass="ttname"><ahref="classfaiss_1_1gpu_1_1GpuIndex.html#a17b82a8a11783da6eb1b07c9aab98c36">faiss::gpu::GpuIndex::resources_</a></div><divclass="ttdeci">GpuResources * resources_</div><divclass="ttdoc">Manages streams, cuBLAS handles and scratch memory for devices. </div><divclass="ttdef"><b>Definition:</b><ahref="GpuIndex_8h_source.html#l00123">GpuIndex.h:123</a></div></div>
<divclass="ttc"id="classfaiss_1_1gpu_1_1GpuIndex_html_af304169eac7781b573f76d545f37b7d9"><divclass="ttname"><ahref="classfaiss_1_1gpu_1_1GpuIndex.html#af304169eac7781b573f76d545f37b7d9">faiss::gpu::GpuIndex::memorySpace_</a></div><divclass="ttdeci">const MemorySpace memorySpace_</div><divclass="ttdoc">The memory space of our primary storage on the GPU. </div><divclass="ttdef"><b>Definition:</b><ahref="GpuIndex_8h_source.html#l00129">GpuIndex.h:129</a></div></div>
<divclass="ttc"id="classfaiss_1_1gpu_1_1GpuIndex_html_a32a08664fc4dca2f9405e07ea5bc206f"><divclass="ttname"><ahref="classfaiss_1_1gpu_1_1GpuIndex.html#a32a08664fc4dca2f9405e07ea5bc206f">faiss::gpu::GpuIndex::minPagedSize_</a></div><divclass="ttdeci">size_t minPagedSize_</div><divclass="ttdoc">Size above which we page copies from the CPU to GPU. </div><divclass="ttdef"><b>Definition:</b><ahref="GpuIndex_8h_source.html#l00132">GpuIndex.h:132</a></div></div>
<divclass="ttc"id="namespacefaiss_html_afd12191c638da74760ff397cf319752c"><divclass="ttname"><ahref="namespacefaiss.html#afd12191c638da74760ff397cf319752c">faiss::MetricType</a></div><divclass="ttdeci">MetricType</div><divclass="ttdoc">Some algorithms support both an inner product version and a L2 search version. </div><divclass="ttdef"><b>Definition:</b><ahref="Index_8h_source.html#l00044">Index.h:44</a></div></div>