Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
arax_throttle.h File Reference
#include "async.h"
+ Include dependency graph for arax_throttle.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  arax_throttle_s
 

Macros

#define ARAX_THROTTLE_DEBUG_PARAMS
 
#define ARAX_THROTTLE_DEBUG_FUNC(FUNC)
 
#define ARAX_THROTTLE_DEBUG_PRINT(...)
 

Typedefs

typedef struct arax_throttle_s arax_throttle_s
 

Functions

void arax_throttle_init (async_meta_s *meta, arax_throttle_s *thr, size_t a_sz, size_t t_sz)
 
void ARAX_THROTTLE_DEBUG_FUNC arax_throttle_size_inc (arax_throttle_s *thr, size_t sz ARAX_THROTTLE_DEBUG_PARAMS)
 
void ARAX_THROTTLE_DEBUG_FUNC arax_throttle_size_dec (arax_throttle_s *thr, size_t sz ARAX_THROTTLE_DEBUG_PARAMS)
 
size_t arax_throttle_get_available_size (arax_throttle_s *thr)
 
size_t arax_throttle_get_total_size (arax_throttle_s *thr)
 

Macro Definition Documentation

◆ ARAX_THROTTLE_DEBUG_FUNC

#define ARAX_THROTTLE_DEBUG_FUNC ( FUNC)
Value:
FUNC

Definition at line 31 of file arax_throttle.h.

◆ ARAX_THROTTLE_DEBUG_PARAMS

#define ARAX_THROTTLE_DEBUG_PARAMS

Definition at line 30 of file arax_throttle.h.

Referenced by arax_throttle_size_dec(), and arax_throttle_size_inc().

◆ ARAX_THROTTLE_DEBUG_PRINT

#define ARAX_THROTTLE_DEBUG_PRINT ( ...)
Value:
({ })

Definition at line 32 of file arax_throttle.h.

Referenced by arax_data_allocate_remote(), arax_data_deref(), and ARAX_OBJ_DTOR_DECL().

Typedef Documentation

◆ arax_throttle_s

typedef struct arax_throttle_s arax_throttle_s

Definition at line 4 of file arax_throttle.h.

Function Documentation

◆ arax_throttle_get_available_size()

size_t arax_throttle_get_available_size ( arax_throttle_s * thr)

Gets available size

Parameters
thrarax_throttle_s instance
Returns
Avaliable size.

Definition at line 108 of file arax_throttle.c.

References arax_assert, and arax_throttle_s::available.

Referenced by arax_accel_get_available_size(), and arax_pipe_get_available_size().

+ Here is the caller graph for this function:

◆ arax_throttle_get_total_size()

size_t arax_throttle_get_total_size ( arax_throttle_s * thr)

Gets available size

Parameters
thrarax_throttle_s instance
Returns
Total size

Definition at line 115 of file arax_throttle.c.

References arax_assert, and arax_throttle_s::capacity.

Referenced by arax_accel_get_total_size(), and arax_pipe_get_total_size().

+ Here is the caller graph for this function:

◆ arax_throttle_init()

void arax_throttle_init ( async_meta_s * meta,
arax_throttle_s * thr,
size_t a_sz,
size_t t_sz )

Increments available size by sz

Parameters
metaasync meta for cond wait
thrarax_throttle_s instance to inc
Returns
Nothing .

Definition at line 28 of file arax_throttle.c.

References arax_assert, async_condition_init(), arax_throttle_s::available, arax_throttle_s::capacity, arax_throttle_s::ready, and utils_spinlock_init.

Referenced by arax_accel_init(), and arax_pipe_init().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arax_throttle_size_dec()

void ARAX_THROTTLE_DEBUG_FUNC arax_throttle_size_dec ( arax_throttle_s * thr,
size_t sz ARAX_THROTTLE_DEBUG_PARAMS )

Decrements available size by sz

Parameters
thrarax_throttle_s instance to dec
szsize of removed data
Returns
Nothing .

Definition at line 77 of file arax_throttle.c.

References arax_assert, ARAX_THROTTLE_DEBUG_PARAMS, arax_throttle_size_dec(), async_condition_lock(), async_condition_unlock(), async_condition_wait(), and PRINT_THR.

Referenced by arax_accel_size_dec(), arax_pipe_size_dec(), and arax_throttle_size_dec().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ arax_throttle_size_inc()

void ARAX_THROTTLE_DEBUG_FUNC arax_throttle_size_inc ( arax_throttle_s * thr,
size_t sz ARAX_THROTTLE_DEBUG_PARAMS )

Increments available size by sz

Parameters
thrarax_throttle_s instance to inc
szSize of added data
Returns
Nothing .

Definition at line 49 of file arax_throttle.c.

References arax_assert, ARAX_THROTTLE_DEBUG_PARAMS, arax_throttle_size_inc(), async_condition_lock(), async_condition_notify(), async_condition_unlock(), and PRINT_THR.

Referenced by arax_accel_size_inc(), arax_pipe_size_inc(), and arax_throttle_size_inc().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: