Patch correspoding to upstream source 20210000.5.

This patched to the optimizers implementation of atomic functions and
needed to the same change for several different atomic function operators.
This commit is contained in:
Brad Bell 2021-02-19 03:14:35 -07:00
commit e41fd191ef

View file

@ -13,7 +13,7 @@
# https://fedoraproject.org/wiki/Packaging:Versioning
Name: cppad
Version: %{yyyymmdd}.3
Release: 2%{?dist}
Release: 3%{?dist}
Summary: C++ Algorithmic Differentiation (AD), %{name}-devel and %{name}-doc
License: EPL-2.0 or GPLv2+
@ -85,8 +85,9 @@ tar -xzf %{_topdir}/SOURCES/%{yyyymmdd}.doc.tar.gz
mv CppAD-%{yyyymmdd}.doc/doc CppAD-%{version}/doc
mv CppAD-%{version}/COPYING COPYING
mv CppAD-%{version}/uw_copy_040507.html uw_copy_040507.html
#
# Patch corresponding to bug fix in unstream source 20210000.4
# ---------------------------------------------------------------------------
# Patch corresponding to bug fix in upstream source 20210000.4
# ---------------------------------------------------------------------------
cp CppAD-%{version}/include/cppad/core/abs_normal_fun.hpp \
CppAD-%{version}/include/cppad/core/abs_normal_fun.bak
for uu in vp pv vv
@ -97,7 +98,83 @@ do
done
sed -i CppAD-%{version}/include/cppad/core/abs_normal_fun.hpp \
-e 's|^\( *\)case ZmulvvOp:|\1case PowvvOp:\n&|'
# ---------------------------------------------------------------------------
# Patch corresponding to fix in upstream source 20210000.5
# ---------------------------------------------------------------------------
file="CppAD-%{version}/test_more/general/atomic_three.cpp"
cat << EOF > junk.sed
s|f.size_par() == 5;|f.size_par() == 6;|
s|f.size_par() == 4;|f.size_par() == 5;|
s|f.size_par() == 2;|f.size_par() == 3;|
EOF
sed -i $file -f junk.sed
#
file="CppAD-%{version}/test_more/general/new_dynamic.cpp"
cat << EOF > junk.sed
s|== num_dyn_ind + 1 + 2;|== num_dyn_ind + 1 + 3;|
s|== nd + 2 + 2;|== nd + 2 + 3;|
EOF
sed -i $file -f junk.sed
#
file="CppAD-%{version}/include/cppad/local/optimize/optimize_run.hpp"
cat << EOF > junk.sed
/nan with type Base/! b one
N;N;N
d
b end
#
: one
/const size_t num_var/! b two
s|^|# ifndef NDEBUG\\n|
s|\$|\\n# endif|
b end
#
: two
/set new_par for the dependent dynamic parameters/! b three
s|^| // index corresponding to the parameter zero\\
addr_t zero_par_index = rec->put_con_par( Base(0) );\\n\\n|
b end
#
: three
/case FunapOp:/! b four
N;N;N;N;N;N;N
s|\\n *if.*||
s|$|\\
if( new_arg[0] == addr_t_max )\\
new_arg[0] = zero_par_index;\\
rec->PutArg(new_arg[0]);|
b end
#
: four
/if( size_t(new_arg.0.) < num_var )/! b five
s|if|CPPAD_ASSERT_UNKNOWN|
s|$|;\\
if( new_arg[0] != 0 )|
b end
#
: five
/new_arg.0. =.*base_nan/! b six
s|=.*|= zero_par_index;|
: six
/case FunrpOp:/! b seven
N;N;N;N;N;N;N;N;N;N;N;N
s|\\n *if.*||
s|$|\\
if( new_arg[0] == addr_t_max )\\
{ // This parameter is not used here or anywhere.\\
CPPAD_ASSERT_UNKNOWN( op_usage[i_op] == usage_t(no_usage) );\\
new_arg[0] = zero_par_index;\\
}\\
rec->PutArg(new_arg[0]);\\
//|
b end
#
: seven
s|rec->PutArg(0);.*|rec->PutArg( zero_par_index );|
: end
EOF
sed -i $file -f junk.sed
# ----------------------------------------------------------------------------
# cppad_lib: replace soversion number and ensure build type is release
sed -i.bak CppAD-%{version}/cppad_lib/CMakeLists.txt \
-e "s|print_variable(soversion)|SET(soversion %{soversion} )\n&|" \
@ -195,6 +272,9 @@ make %{?_smp_mflags} check
# ----------------------------------------------------------------------------
%changelog
* Thu Feb 18 2021 Brad Bell <bradbell at seanet dot com> - 20210000.3-3
- Patch corresponding to bug fix in upstream source 20210000.5
* Tue Feb 02 2021 Brad Bell <bradbell at seanet dot com> - 20210000.3-2
- Patch corresponding to bug fix in upstream source 20210000.4