added missing cleanup of some nbnxn_cuda data
authorSzilárd Páll <pszilard@cbr.su.se>
Wed, 16 Jan 2013 23:57:42 +0000 (00:57 +0100)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Thu, 17 Jan 2013 22:37:52 +0000 (23:37 +0100)
While the content of the data structures the pointers in nbnxn_cuda
point to was freed up, the data structures themselves were not.

Change-Id: Icb1c5da9867ee252e2a6dadf7f164d7bb4f41a26

src/mdlib/nbnxn_cuda/nbnxn_cuda_data_mgmt.cu

index 251c6d9c0386fd95371bb3a01256e81c86795e24..f9f9bfa2c386304d116109e1a5b687573f7879ee 100644 (file)
@@ -862,6 +862,17 @@ void nbnxn_cuda_free(FILE *fplog, nbnxn_cuda_ptr_t cu_nb)
         cu_free_buffered(plist_nl->excl, &plist_nl->nexcl, &plist->excl_nalloc);
     }
 
+    sfree(atdat);
+    sfree(nbparam);
+    sfree(plist);
+    if (cu_nb->bUseTwoStreams)
+    {
+        sfree(plist_nl);
+    }
+    sfree(timers);
+    sfree(cu_nb->timings);
+    sfree(cu_nb);
+
     if (debug)
     {
         fprintf(debug, "Cleaned up CUDA data structures.\n");