-
Notifications
You must be signed in to change notification settings - Fork 606
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix DALI compilation for CUDA 11 pre 11.3 version #2925
Conversation
CI MESSAGE: [2337568]: BUILD STARTED |
CI MESSAGE: [2337569]: BUILD STARTED |
CI MESSAGE: [2337569]: BUILD FAILED |
CI MESSAGE: [2337568]: BUILD FAILED |
CI MESSAGE: [2337645]: BUILD STARTED |
CI MESSAGE: [2337646]: BUILD STARTED |
7b0a632
to
719352b
Compare
CI MESSAGE: [2337665]: BUILD STARTED |
CI MESSAGE: [2337667]: BUILD STARTED |
CI MESSAGE: [2337667]: BUILD PASSED |
CI MESSAGE: [2337665]: BUILD FAILED |
CI MESSAGE: [2337665]: BUILD PASSED |
@@ -74,7 +74,9 @@ class nvJPEGDecoder : public Operator<MixedBackend>, CachedDecoderImpl { | |||
nvjpeg2k_thread_(1, | |||
spec.GetArgument<int>("device_id"), | |||
spec.GetArgument<bool>("affine")) { | |||
#if NVJPEG_VER_MAJOR > 11 || (NVJPEG_VER_MAJOR == 11 && NVJPEG_VER_MINOR >= 1) | |||
#if NVJPEG_VER_MAJOR > 11 || \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can make this a macro so that we don't repeat it several times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
- fixes the if condition for enabling nvJPEG HW backend with ROI support Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
719352b
to
d769ea3
Compare
CI MESSAGE: [2341397]: BUILD STARTED |
CI MESSAGE: [2341439]: BUILD STARTED |
#define IF_HW_DECODER_COMPATIBLE \ | ||
NVJPEG_VER_MAJOR > 11 || \ | ||
(NVJPEG_VER_MAJOR == 11 && (NVJPEG_VER_MINOR > 4 || \ | ||
(NVJPEG_VER_MINOR == 4 && NVJPEG_VER_PATCH >= 1))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Normally when one defines such macro, the condition would be in parenthesis - otherwise there can be "interesting" results, like:
#if IF_HW_DECODER_COMPATIBLE && something
would resolve to:
#if NVJPEG_VER_MAJOR > 11 || \
(NVJPEG_VER_MAJOR == 11 && (NVJPEG_VER_MINOR > 4 || \
(NVJPEG_VER_MINOR == 4 && NVJPEG_VER_PATCH >= 1))) && something
The && something
only applies to the right hand side of ||
.
Therefore, it should be:
#define IF_HW_DECODER_COMPATIBLE \ | |
NVJPEG_VER_MAJOR > 11 || \ | |
(NVJPEG_VER_MAJOR == 11 && (NVJPEG_VER_MINOR > 4 || \ | |
(NVJPEG_VER_MINOR == 4 && NVJPEG_VER_PATCH >= 1))) | |
#define (IS_HW_DECODER_COMPATIBLE \ | |
NVJPEG_VER_MAJOR > 11 || \ | |
(NVJPEG_VER_MAJOR == 11 && (NVJPEG_VER_MINOR > 4 || \ | |
(NVJPEG_VER_MINOR == 4 && NVJPEG_VER_PATCH >= 1)))) |
or
#define IF_HW_DECODER_COMPATIBLE \ | |
NVJPEG_VER_MAJOR > 11 || \ | |
(NVJPEG_VER_MAJOR == 11 && (NVJPEG_VER_MINOR > 4 || \ | |
(NVJPEG_VER_MINOR == 4 && NVJPEG_VER_PATCH >= 1))) | |
#if NVJPEG_VER_MAJOR > 11 || \ | |
(NVJPEG_VER_MAJOR == 11 && (NVJPEG_VER_MINOR > 4 || \ | |
(NVJPEG_VER_MINOR == 4 && NVJPEG_VER_PATCH >= 1))) | |
#define IS_HW_DECODER_COMPATIBLE 1 | |
#else | |
#define IS_HW_DECODER_COMPATIBLE 0 | |
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -74,7 +78,7 @@ class nvJPEGDecoder : public Operator<MixedBackend>, CachedDecoderImpl { | |||
nvjpeg2k_thread_(1, | |||
spec.GetArgument<int>("device_id"), | |||
spec.GetArgument<bool>("affine")) { | |||
#if NVJPEG_VER_MAJOR > 11 || (NVJPEG_VER_MAJOR == 11 && NVJPEG_VER_MINOR >= 1) | |||
#if IF_HW_DECODER_COMPATIBLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This double if
looks weird.
#if IF_HW_DECODER_COMPATIBLE | |
#if IS_HW_DECODER_COMPATIBLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
Signed-off-by: Janusz Lisiecki <jlisiecki@nvidia.com>
CI MESSAGE: [2341527]: BUILD STARTED |
CI MESSAGE: [2341528]: BUILD STARTED |
CI MESSAGE: [2341527]: BUILD PASSED |
CI MESSAGE: [2341528]: BUILD PASSED |
support
Signed-off-by: Janusz Lisiecki jlisiecki@nvidia.com
Why we need this PR?
Pick one, remove the rest
What happened in this PR?
Fill relevant points, put NA otherwise. Replace anything inside []
fixes the if condition for enabling nvJPEG HW backend with ROI support
nvjpeg_decoder_decoupled_api.h
NA
CI
NA
JIRA TASK: [NA]