Skip to content

Commit bb1741c

Browse files
committed
Handle fbcode logic
1 parent d6c3289 commit bb1741c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/torchcodec/_core/NVCUVIDRuntimeLoader.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@
44
// This source code is licensed under the BSD-style license found in the
55
// LICENSE file in the root directory of this source tree.
66

7+
#ifdef FBCODE_CAFFE2
8+
// No need to do anything on fbcode. NVCUVID is available there, we can take a
9+
// hard dependency on it.
10+
// The FBCODE_CAFFE2 macro is defined in the upstream fbcode build of torch, so
11+
// we can rely on it, that's what torch does too.
12+
13+
namespace facebook::torchcodec {
14+
bool loadNVCUVIDLibrary() {
15+
return true;
16+
}
17+
} // namespace facebook::torchcodec
18+
#else
19+
720
#include "src/torchcodec/_core/NVCUVIDRuntimeLoader.h"
821

922
#include "src/torchcodec/_core/nvcuvid_include/cuviddec.h"
@@ -303,3 +316,5 @@ cuvidUnmapVideoFrame64(CUvideodecoder decoder, unsigned long long framePtr) {
303316
}
304317

305318
} // extern "C"
319+
320+
#endif // FBCODE_CAFFE2

0 commit comments

Comments
 (0)