Skip to content

Commit 85d58fb

Browse files
committed
Create common g_cached_npp_ctxs
1 parent 633c4b3 commit 85d58fb

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/torchcodec/_core/CUDACommon.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
// LICENSE file in the root directory of this source tree.
66

77
#include "src/torchcodec/_core/CUDACommon.h"
8+
#include "src/torchcodec/_core/Cache.h" // for PerGpuCache
89

910
namespace facebook::torchcodec {
1011

src/torchcodec/_core/NVDECCache.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ namespace facebook::torchcodec {
2222

2323
NVDECCache& NVDECCache::getCache(const torch::Device& device) {
2424
static NVDECCache cacheInstances[MAX_CUDA_GPUS];
25-
26-
int deviceIndex = getDeviceIndex(device);
27-
return cacheInstances[deviceIndex];
25+
return cacheInstances[getDeviceIndex(device)];
2826
}
2927

3028
UniqueCUvideodecoder NVDECCache::getDecoder(CUVIDEOFORMAT* videoFormat) {

0 commit comments

Comments
 (0)