check memory safe implementation on GPU