faiss/gpu/impl/VectorResidual.cuh

40 lines
1.3 KiB
Plaintext
Raw Normal View History

2017-02-22 23:26:44 +01:00
/**
* Copyright (c) Facebook, Inc. and its affiliates.
2017-02-22 23:26:44 +01:00
*
* This source code is licensed under the MIT license found in the
2017-02-22 23:26:44 +01:00
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <faiss/gpu/utils/Tensor.cuh>
2017-02-22 23:26:44 +01:00
namespace faiss { namespace gpu {
// Calculates residual v_i - c_j for all v_i in vecs where j = vecToCentroid[i]
void runCalcResidual(Tensor<float, 2, true>& vecs,
Tensor<float, 2, true>& centroids,
Tensor<int, 1, true>& vecToCentroid,
Tensor<float, 2, true>& residuals,
cudaStream_t stream);
void runCalcResidual(Tensor<float, 2, true>& vecs,
Tensor<half, 2, true>& centroids,
Tensor<int, 1, true>& vecToCentroid,
Tensor<float, 2, true>& residuals,
cudaStream_t stream);
// Gather vectors
void runReconstruct(Tensor<int, 1, true>& listIds,
Tensor<float, 2, true>& vecs,
Tensor<float, 2, true>& out,
cudaStream_t stream);
void runReconstruct(Tensor<int, 1, true>& listIds,
Tensor<half, 2, true>& vecs,
Tensor<float, 2, true>& out,
cudaStream_t stream);
2017-02-22 23:26:44 +01:00
} } // namespace