Sort all includes in src/gromacs
[alexxy/gromacs.git] / src / gromacs / gmxlib / cuda_tools / pmalloc_cuda.cu
index 4e2933dd46d4e099e6507d7330bd44b008d4c394..d0c684d4ae0ae29b44d0891e79f673fb23202d68 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * This file is part of the GROMACS molecular simulation package.
  *
- * Copyright (c) 2012, by the GROMACS development team, led by
+ * Copyright (c) 2012,2014, by the GROMACS development team, led by
  * Mark Abraham, David van der Spoel, Berk Hess, and Erik Lindahl,
  * and including many others, as listed in the AUTHORS file in the
  * top-level source directory and at http://www.gromacs.org.
  * the research papers on the package. Check out http://www.gromacs.org.
  */
 
-#include <stdlib.h>
+#include "gmxpre.h"
+
+#include "gromacs/legacyheaders/pmalloc_cuda.h"
 
-#include "gmx_fatal.h"
+#include <stdlib.h>
 
-#include "cudautils.cuh"
-#include "pmalloc_cuda.h"
+#include "gromacs/gmxlib/cuda_tools/cudautils.cuh"
+#include "gromacs/utility/cstringutil.h"
 
-/*! Allocates nbytes of page-locked memory. 
- *  This memory should always be freed using pfree (or with the page-locked 
+/*! Allocates nbytes of page-locked memory.
+ *  This memory should always be freed using pfree (or with the page-locked
  *  free functions provied by the CUDA library).
  */
 void pmalloc(void **h_ptr, size_t nbytes)
@@ -58,13 +60,13 @@ void pmalloc(void **h_ptr, size_t nbytes)
 
     CU_CHECK_PREV_ERR();
 
-    stat = cudaMallocHost(h_ptr, nbytes, flag);    
+    stat = cudaMallocHost(h_ptr, nbytes, flag);
     sprintf(strbuf, "cudaMallocHost of size %d bytes failed", (int)nbytes);
-    CU_RET_ERR(stat, strbuf);  
+    CU_RET_ERR(stat, strbuf);
 }
 
-/*! Allocates nbytes of page-locked memory with write-combining. 
- *  This memory should always be freed using pfree (or with the page-locked 
+/*! Allocates nbytes of page-locked memory with write-combining.
+ *  This memory should always be freed using pfree (or with the page-locked
  *  free functions provied by the CUDA library).
  */
 void pmalloc_wc(void **h_ptr, size_t nbytes)
@@ -81,21 +83,21 @@ void pmalloc_wc(void **h_ptr, size_t nbytes)
 
     CU_CHECK_PREV_ERR();
 
-    stat = cudaMallocHost(h_ptr, nbytes, flag);    
+    stat = cudaMallocHost(h_ptr, nbytes, flag);
     sprintf(strbuf, "cudaMallocHost of size %d bytes failed", (int)nbytes);
-    CU_RET_ERR(stat, strbuf);  
+    CU_RET_ERR(stat, strbuf);
 }
 
 /*! Frees page locked memory allocated with pmalloc.
- *  This function can safely be called also with a pointer to a page-locked 
+ *  This function can safely be called also with a pointer to a page-locked
  *  memory allocated directly with CUDA API calls.
  */
-void pfree(void *h_ptr) 
+void pfree(void *h_ptr)
 {
-    cudaError_t stat; 
+    cudaError_t stat;
 
     if (h_ptr == NULL)
-    {        
+    {
         return;
     }