Fence#
Fully qualified name: cupva::Fence
Defined in cupva_host.hpp
-
class Fence : public cupva::StaticStorage<impl::Fence, priv::CUPVA_FENCE_SIZE, priv::CUPVA_FENCE_ALIGN>#
Fence is used to synchronize between PVA programs.
Fences are used to synchronize between CUPVA Streams and with other engines. Fences may optionally include timestamps. It is recommended that Fences and timestamps are used to ensure that any assumptions made about scheduling on available PVA resources are correct. In some cases scheduling may be outside of the user’s control, for example if multiple applications are submitting work. Timestamps allow verification that scheduling order is as expected.
Maturity: GA
Public Functions
-
Fence() noexcept#
Construct a new uninitialized object.
Usage considerations
Allowed context for the API call
Interrupt handler: No
Signal handler: No
Thread-safe: No
Re-entrant: No
Async/Sync: Sync
Required privileges: None
Allowed execution state
Initialization: Yes
Operational: Yes
Reinit/Deinit Preparation: Yes
Maturity: GA
- Pre:
None
-
explicit Fence(SyncObj &syncObj) noexcept#
Construct a new Fence object.
Usage considerations
Allowed context for the API call
Interrupt handler: No
Signal handler: No
Thread-safe: No
Re-entrant: No
Async/Sync: Sync
Required privileges: None
Allowed execution state
Initialization: Yes
Operational: Yes
Reinit/Deinit Preparation: Yes
Maturity: GA
- Parameters:
syncObj – The SyncObj the fence is using.
- Pre:
None
-
~Fence() noexcept#
Destroy the Fence object.
Usage considerations
Allowed context for the API call
Interrupt handler: No
Signal handler: No
Thread-safe: No
Re-entrant: No
Async/Sync: Sync
Required privileges: None
Allowed execution state
Initialization: Yes
Operational: Yes
Reinit/Deinit Preparation: Yes
Maturity: GA
- Pre:
None
-
Fence(Fence &&obj) noexcept#
Move constructor.
Usage considerations
Allowed context for the API call
Interrupt handler: No
Signal handler: No
Thread-safe: No
Re-entrant: No
Async/Sync: Sync
Required privileges: None
Allowed execution state
Initialization: Yes
Operational: Yes
Reinit/Deinit Preparation: Yes
Maturity: GA
- Pre:
None
-
Fence &operator=(Fence &&obj) & noexcept#
Move assignment operator.
Usage considerations
Allowed context for the API call
Interrupt handler: No
Signal handler: No
Thread-safe: No
Re-entrant: No
Async/Sync: Sync
Required privileges: None
Allowed execution state
Initialization: Yes
Operational: Yes
Reinit/Deinit Preparation: Yes
Maturity: GA
- Pre:
None
-
Fence(const Fence &obj) noexcept#
Copy constructor.
Usage considerations
Allowed context for the API call
Interrupt handler: No
Signal handler: No
Thread-safe: No
Re-entrant: No
Async/Sync: Sync
Required privileges: None
Allowed execution state
Initialization: Yes
Operational: Yes
Reinit/Deinit Preparation: Yes
Maturity: GA
- Pre:
None
-
Fence &operator=(const Fence &obj) & noexcept#
Copy assignment operator.
Usage considerations
Allowed context for the API call
Interrupt handler: No
Signal handler: No
Thread-safe: No
Re-entrant: No
Async/Sync: Sync
Required privileges: None
Allowed execution state
Initialization: Yes
Operational: Yes
Reinit/Deinit Preparation: Yes
Maturity: GA
- Pre:
None
-
bool wait(int64_t const timeout = -1) const#
Block the calling thread until the fence is triggered or time out.
This API may only be called on Fences which are signaled by PVA. For externally signaled fences imported from NvSciSync, use NvSciSync APIs instead.
Usage considerations
Allowed context for the API call
Interrupt handler: No
Signal handler: No
Thread-safe: Yes
Re-entrant: No
Async/Sync: Sync
Required privileges: None
Allowed execution state
Initialization: Yes
Operational: Yes
Reinit/Deinit Preparation: Yes
Maturity: GA
-
uint64_t timestamp() const#
Gets the time at which current fence expired (in nanoseconds).
Epoch is implementation defined.
Usage considerations
Allowed context for the API call
Interrupt handler: No
Signal handler: No
Thread-safe: Yes
Re-entrant: No
Async/Sync: Sync
Required privileges: None
Allowed execution state
Initialization: Yes
Operational: Yes
Reinit/Deinit Preparation: Yes
Maturity: GA
- Throws:
cupva::Exception(DriverAPIError) – The PVA driver returned an unexpected error.
- Pre:
cupva::Fence::wait() must return with success prior to calling this API or the timestamp value cannot be considered valid.
- Returns:
the time at which current fence expired (in nanoseconds).