From 07b5b45a691112ca9bd0c24382cd8d6954abc110 Mon Sep 17 00:00:00 2001 From: Brant-Skywalker Date: Tue, 15 Oct 2024 16:28:37 -0500 Subject: [PATCH] fix example --- example/Makefile | 9 +++++---- example/example.c | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/example/Makefile b/example/Makefile index 19fe608..48e19f9 100644 --- a/example/Makefile +++ b/example/Makefile @@ -2,7 +2,8 @@ ENZYME_PATH ?= /home/brant/sync/Enzyme/build/Enzyme/ClangEnzyme-15.so LLVM_PATH ?= /home/brant/llvms/llvm15/build/bin CXX = $(LLVM_PATH)/clang++ -CXXFLAGS = -I/home/brant/include \ +CXXFLAGS = -O3 -Wall \ + -I/home/brant/include \ -L/home/brant/lib \ -I /usr/include/c++/11 \ -I /usr/include/x86_64-linux-gnu/c++/11 \ @@ -41,13 +42,13 @@ example-logged.cpp: $(SRC) python3 fpopt-logged-driver-generator.py $(SRC) example example.exe: example.cpp - $(CXX) -Wall -O3 example.cpp $(CXXFLAGS) -o $@ + $(CXX) example.cpp $(CXXFLAGS) -o $@ example-golden.exe: example-golden.cpp - $(CXX) -Wall -O3 example-golden.cpp $(CXXFLAGS) -lmpfr -o $@ + $(CXX) example-golden.cpp $(CXXFLAGS) -lmpfr -o $@ example-logged.exe: example-logged.cpp $(LOGGER) - $(CXX) -Wall -O3 $(LOGGER) example-logged.cpp $(CXXFLAGS) -o $@ + $(CXX) $(LOGGER) example-logged.cpp $(CXXFLAGS) -mllvm --enzyme-inline=0 -o $@ example.txt: example-logged.exe ./example-logged.exe > $@ diff --git a/example/example.c b/example/example.c index bff9b18..9dfe018 100644 --- a/example/example.c +++ b/example/example.c @@ -6,6 +6,7 @@ // ## PRE c: 1, 9 // ## PRE a: 1, 9 // ## PRE b: 1, 9 +__attribute__((noinline)) double example(double a, double b, double c) { double tmp; if (a < b) {