In your code snippet you’ll most likely get an error stating some tensors are not on the same device.
Since outputA and outputB are on GPU0 and GPU1, respectively, you should push them to the same device.
Could you try the following:
...
lossC = torch.nn.CosineSimilarity(outputA, outputB.to('cuda:0')) # lossC is now on cuda:0
final_loss = lossA + lossB.to('cuda:0') + lossC