ensure banned_mask and indices in same device (#23901)
* ensure banned_mask and indices in same device
* ensure banned_mask and indices in same device
switch the order in which indices and banned_mask are created and create banned_mask on the proper device