STM Runtime.
Overview: STM is a co-operative, non-preemptive, static scheduling framework for real-time systems. The STM runtime is a library that executes a schedule produced offline by the STM compiler, enforcing data dependency ordering and control flow ordering across engines on a Tegra SoC.
STM Clients: Every STM client corresponds to an OS process. All STM clients mentioned to the STM compiler must be launched before any STM client will begin scheduling runnables.
STM Master: Alongside STM clients, the STM master executable needs to be launched and passed a .stm file generated by the STM compiler. STM clients will block at the call to stmClientInit() until the STM master process has been launched.
Definition in file stm.h.
Go to the source code of this file.
Data Structures | |
| struct | stmRunnableInfo_t |
| Information which can be queried by CPU runnables using stmGetRuntimeInfo() More... | |
Macros | |
| #define | STM_ALL_SCHEDULES UINT16_MAX |
| The key to use to reference to all schedules. More... | |
Typedefs | |
| typedef void(* | stmRunnable_t) (void *userdata) |
| Function signature for STM CPU runnable. More... | |
| typedef void(* | stmCudaSubmitter_t) (void *userdata, cudaStream_t stream) |
| Function signature for STM CUDA submitter runnable. More... | |
| typedef void(* | stmScheduleSwitchCallback_t) (uint16_t startScheduleId, uint16_t hyperepochId, void *userdata) |
| Function signature for STM schedule switch callback. More... | |
Functions | |
| STM_API stmErrorCode_t | stmClientInit (const char *clientName, uint16_t scheduleId) |
| Initialize STM client context for all schedules. More... | |
| STM_API stmErrorCode_t | stmClientInitWithDiscriminator (const char *clientName, int32_t discriminator, uint16_t scheduleId) |
| Initialize STM client context with a discriminator for all schedules. More... | |
| STM_API stmErrorCode_t | stmRegisterCpuRunnable (stmRunnable_t func, const char *const runnableId, void *userdata) |
| Registers an stmRunnable_t function with the name provided by the user to the STM compiler. More... | |
| STM_API stmErrorCode_t | stmRegisterCudaSubmitter (stmCudaSubmitter_t func, const char *const runnableId, void *userdata) |
| Registers an stmCudaSubmitter_t function with the name provided by the user to the STM compiler. More... | |
| STM_API stmErrorCode_t | stmRegisterCudaResource (const char *resourceName, cudaStream_t stream) |
| Registers a CUDA stream resource. More... | |
| STM_API stmErrorCode_t | stmRegisterCallBack (stmScheduleSwitchCallback_t func, void *userdata) |
| Registers a callback function with a client to be invoked during a schedule switch. More... | |
| STM_API stmErrorCode_t | stmNotifyScheduleReady (uint16_t scheduleId) |
| Notify the STM scheduler that the schedule is ready to run. More... | |
| STM_API stmErrorCode_t | stmWaitForExit (void) |
| Wait until the STM schedule has exited and it is safe to exit the client using stmClientExit. More... | |
| STM_API stmErrorCode_t | stmGetRuntimeInfo (stmRunnableInfo_t *info) |
| Get runtime information about execution. More... | |
| STM_API stmErrorCode_t | stmEventInit (void) |
| Initializes context for external fence signaling. More... | |
| STM_API stmErrorCode_t | stmEventInitWithDiscriminator (int32_t discriminator) |
| Initializes context for external fence signaling with a discriminator. More... | |
| STM_API void | stmEventDeinit (void) |
| Deinitializes context for external fence signaling. More... | |
| STM_API stmErrorCode_t | stmTriggerHyperepoch (uint16_t hyperepochId) |
| Signals start of an event-triggered hyperepoch. More... | |
| STM_API stmErrorCode_t | stmExitScheduler (void) |
| Request an exit to the global STM scheduler. More... | |
| STM_API void | stmClientExit (void) |
| Cleans up STM client context. More... | |