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. */
41
41
#include <unistd.h>
42
42
#include <mpi.h>
43
43
#include <pthread.h>
44
-
44
+ #include "cuda_runtime_api.h"
45
45
#include "libcaf.h"
46
46
47
47
/* Define GFC_CAF_CHECK to enable run-time checking. */
@@ -477,8 +477,8 @@ PREFIX(registernc) (void* mem,size_t mem_size)
477
477
cuda_ierr = cudaHostRegister (mem ,mem_size ,cudaHostRegisterMapped );
478
478
cudaDeviceSynchronize ();
479
479
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 );
482
482
483
483
return ;
484
484
You can’t perform that action at this time.
0 commit comments