OpenCL and MinGW problems


I’m using Code::Blocks IDE with MinGW and I’m having some problems with cl.hpp. When I try to compile my program I get an error because cl.hpp tries to include intrin.h which doesn’t exist in MinGW, so I changed it to x86intrin.h which I believe is the MinGW equivalent of intrin.h. However, now I get an error on cl.hpp line 1041 saying that _mm_mfence was not defined in this scope. This is the line where the error is:

inline void fence() { _mm_mfence();}

If I simply comment out that line and every occurence of fence() in cl.hpp it all compiles and works perfectly, but I fear that this might cause some problems in future? Is there a way to get this working properly?


Nevermind, I just had to set compiler flag that allows sse2 instructions, and now it works as it should.