- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can Intel Parallel Studio C++ Compiler compile parallel C++ program with all C++ 17 & Parallel TS (Technical Standard) features please?
Can Intel Parallel Studio C++ Compiler compile below given parallel C++ program please?
Following web site has small program to parallel sum elements of a Vector:
http://en.cppreference.com/w/cpp/experimental/reduce
#include <iostream>
#include <chrono>
#include <vector>
#include <numeric>
// #include <experimental/execution_policy>
// #include <experimental/numeric>
#include <experimental/execution_policy>
#include <experimental/numeric>
int main()
{
std::vector<double> v(10'000'007, 0.5);
{
auto t1 = std::chrono::high_resolution_clock::now();
double result = std::accumulate(v.begin(), v.end(), 0.0);
auto t2 = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::milli> ms = t2 - t1;
std::cout << std::fixed << "std::accumulate result " << result
<< " took " << ms.count() << " ms\n";
}
{
auto t1 = std::chrono::high_resolution_clock::now();
double result = std::experimental::parallel::reduce(
std::experimental::parallel::par,
v.begin(), v.end());
auto t2 = std::chrono::high_resolution_clock::now();
std::chrono::duration<double, std::milli> ms = t2 - t1;
std::cout << "parallel::reduce result "
<< result << " took " << ms.count() << " ms\n";
}
}
Above program output will be:
<
std::accumulate result 5000003.50000 took 12.7365 ms
parallel::reduce result 5000003.50000 took 5.06423 ms
>
I compiled this program using Microsoft Visual C++ 2017 Professional.
Compiler is giving following errors:
cannot open source file "experimental/execution_policy"
cannot open source file "experimental/numeric"
Any information to resolve these compilation errors please?
I do not have Intel C++ compiler at present.
Before, I buy Intel C++ compiler, I like to confirm Intel C++ compiler software will compile above shown parallel C++ program and other such parallel programs please?
Thanks
- Tags:
- Parallel Computing
Link Copied
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page