Skip to content

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

@guignont

Description

@guignont

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions