Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for MSVC #26

Open
victor-zou opened this issue Nov 23, 2022 · 0 comments
Open

Fix for MSVC #26

victor-zou opened this issue Nov 23, 2022 · 0 comments

Comments

@victor-zou
Copy link

Three places need to fix if want to compile with MSVC:

  1. complex types in MSVC-C is _Fcomplex and _Dcomplex, not conforming to C99 , should should replace xxx _Complex with following macro:
#ifndef HPTT_C_FLT_COMPLEX
#ifdef _MSC_VER
  #define HPTT_C_FLT_COMPLEX _Fcomplex
  #define HPTT_C_DBL_COMPLEX _Dcomplex
#else
  #define HPTT_C_FLT_COMPLEX float _Complex
  #define HPTT_C_DBL_COMPLEX double _Complex
#endif
#endif
  1. the INLINE macro should add specification with MSVC: __forceinline
#if defined(__ICC) || defined(__INTEL_COMPILER) || defined(_MSC_VER)
# define INLINE __forceinline
#elif .....
  1. MSVC does not support VLA, should use _alloca instead.
#ifdef _MSC_VER
#define HPTT_DECL_VLA(type_, name_, len_) type_* name_ = reinterpret_cast<type_*>(_alloca(sizeof(type_)*len_));
#else 
#define HPTT_DECL_VLA(type_, name_, len_) type_ name_[len_];
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant