Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Library : Other (not classified elsewhere) » Eigen updated
Re: Eigen updated [message #54019 is a reply to message #54016] Thu, 21 May 2020 16:50 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
Hello.

Please check second variant of the patch in Redmine #2035, which may fix reference/Eigen_demo build.
Re: Eigen updated [message #54020 is a reply to message #54019] Thu, 21 May 2020 17:48 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Great Sender

With your first patch, now MSVC works in W10 (MinGW and CLANG worked before).
However the problem remains in Ubuntu.
I have added information in your Redmine bug as in Core/Oops.h, in line 395, RGBA should have to be dword.


Best regards
Iñaki
Re: Eigen updated [message #54025 is a reply to message #54020] Fri, 22 May 2020 09:25 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Dear Sender

Some changes have been included in last version, but not all.
I am overwhelmed, vectorization and intrinsics are out of my knowledge.

It is like if including #include <smmintrin.h> in an include (Core/Blit.h), hides __m128* unions. However I do not know why. Maybe caused by name mangling?
Replacing #ifdef CPU_X86 with #if defined(CPU_X86) && defined(__SSE2__) just avoids the problem by avoiding #include <smmintrin.h>.

Maybe these new options in Core/Blit.h require adding new compiler flags?


Best regards
Iñaki

[Updated on: Fri, 22 May 2020 09:26]

Report message to a moderator

Re: Eigen updated [message #54029 is a reply to message #54025] Fri, 22 May 2020 10:08 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
koldo wrote on Fri, 22 May 2020 07:25

Replacing #ifdef CPU_X86 with #if defined(CPU_X86) && defined(__SSE2__) just avoids the problem by avoiding #include <smmintrin.h>

The __SSE2__ define was used for <emmintrin.h> include, because of _mm_set1_epi32 usage. There is a possibility to use <immintrin.h> include for available intrinsics:
#ifdef __SSE2__
#include <emmintrin.h>
#endif

or <x86intrin.h>:
#include <immintrin.h>

But may need to check for related define where related intrinsic(s) used, I guess.

Some examples of how this was done for Eigen:
uppsrc/plugin/Eigen/Eigen/src/Core/util/ConfigureVectorizati on.h:236-238:
#ifdef __SSE4_1__
	#define EIGEN_VECTORIZE_SSE4_1
#endif

uppsrc/plugin/Eigen/Eigen/src/Core/util/ConfigureVectorizati on.h:350-352:
#ifdef EIGEN_VECTORIZE_SSE4_1
	#include <smmintrin.h>
#endif

for OpenGL Mathematics (GLM):
uppsrc/plugin/glm/simd/platform.h:242:
#define GLM_ARCH_SSE2	(GLM_ARCH_SSE2_BIT | GLM_ARCH_SSE)

uppsrc/plugin/glm/simd/platform.h:296-297:
#	elif defined(__SSE2__) || defined(__x86_64__) || defined(_M_X64) || defined(_M_IX86_FP)
# define GLM_ARCH (GLM_ARCH_SSE2)

uppsrc/plugin/glm/simd/platform.h:340-342:
#elif GLM_ARCH & GLM_ARCH_SSE2_BIT
#	include <emmintrin.h>
#endif//GLM_ARCH

Possible to fix Eigen build issue, if place usage of intrinsic(s) (e.g. in uppsrc/Core) inside of C/C++ (*.c/*.cpp) instead of header (*.h) files. Maybe there are other methods.

[Updated on: Fri, 22 May 2020 10:25]

Report message to a moderator

Re: Eigen updated [message #54030 is a reply to message #54029] Fri, 22 May 2020 10:23 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Quote:
Possible to fix Eigen build issue, if place usage of intrinsic(s) (e.g. in uppsrc/Core) inside of C++ (*.cpp) instead of header (*.h) files. Maybe there are other methods.
Yes, that would solve it all.
The problem of this is that inline functions have to be in .h, and Core/Blit.h includes inline void memsetd().


Best regards
Iñaki
Re: Eigen updated [message #54037 is a reply to message #54030] Fri, 22 May 2020 11:42 Go to previous messageGo to next message
Sender Ghost is currently offline  Sender Ghost
Messages: 301
Registered: November 2008
Senior Member
koldo wrote on Fri, 22 May 2020 08:23
Quote:
Possible to fix Eigen build issue, if place usage of intrinsic(s) (e.g. in uppsrc/Core) inside of C++ (*.cpp) instead of header (*.h) files. Maybe there are other methods.
Yes, that would solve it all.
The problem of this is that inline functions have to be in .h, and Core/Blit.h includes inline void memsetd().

Looks like, the Eigen build issue with <smmintrin.h> include was because of its include inside of (Upp) namespace.
I attached newer patch in Redmine #2035. But if there is a need to support CPUs without SSE2 instructions, there is a need to provide other implementations, based on __SSE2__ (or other) check, I guess.

[Updated on: Fri, 22 May 2020 11:54]

Report message to a moderator

Re: Eigen updated [message #54041 is a reply to message #54037] Fri, 22 May 2020 12:49 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Awesome Sender, you got it!
I have asked Mirek and Tom here to consider your patch.
I owe you one.


Best regards
Iñaki
Re: Eigen updated [message #54071 is a reply to message #54041] Sat, 30 May 2020 00:10 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
This is me again with bad news.
I tried to compile Eigen_demo for Windows using CLANG (actually, I compiled on Linux using wine), and CLANG never fished compilation. I guess this is a bug with CLANG shipped with Upp.
Or it is a bug with Eigen_demo itself ...
Command used for compilation:
wine umk reference Eigen_demo CLANG -bus


Regards,
Novo
Re: Eigen updated [message #54076 is a reply to message #54071] Sat, 30 May 2020 11:32 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Dear Novo

I cannot reproduce your problem in my W10, using CLANG from U++ and MSVC, both 32 and 64 bits.
Anyway, now it is just updated the very last version, with tiny changes. Please check it just in case, and send the error messages.
Thank you for your support.


Best regards
Iñaki

[Updated on: Sat, 30 May 2020 11:33]

Report message to a moderator

Re: Eigen updated [message #54089 is a reply to message #54076] Sun, 31 May 2020 07:05 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
I was able to compile it in Release configuration.
$ wine umk reference Eigen_demo CLANGx64 -brus
----- Core ( CLANG SHARED BLITZ WIN32 ) (1 / 4)
----- plugin/Eigen ( CLANG SHARED BLITZ WIN32 ) (2 / 4)
----- plugin/z ( CLANG SHARED BLITZ WIN32 ) (3 / 4)
----- Eigen_demo ( MAIN CLANG SHARED BLITZ WIN32 ) (4 / 4)
BLITZ: eigen_demo.cpp non-linear.cpp fft.cpp
Eigen_demo: 3 file(s) built in (1:37.71), 32570 msecs / file
Linking...
Z:\home\ssg\.local\soft\bb-worker\worker\wine-upp\build\.cache\upp.out\CLANGx64.Blitz.Shared\Eigen_demo.exe (2488320 B) linked in (0:00.69)

It takes a minute and a half.
I never saw it finishing compilation in Debug.
TheIde and Clang are from March 3-rd 2020. I guess this is a release.
Tested on Linux with wine.


Regards,
Novo

[Updated on: Sun, 31 May 2020 07:05]

Report message to a moderator

Re: Eigen updated [message #54093 is a reply to message #54089] Sun, 31 May 2020 20:44 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Dear Novo

I have never used wine with U++. However, I will try to run it all to try to reproduce your problem.
On the other side, I can promise that it works everyday in tenths of computers with W10.


Best regards
Iñaki
Previous Topic: [Proposal] Blur algorithm (fast box blur with gaussian approximation)
Next Topic: Set mouse position
Goto Forum:
  


Current Time: Fri Mar 29 09:13:52 CET 2024

Total time taken to generate the page: 0.01498 seconds