Arax -8d09c51940345c86062e8ef2427c705ae66e5926
A Runtime Framework for Decoupling Applications from Heterogeneous Accelerators
Loading...
Searching...
No Matches
arax_throttle.c File Reference
#include "arax_throttle.h"
#include "utils/arax_assert.h"
#include "stdio.h"
+ Include dependency graph for arax_throttle.c:

Go to the source code of this file.

Macros

#define PRINT_THR(OBJ, DELTA, FUNC)
 

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

◆ PRINT_THR

#define PRINT_THR ( OBJ,
DELTA,
FUNC )

Definition at line 25 of file arax_throttle.c.

Referenced by arax_throttle_size_dec(), and arax_throttle_size_inc().

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: