Compute resource manager
Compute resource manager API
HAP_compute_res.h File Reference

Header file with APIs to allocate compute resources. More...

Go to the source code of this file.

Classes

struct  compute_res_attr_t
 
struct  compute_res_vtcm_page_def_t
 
struct  compute_res_vtcm_page_t
 
struct  compute_res_hmx_mutex_t
 
struct  compute_res_preempt_data_t
 

Macros

#define HAP_COMPUTE_RES_NOT_SUPPORTED   0x80000404
 
#define HAP_COMPUTE_RES_MAX_NUM_THREADS   16
 
#define HAP_COMPUTE_RES_COOPERATIVE_PREEMPTION   1
 
#define HAP_COMPUTE_RES_AUTONOMOUS_PREEMPTION   2
 
#define HAP_COMPUTE_RES_THREADS_FOR_AUTONOMOUS_PREEMPTION   4
 

Enumerations

enum  compute_res_hmx_type_t { HAP_COMPUTE_RES_HMX_NON_SHARED = 0, HAP_COMPUTE_RES_HMX_SHARED = 1 }
 
enum  compute_res_capability_id { HAP_COMPUTE_RES_PREEMPTION_CAPABILITY = 1 }
 
enum  compute_res_threads_cmd_id { HAP_COMPUTE_RES_THREADS_OVERRIDE = 1, HAP_COMPUTE_RES_THREADS_APPEND = 2, HAP_COMPUTE_RES_THREADS_REMOVE = 3 }
 

Functions

static int HAP_compute_res_attr_init (compute_res_attr_t *attr)
 
static int HAP_compute_res_attr_set_serialize (compute_res_attr_t *attr, unsigned char b_serialize)
 
static int HAP_compute_res_attr_set_vtcm_param (compute_res_attr_t *attr, unsigned int vtcm_size, unsigned char b_single_page)
 
static void * HAP_compute_res_attr_get_vtcm_ptr (compute_res_attr_t *attr)
 
static int HAP_compute_res_attr_set_vtcm_param_v2 (compute_res_attr_t *attr, unsigned int vtcm_size, unsigned int min_page_size, unsigned int min_vtcm_size)
 
static int HAP_compute_res_attr_set_vtcm_backup (compute_res_attr_t *attr, void *buffer, unsigned int buffer_size)
 
static int HAP_compute_res_attr_set_threads (compute_res_attr_t *attr, unsigned int *threads, unsigned int num_threads)
 
static int HAP_compute_res_cached_set_threads (compute_res_threads_cmd_id command, unsigned int context_id, unsigned int *threads, unsigned int num_threads)
 
static int HAP_compute_res_attr_set_vtcm_clear_on_release (compute_res_attr_t *attr, unsigned char enable)
 
static int HAP_compute_res_attr_get_vtcm_ptr_v2 (compute_res_attr_t *attr, void **vtcm_ptr, unsigned int *vtcm_size)
 
static int HAP_compute_res_attr_set_hmx_param (compute_res_attr_t *attr, unsigned char b_enable)
 
static int HAP_compute_res_attr_set_cache_mode (compute_res_attr_t *attr, unsigned char b_enable)
 
static int HAP_compute_res_attr_set_app_type (compute_res_attr_t *attr, unsigned int application_id)
 
static int HAP_compute_res_query_VTCM (unsigned int application_id, unsigned int *total_block_size, compute_res_vtcm_page_t *total_block_layout, unsigned int *avail_block_size, compute_res_vtcm_page_t *avail_block_layout)
 
static int HAP_compute_res_check_release_request (unsigned int context_id)
 
static unsigned int HAP_compute_res_acquire (compute_res_attr_t *attr, unsigned int timeout_us)
 
static int HAP_compute_res_release (unsigned int context_id)
 
static int HAP_compute_res_acquire_cached (unsigned int context_id, unsigned int timeout_us)
 
static int HAP_compute_res_release_cached (unsigned int context_id)
 
static int HAP_compute_res_attr_set_release_callback (compute_res_attr_t *attr, int(*release_callback)(unsigned int context_id, void *client_context), void *client_context)
 
static int HAP_compute_res_update_priority (unsigned int context_id, unsigned short priority)
 
static int HAP_compute_res_tid_preemption_lock (void)
 
static int HAP_compute_res_tid_preemption_unlock (void)
 
static int HAP_compute_res_query_capability (compute_res_capability_id capability_id, unsigned int *data)
 
static int HAP_compute_res_get_preempt_data (unsigned int context_id, compute_res_preempt_data_t *data)
 
static int HAP_compute_res_hmx_lock (unsigned int context_id)
 
static int HAP_compute_res_hmx_unlock (unsigned int context_id)
 
static int HAP_compute_res_hmx_lock2 (unsigned int context_id, compute_res_hmx_type_t type)
 
static int HAP_compute_res_hmx_unlock2 (unsigned int context_id, compute_res_hmx_type_t type)
 
static int HAP_compute_res_hmx_lock3 (unsigned int context_id, compute_res_hmx_type_t type, compute_res_hmx_mutex_t *hmx_mutex, unsigned int timeout_us)
 
static int HAP_compute_res_hmx_unlock3 (unsigned int context_id, compute_res_hmx_type_t type, compute_res_hmx_mutex_t *hmx_mutex)
 

Detailed Description

Header file with APIs to allocate compute resources.