TAPs 0.7.7.3
TAPsCUDA_DataPool_Def.cu
Go to the documentation of this file.
00001 /******************************************************************************
00002 TAPsCUDA_DataPool_Def.cu
00003 
00004 CUDA Data Pool Definition (i.e., cpp file).
00005 
00006 SUKITTI PUNAK   (08/27/2008)
00007 UPDATE          (09/18/2009)
00008 ******************************************************************************/
00009 
00010 #include "TAPsCUDA_DataPool.cu"
00011 
00012 BEGIN_NAMESPACE_TAPs__CUDA
00013 //=============================================================================
00014 //-----------------------------------------------------------------------------
00015 
00016 // Add Vertex List Data Object to the CUDA Global Data Pool
00017 bool AddToGlobal_Pool_Of_DATA_Vertex_List ( DATA_Vertex_List * dataObj )
00018 {
00019     //printf( "AddToGlobal_Pool_Of_DATA_Vertex_List\n" );
00020     //fflush( stdout );
00021 
00022     unsigned int current_size = DATA_GlobalPool.SizeOfGlobal_Pool;
00023     if ( current_size == 0 ) {
00024         // SHOULD NEVER REACHED THIS!!!
00025         DATA_GlobalPool.DataForVertexList = new DATA_Vertex_List * [ ++DATA_GlobalPool.SizeOfGlobal_Pool ];
00026     }
00027     else {
00028         DATA_Vertex_List ** old_list = DATA_GlobalPool.DataForVertexList;
00029         DATA_GlobalPool.DataForVertexList = new DATA_Vertex_List * [ ++DATA_GlobalPool.SizeOfGlobal_Pool ];
00030         for ( unsigned int i = 0; i < current_size; ++i ) {
00031             DATA_GlobalPool.DataForVertexList[ i ] = old_list[ i ];
00032         }
00033         delete [] old_list;
00034     }
00035     DATA_GlobalPool.DataForVertexList[ current_size ] = dataObj;
00036     
00037     // DEBUG
00038     printf( "Add vetex list set -- SizeOfGlobal_Pool (and with PLHM): %i %i\n", DATA_GlobalPool.SizeOfGlobal_Pool, DATA_GlobalPool.SizeOfGlobal_PoolPLHM );
00039 
00040     return true;
00041 }
00042 
00043 // Remove Vertex List Data Object from the CUDA Global Data Pool
00044 //bool RemoveFromGlobal_Pool_Of_DATA_Vertex_List ( DATA_Vertex_List * dataObj )
00045 //{
00046 //  return false;
00047 //}
00048 
00049 
00050 
00051 // Add Vertex List (PLHM) Data Object to the CUDA Global Data Pool
00052 bool AddToGlobal_Pool_Of_DATA_Vertex_ListPLHM ( DATA_Vertex_ListPLHM * dataObj )
00053 {
00054     unsigned int current_size = DATA_GlobalPool.SizeOfGlobal_PoolPLHM;
00055     if ( current_size == 0 ) {
00056         // SHOULD NEVER REACHED THIS!!!
00057         DATA_GlobalPool.DataForVertexListPLHM = new DATA_Vertex_ListPLHM * [ ++DATA_GlobalPool.SizeOfGlobal_PoolPLHM ];
00058     }
00059     else {
00060         DATA_Vertex_ListPLHM ** old_list = DATA_GlobalPool.DataForVertexListPLHM;
00061         DATA_GlobalPool.DataForVertexListPLHM = new DATA_Vertex_ListPLHM * [ ++DATA_GlobalPool.SizeOfGlobal_PoolPLHM ];
00062         for ( unsigned int i = 0; i < current_size; ++i ) {
00063             DATA_GlobalPool.DataForVertexListPLHM[ i ] = old_list[ i ];
00064         }
00065         delete [] old_list;
00066     }
00067     DATA_GlobalPool.DataForVertexListPLHM[ current_size ] = dataObj;
00068     
00069     // DEBUG
00070     printf( "Add vetex list (PLHM) set -- SizeOfGlobal_Pool (and with PLHM): %i %i\n", DATA_GlobalPool.SizeOfGlobal_Pool, DATA_GlobalPool.SizeOfGlobal_PoolPLHM );
00071     
00072     return true;
00073 }
00074 
00075 // Remove Vertex List (PLHM) Data Object from the CUDA Global Data Pool
00076 //bool RemoveFromGlobal_Pool_Of_DATA_Vertex_ListPLHM ( DATA_Vertex_ListPLHM * dataObj )
00077 //{
00078 //  return false;
00079 //}
00080 
00081 //-----------------------------------------------------------------------------
00082 //=============================================================================
00083 END_NAMESPACE_TAPs__CUDA
00084 //-----------------------------------------------------------------------------
00085 //34567890123456789012345678901234567890123456789012345678901234567890123456789
00086 //--+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines