This bugzilla service is closed. All entries have been migrated to https://gitlab.com/libeigen/eigen
Bug 861 - _mm_malloc() and _mm_free() incorrectly selected when compiling with Portland Group compiler
Summary: _mm_malloc() and _mm_free() incorrectly selected when compiling with Portland...
Status: RESOLVED FIXED
Alias: None
Product: Eigen
Classification: Unclassified
Component: General (show other bugs)
Version: 3.2
Hardware: x86 - 64-bit Linux
: Normal Compilation Problem
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-20 20:11 UTC by drnairb
Modified: 2019-12-04 13:37 UTC (History)
3 users (show)



Attachments
Enable posix_memalign with PGI (961 bytes, patch)
2014-08-22 09:00 UTC, Gael Guennebaud
no flags Details | Diff

Description drnairb 2014-08-20 20:11:07 UTC
When compiling with the Portland Group C++ compiler (v14.4, haven't tried anything older), the macro EIGEN_HAS_MM_MALLOC is activated, which sets the pointer function aligned_malloc() to use _mm_malloc(), and the pointer function aligned_free() to use _mm_free() in Eigen/src/Core/util/Memory.h. The Portland compiler does not implement either of these functions, causing an error during compilation.

The macro is activated because Eigen activates EIGEN_VECTORIZE_SSE in the file "Core". I think this macro in turn is activated through the definition of EIGEN_SSE2_ON_NON_MSVC_BUT_NOT_OLD_GCC.

I believe the correct function to use for Portland is posix_memalign() (see this thread: http://www.pgroup.com/userforum/viewtopic.php?t=3573&sid=4b01d3b80e36d77323fe55ec82f53854). This means that the macro EIGEN_HAS_POSIX_MEMALIGN should be defined instead of EIGEN_HAS_MM_MALLOC. I have forced this definition in Memory.h and Portland does indeed compile without error.
Comment 1 Gael Guennebaud 2014-08-22 09:00:52 UTC
Created attachment 487 [details]
Enable posix_memalign with PGI

Could you test the attached fix and confirm that it is doing the job. Thank you.
Comment 2 drnairb 2014-08-22 17:03:12 UTC
That patch does indeed fix the compilation error. The resulting code produces the correct results as well. Thanks for the quick response.
Comment 4 Nobody 2019-12-04 13:37:21 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/861.

Note You need to log in before you can comment on or make changes to this bug.