Revert "simple gpu algorithm: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]"

This reverts commit 1b6d639907155b9f84fb732d4bea9a4d9057f7d2.