These are, of course, two very different issues. We should not equate consensual same-sex activities in prison with sexual assaults. Consensual activities are, at worst, immoral (depending on your point of view) whereas assaults are both immoral and illegal.
I would argue that there is very little that can feasibly be done to reduce the amount of sexual assault in prisons. There are one or two things that could potentially help, but it is not clear that they could be implemented or that they would work if they were implemented. One thing that could be done would be to provide prisoners with the chance to have conjugal visits on a regular basis. This might decrease the level of sexual frustration that they feel and, thereby, reduce the number of sexual assaults. However, it is not clear that everyone would be able to get partners for conjugal visits and it is not clear that Americans would be willing to give prisoners this privilege. Finally, it may be that the sexual assaults are more about power than they are about sex. In that case, conjugal visits would do no good even if they could be arranged.
A second thing that could be done would be to have greatly increased surveillance of all areas of a prison. This would mean that any sexual assault would be caught on camera. People committing sexual assaults could be given special punishments like solitary confinement. This punitive approach might work. However, it is not clear that our prisons can afford to have the amount of surveillance equipment and the amount of manpower needed to monitory that equipment in the current state of our government budgets.
Thus, I would argue that it is not likely to be possible to severely reduce the incidence of prison sexual assault. Such a reduction would likely require a complete change in the entire culture of prison life in the US. This would not be at all easy to accomplish. As for consensual sexual activity, I see no reason to treat this as a problem that deserves to be in the same question as sexual assault.