pycuda icon indicating copy to clipboard operation
pycuda copied to clipboard

Implement stream priority feature

Open dmenig opened this issue 4 years ago • 6 comments

Solves https://github.com/inducer/pycuda/issues/319

I'm not exactly sure my work is proper, I'm more a python guy than C++. Can you share your thoughts @inducer please ?

dmenig avatar Nov 23 '21 10:11 dmenig

Thanks for your contribution, and sorry about the long delay in reviewing this.

Gitlab CI link: https://gitlab.tiker.net/inducer/pycuda/-/commit/c08a582c48d1b28e201adb0b2f5a1adec1f5eef6/pipelines?ref=issue_319

Do you know how to solve this ?

        src/wrapper/wrap_cudadrv.cpp:1202:87: error: no matching function for call to ‘pycudaboost::python::init<unsigned int, int>::init(pycudaboost::python::arg&, pycudaboost::python::arg&)’
         1202 |       ("Stream", py::init<unsigned int, int>(py::arg("flags")=0, py::arg("priority")=0))

I tried removing the int arg and am waiting for the CI result but I'm doubtful that is the problem. I'm puzzled.

dmenig avatar Apr 26 '22 13:04 dmenig

I tried removing the int arg and am waiting for the CI result but I'm doubtful that is the problem. I'm puzzled.

Does it compile for you locally?

inducer avatar Apr 26 '22 14:04 inducer

Pushed to Gitlab for CI, find results via https://gitlab.tiker.net/inducer/pycuda/-/commits/issue_319

inducer avatar Apr 26 '22 14:04 inducer

(Pushed once again.)

inducer avatar Apr 26 '22 15:04 inducer

I tried removing the int arg and am waiting for the CI result but I'm doubtful that is the problem. I'm puzzled.

Does it compile for you locally?

I didn't try to do that. I usually use my CI for back and forth. I'll see if I manage to do that.

dmenig avatar Apr 26 '22 15:04 dmenig

I managed to repoduce the CI results on my machine. I think this larger message is interesting :

    src/wrapper/wrap_cudadrv.cpp:1202:87: error: no matching function for call to ‘pycudaboost::python::init<unsigned int, int>::init(pycudaboost::python::arg&, pycudaboost::python::arg&)’       1202 |       ("Stream", py::init<unsigned int, int>(py::arg("flags")=0, py::arg("priority")=0))                                                                                                    |                                                                                       ^                                                                                               In file included from bpl-subset/bpl_subset/boost/python/class.hpp:20,                                                                                                                                         from bpl-subset/bpl_subset/boost/python.hpp:18,                                                                                                                          
                     from src/cpp/cuda.hpp:36,                                                                                                                                                
                     from src/wrapper/wrap_cudadrv.cpp:3:                                      
    bpl-subset/bpl_subset/boost/python/init.hpp:253:5: note: candidate: ‘template<long unsigned int N> pycudaboost::python::init<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T
14>::init(const pycudaboost::python::detail::keywords<N>&, const char*)’                                                                                                                      
      253 |     init(detail::keywords<N> const& kw, char const* doc_ = 0)                      
          |     ^~~~                                                                                                                                                                          
    bpl-subset/bpl_subset/boost/python/init.hpp:253:5: note:   template argument deduction/substitution failed:                                                                               
    src/wrapper/wrap_cudadrv.cpp:1202:85: note:   cannot convert ‘pycudaboost::python::detail::keywords<1>(((const char*)"priority")).pycudaboost::python::detail::keywords<1>::operator=<int>
(0)’ (type ‘pycudaboost::python::arg’ {aka ‘pycudaboost::python::detail::keywords<1>’}) to type ‘const char*’
     1202 |       ("Stream", py::init<unsigned int, int>(py::arg("flags")=0, py::arg("priority")=0))
          |                                                                      ~~~~~~~~~~~~~~~^~
    In file included from bpl-subset/bpl_subset/boost/python/class.hpp:20,
                     from bpl-subset/bpl_subset/boost/python.hpp:18,
                     from src/cpp/cuda.hpp:36,
                     from src/wrapper/wrap_cudadrv.cpp:3:
    bpl-subset/bpl_subset/boost/python/init.hpp:244:5: note: candidate: ‘template<long unsigned int N> pycudaboost::python::init<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T
14>::init(const char*, const pycudaboost::python::detail::keywords<N>&)’
      244 |     init(char const* doc_, detail::keywords<N> const& kw)
          |     ^~~~
    bpl-subset/bpl_subset/boost/python/init.hpp:244:5: note:   template argument deduction/substitution failed:

Looks like I can't supply two keywords with default value to this function, but I can't figure out why. Come to think of it : none of the other functions have two arguments with default values in this repo. Can you tell me how to solve this ?

dmenig avatar Apr 26 '22 17:04 dmenig