Code Monkey home page Code Monkey logo

Comments (3)

marsaev avatar marsaev commented on August 26, 2024

As i mentioned in another issue: Compiler should be able to deduce overloading here. But if it doesn't - i would try to move poly_postsmooth() and poly_presmooth() functions to partially specialized class/struct with general template throwing "not supported" error.

Something like

template<class T_Config>
struct poly_smooth
{
    static void poly_postsmooth(const Matrix<T_Config> &A, const Vector<T_Config> &B, Vector<T_Config> &C, cusp::relaxation::polynomial<typename T_Config::MatPrec, typename T_Config::MemSpace> &poly)
    {
        FatalError("Mixed precision is not supported for scalar matrix type", AMGX_ERR_NOT_IMPLEMENTED);
    }
    static void poly_presmooth(const Matrix<T_Config> &A, const Vector<T_Config> &B, Vector<T_Config> &C, cusp::relaxation::polynomial<typename T_Config::MatPrec, typename T_Config::MemSpace> &poly)
    {
        FatalError("Mixed precision is not supported for scalar matrix type", AMGX_ERR_NOT_IMPLEMENTED);
    }
}

template<AMGX_MemorySpace t_memSpace, AMGX_IndPrecision t_indInt>
struct poly_smooth<TemplateConfig<t_memSpace, AMGX_vecDouble, AMGX_matDouble, t_indInt>>
{
    static void poly_postsmooth(...){...};
    static void poly_presmooth(...){...};
}

template<AMGX_MemorySpace t_memSpace, AMGX_IndPrecision t_indInt>
struct poly_smooth<TemplateConfig<t_memSpace, AMGX_vecFloat, AMGX_matFloat, t_indInt>>
{
    static void poly_postsmooth(...){...};
    static void poly_presmooth(...){...};
}

...
poly_smooth<T_Config>::poly_postsmooth(...);
...

I might be a little off on that, but that's the general idea.

from amgx.

marsaev avatar marsaev commented on August 26, 2024

JFYI, solution above works for VS2017, i will patch code little bit later

from amgx.

DaveMakhija avatar DaveMakhija commented on August 26, 2024

Will there be a release anytime soon with a compiling version on VS2017? I'd like to give AMGX a try but I haven't gotten anywhere on Windows.

from amgx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.