MegviiRobot / MegBA

MegBA: A GPU-Based Distributed Library for Large-Scale Bundle Adjustment

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

dentifier "CUSPARSE_SPMV_ALG_DEFAULT" is undefined

pshuxue opened this issue · comments

home/pengshuxue/Downloads/MegBA/src/solver/schur_pcg_solver.cu(470): error: identifier "CUSPARSE_SPMV_ALG_DEFAULT" is undefined
detected during:
instantiation of "__nv_bool MegBA::::SchurPCGSolverDistributed(const MegBA::SolverOption::SolverOptionPCG &, const std::vector<T *, std::allocator<T *>> &, const std::vector<T *, std::allocator<T *>> &, const std::vector<T *, std::allocator<T *>> &, const std::vector<int *, std::allocator<int *>> &, const std::vector<int *, std::allocator<int *>> &, const std::vector<T *, std::allocator<T *>> &, const std::vector<int *, std::allocator<int *>> &, const std::vector<int *, std::allocator<int *>> &, const std::vector<T *, std::allocator<T *>> &, int, int, int, int, const std::vector<int, std::allocator> &, int, int, const std::vector<T *, std::allocator<T *>> &) [with T=double]"
(658): here
instantiation of "void MegBA::SchurPCGSolver::solve(const MegBA::BaseLinearSystem &) [with T=double]"
(661): here

/home/pengshuxue/Downloads/MegBA/src/solver/schur_pcg_solver.cu(201): error: identifier "CUSPARSE_SPMV_ALG_DEFAULT" is undefined
detected during:
instantiation of "__nv_bool MegBA::::SchurPCGSolverDistributed(const MegBA::SolverOption::SolverOptionPCG &, const std::vector<T *, std::allocator<T *>> &, const std::vector<T *, std::allocator<T *>> &, const std::vector<T *, std::allocator<T *>> &, const std::vector<int *, std::allocator<int *>> &, const std::vector<int *, std::allocator<int *>> &, const std::vector<T *, std::allocator<T *>> &, const std::vector<int *, std::allocator<int *>> &, const std::vector<int *, std::allocator<int *>> &, const

Hi,
Thanks for your comments. This compiling time error is due to the macro name change in the CUDA toolkit. Specifically, in 11.3 or later versions, NVIDIA uses CUSPARSE_SPMV_ALG_DEFAULT as the sparse matrix multiplication flag; but in 11.2 or previous versions, they use CUSPARSE_MV_ALG_DEFAULT as the flag instead. We have fixed this bug by judging the nvcc version and manually defining macro variables.
Best regards,
Jie