The problem I was having was a stack overflow on numberEffectsRecord. Also added cuda error handling