cuda works. hit test by cpu. TODO: clean code