فهرست منبع

Fix errors in device_wrapper.txx

Dhairya Malhotra 10 سال پیش
والد
کامیت
36144b622a
2فایلهای تغییر یافته به همراه5 افزوده شده و 4 حذف شده
  1. 2 1
      examples/src/fmm_cheb.cpp
  2. 3 3
      include/device_wrapper.txx

+ 2 - 1
examples/src/fmm_cheb.cpp

@@ -506,7 +506,8 @@ int main(int argc, char **argv){
   MPI_Init(&argc, &argv);
 
   MPI_Comm comm=MPI_COMM_WORLD;
-  if(1){ // Remove slow processors.
+  int p; MPI_Comm_size(comm,&p);
+  if(p>8){ // Remove slow processors.
     MPI_Comm comm_=MPI_COMM_WORLD;
     size_t N=2048;
     pvfmm::Matrix<double> A(N,N);

+ 3 - 3
include/device_wrapper.txx

@@ -26,8 +26,8 @@ namespace DeviceWrapper{
 #ifdef __cplusplus
 extern "C" {
 #endif
-  inline void* host_malloc_cuda(size_t size);
-  inline void host_free_cuda(void* p);
+  void* host_malloc_cuda(size_t size);
+  void host_free_cuda(void* p);
 #ifdef __cplusplus
 }
 #endif
@@ -171,7 +171,7 @@ extern "C" {
 
   inline void* host_malloc(size_t size){
     #if defined(PVFMM_HAVE_CUDA)
-    return host_malloc_cuda;
+    return host_malloc_cuda(size);
     #else
     return malloc(size);
     #endif