PR #10489: [GPU] Fix command buffer support for cuDNN fusions.
PR #10489: [GPU] Fix command buffer support for cuDNN fusions.

Imported from GitHub PR https://github.com/openxla/xla/pull/10489

CuDnnCmd is constructed before DnnGraph in CuDnnThunk is initialized so CuDnnCmd has to get  unique_ptr\<DnnGraph\>& instead of DnnGraph& at initialization.

Accordingly cuDNN thunks have to be initialized before command buffer ones to initialize graphs before they get captured.

Test CommandBuffersAreSupported used to not demonstrate the use of command buffers because the corresponding command buffer call used to be inlined and no command buffers were created. This is now cleaned up and does work as expected with minimal CUDA graph size set to 1 with a flag.
Copybara import of the project:

--
8547c674f3e0858efca9763bed586f1d796184d7 by Ilia Sergachev <isergachev@nvidia.com>:

[GPU] Fix command buffer support for cuDNN fusions.

Merging this change closes #10489

FUTURE_COPYBARA_INTEGRATE_REVIEW=https://github.com/openxla/xla/pull/10489 from openxla:fix_cudnn_cmd_buffers 8547c674f3e0858efca9763bed586f1d796184d7
