Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
10 Views

Unexpected behaviour of compiled code

I am having problems with Intex C++ compiler 18.0.1 and TBB. The sample code looks like this: #include #include "tbb/tbb.h" #include "tbb/parallel_for.h" #include "tbb/blocked_range.h" __declspec(cpu_dispatch(generic, core_4th_gen_avx)) void do_stuff(){} __declspec(cpu_specific(core_4th_gen_avx)) void do_stuff() { std::cout << "in AVX2 version: "; tbb::parallel_for(0,10,[&](const unsigned int m) { if (m == 5) std::cout << "utilizing AVX2 version parallel_for\n"; }); } __declspec(cpu_specific(generic)) void do_stuff() { std::cout << "in generic version: "; tbb::parallel_for(0,10,[&](const unsigned int m) { if (m == 5) std::cout << "utilizing generic version parallel_for\n"; }); } int main() { do_stuff(); return 0; } When I run the compiled binary in Intel processor that does not support AVX2-extensions I get: 'in generic version: utilizing AVX2 version parallel_for' Is this to be expected?
0 Kudos
0 Replies