<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="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment">/// A wrapper for gpu/impl/Distance.cuh to expose direct brute-force k-nearest</span></div>
<divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="comment">/// neighbor searches on an externally-provided region of memory (e.g., from a</span></div>
<divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="comment">/// The data (vectors, queries, outDistances, outIndices) can be resident on the</span></div>
<divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="comment">/// GPU or the CPU, but all calculations are performed on the GPU. If the result</span></div>
<divclass="line"><aname="l00022"></a><spanclass="lineno"> 22</span> <spanclass="comment">/// buffers are on the CPU, results will be copied back when done.</span></div>
<divclass="line"><aname="l00024"></a><spanclass="lineno"> 24</span> <spanclass="comment">/// All GPU computation is performed on the current CUDA device, and ordered</span></div>
<divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> <spanclass="comment">/// with respect to resources->getDefaultStreamCurrentDevice().</span></div>
<divclass="line"><aname="l00027"></a><spanclass="lineno"> 27</span> <spanclass="comment">/// For each vector in `queries`, searches all of `vectors` to find its k</span></div>
<divclass="line"><aname="l00028"></a><spanclass="lineno"> 28</span> <spanclass="comment">/// nearest neighbors with respect to the given metric</span></div>
<divclass="line"><aname="l00031"></a><spanclass="lineno"> 31</span> <spanclass="comment">// If vectorsRowMajor is true, this is</span></div>
<divclass="line"><aname="l00032"></a><spanclass="lineno"> 32</span> <spanclass="comment">// numVectors x dims, with dims innermost; otherwise,</span></div>
<divclass="line"><aname="l00033"></a><spanclass="lineno"> 33</span> <spanclass="comment">// dims x numVectors, with numVectors innermost</span></div>
<divclass="line"><aname="l00037"></a><spanclass="lineno"> 37</span> <spanclass="comment">// If queriesRowMajor is true, this is</span></div>
<divclass="line"><aname="l00038"></a><spanclass="lineno"> 38</span> <spanclass="comment">// numQueries x dims, with dims innermost; otherwise,</span></div>
<divclass="line"><aname="l00039"></a><spanclass="lineno"> 39</span> <spanclass="comment">// dims x numQueries, with numQueries innermost</span></div>
<divclass="line"><aname="l00045"></a><spanclass="lineno"> 45</span> <spanclass="comment">// A region of memory size numQueries x k, with k</span></div>
<divclass="line"><aname="l00048"></a><spanclass="lineno"> 48</span> <spanclass="comment">// A region of memory size numQueries x k, with k</span></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="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>