Software Archive
Read-only legacy content
17061 Discussions

offload_signaled documentation

jimdempseyatthecove
Honored Contributor III
473 Views

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)

0 Kudos
3 Replies
Kevin_D_Intel
Employee
473 Views

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.

0 Kudos
jimdempseyatthecove
Honored Contributor III
473 Views

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 

0 Kudos
Ravi_N_Intel
Employee
473 Views

Jim,
   The return value is 1 (true)  or 0 (false) if offload associated with the signal has completed or not.

Ravi

0 Kudos
Reply