Skip to content

Commit

Permalink
Use skip_pre_sync
Browse files Browse the repository at this point in the history
Signed-off-by: Joaquin Anton Guirao <janton@nvidia.com>
  • Loading branch information
jantonguirao committed Oct 24, 2024
1 parent 467dd45 commit 3b6b2f2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions dali/operators/imgcodec/image_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ class ImageDecoder : public StatelessOperator<Backend> {
exec_params_.executor = &executor_;
exec_params_.max_num_cpu_threads = num_threads_;
exec_params_.pre_init = 1;
exec_params_.skip_pre_sync = 1; // we are not doing stream allocations before decoding.
decoder_ = NvImageCodecDecoder::Create(instance_, &exec_params_, opts_.to_string());
}

Expand Down
6 changes: 5 additions & 1 deletion third_party/nvimgcodec/include/nvimgcodec.h
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,11 @@ extern "C"
int device_id; /**< Device id to process decoding on. It can be also specified
using defines NVIMGCODEC_DEVICE_CURRENT or NVIMGCODEC_DEVICE_CPU_ONLY. */
int pre_init; /**< If true, all relevant resources are initialized at creation of the instance */
int num_backends; /**< Number of allowed backends passed (if any)
int skip_pre_sync; /**< If true, synchronization between user stream and per-thread streams is skipped before
decoding (we only synchronize after decoding). This can be useful when we are sure that
there are no actions that need synchronization (e.g. a CUDA async allocation on
the user stream) */
int num_backends; /**< Number of allowed backends passed (if any)
in backends parameter. For 0, all backends are allowed.*/
const nvimgcodecBackend_t* backends; /**< Points a nvimgcodecBackend_t array with defined allowed backends.
For nullptr, all backends are allowed. */
Expand Down

0 comments on commit 3b6b2f2

Please sign in to comment.