コード例 #1
0
def emitHeaderDefFile(filename):
    '''Emit a header file with definitions of the sparse triangular solve routines.
    
    Trilinos optionally allows explicit instantiation of template
    classes and functions.  It handles this by separating header files
    into declarations and definitions.  This function generates the
    header file of definitions for the sparse triangular solve
    routines.'''

    headerizedFilename = filename.replace('.', '_')

    s = ''
    s = s + makeCopyrightNotice () + Template ('''
#ifndef __${headerizedFilename}
#define __${headerizedFilename}

/// \\file ${baseFilename}
/// \\brief Definitions of "raw" sequential sparse triangular solve routines.
/// \warning This code was generated by the SparseTriSolve.py script.  
///   If you edit this header by hand, your edits will disappear the 
///   next time you run the generator script.

namespace Kokkos {
namespace Raw {

''').substitute (baseFilename=basename(filename), \
                     headerizedFilename=headerizedFilename)
    s = s + emitFuncDefVariants(0) + \
        '} // namespace Raw\n' + \
        '} // namespace Kokkos\n\n' + \
        '#endif // #ifndef __' + headerizedFilename + '\n'
    return s
コード例 #2
0
ファイル: SparseTriSolve.py プロジェクト: 00liujj/trilinos
def emitHeaderDefFile (filename):
    '''Emit a header file with definitions of the sparse triangular solve routines.
    
    Trilinos optionally allows explicit instantiation of template
    classes and functions.  It handles this by separating header files
    into declarations and definitions.  This function generates the
    header file of definitions for the sparse triangular solve
    routines.'''

    headerizedFilename = filename.replace ('.', '_')

    s = ''
    s = s + makeCopyrightNotice () + Template ('''
#ifndef __${headerizedFilename}
#define __${headerizedFilename}

/// \\file ${baseFilename}
/// \\brief Definitions of "raw" sequential sparse triangular solve routines.
/// \warning This code was generated by the SparseTriSolve.py script.  
///   If you edit this header by hand, your edits will disappear the 
///   next time you run the generator script.

namespace KokkosClassic {
namespace Raw {

''').substitute (baseFilename=basename(filename), \
                     headerizedFilename=headerizedFilename)
    s = s + emitFuncDefVariants(0) + \
        '} // namespace Raw\n' + \
        '} // namespace KokkosClassic\n\n' + \
        '#endif // #ifndef __' + headerizedFilename + '\n'
    return s
コード例 #3
0
def makeHeaderDeclFile (filename):
    '''Make a header file with declarations of the sparse triangular solve routines.
    
    Trilinos optionally allows explicit instantiation of template
    classes and functions.  It handles this by separating header files
    into declarations and definitions.  This function generates the
    header file of declarations for the sparse triangular solve
    routines.
    '''

    headerizedFilename = filename.replace ('.', '_')

    s = ''
    s = s + makeCopyrightNotice ()
    s = s + Template ('''
#ifndef __${headerizedFilename}
#define __${headerizedFilename}

/// \\file ${baseFilename}
/// \\brief Declarations of "raw" sequential sparse triangular solve routines.
/// \warning This code was generated by the sparse_triangular_solve.py script.  
///   If you edit this header by hand, your edits will disappear the next time
///   we run the generator script.

namespace KokkosClassic {

/// \\namespace Raw
/// \\brief "Raw" intranode computational routines.
///
/// "Raw" means first that the routines only use standard data structures,
/// rather than Kokkos data structures.  Second, it means that the routines
/// do not depend on the Kokkos Node API (a generic intranode parallel
/// programming model).  They are either sequential, or directly use a 
/// standard shared-memory programming model, such as Pthreads, Intel's
/// Threading Building Blocks, or the like.
namespace Raw {

''').substitute (baseFilename=basename(filename), \
                     headerizedFilename=headerizedFilename)

    sparseFormat = 'CSR'
    inPlace = False

    for dataLayout in ['column major', 'row major']:
        for upLo in ['lower', 'upper']:
            for unitDiag in [False, True]:
                for conjugateMatrixElements in [False, True]:
                    defDict = {'sparseFormat': sparseFormat,
                               'upLo': upLo,
                               'dataLayout': dataLayout,
                               'unitDiag': unitDiag,
                               'inPlace': inPlace,
                               'conjugateMatrixElements': conjugateMatrixElements}
                    s = s + makeFunctionDoc (defDict) + \
                        makeFunctionDeclaration (defDict) + '\n\n'
    s = s + '} // namespace Raw\n' + \
        '} // namespace KokkosClassic\n\n' + \
        '#endif // #ifndef __' + headerizedFilename + '\n'
    return s
