Work around bug in nvcc in cuda 10.1

This commit is contained in:
Davis King 2019-03-03 17:01:48 -05:00
parent c3ee638b3f
commit 02ed083c4c
1 changed files with 5 additions and 5 deletions

View File

@ -1771,7 +1771,7 @@ namespace dlib
explicit literal_assign_helper(matrix* m_): m(m_), r(0), c(0),has_been_used(false) {next();} explicit literal_assign_helper(matrix* m_): m(m_), r(0), c(0),has_been_used(false) {next();}
~literal_assign_helper() noexcept(false) ~literal_assign_helper() noexcept(false)
{ {
DLIB_CASSERT(!has_been_used || r == m->nr(), DLIB_CASSERT(!has_been_used || r == (*m).nr(),
"You have used the matrix comma based assignment incorrectly by failing to\n" "You have used the matrix comma based assignment incorrectly by failing to\n"
"supply a full set of values for every element of a matrix object.\n"); "supply a full set of values for every element of a matrix object.\n");
} }
@ -1780,14 +1780,14 @@ namespace dlib
const T& val const T& val
) const ) const
{ {
DLIB_CASSERT(r < m->nr() && c < m->nc(), DLIB_CASSERT(r < (*m).nr() && c < (*m).nc(),
"You have used the matrix comma based assignment incorrectly by attempting to\n" << "You have used the matrix comma based assignment incorrectly by attempting to\n" <<
"supply more values than there are elements in the matrix object being assigned to.\n\n" << "supply more values than there are elements in the matrix object being assigned to.\n\n" <<
"Did you forget to call set_size()?" "Did you forget to call set_size()?"
<< "\n\t r: " << r << "\n\t r: " << r
<< "\n\t c: " << c << "\n\t c: " << c
<< "\n\t m->nr(): " << m->nr() << "\n\t m->nr(): " << (*m).nr()
<< "\n\t m->nc(): " << m->nc()); << "\n\t m->nc(): " << (*m).nc());
(*m)(r,c) = val; (*m)(r,c) = val;
next(); next();
has_been_used = true; has_been_used = true;
@ -1802,7 +1802,7 @@ namespace dlib
) const ) const
{ {
++c; ++c;
if (c == m->nc()) if (c == (*m).nc())
{ {
c = 0; c = 0;
++r; ++r;