Uses template functions in cpu.cc.