コード例 #4
0
def makeHeaderDeclFile (filename):
    '''Make a header file with declarations of the sparse triangular solve routines.
    
    Trilinos optionally allows explicit instantiation of template
    classes and functions.  It handles this by separating header files
    into declarations and definitions.  This function generates the
    header file of declarations for the sparse triangular solve
    routines.
    '''

    headerizedFilename = filename.replace ('.', '_')

    s = ''
    s = s + makeCopyrightNotice ()
    s = s + Template ('''
#ifndef __${headerizedFilename}
#define __${headerizedFilename}

/// \\file ${baseFilename}
/// \\brief Declarations of "raw" sequential sparse triangular solve routines.
/// \warning This code was generated by the sparse_triangular_solve.py script.  
///   If you edit this header by hand, your edits will disappear the next time
///   we run the generator script.

namespace Kokkos {

/// \\namespace Raw
/// \\brief "Raw" intranode computational routines.
///
/// "Raw" means first that the routines only use standard data structures,
/// rather than Kokkos data structures.  Second, it means that the routines
/// do not depend on the Kokkos Node API (a generic intranode parallel
/// programming model).  They are either sequential, or directly use a 
/// standard shared-memory programming model, such as Pthreads, Intel's
/// Threading Building Blocks, or the like.
namespace Raw {

''').substitute (baseFilename=basename(filename), \
                     headerizedFilename=headerizedFilename)

    sparseFormat = 'CSR'
    inPlace = False

    for dataLayout in ['column major', 'row major']:
        for upLo in ['lower', 'upper']:
            for unitDiag in [False, True]:
                for conjugateMatrixElements in [False, True]:
                    defDict = {'sparseFormat': sparseFormat,
                               'upLo': upLo,
                               'dataLayout': dataLayout,
                               'unitDiag': unitDiag,
                               'inPlace': inPlace,
                               'conjugateMatrixElements': conjugateMatrixElements}
                    s = s + makeFunctionDoc (defDict) + \
                        makeFunctionDeclaration (defDict) + '\n\n'
    s = s + '} // namespace Raw\n' + \
        '} // namespace Kokkos\n\n' + \
        '#endif // #ifndef __' + headerizedFilename + '\n'
    return s
コード例 #5
0
def emitHeaderDeclFile(filename):
    '''Make a header file with declarations of the sparse triangular solve routines.
    
    Trilinos optionally allows explicit instantiation of template
    classes and functions.  It handles this by separating header files
    into declarations and definitions.  This function generates the
    header file of declarations for the sparse triangular solve
    routines.
    '''

    headerizedFilename = filename.replace('.', '_')

    s = ''
    s = s + makeCopyrightNotice()
    s = s + Template ('''
#ifndef __${headerizedFilename}
#define __${headerizedFilename}

/// \\file ${baseFilename}
/// \\brief Declarations of "raw" sequential sparse triangular solve routines.
/// \warning This code was generated by the SparseTriSolve.py script.  
///   If you edit this header by hand, your edits will disappear the 
///   next time you run the generator script.

namespace Kokkos {

/// \\namespace Raw
/// \\brief "Raw" intranode computational routines.
///
/// "Raw" means first that the routines only use standard data structures,
/// rather than Kokkos data structures.  Second, it means that the routines
/// do not depend on the Kokkos Node API (a generic intranode parallel
/// programming model).  They are either sequential, or directly use a 
/// standard shared-memory programming model, such as Pthreads, Intel's
/// Threading Building Blocks, or the like.
///
/// The sparse matrix-vector multiply and sparse triangular solve routines
/// defined in this namespace accept multiple vectors at a time.  These are
/// really just dense matrices, but we sometimes call them "multivectors,"
/// to highlight that we are considering them as collections of one or more
/// vectors.
namespace Raw {

''').substitute (baseFilename=basename(filename), \
                     headerizedFilename=headerizedFilename)
    s = s + emitFuncDeclVariants(0) + \
        '} // namespace Raw\n' + \
        '} // namespace Kokkos\n\n' + \
        '#endif // #ifndef __' + headerizedFilename + '\n'
    return s
