Skip to content

Commit bfffd44

Browse files
Michael Norrisfacebook-github-bot
authored andcommitted
Resolve "incorrect-portions-license" errors: add no license lint to top of GPU files with both licenses (#3965)
Summary: This is the first diff in enabling linting. I wanted the diff which updates all files to be just the automated command and the .toml config files changes, so this diff is a preparation step. We need this because we get errors due to having both NVidia and FB license comment headers in the same files. See the errors in D64429711 under "linter-coverage-verification" signal. Context on linting: https://fb.workplace.com/groups/lintqa/posts/3762373340693743/?comment_id=3762915930639484&reply_comment_id=3763044163959994 Per OSS, we cannot remove the Nvidia notice: https://fb.workplace.com/groups/osssupport/posts/27179779734977284/?comment_id=27181801724775085&reply_comment_id=27181818148106776 Differential Revision: D64481766
1 parent 1a799d0 commit bfffd44

27 files changed

Lines changed: 36 additions & 22 deletions

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# @lint-ignore-every LICENSELINT
12
# Copyright (c) Facebook, Inc. and its affiliates.
23
# All rights reserved.
34
#

cmake/FindMKL.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Copyright (c) Facebook, Inc. and its affiliates.
1+
# @lint-ignore-every LICENSELINT
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
23
# All rights reserved.
34
#
45
# This source code is licensed under the BSD-style license found in the

cmake/link_to_faiss_lib.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Copyright (c) Facebook, Inc. and its affiliates.
1+
# @lint-ignore-every LICENSELINT
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
23
# All rights reserved.
34
#
45
# This source code is licensed under the BSD-style license found in the

faiss/gpu/GpuDistance.cu

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @lint-ignore-every LICENSELINT
12
/**
23
* Copyright (c) Facebook, Inc. and its affiliates.
34
*
@@ -51,20 +52,14 @@ using namespace raft::distance;
5152
using namespace raft::neighbors;
5253
#endif
5354

54-
/// Caches device major version
55-
int device_major_version = -1;
56-
5755
bool should_use_raft(GpuDistanceParams args) {
58-
if (device_major_version < 0) {
59-
cudaDeviceProp prop;
60-
int dev = args.device >= 0 ? args.device : getCurrentDevice();
61-
cudaGetDeviceProperties(&prop, dev);
62-
device_major_version = prop.major;
63-
}
56+
cudaDeviceProp prop;
57+
int dev = args.device >= 0 ? args.device : getCurrentDevice();
58+
cudaGetDeviceProperties(&prop, dev);
6459

65-
if (device_major_version < 7)
60+
if (prop.major < 7)
6661
return false;
67-
62+
int x; // test this useless variable lint still works?
6863
return args.use_raft;
6964
}
7065

faiss/gpu/GpuIndex.cu

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,11 @@ constexpr idx_t kAddVecSize = (idx_t)512 * 1024;
4242
// FIXME: parameterize based on algorithm need
4343
constexpr idx_t kSearchVecSize = (idx_t)32 * 1024;
4444

45-
/// Caches device major version
46-
extern int device_major_version;
47-
4845
bool should_use_raft(GpuIndexConfig config_) {
49-
if (device_major_version < 0) {
50-
cudaDeviceProp prop;
51-
cudaGetDeviceProperties(&prop, config_.device);
52-
device_major_version = prop.major;
53-
}
46+
cudaDeviceProp prop;
47+
cudaGetDeviceProperties(&prop, config_.device);
5448

55-
if (device_major_version < 7)
49+
if (prop.major < 7)
5650
return false;
5751

5852
return config_.use_raft;

faiss/gpu/GpuIndex.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @lint-ignore-every LICENSELINT
12
/**
23
* Copyright (c) Facebook, Inc. and its affiliates.
34
*

faiss/gpu/GpuIndexCagra.cu

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @lint-ignore-every LICENSELINT
12
/**
23
* Copyright (c) Facebook, Inc. and its affiliates.
34
*

faiss/gpu/GpuIndexCagra.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @lint-ignore-every LICENSELINT
12
/**
23
* Copyright (c) Facebook, Inc. and its affiliates.
34
*

faiss/gpu/GpuResources.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @lint-ignore-every LICENSELINT
12
/**
23
* Copyright (c) Facebook, Inc. and its affiliates.
34
*

faiss/gpu/GpuResources.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// @lint-ignore-every LICENSELINT
12
/**
23
* Copyright (c) Facebook, Inc. and its affiliates.
34
*

0 commit comments

Comments
 (0)