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
Torchaudio
Commits
0b6ca28d
Unverified
Commit
0b6ca28d
authored
Oct 13, 2023
by
moto
Committed by
GitHub
Oct 13, 2023
Browse files
Do not compile CUDA helper for CPU build (#3657)
parent
fa78fb64
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
0 deletions
+4
-0
src/libtorio/ffmpeg/stream_reader/stream_processor.cpp
src/libtorio/ffmpeg/stream_reader/stream_processor.cpp
+2
-0
src/libtorio/ffmpeg/stream_writer/encode_process.cpp
src/libtorio/ffmpeg/stream_writer/encode_process.cpp
+2
-0
No files found.
src/libtorio/ffmpeg/stream_reader/stream_processor.cpp
View file @
0b6ca28d
...
...
@@ -27,6 +27,7 @@ AVCodecContextPtr alloc_codec_context(
return
AVCodecContextPtr
(
codec_ctx
);
}
#ifdef USE_CUDA
const
AVCodecHWConfig
*
get_cuda_config
(
const
AVCodec
*
codec
)
{
for
(
int
i
=
0
;;
++
i
)
{
const
AVCodecHWConfig
*
config
=
avcodec_get_hw_config
(
codec
,
i
);
...
...
@@ -80,6 +81,7 @@ enum AVPixelFormat get_hw_format(
TORCH_WARN
(
"Failed to get HW surface format."
);
return
AV_PIX_FMT_NONE
;
}
#endif // USE_CUDA
AVBufferRef
*
get_hw_frames_ctx
(
AVCodecContext
*
codec_ctx
)
{
AVBufferRef
*
p
=
av_hwframe_ctx_alloc
(
codec_ctx
->
hw_device_ctx
);
...
...
src/libtorio/ffmpeg/stream_writer/encode_process.cpp
View file @
0b6ca28d
...
...
@@ -527,6 +527,7 @@ void configure_video_codec_ctx(
}
}
#ifdef USE_CUDA
void
configure_hw_accel
(
AVCodecContext
*
ctx
,
const
std
::
string
&
hw_accel
)
{
torch
::
Device
device
{
hw_accel
};
TORCH_CHECK
(
...
...
@@ -570,6 +571,7 @@ void configure_hw_accel(AVCodecContext* ctx, const std::string& hw_accel) {
"Failed to initialize CUDA frame context: "
,
av_err2string
(
ret
));
}
#endif // USE_CUDA
////////////////////////////////////////////////////////////////////////////////
// AVStream
...
...
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