Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added an experimental_tests.py file to run some tests that are likely…
… to be trouble improved the tape equivalence example: uses the <<= operator to reduce the num_max_lives adouble( adub(x)) now works
- Loading branch information
Showing
7 changed files
with
76 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,2 +1,5 @@ | |||
jac_pat.mtx | jac_pat.mtx | ||
!*.png | !*.png | ||
|
|||
*.tap | |||
tape_0.tex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,30 @@ | |||
import numpy | |||
from adolc import * | |||
def test_big_tape(): | |||
""" | |||
Hmm, this should raise an error because num_max_lives is bigger than the value buffer | |||
""" | |||
N = 65534*4 | |||
|
|||
ay = adouble(0.) | |||
ax = adouble(0.) | |||
x = 1. | |||
|
|||
# usual way: leads to increasing locints | |||
trace_on(0) | |||
independent(ax) | |||
ay = ax | |||
for i in range(N): | |||
ay = ay * ay | |||
|
|||
dependent(ay) | |||
trace_off() | |||
|
|||
print tapestats(0) | |||
print function(0,[1.]) | |||
#tape_to_latex(0,numpy.array([1.]),numpy.array([0.])) | |||
|
|||
|
|||
|
|||
if __name__ == "__main__": | |||
test_big_tape() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,25 @@ | |||
adolc_include_path = '/home/basti/workspace/adolc-2.0.0' | |||
adolc_library_path = '/home/basti/workspace/adolc-2.0.0/adolc/.libs' | |||
|
|||
LIBS = ['adolc', | |||
] | |||
LIBPATH = [ | |||
adolc_library_path, | |||
] | |||
INCLUDEPATH = [ | |||
adolc_include_path, | |||
'/usr/include/python2.5' | |||
] | |||
|
|||
|
|||
env = Environment( | |||
CPPPATH = INCLUDEPATH, | |||
CXXFLAGS= "-ftemplate-depth-100 -Wall -O2", | |||
LIBPATH =LIBPATH, | |||
LIBS = LIBS, | |||
RPATH = LIBPATH, #include information where shared libraries can be found to avoid errors like: "ImportError: libboost_python-gcc42-mt-1_34_1.so.1.34.1: cannot open shared object file: No such file or directory" | |||
SHLIBPREFIX="", #gets rid of lib prefix, i.e. get mylib.so instead of libmylib.so | |||
) | |||
Default('.') | |||
my_executable = env.Program(target='benchmark.exe', source=['benchmark.cpp']) | |||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters