Skip to content

Add configurable accuracy in Makefile #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 26 additions & 8 deletions numpy/umath/Makefile
Original file line number Diff line number Diff line change
@@ -1,23 +1,41 @@
# 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

all: umath_precise
./umath_precise
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

TARGET=umath_$(ACC)


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