title: Initialize device array in CUDA
body: <p>How do I initialize device array which is allocated using <code>cudaMalloc()</code>?  </p>
  
  <p>I tried <code>cudaMemset</code>, but it fails to initialize all values except <code>0.code</code>, for cudaMemset looks like below, where value is initialized to 5.  </p>
  
  <pre><code>cudaMemset(devPtr,value,number_bytes)
  </code></pre>