[closed]Set value of Npp32f array

Hi,

I have:
int s;
Npp32f * m = nppiMalloc_32f_C1(w, h, &s);

Question: how i can set value of element of Npp32f array?
m[0]=1.4; <-- not works “Bus error”

Best regards, Viktor.

nppiMalloc_xxxxx allocates memory on the device. Such memory cannot be directly manipulated in host code.

The usual practice is to have a host copy of the image (e.g. perhaps allocated with malloc), and a device copy.

You modify data in the host copy, then copy the whole image to the device.

Take a look at the cuda sample codes for example usage. In particular, on linux, there will be NPP utilities provided in /usr/local/cuda/samples/common/UtilNPP which will probably be useful, either to use directly or to study, such as in ImageAllocatorsNPP.h

Thank you. I have understood. Will learn UtilsNpp source code.