Prev | Next |
xpackage
to the speed tests:
git grep -l xpackage
your_package
is the name of a package you
want to add to the speed tests.
If you are using a Unix system,
executing the following commands in the distribution directory
will use xpackage
as a template for your package:
cp -r speed/xpackage speed/your_package
for file in `ls speed/your_package`
do
sed -i speed/your_package/$file \
-e 's|xpackage|your_package|' \
-e 's|Xpackage|Your_package|' \
-e 's|CPPAD_XPACKAGE_SPEED|YOUR_PACKGE|'
done
git checkout speed/CMakeLists.txt
sed -i speed/CMakeLists.txt \
-e 's|^.*(xpackage)|ADD_SUBDIRECTORY(your_package)\n&|'
git checkout speed/main.cpp
line1='# ifdef CPPAD_YOUR_PACKAGE_SPEED'
line2='# define AD_PACKAGE "your_package"'
line3='# endif'
sed -i speed/main.cpp \
-e "/CPPAD_XPACKAGE_SPEED/s|^|$line1\n$line2\n$line3\n|"
where
your_package
has been replaced by the name of the new package
Your_package
is a capitalized version of the name, and
YOUR_PACKAGE
is an all caps version of the name.
bin/run_cmake.sh --no_optional
cd build/speed/your_package
make check_speed_your_package VERBOSE=1
This should result in the following output:
...
your_package_det_lu_available = false
your_package_det_minor_available = false
your_package_mat_mul_available = false
your_package_ode_available = false
your_package_poly_available = false
your_package_sparse_hessian_available = false
your_package_sparse_jacobian_available = false
All 0 correctness tests passed.
No memory leak detected
speed main: OK
[100%] Built target check_speed_your_package
You can not edit one or more of the
*.cpp
files in the
your_package
directory so that the corresponding speed test
is available and then run the corresponding test using the
speed_main
instructions.
See speed_cppad
for examples of how to do this for each
of the speed tests.