- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page