uwsampa / accept

an approximate compiler
http://accept.rocks
MIT License
37 stars 14 forks source link

Stores to multi-dimensional arrays are not marked as approximate #20

Closed sampsyo closed 10 years ago

sampsyo commented 10 years ago

This program:

#include <enerc.h>
void main () {
    APPROX float w[3];
    w[0] = 5.0f;
}

correctly produces an approximate store instruction. But this one:

#include <enerc.h>
void main () {
    APPROX float w[3][3];
    w[0][0] = 5.0f;
}

does not. Looks like assignments into double-index expressions are not correctly typed.

sampsyo commented 10 years ago

Hey @andreolb; this should work now (note the subrepo update, however).

andreolb commented 10 years ago

Hey Adrian!

Did you test this for the entire sobel benchmark? When I did so, clang crashed. I've put the traceback in /sampa/share/andreolb/output.txt

On Fri, Jul 11, 2014 at 11:32 AM, Adrian Sampson notifications@github.com wrote:

Hey @andreolb https://github.com/andreolb; this should work now (note the subrepo update, however).

— Reply to this email directly or view it on GitHub https://github.com/uwsampa/accept/issues/20#issuecomment-48766411.

André Oliveira

sampsyo commented 10 years ago

No, sorry. :frowning: I'll try to reproduce this momentarily.

sampsyo commented 10 years ago

Okay, that above commit should do it. Your sobel (freshly scp'd from the server) compiles on my machine. Maybe we should add sobel to git?

andreolb commented 10 years ago

Still doesn't work here. You're right about adding sobel to git. Could you try with the benchmark "npu-sobel" in the "npu" branch?

On Fri, Jul 11, 2014 at 2:41 PM, Adrian Sampson notifications@github.com wrote:

Okay, that above commit should do it. Your sobel (freshly scp'd from the server) compiles on my machine. Maybe we should add sobel to git?

— Reply to this email directly or view it on GitHub https://github.com/uwsampa/accept/issues/20#issuecomment-48786320.

André Oliveira

sampsyo commented 10 years ago

Works fine here:

$ cd apps
$ git checkout origin/npu npu-sobel
$ cd npu-sobel
[ ... use editor to remove includes that I don't have ... ]
$ make build_orig
/Users/asampson/uw/research/accept/apps/../build/built/bin/clang -Xclang -load -Xclang /Users/asampson/uw/research/accept/apps/../build/built/lib/EnerCTypeChecker.dylib -Xclang -add-plugin -Xclang enerc-type-checker -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include -I/Users/asampson/uw/research/accept/apps/../include -g -fno-use-cxa-atexit  -c -emit-llvm -o convolution.bc convolution.c
consumer finished
[ ... bunch of warnings, but everything compiles ... ]
sampsyo commented 10 years ago

Sorry, @andreolb; I should have asked: is this indeed ending in the same crash (the same assertion is failing) on your machine? If so, something weird is going on…

andreolb commented 10 years ago

Hey Adrian!

I saw a second commit of yours and, after that, it worked fine. Thanks!!

On Sun, Jul 13, 2014 at 8:36 PM, Adrian Sampson notifications@github.com wrote:

Sorry, @andreolb https://github.com/andreolb; I should have asked: is this indeed ending in the same crash (the same assertion is failing) on your machine? If so, something weird is going on…

— Reply to this email directly or view it on GitHub https://github.com/uwsampa/accept/issues/20#issuecomment-48862759.

André Oliveira

sampsyo commented 10 years ago

Awesome!

awesome