Skip to content

Commit e17a323

Browse files
datumboxfacebook-github-bot
authored andcommitted
[fbsync] Make nvjpeg handle creation once_flag static (#5713)
Reviewed By: NicolasHug Differential Revision: D35393163 fbshipit-source-id: 339bd0dd1ab3f61d32b154a937a9968bdbd54dbf
1 parent abb9492 commit e17a323

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

torchvision/csrc/io/image/cuda/decode_jpeg_cuda.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ torch::Tensor decode_jpeg_cuda(
7171
at::cuda::CUDAGuard device_guard(device);
7272

7373
// Create global nvJPEG handle
74-
std::once_flag nvjpeg_handle_creation_flag;
74+
static std::once_flag nvjpeg_handle_creation_flag;
7575
std::call_once(nvjpeg_handle_creation_flag, []() {
7676
if (nvjpeg_handle == nullptr) {
7777
nvjpegStatus_t create_status = nvjpegCreateSimple(&nvjpeg_handle);

0 commit comments

Comments
 (0)