Add cuda device synchronization support in JIT (#55469)
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/55469
Test Plan: Imported from OSS
Reviewed By: ZolotukhinM
Differential Revision: D27749077
Pulled By: nikithamalgifb
fbshipit-source-id: bce3d331ab781cf3232b47b4f02ef504b9eadc7e