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

mipp::mul<int64_t> (AVX512) is undefined! #50

Open
guignont opened this issue Nov 24, 2023 · 1 comment
Open

mipp::mul<int64_t> (AVX512) is undefined! #50

guignont opened this issue Nov 24, 2023 · 1 comment

Comments

@guignont
Copy link
Contributor

Hello,

the following code:

#include <iostream>
#include "mipp.h"

int main(int argc,char **argv)
{
  mipp::Reg<int64_t> b = 3;
  mipp::Reg<int64_t> c = 9;

  auto d = b*c;

  std::cout << b << std::endl;
  std::cout << c << std::endl;
  std::cout << d << std::endl;

  return 1;
}

terminate called after throwing an instance of 'std::runtime_error'
what(): mipp::mul<int64_t> (AVX512) is undefined!

fix proposal in mipp_impl_AVX512.hxx :

#if defined(__AVX512DQ__)
        template <>
	inline reg mul<int64_t>(const reg v1, const reg v2) {
		return _mm512_castsi512_ps(_mm512_mullo_epi64(_mm512_castps_si512(v1), _mm512_castps_si512(v2)));
	}
#else
        template <>
	inline reg mul<int64_t>(const reg v1, const reg v2) {
		return _mm512_castsi512_ps(_mm512_mullox_epi64(_mm512_castps_si512(v1), _mm512_castps_si512(v2)));
	}    
#endif
@kouchy
Copy link
Member

kouchy commented Nov 24, 2023

Hi @guignont !

Yes, it sounds like a good improvement.
Can you enable the tests for int64_t AVX512 mul and send me a PR?

If not I will do it when I will have some time ;-).

Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants