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... | |
| #define STM_ALL_SCHEDULES UINT16_MAX |
Function signature for STM CUDA submitter runnable.
| [in] | userdata | Pointer to any data needed by the runnable |
| [in] | stream | CUDA stream created by application for the kernels |
Cleans up STM client context.
No STM APIs can be called after this.
| STM_API stmErrorCode_t stmClientInit | ( | const char * | clientName, |
| uint16_t | scheduleId | ||
| ) |
Initialize STM client context for all schedules.
discriminator = -1. This must be called after registering all resources/runnables for the schedule(s) specified by scheduleId.| [in] | clientName | Name of the client. |
| [in] | scheduleId | Schedule id for the schedule to initialize. Note if this is STM_ALL_SCHEDULES, all schedules will be initialized and this will block until all of them are ready. Thus, if it is necessary to start a schedule before the rest are initialized, the call to the early schedule must occur first. |
| STM_API stmErrorCode_t stmClientInitWithDiscriminator | ( | const char * | clientName, |
| int32_t | discriminator, | ||
| uint16_t | scheduleId | ||
| ) |
Initialize STM client context with a discriminator for all schedules.
discriminator is started. Client contexts should be cleaned up with stmClientExit() after STM has completed its execution. Client must call at most one of the two: stmClientInit() or stmClientInitWithDiscriminator() All negative values of discriminator are equivalent and the same as calling stmClientInit() This must be called after registering all resources/runnables for the schedule(s) specified by scheduleId.| [in] | clientName | Name of the client. |
| [in] | discriminator | Discriminator for the client. |
| [in] | scheduleId | Schedule id for the schedule to initialize. Note if this is STM_ALL_SCHEDULES, all schedules will be initialized and this will block until all of them are ready. Thus, if it is necessary to start a schedule before the rest are initialized, the call to the early schedule must occur first. |
| STM_API stmErrorCode_t stmEventInit | ( | void | ) |
Initializes context for external fence signaling.
| STM_API stmErrorCode_t stmEventInitWithDiscriminator | ( | int32_t | discriminator | ) |
Initializes context for external fence signaling with a discriminator.
| discriminator | The discriminator to use. |
| STM_API stmErrorCode_t stmExitScheduler | ( | void | ) |
Request an exit to the global STM scheduler.
| STM_API stmErrorCode_t stmGetRuntimeInfo | ( | stmRunnableInfo_t * | info | ) |
Get runtime information about execution.
| [out] | info | Pointer to stmRunnableInfo_t whose fields will be populated |
| STM_API stmErrorCode_t stmNotifyScheduleReady | ( | uint16_t | scheduleId | ) |
Notify the STM scheduler that the schedule is ready to run.
This is non-blocking once the state of the specified schedule is updated to ready. Once all clients notify that all schedules are ready by specifying STM_ALL_SCHEDULES, STM will have fully transitioned from init to ready state and no more initialization APIs will be called by STM.
| [in] | scheduleId | The schedule ID to notify the scheduler about. Can be STM_ALL_SCHEDULES to notify all schedules. |
| STM_API stmErrorCode_t stmRegisterCallBack | ( | stmScheduleSwitchCallback_t | func, |
| void * | userdata | ||
| ) |
Registers a callback function with a client to be invoked during a schedule switch.
Before this client starts running, the callback function will be invoked.
| [in] | func | The callback function to be executed. |
| [in] | userdata | Optional pointer to any data needed by the callback. |
| 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.
| [in] | func | STM CPU runnable function pointer. |
| [in] | runnableId | Name of CPU runnable provided to the STM compiler. |
| [in] | userdata | Pointer to any data needed by the runnable. |
| STM_API stmErrorCode_t stmRegisterCudaResource | ( | const char * | resourceName, |
| cudaStream_t | stream | ||
| ) |
Registers a CUDA stream resource.
| [in] | resourceName | Name of resource. Needs to match resource name passed to STM compiler. |
| [in] | stream | CUDA stream created by application. |
| 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.
| [in] | func | STM CUDA submitter runnable function pointer. |
| [in] | runnableId | Name of CUDA submitter runnable provided to the STM compiler. |
| [in] | userdata | Pointer to any data needed by the runnable. |
| STM_API stmErrorCode_t stmTriggerHyperepoch | ( | uint16_t | hyperepochId | ) |
Signals start of an event-triggered hyperepoch.
| [in] | hyperepochId | The hyperepoch id to trigger. |
| STM_API stmErrorCode_t stmWaitForExit | ( | void | ) |
Wait until the STM schedule has exited and it is safe to exit the client using stmClientExit.