Software Archive
Read-only legacy content
17061 Discussions

Strange compile time errors: "this kind of pragma may not be used here"

Dhairya_M_
Beginner
1,020 Views

This code was working fine, till I changed something in some other file. Can someone please explain why am I getting this error and what does it mean?

error: this kind of pragma may not be used here
      #pragma offload_transfer target(mic:0) nocopy( A: length(dim) alloc_if(0) free_if(1) )
              ^

So, instead I tried:

#pragma offload target(mic:0) nocopy( A: length(dim) alloc_if(0) free_if(1) )

{}

Now the error is:

internal error: assertion failed at: "shared/cfe/edgcpfe/ipragma_omp.c", line 4257
      {}
      ^

0 Kudos
5 Replies
Ravi_N_Intel
Employee
1,020 Views

Difficult to say what the problem is without the source code.  One possibility is that offload_transfer was added to some structure declared in an header file which is included your code.

0 Kudos
Dhairya_M_
Beginner
1,020 Views

I understand it is difficult without the source code. I just want some help understanding what this error means? why would the compiler determine that it can not transfer a char array to mic? I fail to imagine any situation where the compiler could possibly determine that a char array can not be transferred to mic.

And what does that second error "internal error: assertion failed..." mean?

0 Kudos
Andrey_Vladimirov
New Contributor III
1,020 Views

I am curious what version of the compiler you are using. I had had this "internal error" issue in an older version of the compiler (13.0.xxx). It was caused by offload pragmas with an empty body. The issue is fixed in more recent versions (version 13.1.1 does not have it for sure).

0 Kudos
Dhairya_M_
Beginner
1,020 Views

I have version 13.1.0.146.

0 Kudos
Kevin_D_Intel
Employee
1,020 Views

 

 The internal error should never happen. It is not specific to any one error or condition. We need a reproducer to provide to Development so they can fix the root-cause or determine whether it is already fixed.

The initial error is not suggesting anything with respect to the array A. It is suggesting the placement of the pragma is not allowed so without some additional source context, as Ravi mentioned, the reason for it cannot be explained.

Can you provide a small reproducer or any additional source content that might permit us to create a reproducer?

You are using the Composer XE 2013 Update 2 (13.1.0.146) and could consider upgrading to Update 3 (13.1.1.163) to see whether the error is fixed in the newer release as Andrey found for his instance.

0 Kudos
Reply