|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?FreeOZ用户注册
x
Cilk Arts, developer of the Cilk++platform which lets C++ developers more easily exploit multicoreprocessors, has joined Intel. Intel acquired the entire developmentteam and all of Cilk Arts products and technology.
According to Intel's James Reinders, Cilk technology willcomplement tools such as OpenMP and Intel Threading Building Blocks.Over the coming weeks, Cilk++ will be integrated into Intel paralleltools like Intel Parallel Studio.
Cilk technology offers parallel extensions that are tightly tiedinto a compiler. This has pluses and minuses when compared withcompiler independent methods like Intel Threading Building Blocks.Having both is better than either alone, and both will have strongfollowings.
The Cilk++ cross-platform solution lets developers maximize applicationperformance on multicore processors by providing a set of extensionsfor C++, coupled with a runtime system for multicore-enabledapplications. Cilk++ enables rapid development, testing, and deploymentof high-performance multicore applications.
Cilk++ addresses two large problems:
- Enabling programmers to develop multithreaded (or parallel) applications; and
- Providing a smooth path to multicore for legacy applicationsthat otherwise cannot easily leverage the performance capabilities ofmulticore processors.
With Cilk++, developers can retain the serial semantics ofexisting applications, use existing serial methodologies forprogramming, tooling, debugging, and regression testing.
不知道Cilk++为何物的可以从下面的代码得到感性认识:
- 1 // -*- Cilk++ -*-
- 2
- 3 // A demonstration of a Cilk for-loop.
- 4
- 5 #include <iostream>
- 6 #include <cstdlib>
- 7 #include <ctime>
- 8 #include <windows.h>
- 9 #include <cilk.h>
- 10
- 11 int dowork(int i)
- 12 {
- 13 // Waste time:
- 14 volatile int j = 0;
- 15 for (j = 0; j < 50000; ++j)
- 16 ;
- 17
- 18 return i;
- 19 }
- 20
- 21 int cilk_main(int argc, char *argv[])
- 22 {
- 23 int n = 100000;
- 24 if (argc > 1)
- 25 n = std::atoi(argv[1]);
- 26
- 27 int *a = new int[n];
- 28 for (int j = 0; j < n; ++j)
- 29 a[j] = j;
- 30
- 30 std::cout << "Iterating over " << n << " integers" << std::endl;
- 32 int = GetTickCount();
- 33
- 34 cilk_for (int i = 0; i < n; ++i)
- 35 dowork(a[i]);
- 36
- 37 int t2 = GetTickCount();
- 38 std::cout << (t2-t1)/1000 << "." << (t2-t1)%1000 << " seconds" << std::endl;
- 39
- 40 return 0;
- 41 }
复制代码 |
|