I think if you make these changes:
__global__ void operate(int* memoria1, int* memoria2)
^ ^
and:
cudaMalloc((void**) &memory_1, 5 * sizeof(int));
cudaMalloc((void**) &memory_2, 5 * sizeof(int));
^ ^
Your code will compile and run properly.
Your results will be kind of wierd since the code doesn't actually initialize the values of a
and c
that are being operated on by the CUDA kernel. So you might want to initialize those.