Skip to content

Commit

Permalink
move forward kernels in elastic.c into separate functions so that the…
Browse files Browse the repository at this point in the history
…y are vectorized even when using OpenMP
  • Loading branch information
ar4 committed Jul 21, 2023
1 parent 3e6de3c commit e5c54c7
Show file tree
Hide file tree
Showing 6 changed files with 182 additions and 125 deletions.
2 changes: 1 addition & 1 deletion src/deepwave/build_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

DW_OMP_NAME=libgomp.so.1
CFLAGS="-Wall -Wextra -pedantic -DDW_USE_OPENMP -fPIC -fopenmp -Ofast -mavx2"
CFLAGS="-Wall -Wextra -pedantic -fPIC -fopenmp -Ofast -mavx2"
CUDAFLAGS="--restrict --use_fast_math -O3 -gencode=arch=compute_52,code=sm_52, -gencode=arch=compute_60,code=sm_60 -gencode=arch=compute_70,code=sm_70 -gencode=arch=compute_75,code=sm_75 -gencode=arch=compute_80,code=compute_80 --compiler-options -fPIC"
gcc $CFLAGS -DDW_ACCURACY=2 -DDW_DTYPE=float -c scalar.c -o scalar_cpu_iso_2_float.o
gcc $CFLAGS -DDW_ACCURACY=4 -DDW_DTYPE=float -c scalar.c -o scalar_cpu_iso_4_float.o
Expand Down
2 changes: 1 addition & 1 deletion src/deepwave/build_macos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
set -e

DW_OMP_NAME=iomp5
CFLAGS="-Wall -Wextra -pedantic -DDW_USE_OPENMP -fPIC -Ofast -Xpreprocessor -fopenmp -I`brew --prefix libomp`/include"
CFLAGS="-Wall -Wextra -pedantic -fPIC -Ofast -Xpreprocessor -fopenmp -I`brew --prefix libomp`/include"
clang $CFLAGS -DDW_ACCURACY=2 -DDW_DTYPE=float -c scalar.c -o scalar_cpu_iso_2_float.o
clang $CFLAGS -DDW_ACCURACY=4 -DDW_DTYPE=float -c scalar.c -o scalar_cpu_iso_4_float.o
clang $CFLAGS -DDW_ACCURACY=6 -DDW_DTYPE=float -c scalar.c -o scalar_cpu_iso_6_float.o
Expand Down
6 changes: 0 additions & 6 deletions src/deepwave/common_cpu.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
#ifndef DW_COMMON_CPU_H
#define DW_COMMON_CPU_H

//#ifdef DW_USE_OPENMP
//int dw_use_openmp = 1;
//#else
//int dw_use_openmp = 0;
//#endif /* DW_USE_OPENMP */

static void add_sources(DW_DTYPE *__restrict const wf,
DW_DTYPE const *__restrict const f,
int64_t const *__restrict const sources_i,
Expand Down

0 comments on commit e5c54c7

Please sign in to comment.