Registered Member
|
Hi,
I am trying to implement multithreading in a program I've written, but I've run into an issue I can't resolve. The program works with no problems when run sequentially, but it causes unaligned array assertion failures when I try to parallelize a section in a for loop. I think I've traced it down to the declaration of quaternions in a function within the loop. The following test code demonstrates the issue I'm seeing. Everything is fine in the master thread, but all of the other threads have the assertion failure. Oddly, it seems to also happen with an Array of size 4, but not an Array of size 3. I'm probably missing something obvious. Any suggestions would be greatly appreciated, Best Regards, Mike
|
Moderator
|
Works fine here (OSX and Linux). This is probably because the alignment of the stack is not preserved within the generated threads. I guess You are running on windows? Then you can either disable static alignment globally with EIGEN_DONT_ALIGN_STATICALLY or locally using Array<float,4,1,DontAlign>, or Quaternion<float,DontAlign> types. This will disable vectorization for these objects.
|
Registered Member
|
Thanks for the quick reply!
Yes, I am using windows. I appreciate the advice. Best Regards, Mike |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft