Software Archive
Read-only legacy content
17061 Discussions

buffer write failed

nikolaos_s_1
Beginner
622 Views

Hello,

I am trying to offload a whole program on mic by doing the following:

int mymain(int argc,char *argv[]){

...

}

 int main(int argc,char *argv[]){

#pragma offload target(mic) in(argv:length(argc)) 

mymain(argc,argv);

}

I get the following error: 

offload error: buffer write failed (error code 6)

Could you please help me?

Best,
Nikos

 

0 Kudos
2 Replies
Ravi_N_Intel
Employee
622 Views

which version of the compiler are you using.

with 16.0 compiler I do not get the error

 cat test.c
__declspec(target(mic))
int mymain(int argc,char *argv[]){
  printf("hello world\n");
}
int main(int argc,char *argv[]){
#pragma offload target(mic) in(argv:length(argc))
mymain(argc,argv);
}


icc test.c
test.c(3): warning #266: *MIC* function "printf" declared implicitly
    printf("hello world\n");
    ^

 ./a.out
hello world

0 Kudos
nikolaos_s_1
Beginner
622 Views

Hello Ravi,

Thank you for the immediate response, it turned out to be a reference to an extern variable that was resolved when i defined a local copy of that variable. 

0 Kudos
Reply