Registered Member
|
Is there an option in Eigen that would make it check the bounds in BLAS-1 and more expensive functions, while leaving element-level access unsafe and fast?
For large arrays, checking that their sizes agree before operating on them adds a negligible overhead, while for element-level access the overhead can be dramatic. During development/debugging, I like to check things as much as possible, but for "Release", only where it costs little. |
Moderator
|
Bounds checking are disabled in "Release" mode, that is when compiling with -DNDEBUG or -DEIGEN_NO_DEBUG.
|
Registered Member
|
Right. My question is if it's possible to partially enable it, i.e. make
I work with largish matrices, so the above would be a better "Release" mode than not checking anything anywhere (equally fast, but safer). |
Moderator
|
I see. We do have this subtle difference for internal debugging but not for operator(). In Eigen's own code we use some_mat.coeff(i,j) and some_mat.coeffRef(i,j) for which no bound checking are performed (they are performed once before starting the computation). However for internal debugging we can enable bound checking for them by compiling with -DEIGEN_INTERNAL_DEBUGGING=1.
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], Yahoo [Bot]