- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I'm trying to write my first program using pragma offload target(gfx). I tried the exemple from this page, replacing mic with gfx :
subr.c ====== void subr() { } main.c ====== int main() { #pragma offload target(gfx) subr(); }
The output :
$ icc -c -qoffload-attribute-target=gfx subr.c $ icc subr.o main.c main.c(4): error: function "subr" called in offload region must have been declared with compatible "target" attribute subr(); ^ main.c(4): error: offload target(gfx) or omp target pragma is not followed by a parallel loop subr(); ^ compilation aborted for main.c (code 2)
How can I adapt this example to target "gfx" ?
If it helps, I have icc 17.0.1, from Intel Parallel Studio XE 2017 Cluster edition, and a Broadwell-U GPU (Iris pro 6200).
Thanks,
Mathieu
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, Mathieu
The offloaded code on GPU need to run in parallel and vectorizable. The supported programming model in offloaded code for graphics are followings:
-
A Subset of Intel® Cilk™ Plus Language Extensions: The compiler supports the _Cilk_for, _Thread_group and__thread_group_local keywords to specify parallelism in offloaded code and thread group local data, as well as #pragma offload syntax to enable offload.
-
API-based Offload: In this model, you don't use any special syntax for initiating an offload, such as #pragma offload or #pragma omp target. Instead, you express data setup and offload using special API functions implemented in the Intel® Graphics Technology offload runtime.
You can download and try our graphics processor samples as a start: Intel® C++ Compiler - Samples for Intel® Graphics Technology
Please also make sure you have read the getting started guide for all the requisites:
Hope this helps.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Yolanda,
Thank you for your answer, the samples are very useful.
Mathieu

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page