c++ - gcc-5.2 cilk plus offload to intel gfx hardware -


can offload graphics hardware using cilk plus 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) pin(out, in1, in2 : length(n)) 

the compiler gives above warning following test code:

#include <iostream> #include <cilk/cilk.h>  void vec_add(int n, float *out, float *in1, float *in2) { #pragma offload target(gfx) pin(out, in1, in2 : length(n))     cilk_for(int = 0; != n; ++i)     {         out[i] = in1[i] + in2[i];     } }  static int ar_sz = 100000; int main (int argc, char **argv) {     float foo[ar_sz];     float bar[ar_sz];     float out[ar_sz];     for(int = 0; != ar_sz; ++i)     {         foo[i] = + ar_sz * 10;         bar[i] = i;     }     vec_add(ar_sz, out, foo, bar);      for(int = 0; != ar_sz; += 100)     {         std::cout << "foo[" << << "] =" << foo[i] << "\t|\tbar[" << << "] =" <<  bar[i] << std::endl;     } } 

compiled with

flags=-std=c++14 -wall -o3 -march=native -fcilkplus  all: vec_add fib  vec_add: vec_add.cpp     g++ $(flags) $< -o $@ 

gcc not support offload pragma far know, it's not possible this. actually, warning message explicitly saying unknown pragma.


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -