Fix cuda problem in mac, due to calling assert in kernel. Now maos with cuda runs fine in mac.