I have the following cuda c++. I am trying to delete the h_c, h_c_Row and h_c_ColdIndices array using delete function. But the memory is not getting deleted when I see the memory and the value stored in that memory for each array in the debug mode in nsight eclispe.
float *h_c = new float[nnz_c];
int *h_c_Row = new int[n_k+1];
int *h_c_ColIndices = new int[nnz_c];
create_sparse_MY(c,n_k,d,h_c,h_c_Row,h_c_ColIndices, nnz_c);
// transfer sparse c to device memory
float *d_sc; (cudaMalloc(&d_sc, nnz_c * sizeof(float)));
(cudaMemcpy(d_sc, h_c, (nnz_c) * sizeof(float), cudaMemcpyHostToDevice));
int *d_c_ColIndices; (cudaMalloc(&d_c_ColIndices, nnz_c * sizeof(*d_c_ColIndices)));
(cudaMemcpy(d_c_ColIndices, h_c_ColIndices, (nnz_c) * sizeof(int), cudaMemcpyHostToDevice));
int *d_c_RowIndices; (cudaMalloc(&d_c_RowIndices, (n_k+1) * sizeof(*d_c_RowIndices)));
(cudaMemcpy(d_c_RowIndices, h_c_Row, (n_k+1) * sizeof(int), cudaMemcpyHostToDevice));
delete[] h_c;
delete[] h_c_Row;
delete[] h_c_ColIndices
Can someone please help me with it? Is this the right way to delete to arrays in main memory in cuda c++?