libflame
revision_anchor
|
00001 /* 00002 00003 Copyright (C) 2014, The University of Texas at Austin 00004 00005 This file is part of libflame and is available under the 3-Clause 00006 BSD license, which can be found in the LICENSE file at the top-level 00007 directory, or at http://opensource.org/licenses/BSD-3-Clause 00008 00009 */ 00010 00011 #ifndef FLASH_QUEUE_MAIN_PROTOTYPES_H 00012 #define FLASH_QUEUE_MAIN_PROTOTYPES_H 00013 00014 00015 void FLASH_Queue_begin( void ); 00016 void FLASH_Queue_end( void ); 00017 unsigned int FLASH_Queue_stack_depth( void ); 00018 00019 FLA_Error FLASH_Queue_enable( void ); 00020 FLA_Error FLASH_Queue_disable( void ); 00021 FLA_Bool FLASH_Queue_get_enabled( void ); 00022 00023 void FLASH_Queue_set_num_threads( unsigned int n_threads ); 00024 unsigned int FLASH_Queue_get_num_threads( void ); 00025 00026 00027 #ifdef FLA_ENABLE_SUPERMATRIX 00028 00029 00030 void FLASH_Queue_init( void ); 00031 void FLASH_Queue_finalize( void ); 00032 00033 unsigned int FLASH_Queue_get_num_tasks( void ); 00034 00035 void FLASH_Queue_set_verbose_output( FLASH_Verbose verbose ); 00036 FLASH_Verbose FLASH_Queue_get_verbose_output( void ); 00037 void FLASH_Queue_set_sorting( FLA_Bool sorting ); 00038 FLA_Bool FLASH_Queue_get_sorting( void ); 00039 void FLASH_Queue_set_caching( FLA_Bool caching ); 00040 FLA_Bool FLASH_Queue_get_caching( void ); 00041 void FLASH_Queue_set_work_stealing( FLA_Bool work_stealing ); 00042 FLA_Bool FLASH_Queue_get_work_stealing( void ); 00043 void FLASH_Queue_set_data_affinity( FLASH_Data_aff data_affinity ); 00044 FLASH_Data_aff FLASH_Queue_get_data_affinity( void ); 00045 double FLASH_Queue_get_total_time( void ); 00046 double FLASH_Queue_get_parallel_time( void ); 00047 00048 void FLASH_Queue_exec( void ); 00049 00050 00051 // --- helper functions ------------------------------------------------------- 00052 00053 void FLASH_Queue_set_parallel_time( double dtime ); 00054 void FLASH_Queue_set_block_size( dim_t size ); 00055 dim_t FLASH_Queue_get_block_size( void ); 00056 void FLASH_Queue_set_cache_size( dim_t size ); 00057 dim_t FLASH_Queue_get_cache_size( void ); 00058 void FLASH_Queue_set_cache_line_size( dim_t size ); 00059 dim_t FLASH_Queue_get_cache_line_size( void ); 00060 void FLASH_Queue_set_cores_per_cache( int cores ); 00061 int FLASH_Queue_get_cores_per_cache( void ); 00062 void FLASH_Queue_set_cores_per_queue( int cores ); 00063 int FLASH_Queue_get_cores_per_queue( void ); 00064 void FLASH_Queue_reset( void ); 00065 FLASH_Task* FLASH_Queue_get_head_task( void ); 00066 FLASH_Task* FLASH_Queue_get_tail_task( void ); 00067 void FLASH_Queue_push( void *func, void *cntl, char *name, 00068 FLA_Bool enabled_gpu, 00069 int n_int_args, int n_fla_args, 00070 int n_input_args, int n_output_args, ... ); 00071 void FLASH_Queue_push_input( FLA_Obj obj, FLASH_Task* t ); 00072 void FLASH_Queue_push_output( FLA_Obj obj, FLASH_Task* t ); 00073 FLASH_Task* FLASH_Task_alloc( void *func, void *cntl, char *name, 00074 FLA_Bool enabled_gpu, 00075 int n_int_args, int n_fla_args, 00076 int n_input_args, int n_output_args ); 00077 void FLASH_Task_free( FLASH_Task *t ); 00078 void FLASH_Queue_exec_task( FLASH_Task *t ); 00079 void FLASH_Queue_verbose_output( void ); 00080 00081 void FLASH_Queue_init_tasks( void *arg ); 00082 void FLASH_Queue_wait_enqueue( FLASH_Task *t, void *arg ); 00083 FLASH_Task* FLASH_Queue_wait_dequeue( int queue, int cache, void *arg ); 00084 FLASH_Task* FLASH_Queue_wait_dequeue_block( int queue, int cache, void *arg ); 00085 void FLASH_Queue_update_cache( FLASH_Task *t, void *arg ); 00086 void FLASH_Queue_update_cache_block( FLA_Obj obj, int cache, FLA_Bool output, void *arg ); 00087 void FLASH_Queue_prefetch( int cache, void *arg ); 00088 void FLASH_Queue_prefetch_block( FLA_Obj obj ); 00089 FLASH_Task* FLASH_Queue_work_stealing( int queue, void *arg ); 00090 #ifdef FLA_ENABLE_GPU 00091 void FLASH_Queue_create_gpu( int thread, void *arg ); 00092 void FLASH_Queue_destroy_gpu( int thread, void *arg ); 00093 FLA_Bool FLASH_Queue_exec_gpu( FLASH_Task *t, void *arg ); 00094 FLA_Bool FLASH_Queue_check_gpu( FLASH_Task *t, void *arg ); 00095 FLA_Bool FLASH_Queue_check_block_gpu( FLA_Obj obj, int thread, void *arg ); 00096 void FLASH_Queue_update_gpu( FLASH_Task *t, void **input_arg, void **output_arg, void *arg ); 00097 void FLASH_Queue_update_block_gpu( FLA_Obj obj, void **buffer_gpu, int thread, void *arg ); 00098 void FLASH_Queue_mark_gpu( FLASH_Task *t, void *arg ); 00099 void FLASH_Queue_invalidate_block_gpu( FLA_Obj obj, int thread, void *arg ); 00100 void FLASH_Queue_flush_block_gpu( FLA_Obj obj, int thread, void *arg ); 00101 void FLASH_Queue_flush_gpu( int thread, void *arg ); 00102 #endif 00103 void FLASH_Queue_exec_parallel( void *arg ); 00104 void* FLASH_Queue_exec_parallel_function( void *arg ); 00105 FLASH_Task* FLASH_Task_update_dependencies( FLASH_Task *t, void *arg ); 00106 FLASH_Task* FLASH_Task_update_binding( FLASH_Task *t, FLASH_Task *r, void *arg ); 00107 void FLASH_Task_free_parallel( FLASH_Task *t, void *arg ); 00108 00109 void FLASH_Queue_exec_simulation( void *arg ); 00110 00111 00112 #endif // FLA_ENABLE_SUPERMATRIX 00113 00114 00115 #endif // FLASH_QUEUE_MAIN_PROTOTYPES_H