Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
6db54fb7
"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "7186bb45f00adb36a880bd30d41cfddb12faae11"
Unverified
Commit
6db54fb7
authored
Mar 31, 2022
by
Nicolas Hug
Committed by
GitHub
Mar 31, 2022
Browse files
Make nvjpeg handle creation once_flag static (#5713)
parent
88aaf51e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torchvision/csrc/io/image/cuda/decode_jpeg_cuda.cpp
torchvision/csrc/io/image/cuda/decode_jpeg_cuda.cpp
+1
-1
No files found.
torchvision/csrc/io/image/cuda/decode_jpeg_cuda.cpp
View file @
6db54fb7
...
@@ -71,7 +71,7 @@ torch::Tensor decode_jpeg_cuda(
...
@@ -71,7 +71,7 @@ torch::Tensor decode_jpeg_cuda(
at
::
cuda
::
CUDAGuard
device_guard
(
device
);
at
::
cuda
::
CUDAGuard
device_guard
(
device
);
// Create global nvJPEG handle
// Create global nvJPEG handle
std
::
once_flag
nvjpeg_handle_creation_flag
;
static
std
::
once_flag
nvjpeg_handle_creation_flag
;
std
::
call_once
(
nvjpeg_handle_creation_flag
,
[]()
{
std
::
call_once
(
nvjpeg_handle_creation_flag
,
[]()
{
if
(
nvjpeg_handle
==
nullptr
)
{
if
(
nvjpeg_handle
==
nullptr
)
{
nvjpegStatus_t
create_status
=
nvjpegCreateSimple
(
&
nvjpeg_handle
);
nvjpegStatus_t
create_status
=
nvjpegCreateSimple
(
&
nvjpeg_handle
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment