File simdlib_neon.h

namespace faiss

Copyright (c) Facebook, Inc. and its affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.

Throughout the library, vectors are provided as float * pointers. Most algorithms can be optimized when several vectors are processed (added/searched) together in a batch. In this case, they are passed in as a matrix. When n vectors of size d are provided as float * x, component j of vector i is

x[ i * d + j ]

where 0 <= i < n and 0 <= j < d. In other words, matrices are always compact. When specifying the size of the matrix, we call it an n*d matrix, which implies a row-major storage.

Copyright (c) Facebook, Inc. and its affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. I/O functions can read/write to a filename, a file handle or to an object that abstracts the medium.

The read functions return objects that should be deallocated with delete. All references within these objectes are owned by the object.

Copyright (c) Facebook, Inc. and its affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Definition of inverted lists + a few common classes that implement the interface.

Copyright (c) Facebook, Inc. and its affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Since IVF (inverted file) indexes are of so much use for large-scale use cases, we group a few functions related to them in this small library. Most functions work both on IndexIVFs and IndexIVFs embedded within an IndexPreTransform.

Copyright (c) Facebook, Inc. and its affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. In this file are the implementations of extra metrics beyond L2 and inner product

Copyright (c) Facebook, Inc. and its affiliates.

This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree. Defines a few objects that apply transformations to a set of vectors Often these are pre-processing steps.

struct simd16uint16 : public faiss::simd256bit
#include <simdlib_avx2.h>
struct simd32uint8 : public faiss::simd256bit
struct simd8float32 : public faiss::simd256bit
struct simd8uint32 : public faiss::simd256bit
#include <simdlib_avx2.h>
namespace detail
namespace simdlib

Functions

static inline uint8x16x2_t reinterpret_u8(const uint8x16x2_t &v)
static inline uint8x16x2_t reinterpret_u8(const uint16x8x2_t &v)
static inline uint8x16x2_t reinterpret_u8(const uint32x4x2_t &v)
static inline uint8x16x2_t reinterpret_u8(const float32x4x2_t &v)
static inline uint16x8x2_t reinterpret_u16(const uint8x16x2_t &v)
static inline uint16x8x2_t reinterpret_u16(const uint16x8x2_t &v)
static inline uint16x8x2_t reinterpret_u16(const uint32x4x2_t &v)
static inline uint16x8x2_t reinterpret_u16(const float32x4x2_t &v)
static inline uint32x4x2_t reinterpret_u32(const uint8x16x2_t &v)
static inline uint32x4x2_t reinterpret_u32(const uint16x8x2_t &v)
static inline uint32x4x2_t reinterpret_u32(const uint32x4x2_t &v)
static inline uint32x4x2_t reinterpret_u32(const float32x4x2_t &v)
static inline float32x4x2_t reinterpret_f32(const uint8x16x2_t &v)
static inline float32x4x2_t reinterpret_f32(const uint16x8x2_t &v)
static inline float32x4x2_t reinterpret_f32(const uint32x4x2_t &v)
static inline float32x4x2_t reinterpret_f32(const float32x4x2_t &v)
static inline void bin(const char (&bytes)[32], char bits[257])
template<typename T, size_t N, typename S>
static inline void bin(const S &simd, char bits[257])
template<typename S>
static inline std::string bin(const S &simd)
template<typename D, typename F, typename T>
static inline void set1(D &d, F &&f, T t)
template<typename T, size_t N, typename S>
static inline std::string elements_to_string(const char *fmt, const S &simd)
template<typename T, typename F>
static inline T unary_func(const T &a, F &&f)
template<typename T, typename F>
static inline T binary_func(const T &a, const T &b, F &&f)
static inline uint16_t vmovmask_u8(const uint8x16_t &v)
template<uint16x8_t (*F)(uint16x8_t, uint16x8_t)>
static inline uint32_t cmp_xe32(const uint16x8x2_t &d0, const uint16x8x2_t &d1, const uint16x8x2_t &thr)
template<std::uint8_t Shift>
static inline uint16x8_t vshlq(uint16x8_t vec)
template<std::uint8_t Shift>
static inline uint16x8_t vshrq(uint16x8_t vec)
template<typename T, typename U = decltype(reinterpret_u8(std::declval<T>().data))>
struct is_simd256bit : public std::is_same<decltype(reinterpret_u8(std::declval<T>().data)), uint8x16x2_t>