Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

inlining failed in call to always_inline '__m256d _mm256_broadcast_sd(const double*)'

I'm trying to run a Visual Studio cpp project created by a friend of mine. I'm trying to run the file without VS. But I'm getting a list of errors, all in the same format:

inlining failed in call to always_inline '__m256d _mm256_broadcast_sd(const double*)': target specific option mismatch|

It runs correctly in VS with release mode and breaks when run in debug mode.

The includes are as follows:

#include "stdafx.h"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <vector>
# include <omp.h>
#include <chrono>
#include <fstream>
#include <algorithm>

#include <immintrin.h>

using namespace std::chrono;
using namespace std;

and the error is called from here:

double zero = 0;
__m256d acc = _mm256_broadcast_sd(&zero);

Update:

I'm using the this command to run it: g++ -std=c++0x multip.cpp -o multip, is there an additional parameter to add -mavx to the compiler invocation?

like image 613
S.Dan Avatar asked Dec 23 '22 16:12

S.Dan


1 Answers

"Target specific option mismatch" means that you're missing a feature flag from your GCC invocation. You probably need to add -mavx to your compiler invocation.

If you're intending to run this on your computer only, -march=native will turn on all the feature flags that your own machine supports.

like image 51
zneak Avatar answered Dec 26 '22 12:12

zneak