- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In the C++ (v16.0 update 1) documentation:
Determining if Code has Completed Running on a Coprocessor
To determine if a section of offloaded code has completed running on a given coprocessor, you can use the API _Offload_signaled().
The syntax for this API is:
extern int _Offload_signaled(int target_number, void *signal);
Nowhere is it described what the return values are.
Same thing in the Fortran documentation
Determining if Code has Completed Running on a Coprocessor
To determine if a section of offloaded code has completed running on a given coprocessor, you can use the API OFFLOAD_SIGNALED().
The syntax for this API is:
OFFLOAD_SIGNALED(target_number,signal)
enum, bind(C) enumerator :: OFFLOAD_SUCCESS = 0 enumerator :: OFFLOAD_DISABLED ! offload is disabled enumerator :: OFFLOAD_UNAVAILABLE ! card is not available enumerator :: OFFLOAD_OUT_OF_MEMORY ! not enough memory on device enumerator :: OFFLOAD_PROCESS_DIED ! target process has died enumerator :: OFFLOAD_ERROR ! unspecified error end enum
But it is not stated (clear) as if these are, or are the only return values. If they are the return values, then missing is OFFLOAD_BUSY
Does someone know what the return values are for OFFLOAD_SIGNALED?
Jim Dempsey
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'll confirm, but I understand offload_signaled() returns a 1 (true) or 0 (false) based on the signal having been set (1) or not (0). The values cited from mic_lib.f90 correspond to the STATUS() clause.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Kevin,
The results of STATUS() clause are those listed above. My interest is in the return of OFFLOAD_SIGNALED, which has a different (additional) set of return values.
In particular, OFFLOAD_SIGNALED is intended for use with asynchronous offloads. The intended purpose is not only to determine STATUS(), but also if the signaled state is not signaled and the offload associated with the signal has not aborted (IOW running).
Note, status OFFLOAD_UNAVAILABLE is not suitable for SIGNAL_BUSY or SIGNAL_NOT_SIGNALED. Though I could envision a naïve implementation to assume OFFLOAD_UNAVAILABLE is interchangeable.
Jim Dempsey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jim,
The return value is 1 (true) or 0 (false) if offload associated with the signal has completed or not.
Ravi

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