1 修复cupy.cuda.compile_with_cache deprecated错误

最近在跑https://github.com/alex04072000/FuSta,以下的代码

@cupy.memoize(for_each_device=True)
def cupy_launch(strFunction, strKernel):
    return cupy.cuda.compile_with_cache(strKernel).get_function(strFunction)

出现了cupy.cuda.compile_with_cache deprecated的问题,这是由于在项目中安装了cupy的高版本,导致不兼容原有的函数。

上述代码可以进行如下修改:

@cupy.memoize(for_each_device=True)
def cupy_launch(strFunction, strKernel):
    module = cupy.RawModule(code=strKernel)
    return module.get_function(strFunction)

即可解决。

参考链接