mirror of
https://github.com/facebookresearch/faiss.git
synced 2026-10-12 02:13:36 +00:00
Summary: Pull Request resolved: https://github.com/facebookresearch/faiss/pull/5124 GCC 12.4 (used in the conda faiss-gpu build) miscompiles the SIMD histogram_16 code path, causing test_16bin_bounded_bigrange to fail in the CUDA 12.6 nightly. Fall back to the scalar implementation when compiling with GCC 12. 🤖 This diff was automatically generated by myclaw_faiss_monitor Reviewed By: junjieqi Differential Revision: D101598734 fbshipit-source-id: b33a42df0bc3385cfdc3fc3ab8dabba7e09c9cd8
31 lines
821 B
C++
31 lines
821 B
C++
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#include <gtest/gtest.h>
|
|
|
|
#include <faiss/utils/AlignedTable.h>
|
|
#include <faiss/utils/partitioning.h>
|
|
|
|
using namespace faiss;
|
|
|
|
using AlignedTableUint16 = AlignedTable<uint16_t>;
|
|
|
|
// GCC 12 miscompiles the AVX2 SIMD histogram. The conda packages
|
|
// now use GCC 12.4, so we fall back to scalar in partitioning.cpp.
|
|
TEST(TestPartitioning, TestPartitioningBigRange) {
|
|
auto n = 1024;
|
|
AlignedTableUint16 tab(n);
|
|
for (auto i = 0; i < n; i++) {
|
|
tab[i] = i * 64;
|
|
}
|
|
int32_t hist[16]{};
|
|
simd_histogram_16(tab.get(), n, 0, 12, hist);
|
|
for (auto i = 0; i < 16; i++) {
|
|
ASSERT_EQ(hist[i], 64);
|
|
}
|
|
}
|