parallel101 / course

高性能并行编程与优化 - 课件
https://space.bilibili.com/263032155
Other
3.77k stars 542 forks source link

报错:no suitable user-defined conversion from "CudaAllocator<int>" to "CudaAllocator<std::_Container_proxy>" exists #23

Open anzisheng opened 1 year ago

anzisheng commented 1 year ago

在08课程04_sugar\01下面生成 visual studio 2022 项目之后,运行报错如下: “no suitable user-defined conversion from "CudaAllocator" to "CudaAllocator" exists”,请问老师如何修改?

archibate commented 1 year ago

已经修复 https://github.com/parallel101/course/blob/master/08/include/CudaAllocator.h#L28C1-L34C6

archibate commented 1 year ago
    template <class U> // cihou shabi wendous
    constexpr CudaAllocator(CudaAllocator<U> const &other) noexcept {
    }

    constexpr bool operator==(CudaAllocator<T> const &other) const {
        return this == &other;
    }
anzisheng commented 1 year ago

@archibate 小彭老师,我试验了一下,好像没有效果,仍然保一样的错。