avoid generating memsets on cuda