Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Issue CUDA 9.2 and VS2017 #32

Closed
DrStS opened this issue Jun 7, 2018 · 3 comments
Closed

Compilation Issue CUDA 9.2 and VS2017 #32

DrStS opened this issue Jun 7, 2018 · 3 comments

Comments

@DrStS
Copy link

DrStS commented Jun 7, 2018

The following error occurs:

polynomial_solver.cu(291): error C2668: "amgx::polynomial_solver::poly_postsmooth":

polynomial_solver.cu(351): error C2668: "amgx::polynomial_solver::poly_presmooth":

@marsaev
Copy link
Collaborator

marsaev commented Jun 19, 2018

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.

@marsaev
Copy link
Collaborator

marsaev commented Jun 21, 2018

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

@DaveMakhija
Copy link

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.

@ftvkun ftvkun mentioned this issue Jan 11, 2019
@marsaev marsaev closed this as completed Apr 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants