From 9d112a8fc20af167867cd8913cb9e770dd775bf6 Mon Sep 17 00:00:00 2001 From: Sameer Bibikar Date: Wed, 2 Jan 2019 14:45:12 -0600 Subject: [PATCH 1/2] Add configurable accuracy in Makefile --- numpy/umath/Makefile | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/numpy/umath/Makefile b/numpy/umath/Makefile index 6dc7135..50dc5d5 100644 --- a/numpy/umath/Makefile +++ b/numpy/umath/Makefile @@ -1,13 +1,26 @@ -# Copyright (C) 2018 Intel Corporation +# Copyright (C) 2018-2019 Intel Corporation # # SPDX-License-Identifier: MIT CC = icc CFLAGS = -qopenmp -xCORE-AVX2 -axCOMMON-AVX512 -O3 \ - -g -fp-model precise -fimf-precision=high -lmkl_rt + -g -lmkl_rt PYTHON ?= python +ACC ?= la +ifeq ($(ACC), ha) + CFLAGS += -fimf-precision=high -D_VML_ACCURACY_HA_ + CFLAGS += -fp-model precise +endif +ifeq ($(ACC), la) + CFLAGS += -fimf-precision=medium -D_VML_ACCURACY_LA_ +endif +ifeq ($(ACC), ep) + CFLAGS += -fimf-precision=low -fimf-domain-exclusion=31 -D_VML_ACCURACY_EP_ +endif + + all: umath_precise ./umath_precise From 1977402f76dd65091f39aea2e9375b098c778d65 Mon Sep 17 00:00:00 2001 From: Sameer Bibikar Date: Wed, 2 Jan 2019 19:47:35 -0600 Subject: [PATCH 2/2] Output to different file depending on accuracy --- numpy/umath/Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/numpy/umath/Makefile b/numpy/umath/Makefile index 50dc5d5..e5290a6 100644 --- a/numpy/umath/Makefile +++ b/numpy/umath/Makefile @@ -20,17 +20,22 @@ ifeq ($(ACC), ep) CFLAGS += -fimf-precision=low -fimf-domain-exclusion=31 -D_VML_ACCURACY_EP_ endif +TARGET=umath_$(ACC) -all: umath_precise - ./umath_precise + +all: $(TARGET) + ./$(TARGET) clean: - rm -f umath_precise umath_bench.c + rm -f umath_ha umath_la umath_ep umath_bench.c + +compile: $(TARGET) + -umath_precise: umath_bench.c - $(CC) umath_bench.c $(CPPFLAGS) $(CFLAGS) -o umath_precise +$(TARGET): umath_bench.c + $(CC) umath_bench.c $(CPPFLAGS) $(CFLAGS) -o $(TARGET) umath_bench.c: umath_bench.c.src $(PYTHON) -m numpy.distutils.conv_template umath_bench.c.src -.PHONY: all clean +.PHONY: all clean compile