libflame revision_anchor
FLASH_Queue_main_prototypes.h
Go to the documentation of this file.
00001 /*
00002    libflame
00003    An object-based infrastructure for developing high-performance
00004    dense linear algebra libraries.
00005 
00006    Copyright (C) 2008, The University of Texas
00007 
00008    libflame is free software; you can redistribute it and/or modify
00009    it under the terms of the GNU Lesser General Public License as
00010    published by the Free Software Foundation; either version 2.1 of
00011    the License, or (at your option) any later version.
00012 
00013    libflame is distributed in the hope that it will be useful, but
00014    WITHOUT ANY WARRANTY; without even the implied warranty of
00015    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016    Lesser General Public License for more details.
00017 
00018    You should have received a copy of the GNU Lesser General Public
00019    License along with libflame; if you did not receive a copy, see
00020    http://www.gnu.org/licenses/.
00021 
00022    For more information, please contact us at flame@cs.utexas.edu or
00023    send mail to:
00024 
00025    Field G. Van Zee and/or
00026    Robert A. van de Geijn
00027    The University of Texas at Austin
00028    Department of Computer Sciences
00029    1 University Station C0500
00030    Austin TX 78712
00031 */
00032 
00033 #ifndef FLASH_QUEUE_MAIN_PROTOTYPES_H
00034 #define FLASH_QUEUE_MAIN_PROTOTYPES_H
00035 
00036 
00037 void           FLASH_Queue_begin( void );
00038 void           FLASH_Queue_end( void );
00039 unsigned int   FLASH_Queue_stack_depth( void );
00040 
00041 FLA_Error      FLASH_Queue_enable( void );
00042 FLA_Error      FLASH_Queue_disable( void );
00043 FLA_Bool       FLASH_Queue_get_enabled( void );
00044 
00045 void           FLASH_Queue_set_num_threads( unsigned int n_threads );
00046 unsigned int   FLASH_Queue_get_num_threads( void );
00047 
00048 
00049 #ifdef FLA_ENABLE_SUPERMATRIX
00050 
00051 
00052 void           FLASH_Queue_init( void );
00053 void           FLASH_Queue_finalize( void );
00054 
00055 unsigned int   FLASH_Queue_get_num_tasks( void );
00056 
00057 void           FLASH_Queue_set_verbose_output( FLASH_Verbose verbose );
00058 FLASH_Verbose  FLASH_Queue_get_verbose_output( void );
00059 void           FLASH_Queue_set_sorting( FLA_Bool sorting );
00060 FLA_Bool       FLASH_Queue_get_sorting( void );
00061 void           FLASH_Queue_set_caching( FLA_Bool caching );
00062 FLA_Bool       FLASH_Queue_get_caching( void );
00063 void           FLASH_Queue_set_work_stealing( FLA_Bool work_stealing );
00064 FLA_Bool       FLASH_Queue_get_work_stealing( void );
00065 void           FLASH_Queue_set_data_affinity( FLASH_Data_aff data_affinity );
00066 FLASH_Data_aff FLASH_Queue_get_data_affinity( void );
00067 double         FLASH_Queue_get_total_time( void );
00068 double         FLASH_Queue_get_parallel_time( void );
00069 
00070 void           FLASH_Queue_exec( void );
00071 
00072 
00073 // --- helper functions -------------------------------------------------------
00074 
00075 void           FLASH_Queue_set_parallel_time( double dtime );
00076 void           FLASH_Queue_set_block_size( dim_t size );
00077 dim_t          FLASH_Queue_get_block_size( void );
00078 void           FLASH_Queue_set_cache_size( dim_t size );
00079 dim_t          FLASH_Queue_get_cache_size( void );
00080 void           FLASH_Queue_set_cache_line_size( dim_t size );
00081 dim_t          FLASH_Queue_get_cache_line_size( void );
00082 void           FLASH_Queue_set_cores_per_cache( int cores );
00083 int            FLASH_Queue_get_cores_per_cache( void );
00084 void           FLASH_Queue_set_cores_per_queue( int cores );
00085 int            FLASH_Queue_get_cores_per_queue( void );
00086 void           FLASH_Queue_reset( void );
00087 FLASH_Task*    FLASH_Queue_get_head_task( void );
00088 FLASH_Task*    FLASH_Queue_get_tail_task( void );
00089 void           FLASH_Queue_push( void *func, void *cntl, char *name,
00090                                  FLA_Bool enabled_gpu,
00091                                  int n_int_args, int n_fla_args,
00092                                  int n_input_args, int n_output_args, ... );
00093 void           FLASH_Queue_push_input( FLA_Obj obj, FLASH_Task* t );
00094 void           FLASH_Queue_push_output( FLA_Obj obj, FLASH_Task* t );
00095 FLASH_Task*    FLASH_Task_alloc( void *func, void *cntl, char *name,
00096                                  FLA_Bool enabled_gpu,
00097                                  int n_int_args, int n_fla_args,
00098                                  int n_input_args, int n_output_args );
00099 void           FLASH_Task_free( FLASH_Task *t );
00100 void           FLASH_Queue_exec_task( FLASH_Task *t );
00101 void           FLASH_Queue_verbose_output( void );
00102 
00103 void           FLASH_Queue_init_tasks( void *arg );
00104 void           FLASH_Queue_wait_enqueue( FLASH_Task *t, void *arg );
00105 FLASH_Task*    FLASH_Queue_wait_dequeue( int queue, int cache, void *arg );
00106 FLASH_Task*    FLASH_Queue_wait_dequeue_block( int queue, int cache, void *arg );
00107 void           FLASH_Queue_update_cache( FLASH_Task *t, void *arg );
00108 void           FLASH_Queue_update_cache_block( FLA_Obj obj, int cache, FLA_Bool output, void *arg );
00109 void           FLASH_Queue_prefetch( int cache, void *arg );
00110 void           FLASH_Queue_prefetch_block( FLA_Obj obj );
00111 FLASH_Task*    FLASH_Queue_work_stealing( int queue, void *arg );
00112 #ifdef FLA_ENABLE_GPU
00113 void           FLASH_Queue_create_gpu( int thread, void *arg );
00114 void           FLASH_Queue_destroy_gpu( int thread, void *arg );
00115 FLA_Bool       FLASH_Queue_exec_gpu( FLASH_Task *t, void *arg );
00116 FLA_Bool       FLASH_Queue_check_gpu( FLASH_Task *t, void *arg );
00117 FLA_Bool       FLASH_Queue_check_block_gpu( FLA_Obj obj, int thread, void *arg );
00118 void           FLASH_Queue_update_gpu( FLASH_Task *t, void **input_arg, void **output_arg, void *arg );
00119 void           FLASH_Queue_update_block_gpu( FLA_Obj obj, void **buffer_gpu, int thread, void *arg );
00120 void           FLASH_Queue_mark_gpu( FLASH_Task *t, void *arg );
00121 void           FLASH_Queue_invalidate_block_gpu( FLA_Obj obj, int thread, void *arg );
00122 void           FLASH_Queue_flush_block_gpu( FLA_Obj obj, int thread, void *arg );
00123 void           FLASH_Queue_flush_gpu( int thread, void *arg );
00124 #endif
00125 void           FLASH_Queue_exec_parallel( void *arg );
00126 void*          FLASH_Queue_exec_parallel_function( void *arg );
00127 FLASH_Task*    FLASH_Task_update_dependencies( FLASH_Task *t, void *arg );
00128 FLASH_Task*    FLASH_Task_update_binding( FLASH_Task *t, FLASH_Task *r, void *arg );
00129 void           FLASH_Task_free_parallel( FLASH_Task *t, void *arg );
00130 
00131 void           FLASH_Queue_exec_simulation( void *arg );
00132 
00133 
00134 #endif // FLA_ENABLE_SUPERMATRIX
00135 
00136 
00137 #endif // FLASH_QUEUE_MAIN_PROTOTYPES_H