Loading makefile +3 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,9 @@ hpc_gpu: hpc_omp: make -f makefile.hpc ACTIVE_OMP=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) macos_omp: make -f makefile.macos ACTIVE_OMP=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) afw_gpu: make -f makefile.afw ACTIVE_GPU=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) Loading makefile.macos 0 → 100644 +22 −0 Original line number Diff line number Diff line OMP_PREFIX := $(shell brew --prefix libomp) GDAL_PREFIX := $(shell brew --prefix gdal) ifdef ACTIVE_GPU CC := nvcc INC_DIRS := FLAGS := --compiler-bindir `which mpic++` -arch=sm_70 -x cu LIBRARIES := -I/usr/include/gdal -lgdal DFLAGS := -DACTIVE_GPU=1 else CC := mpic++ INC_DIRS := $(OMP_PREFIX)/include $(GDAL_PREFIX)/include FLAGS := -Wall -Xpreprocessor -fopenmp LIBRARIES := -L$(OMP_PREFIX)/lib -lomp -L$(GDAL_PREFIX)/lib -lgdal DFLAGS := -DACTIVE_OMP=1 endif triton: $(SRCDIR)/main.cpp if [ ! -d "$(BUILDDIR)" ]; then mkdir $(BUILDDIR); fi @echo 'Compiling file: $<' $(CC) $(INC_DIRS:%=-I%) $(FLAGS) $(DFLAGS) -O3 $(LIBRARIES) -o "$(BUILDDIR)/$@" "$<" --std=c++14 @echo 'Building finished: $@' src/matrix.h +2 −2 Original line number Diff line number Diff line Loading @@ -538,7 +538,7 @@ namespace Matrix sum += this->data_[(long long) this->cols_ * i + n] * m(n, j); } R.set_val(i, j, sum); R.set_value(i, j, sum); } } Loading @@ -562,7 +562,7 @@ namespace Matrix { for (int j = 0; j < this->cols_; j++) { R.set_val(i, j, (this->data_[(long long) this->cols_ * i + j] + m(i, j))); R.set_value(i, j, (this->data_[(long long) this->cols_ * i + j] + m(i, j))); } } Loading Loading
makefile +3 −0 Original line number Diff line number Diff line Loading @@ -10,6 +10,9 @@ hpc_gpu: hpc_omp: make -f makefile.hpc ACTIVE_OMP=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) macos_omp: make -f makefile.macos ACTIVE_OMP=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) afw_gpu: make -f makefile.afw ACTIVE_GPU=1 SRCDIR=$(SRCDIR) BUILDDIR=$(BUILDDIR) Loading
makefile.macos 0 → 100644 +22 −0 Original line number Diff line number Diff line OMP_PREFIX := $(shell brew --prefix libomp) GDAL_PREFIX := $(shell brew --prefix gdal) ifdef ACTIVE_GPU CC := nvcc INC_DIRS := FLAGS := --compiler-bindir `which mpic++` -arch=sm_70 -x cu LIBRARIES := -I/usr/include/gdal -lgdal DFLAGS := -DACTIVE_GPU=1 else CC := mpic++ INC_DIRS := $(OMP_PREFIX)/include $(GDAL_PREFIX)/include FLAGS := -Wall -Xpreprocessor -fopenmp LIBRARIES := -L$(OMP_PREFIX)/lib -lomp -L$(GDAL_PREFIX)/lib -lgdal DFLAGS := -DACTIVE_OMP=1 endif triton: $(SRCDIR)/main.cpp if [ ! -d "$(BUILDDIR)" ]; then mkdir $(BUILDDIR); fi @echo 'Compiling file: $<' $(CC) $(INC_DIRS:%=-I%) $(FLAGS) $(DFLAGS) -O3 $(LIBRARIES) -o "$(BUILDDIR)/$@" "$<" --std=c++14 @echo 'Building finished: $@'
src/matrix.h +2 −2 Original line number Diff line number Diff line Loading @@ -538,7 +538,7 @@ namespace Matrix sum += this->data_[(long long) this->cols_ * i + n] * m(n, j); } R.set_val(i, j, sum); R.set_value(i, j, sum); } } Loading @@ -562,7 +562,7 @@ namespace Matrix { for (int j = 0; j < this->cols_; j++) { R.set_val(i, j, (this->data_[(long long) this->cols_ * i + j] + m(i, j))); R.set_value(i, j, (this->data_[(long long) this->cols_ * i + j] + m(i, j))); } } Loading