Wrap the CPU and GPU math functions in math backend classes