Questions tagged [cilk-plus]

Intel® Cilk™ Plus is an extension to C and C++ that improves the performance of programs on multicore processors.

Intel® Cilk™ Plus is an extension to C and C++ that improves the performance of programs on multicore processors. The three Intel Cilk Plus keywords provide a simple model for parallel programming, while runtime and template libraries offer an environment for building parallel applications.

Source: Intel Developer Zone

79 questions
0
votes
2 answers

gcc-5.2 cilk plus offload to intel gfx hardware

Can we offload to the graphics hardware using cilk plus with gcc-5.2 g++ -std=c++14 -Wall -O3 -march=native -fcilkplus vec_add.cpp -o vec_add vec_add.cpp:6:0: warning: ignoring #pragma offload target [-Wunknown-pragmas] #pragma offload target(gfx)…
Hal
  • 1,061
  • 7
  • 20
0
votes
1 answer

compile cilk plus code centos 7 gcc-5.2 devtoolset-4

#include #include int fib(int n) { if (n < 2) return n; int x = cilk_spawn fib(n-1); int y = fib(n-2); cilk_sync; return x + y; } int main(int argc, char ** argv) { for (int i = 0; i != 20; ++i) { …
Hal
  • 1,061
  • 7
  • 20
0
votes
1 answer

Error while installing Cilk Plus on Mac OS X (El Capitan)

I have encountered issues while installing the CilkPlus on my Mac OS X.Following the installation page, I have executed the following commands in the following order: $mkdir Cilk $cd Cilk $git clone -b cilkplus https://github.com/cilkplus/llvm…
letsBeePolite
  • 2,183
  • 1
  • 22
  • 37
0
votes
1 answer

Installation on Cilk Plus on Mac OS X

How to install the CilkPlus on Mac OS X? When I checked g++ version on my Mac it showed the following: Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 7.0.2…
letsBeePolite
  • 2,183
  • 1
  • 22
  • 37
0
votes
1 answer

How is cilk reduce done (thread vs smid)

I have something like that : for (b=from; bac[b] += srcvec->ac[a] * srcmatrix->weight[a+(b+from)*matrix_width]; } } that i'd like to parallelize using cilk. I have written the…
Arkantus
  • 120
  • 1
  • 10
0
votes
1 answer

Why offloading using _Cilk_offload wants every function to be _Cilk_shared?

I have declared some global variables to be _Cilk_shared. They are used in the functions that I want to offload They are used in some functions I do not want to be offloaded as well. So initially I only declared those functions that I need to…
yidiyidawu
  • 303
  • 1
  • 3
  • 12
0
votes
2 answers

Using Cilk reducer inside Cilk shared function

Hi I am trying to offload some parallel work to MIC using _Cilk_Shared and _Cilk_offload. I declare a Cilk shared function: _Cilk_shared void somefun(int count) In main I call this function using _Cilk_offload somefun(12) ; inside this function…
yidiyidawu
  • 303
  • 1
  • 3
  • 12
0
votes
1 answer

is it ok to construct from a stl container which has a different allocator?

Say I have std::vector A std::vector B I am using __offload::shared_allocator as allocator2 in Cilk Plus for offloading from Host CPU to Xeon Phi coprocessor Can I…
yidiyidawu
  • 303
  • 1
  • 3
  • 12
0
votes
1 answer

Xeon phi offload mode how to take advantage of both thread parallelism and vectorization

I am doing some performance test on Xeon phi using cilk plus with offload. In a simple vector add program I have 2 ways to do it: using cilk_for to split tasks to different threads in Xeon phi: __declspec(target(mic)) void vector_add(double…
yidiyidawu
  • 303
  • 1
  • 3
  • 12
0
votes
1 answer

Why does this Cilk Array Notation matrix perform nearly twice as slow as the serial version?

I'm benchmarking matrix multiplication performance for serial and Cilk array notation versions. The Cilk implementation takes nearly twice as long as the serial and I don't understand why. This is for single core execution This is the meat of the…
geg
  • 4,399
  • 4
  • 34
  • 35
0
votes
1 answer

Using Cilk Plus with MinGW-w64 (gcc 4.9.2)?

Is it possible to use Cilk Plus with MinGW-w64 (x86_64-4.9.2-posix-sjlj-rt_v3-rev0)? When I dont use -fcilkplus option, compiler gives me an error "-fcilkplus must be enabled to use '_Cilk_spawn'" - so obviously it recognizes extensions keyword. On…
MKPS
  • 175
  • 8
0
votes
1 answer

cilk_for error for parallelizing over std::set missing operator-()

I was trying to use cilk_for for iterating over set. turns out that it does not have operator-(..) defined for set. the Cilk_for tutorial explains the reason but did not provide any example to handle such case. they say the following should be…
Pogo
  • 475
  • 3
  • 19
0
votes
1 answer

Why does CILK_NWORKERS affect program with only one cilk_spawn?

I am trying to paralellize a matrix processing program. After using OpenMP I decided to also check out CilkPlus and I noticed the following: In my C code, I only apply parallelism in one part i.e.: //(test_function declarations) cilk_spawn…
koukouviou
  • 820
  • 13
  • 23
0
votes
1 answer

How to use Intel (c) Cilk Plus with CodeBlocks

I have been recently learning multi-threaded algorithms from Introduction to Algorithms (by Cormen, Rivest), third edition. And the preface of the book inspired me to use Cilk Plus extension for the same developed by MIT. However, I have not been…
nerdier.js
  • 591
  • 1
  • 4
  • 15
0
votes
1 answer

The strange copy behavior of Intel Cilk Plus array notation

I'm using Intel Cilk Plus array notation to practice vector programming. However, I met strange copy behaviors of array assignments. The problem to solve is parallel prefix. D is input, and P is output. //Wrong result code. Tested on Intel icc…
hwang
  • 53
  • 7