parray_utils.py 文件源码

python
阅读 31 收藏 0 点赞 0 评论 0

项目:neurodriver 作者: neurokernel 项目源码 文件源码
def get_fill_function(dtype, pitch = True):
    type_dst = dtype_to_ctype(dtype)
    name = "fill"

    if pitch:
        func = SourceModule(
            fill_pitch_template % {
                    "name": name,
                    "type_dst": type_dst
            }, options=["--ptxas-options=-v"]).get_function(name)
        func.prepare('iiPi'+np.dtype(dtype).char)
        #    [np.int32, np.int32, np.intp, np.int32, _get_type(dtype)])
    else:
        func = SourceModule(
                fill_nonpitch_template % {
                    "name": name,
                    "type_dst": type_dst
                },
                options=["--ptxas-options=-v"]).get_function(name)
        func.prepare('iP'+np.dtype(dtype).char)#[np.int32, np.intp, _get_type(dtype)])
    return func
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号