I was wondering if it was possible to use the following CUDA function to initialize for example with FLT_MAX, or 52.34f, instead of juste an int value (0,1 etc…)
cudaMemset2D( void* dstPtr, size_t pitch, int value, size_t width, size_t height)
In this case, it would be used as follows:
float * d_idata; size_t pitch_idata; cudaMallocPitch( (void**) &d_idata, &pitch_idata,sizeof(float)*nbcol, nbrow); cudaMemset2D( (void**) &d_idata, pitch_idata, FLT_MAX, sizeof(float)*nbcol, nbrow);
I tried it but it doesn’t work correctly? Is there another Cuda function that we can use. Or should I write a kernel to execute this?