Skip to content

Commit

Permalink
structure edits
Browse files Browse the repository at this point in the history
  • Loading branch information
tkoziara committed Jul 9, 2019
1 parent 54b95cf commit ebf4f53
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 12 deletions.
18 changes: 9 additions & 9 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ C_OBJS4=$(addprefix objs4/, $(C_SRC:.c=.o))
C_OBJS8=$(addprefix objs8/, $(C_SRC:.c=.o))
LIBS=-lm $(PYTHONLIB) $(HDF5LIB)

default: dirs version $(EXE)4 $(EXE)8
default: dirs version $(ISPC_HEADERS4) $(EXE)4 $(ISPC_HEADERS8) $(EXE)8

.PHONY: dirs clean print

Expand Down Expand Up @@ -55,10 +55,10 @@ $(EXE)8: $(CPP_OBJS8) $(C_OBJS8) $(ISPC_OBJS8)
$(MPICXX) $(CFLAGS) -fopenmp -o $@ $^ $(LIBS)

objs4/%_ispc.h objs4/%_ispc.o objs4/%_ispc_sse2.o objs4/%_ispc_sse4.o objs4/%_ispc_avx.o: %.ispc
$(ISPC) -DREALSIZE=4 --target=$(ISPC_TARGETS) $< -o objs4/$*_ispc.o -h objs4/$*_ispc.h
$(ISPC) -DREALSIZE=4 --target=$(ISPC_TARGETS) -Iinc $< -o objs4/$*_ispc.o -h objs4/$*_ispc.h

objs8/%_ispc.h objs8/%_ispc.o objs8/%_ispc_sse2.o objs8/%_ispc_sse4.o objs8/%_ispc_avx.o: %.ispc
$(ISPC) -DREALSIZE=8 --target=$(ISPC_TARGETS) $< -o objs8/$*_ispc.o -h objs8/$*_ispc.h
$(ISPC) -DREALSIZE=8 --target=$(ISPC_TARGETS) -Iinc $< -o objs8/$*_ispc.o -h objs8/$*_ispc.h

objs4/cpp/tasksys.o: cpp/tasksys.cpp
$(MPICXX) $(CFLAGS) -D ISPC_USE_OMP $< -c -o $@
Expand All @@ -67,13 +67,13 @@ objs8/cpp/tasksys.o: cpp/tasksys.cpp
$(MPICXX) $(CFLAGS) -D ISPC_USE_OMP $< -c -o $@

objs4/%.o: %.cpp $(ISPC_HEADERS4)
$(MPICXX) -DREALSIZE=4 -Iobjs4 $(CFLAGS) $< -c -o $@
$(MPICXX) -DREALSIZE=4 -Iinc -Iobjs4/ispc $(CFLAGS) $< -c -o $@

objs8/%.o: %.cpp $(ISPC_HEADERS8)
$(MPICXX) -DREALSIZE=8 -Iobjs8 $(CFLAGS) $< -c -o $@
$(MPICXX) -DREALSIZE=8 -Iinc -Iobjs8/ispc $(CFLAGS) $< -c -o $@

objs4/%.o: %.c $(ISPC_HEADERS4)
$(MPICC) -DREALSIZE=4 -Iobjs4 $(CFLAGS) $< -c -o $@
objs4/%.o: %.c
$(MPICC) -DREALSIZE=4 -Iinc -Iobjs4/ispc $(CFLAGS) $< -c -o $@

objs8/%.o: %.c $(ISPC_HEADERS8)
$(MPICC) -DREALSIZE=8 -Iobjs8 $(CFLAGS) $< -c -o $@
objs8/%.o: %.c
$(MPICC) -DREALSIZE=8 -Iinc -Iobjs8/ispc $(CFLAGS) $< -c -o $@
4 changes: 4 additions & 0 deletions cpp/solfec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ SOFTWARE.

/* Contributors: Tomasz Koziara */

#include <stdlib.h>
#include <stdio.h>
#include <mpi.h>
#include "real.h"
#include "version.h"
#include "simd_util_ispc.h"

int main (int argc, char *argv[])
{
Expand All @@ -37,5 +39,7 @@ int main (int argc, char *argv[])
printf ("SYNOPSIS: solfec%d path/to/input/file.py\n", REALSIZE);
}

ispc::dummy (argc > 1 ? atoi(argv[1]) : 1000);

return 0;
}
4 changes: 2 additions & 2 deletions cpp/version.h
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#define VERSION_HASH "e1457db"
#define VERSION_DATE "2019-07-04"
#define VERSION_HASH "54b95cf"
#define VERSION_DATE "2019-07-09"
File renamed without changes.
10 changes: 9 additions & 1 deletion ispc/simd_util.ispc
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
export void dummy (uniform int argc)
#include "real.h"

export void dummy (uniform int n)
{
REAL x = 0.0, sum;

foreach (i = 0 ... n)
{
sum += x;
}
}

0 comments on commit ebf4f53

Please sign in to comment.