Multiple CPU threads that use Unified Memory gives a Bus Error

If I get the time, I’ll try creating a MWE or maybe restructuring my code will solve the problem.