move memorize func to GPU