File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change 1+ include ../make.inc
2+
3+ MPICC ?= cc
4+
5+ libcaf_cuda.a : mpi_caf.o ../common/caf_auxiliary.o
6+ ar rcv $@ mpi_caf.o ../common/caf_auxiliary.o
7+ ranlib $@
8+
9+ .c.o :
10+ $(MPICC ) $(CFLAGS ) $(MPI_CFLAGS ) -I.. -I/opt/nvidia/cudatoolkit6.5/6.5.14-1.0502.9836.9.1/include/ -L/opt/nvidia/cudatoolkit6.5/6.5.14-1.0502.9836.9.1/lib -lcuda -lcudart -c $< -o $@
11+
12+ mpi_caf.o : mpi_caf.c ../libcaf.h ../libcaf-gfortran-descriptor.h
13+
14+ ../common/caf_auxiliary.o :
15+ $(MAKE ) -C ../common
16+
17+ clean :
18+ rm -f mpi_caf.o
19+
20+ distclean : clean
21+ rm -f libcaf_mpi.a
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
4141#include <unistd.h>
4242#include <mpi.h>
4343#include <pthread.h>
44-
44+ #include "cuda_runtime_api.h"
4545#include "libcaf.h"
4646
4747/* Define GFC_CAF_CHECK to enable run-time checking. */
@@ -477,8 +477,8 @@ PREFIX(registernc) (void* mem,size_t mem_size)
477477 cuda_ierr = cudaHostRegister (mem ,mem_size ,cudaHostRegisterMapped );
478478 cudaDeviceSynchronize ();
479479
480- if (ierr != 0 )
481- call caf_runtime_error ("CUDA allocation failed with code %d" , ierr );
480+ if (cuda_ierr != 0 )
481+ caf_runtime_error ("CUDA allocation failed with code %d" , cuda_ierr );
482482
483483 return ;
484484
You can’t perform that action at this time.
0 commit comments