non-deterministic memory size of Jet

11 views
Skip to first unread message

Miłosz Makowski

unread,
Jun 24, 2022, 7:56:49 AM6/24/22
to Ceres Solver
Hi,

I noticed that the following code:
sizeof(ceres::Jet<double, N>) / sizeof(double)
sometimes returns N+1 and sometimes N+2

Shouldn't it always be N+1?
Is it only me or have you also encountered such an issue?

Btw, I'm compiling with Clang 14 on Ubuntu 20.04 (64-bit).

Cheers,
Miłosz

Sameer Agarwal

unread,
Jun 24, 2022, 8:20:19 AM6/24/22
to ceres-...@googlegroups.com
That's odd, the only thing I can think about is it being an alignment related issue, but I am not sure.

--
You received this message because you are subscribed to the Google Groups "Ceres Solver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ceres-solver...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ceres-solver/9d4c3434-c9fb-4f14-b52f-0cd5c6793f62n%40googlegroups.com.

Sergiu Deitsch

unread,
Jun 24, 2022, 8:28:24 AM6/24/22
to ceres-...@googlegroups.com
No, the size of the Jet depends on class padding and the size of the internal Eigen::Matrix member that might be influenced by additional compiler settings (e.g., those that affect vectorization).

--

Miłosz Makowski

unread,
Jun 24, 2022, 11:08:40 AM6/24/22
to Ceres Solver
Thank you for the explanation, Sergiu
Reply all
Reply to author
Forward
0 new messages