コード例 #6
0
ファイル: SparseTriSolve.py プロジェクト: 00liujj/trilinos
def emitHeaderDeclFile (filename):
    '''Make a header file with declarations of the sparse triangular solve routines.
    
    Trilinos optionally allows explicit instantiation of template
    classes and functions.  It handles this by separating header files
    into declarations and definitions.  This function generates the
    header file of declarations for the sparse triangular solve
    routines.
    '''

    headerizedFilename = filename.replace ('.', '_')

    s = ''
    s = s + makeCopyrightNotice ()
    s = s + Template ('''
#ifndef __${headerizedFilename}
#define __${headerizedFilename}

/// \\file ${baseFilename}
/// \\brief Declarations of "raw" sequential sparse triangular solve routines.
/// \warning This code was generated by the SparseTriSolve.py script.  
///   If you edit this header by hand, your edits will disappear the 
///   next time you run the generator script.

namespace KokkosClassic {

/// \\namespace Raw
/// \\brief "Raw" intranode computational routines.
///
/// "Raw" means first that the routines only use standard data structures,
/// rather than Kokkos data structures.  Second, it means that the routines
/// do not depend on the Kokkos Node API (a generic intranode parallel
/// programming model).  They are either sequential, or directly use a 
/// standard shared-memory programming model, such as Pthreads, Intel's
/// Threading Building Blocks, or the like.
///
/// The sparse matrix-vector multiply and sparse triangular solve routines
/// defined in this namespace accept multiple vectors at a time.  These are
/// really just dense matrices, but we sometimes call them "multivectors,"
/// to highlight that we are considering them as collections of one or more
/// vectors.
namespace Raw {

''').substitute (baseFilename=basename(filename), \
                     headerizedFilename=headerizedFilename)
    s = s + emitFuncDeclVariants(0) + \
        '} // namespace Raw\n' + \
        '} // namespace KokkosClassic\n\n' + \
        '#endif // #ifndef __' + headerizedFilename + '\n'
    return s
コード例 #7
0
def makeHeaderDefFile(filename):
    '''Make a header file with definitions of the sparse triangular solve routines.
    
    Trilinos optionally allows explicit instantiation of template
    classes and functions.  It handles this by separating header files
    into declarations and definitions.  This function generates the
    header file of definitions for the sparse triangular solve
    routines.
    '''

    headerizedFilename = filename.replace('.', '_')

    s = ''
    s = s + makeCopyrightNotice () + Template ('''
#ifndef __${headerizedFilename}
#define __${headerizedFilename}

/// \\file ${baseFilename}
/// \\brief Definitions of "raw" sequential sparse triangular solve routines.
/// \warning This code was generated by the sparse_triangular_solve.py script.  
///   If you edit this header by hand, your edits will disappear the next time
///   we run the generator script.

namespace KokkosClassic {
namespace Raw {

''').substitute (baseFilename=basename(filename), \
                     headerizedFilename=headerizedFilename)

    sparseFormat = 'CSR'
    inPlace = False

    defDict = {}
    for dataLayout in ['column major', 'row major']:
        for upLo in ['lower', 'upper']:
            for unitDiag in [False, True]:
                for conjugateMatrixElements in [False, True]:
                    defDict = {
                        'sparseFormat': sparseFormat,
                        'upLo': upLo,
                        'dataLayout': dataLayout,
                        'unitDiag': unitDiag,
                        'inPlace': inPlace,
                        'conjugateMatrixElements': conjugateMatrixElements
                    }
                    s = s + makeFunctionDefinition(defDict) + '\n\n'
    s = s + '} // namespace Raw\n' + \
        '} // namespace KokkosClassic\n\n' + \
        '#endif // #ifndef __' + headerizedFilename + '\n'
    return s
コード例 #8
0
def makeHeaderDefFile (filename):
    '''Make a header file with definitions of the sparse triangular solve routines.
    
    Trilinos optionally allows explicit instantiation of template
    classes and functions.  It handles this by separating header files
    into declarations and definitions.  This function generates the
    header file of definitions for the sparse triangular solve
    routines.
    '''

    headerizedFilename = filename.replace ('.', '_')

    s = ''
    s = s + makeCopyrightNotice () + Template ('''
#ifndef __${headerizedFilename}
#define __${headerizedFilename}

/// \\file ${baseFilename}
/// \\brief Definitions of "raw" sequential sparse triangular solve routines.
/// \warning This code was generated by the sparse_triangular_solve.py script.  
///   If you edit this header by hand, your edits will disappear the next time
///   we run the generator script.

namespace KokkosClassic {
namespace Raw {

''').substitute (baseFilename=basename(filename), \
                     headerizedFilename=headerizedFilename)

    sparseFormat = 'CSR'
    inPlace = False

    defDict = {}    
    for dataLayout in ['column major', 'row major']:
        for upLo in ['lower', 'upper']:
            for unitDiag in [False, True]:
                for conjugateMatrixElements in [False, True]:
                    defDict = {'sparseFormat': sparseFormat,
                               'upLo': upLo,
                               'dataLayout': dataLayout,
                               'unitDiag': unitDiag,
                               'inPlace': inPlace,
                               'conjugateMatrixElements': conjugateMatrixElements}
                    s = s + makeFunctionDefinition (defDict) + '\n\n'
    s = s + '} // namespace Raw\n' + \
        '} // namespace KokkosClassic\n\n' + \
        '#endif // #ifndef __' + headerizedFilename + '\n'
    return s