Commit d6b931024ff by Pierre Augier

commandline option -pc -> -af (--accelerator-flags)

parent b12ff16beb0
......@@ -3,7 +3,7 @@ NAME=bench.py
all: pythran other
pythran:
transonic $(NAME) -b pythran -pf "-march=native -DUSE_XSIMD -Ofast"
transonic $(NAME) -b pythran -af "-march=native -DUSE_XSIMD -Ofast"
other:
transonic $(NAME) -b numba
......
......@@ -3,10 +3,10 @@ NAME=bench.py
all: pythran cython other
pythran:
transonic $(NAME) -b pythran -pf "-march=native -DUSE_XSIMD -Ofast"
transonic $(NAME) -b pythran -af "-march=native -DUSE_XSIMD -Ofast"
cython:
transonic $(NAME) -b cython -pf "-march=native -Ofast"
transonic $(NAME) -b cython -af "-march=native -Ofast"
other:
transonic $(NAME) -b numba
......
......@@ -5,10 +5,10 @@ NAMEJIT=row_sum_jit.py
all: pythran cython other
pythran:
transonic $(NAME) -b pythran -pf "-march=native -DUSE_XSIMD -Ofast"
transonic $(NAME) -b pythran -af "-march=native -DUSE_XSIMD -Ofast"
cython:
transonic $(NAME) -b cython -pf "-march=native -Ofast"
transonic $(NAME) -b cython -af "-march=native -Ofast"
other:
transonic $(NAME) -b numba
......
......@@ -28,7 +28,7 @@ To compile this file with different backends, one can run:
transonic -b python row_sum_boost.py
transonic -b cython row_sum_boost.py
transonic -b numba row_sum_boost.py
transonic -b pythran row_sum_boost.py -pf "-march=native -DUSE_XSIMD"
transonic -b pythran row_sum_boost.py -af "-march=native -DUSE_XSIMD"
To choose the backend, we can call for example:
......
......@@ -3,7 +3,7 @@ NAME=bench.py
all: pythran other
pythran:
transonic $(NAME) -b pythran -pf "-march=native -DUSE_XSIMD -Ofast"
transonic $(NAME) -b pythran -af "-march=native -DUSE_XSIMD -Ofast"
other:
transonic $(NAME) -b numba
......
......@@ -4,7 +4,7 @@ NAME=bench_aot.py
all: pythran cython other
pythran:
transonic -b pythran $(NAME) -pf "-march=native -DUSE_XSIMD"
transonic -b pythran $(NAME) -af "-march=native -DUSE_XSIMD"
cython:
transonic -b cython $(NAME)
......
......@@ -375,7 +375,7 @@ class Backend:
def compile_extensions(
self,
paths: Iterable[Path],
str_pythran_flags: str,
str_accelerator_flags: str,
parallel=True,
force=True,
):
......@@ -383,7 +383,7 @@ class Backend:
for path in paths:
self.compile_extension(
path,
str_pythran_flags=str_pythran_flags,
str_accelerator_flags=str_accelerator_flags,
parallel=parallel,
force=force,
)
......@@ -395,7 +395,7 @@ class Backend:
native=False,
xsimd=False,
openmp=False,
str_pythran_flags: Optional[str] = None,
str_accelerator_flags: Optional[str] = None,
parallel=True,
force=True,
):
......@@ -420,7 +420,7 @@ class BackendAOT(Backend):
native=False,
xsimd=False,
openmp=False,
str_pythran_flags: Optional[str] = None,
str_accelerator_flags: Optional[str] = None,
parallel=True,
force=True,
):
......@@ -435,7 +435,7 @@ class BackendAOT(Backend):
native=native,
xsimd=xsimd,
openmp=openmp,
str_pythran_flags=str_pythran_flags,
str_accelerator_flags=str_accelerator_flags,
parallel=parallel,
force=force,
)
......
......@@ -61,7 +61,7 @@ class NumbaBackend(PythonBackend):
native=False,
xsimd=False,
openmp=False,
str_pythran_flags: Optional[str] = None,
str_accelerator_flags: Optional[str] = None,
parallel=True,
force=True,
):
......
......@@ -45,7 +45,7 @@ class PythonBackend(BackendJIT):
native=False,
xsimd=False,
openmp=False,
str_pythran_flags: Optional[str] = None,
str_accelerator_flags: Optional[str] = None,
parallel=True,
force=True,
):
......
......@@ -113,7 +113,7 @@ class SchedulerPopen:
native=False,
xsimd=False,
openmp=False,
str_pythran_flags: Optional[str] = None,
str_accelerator_flags: Optional[str] = None,
parallel=True,
force=True,
):
......@@ -131,8 +131,8 @@ class SchedulerPopen:
if mpi.rank == 0:
logger.info(f"Schedule {backend}ization of file {path}")
if str_pythran_flags is not None:
flags = str_pythran_flags.strip().split()
if str_accelerator_flags is not None:
flags = str_accelerator_flags.strip().split()
else:
flags = []
......@@ -195,7 +195,7 @@ def compile_extension(
native=False,
xsimd=False,
openmp=False,
str_pythran_flags: Optional[str] = None,
str_accelerator_flags: Optional[str] = None,
parallel=False,
force=False,
):
......@@ -211,7 +211,7 @@ def compile_extension(
native=native,
xsimd=xsimd,
openmp=openmp,
str_pythran_flags=str_pythran_flags,
str_accelerator_flags=str_accelerator_flags,
parallel=parallel,
force=force,
)
......@@ -102,7 +102,7 @@ def run():
backend.compile_extensions(
backends_paths,
str_pythran_flags=args.pythran_flags,
str_accelerator_flags=args.accelerator_flags,
parallel=True,
force=args.force,
)
......@@ -156,11 +156,21 @@ def parse_args():
parser.add_argument(
"-pf",
"--pythran-flags",
help=("Depreciated: use -af"),
type=str,
default="",
)
parser.add_argument(
"-af",
"--accelerator-flags",
help=(
"Flags sent to Pythran. "
'Default is "-march=native -DUSE_XSIMD". '
"Flags sent to the accelerator. "
'Default is "". '
"There has to be atleast one space in the passed string! "
'Example: transonic foo.py -pf "-march=native "\n'
"Examples:\n"
'`transonic foo.py -af "-march=native "` or\n'
'`transonic foo.py -af "-march=native -DUSE_XSIMD -Ofast"`\n'
),
type=str,
default="",
......@@ -174,7 +184,11 @@ def parse_args():
# default="",
)
return parser.parse_args()
args = parser.parse_args()
if args.pythran_flags != "":
raise DeprecationWarning("-pf is deprecated. Use -af instead!")
return args
if __name__ == "__main__":
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment