Skip to content

Commit 8cff802

Browse files
r-barnesmeta-codesync[bot]
authored andcommitted
Fix deprecated this capture in faiss/gpu/GpuIcmEncoder.cu +1
Summary: In the future LLVM will require that lambdas capture `this` explicitly. `-Wdeprecated-this-capture` checks for and enforces this now. This diff adds an explicit `this` capture to a lambda to fix an issue that presents similarly to this: ``` -> fbcode/path/to/my_file.cpp:66:47: error: implicit capture of 'this' with a capture default of '=' is deprecated [-Werror,- Wdeprecated-this-capture] -> detail::createIOWorkerProvider(evb, requestsRegistry_); -> ^ -> fbcode/path/to/my_file.cpp:61:30: note: add an explicit capture of 'this' to capture '*this' by reference -> evb->runInEventBaseThread([=, self_weak = std::move(self_weak)]() { -> ^ -> , this ``` Differential Revision: D87785090 fbshipit-source-id: 1a4f6a9be99118d900f27967110f80b2665f4cb0
1 parent f5405d5 commit 8cff802

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

faiss/gpu/GpuIcmEncoder.cu

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ GpuIcmEncoder::GpuIcmEncoder(
7070
GpuIcmEncoder::~GpuIcmEncoder() {}
7171

7272
void GpuIcmEncoder::set_binary_term() {
73-
auto fn = [=](int idx, IcmEncoderImpl* encoder) {
73+
auto fn = [lsq = lsq](int idx, IcmEncoderImpl* encoder) {
7474
encoder->setBinaryTerm(lsq->codebooks.data());
7575
};
7676
shards->runOnShards(fn);

0 commit comments

Comments
 (0)