Exemplo n.º 1
0
inline void gemv(CBLAS_ORDER const Order,
        CBLAS_TRANSPOSE const TransA, int const M, int const N,
         double alpha,
        std::complex<double> const *A, int const lda,
        std::complex<double> const *X, int const incX,
        double beta,
        std::complex<double> *Y, int const incY
) {
	std::complex<double> alphaArg(alpha,0);
	std::complex<double> betaArg(beta,0);
	cblas_zgemv(Order, TransA, M, N,
	        reinterpret_cast<cblas_double_complex_type const *>(&alphaArg),
	        reinterpret_cast<cblas_double_complex_type const *>(A), lda,
	        reinterpret_cast<cblas_double_complex_type const *>(X), incX,
	        reinterpret_cast<cblas_double_complex_type const *>(&betaArg),
	        reinterpret_cast<cblas_double_complex_type *>(Y), incY);
}
Exemplo n.º 2
0
inline void gemv(CBLAS_ORDER const Order,
        CBLAS_TRANSPOSE const TransA, int const M, int const N,
        double alpha,
        std::complex<float> const *A, int const lda,
        std::complex<float> const *X, int const incX,
        double beta,
        std::complex<float> *Y, int const incY
) {
	std::complex<float> alphaArg(alpha,0);
	std::complex<float> betaArg(beta,0);
	cblas_cgemv(Order, TransA, M, N,
	        static_cast<void const *>(&alphaArg),
	        static_cast<void const *>(A), lda,
	        static_cast<void const *>(X), incX,
	        static_cast<void const *>(&betaArg),
	        static_cast<void *>(Y), incY);
}
Exemplo n.º 3
0
inline void gemm(CBLAS_ORDER const Order,
	CBLAS_TRANSPOSE TransA, CBLAS_TRANSPOSE TransB,
	int M, int N, int K,
	double alpha,
	std::complex<double> const *A, int lda,
	std::complex<double> const *B, int ldb,
	double beta,
	std::complex<double>* C, int ldc
) {
	std::complex<double> alphaArg(alpha,0);
	std::complex<double> betaArg(beta,0);
	cblas_zgemm(
		Order, TransA, TransB, M, N, K,
		static_cast<void const *>(&alphaArg),
		static_cast<void const *>(A), lda,
		static_cast<void const *>(B), ldb,
		static_cast<void const *>(&betaArg),
		static_cast<void *>(C), ldc
	);
}
Exemplo n.º 4
0
void LocalInitData::parseArguments( const int argc, char** argv )
{
    try
    {
        std::string wsHelp = "Window System API ( one of: ";
#ifdef AGL
        wsHelp += "AGL ";
#endif
#ifdef GLX
        wsHelp += "glX ";
#endif
#ifdef WGL
        wsHelp += "WGL ";
#endif
        wsHelp += ")";

        std::string desc = EVolve::getHelp();

        TCLAP::CmdLine command( desc );
        
        TCLAP::ValueArg<std::string> modelArg( "m", "model", 
                                               "raw model file name",
                                               false, "Bucky32x32x32.raw",
                                               "string", command );
        TCLAP::SwitchArg residentArg( "r", "resident", 
           "Keep client resident (see resident node documentation on website)", 
                                      command, false );
        TCLAP::ValueArg<uint32_t> framesArg( "n", "numFrames", 
                                           "Maximum number of rendered frames", 
                                             false, 0xffffffffu, "unsigned",
                                             command );
        TCLAP::ValueArg<uint32_t> precisionArg( "p", "precision", 
                "Rendering precision (default 2, bigger is better and slower)", 
                                                false, 2, "unsigned",
                                                command );
        TCLAP::ValueArg<float> brightnessArg( "b", "brightness",
                                              "brightness factor", false, 1.0f,
                                              "float", command );
        TCLAP::ValueArg<float> alphaArg( "a", "alpha", "alpha attenuation", 
                                         false, 1.0f, "float", command );
        TCLAP::SwitchArg orthoArg( "o", "ortho", 
                                   "use orthographic projection", 
                                   command, false );
        TCLAP::ValueArg<std::string> wsArg( "w", "windowSystem", wsHelp,
                                            false, "auto", "string", command );
        TCLAP::VariableSwitchArg ignoreEqArgs( "eq",
                                               "Ignored Equalizer options",
                                               command );
        TCLAP::UnlabeledMultiArg< std::string >
            ignoreArgs( "ignore", "Ignored unlabeled arguments", false, "any",
                        command );

        command.parse( argc, argv );

        if( modelArg.isSet( ))
            setFilename( modelArg.getValue( ));
        if( wsArg.isSet( ))
        {
            std::string windowSystem = wsArg.getValue();
            transform( windowSystem.begin(), windowSystem.end(),
                       windowSystem.begin(), (int(*)(int))std::toupper );

            setWindowSystem( windowSystem );
        }

        if( framesArg.isSet( ))
            _maxFrames = framesArg.getValue();
        if( precisionArg.isSet( ))
            setPrecision( precisionArg.getValue( ));
        if( brightnessArg.isSet( ))
            setBrightness( brightnessArg.getValue( ));
        if( alphaArg.isSet( ))
            setAlpha( alphaArg.getValue( ));
        if( residentArg.isSet( ))
            _isResident = true;
        if( orthoArg.isSet( ))
            _ortho = true;
    }
    catch( const TCLAP::ArgException& exception )
    {
        LBERROR << "Command line parse error: " << exception.error() 
                << " for argument " << exception.argId() << std::endl;
        ::exit( EXIT_FAILURE );
    }
}