GPUart  1.01
Prototype of GPUart, an application-based limited preemptive GPU scheduler for embedded real-time systems
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Enumerations | Functions
GPUart_Scheduler.h File Reference

Interface to the GPUart Scheduling layer. More...

#include "../GPUart_Common/GPUart_Common.h"
#include "../GPUart_Config/GPUart_Config.h"
Include dependency graph for GPUart_Scheduler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  gpuS_kernelTask_status_e { E_STATUS_READY = 0, E_STATUS_RUNNING = 1, E_STATUS_TERMINATED = 2, E_STATUS_INIT = 3 }
 The possible scheduling states of a kernel. More...
 

Functions

GPUart_Retval gpuS_schedule (void)
 Executes the scheduling decision. More...
 
GPUart_Retval gpuS_new_Job (kernel_task_id_e task_id_e)
 Releases a new job and pushes it to the shared job stack gpuS_JobStackShared_s. More...
 
GPUart_Retval gpuS_query_terminated (kernel_task_id_e task_id_e)
 Queries whether a job has terminated. More...
 
GPUart_Retval gpuS_query_ready_to_call (kernel_task_id_e task_id_e)
 Queries whether a kernel is ready to get instantiated. More...
 
GPUart_Retval gpuS_init (void)
 Initializes the GPUart Scheduling layer. More...
 
GPUart_Retval gpuS_destroy (void)
 Destroys the GPUart Scheduling layer. More...
 

Detailed Description

Interface to the GPUart Scheduling layer.

Author
Christoph Hartmann
Date
Created on: 3 Apr 2017

Enumeration Type Documentation

The possible scheduling states of a kernel.

Every job starts with status E_STATUS_INIT. The possible transitions are E_STATUS_INIT -> E_STATUS_READY or E_STATUS_TERMINATED -> E_STATUS_READY when a kernel gets instantiated; E_STATUS_RUNNING -> E_STATUS_READY when a job has been preempted; E_STATUS_READY -> E_STATUS_RUNNING when the scheduler schedules a job; and E_STATUS_RUNNING -> E_STATUS_TERMINATED when a job completes.

Enumerator
E_STATUS_READY 

Kernel is active, but not running on the GPU.

E_STATUS_RUNNING 

Kernel is currently running on the GPU

E_STATUS_TERMINATED 

Kernel has been completed

E_STATUS_INIT 

Initial state at system startup

Function Documentation

GPUart_Retval gpuS_destroy ( void  )

Destroys the GPUart Scheduling layer.

Destroys the mutex of each job_stack_s.

Returns
GPUART_SUCCESS

Here is the caller graph for this function:

GPUart_Retval gpuS_init ( void  )

Initializes the GPUart Scheduling layer.

Initializes all variables of the Scheduling layer.

Returns
GPUART_SUCCESS

Here is the call graph for this function:

Here is the caller graph for this function:

GPUart_Retval gpuS_new_Job ( kernel_task_id_e  task_id_e)

Releases a new job and pushes it to the shared job stack gpuS_JobStackShared_s.

Parameters
kernel_task_id_etask_id_e -> The ID of the kernel which this function instatiates.
Returns
GPUART_SUCCESS if kernel has been instantiated successfully.
GPUART_ERROR_INVALID_ARGUMENT if kernel ID is invalid.
GPUART_ERROR_NO_OPERTATION if there is already an active instance (job) of that kernel.

Here is the call graph for this function:

Here is the caller graph for this function:

GPUart_Retval gpuS_query_ready_to_call ( kernel_task_id_e  task_id_e)

Queries whether a kernel is ready to get instantiated.

Parameters
kernel_task_id_etask_id_e -> The ID of the kernel.
Returns
GPUART_SUCCESS if kernel can get instantiated.
GPUART_ERROR_NOT_READY if there is already an active instance (job) of that kernel.

Here is the caller graph for this function:

GPUart_Retval gpuS_query_terminated ( kernel_task_id_e  task_id_e)

Queries whether a job has terminated.

Parameters
kernel_task_id_etask_id_e -> The ID of the kernel.
Returns
GPUART_SUCCESS if kernel has been terminated
GPUART_ERROR_NOT_READY if kernel is still active.

Here is the caller graph for this function:

GPUart_Retval gpuS_schedule ( void  )

Executes the scheduling decision.

If the compiler switch S_NON_PREEMPTIVE is defined, this function schedules kernel non-preemptively, otherwise it schedules them in a limited preemptive manner. First this function updates the kernel's scheduling state and deletes completed kernels form gpuS_JobList_s, then it updates the job list gpuS_JobList_s with all new released kernels. After that, this function iterates through gpuS_JobList_s and executes the scheduling decision according to the scheduling policy defined in S_SCHED_POLICY.

Returns
GPUART_SUCCESS

Here is the call graph for this function:

Here is the caller graph for this function: