- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've noticed in the article:
http://software.intel.com/en-us/articles/fortran-vs-c-offload-directives-and-functions
That there is a convenient way to mark entire files for offload using the 'offload_attribute push/pop' pragma in c and c++. However there apparently doesn't appear to be an equivalent for fortran. This seems like an very useful feature...
Is there an equivalent way of doing this with the Fortran directives that I'm missing? If not, why is this functionality not available?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Have you looked at the OPTIONS directive?
The Fortran !dir$ options directive accepts the command-line option "/offload-attribute-target=<target> ".
This option enables assigning a <target> attribute to a section of a program declarations appearing between a !dir$ options /offload-attribute-target=<target> and !dir$ end options directive. The declarations can contain interface definitions and variable declarations.
The syntax is:
!dir$ options /offload-attribute-target=mic
<declarations...>
!dir$ end options
A couple of examples can be found within /opt/intel/composerxe/Samples/en_US/Fortran/mic_samples/LEO_Fortran_intro/leoF09_subprograms.F90
Best,
Leo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unlike C/C++, the !dir$ directives cannot be used independently of individual program units. Or at least, as far as I know, there are no directives that can be used like that. So, you cannot bracket a group of functions, subroutines, modules, etc. with a !dir$ / !dir$ end pair. This kind of mirrors one of the underlying differences between C and Fortran. C has a file scope; in Fortran there really isn't a file scope.
There is also the compiler directive -offload-attribute-target=mic, but that doesn't give you the level of control you were asking for. I'll see that the !dir$ options /offload-attribute-target=mic gets added to the that web page.
![](/skins/images/872293744008A34B36F8ABF94A46CC66/responsive_peak/images/icon_anonymous_message.png)
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page