opencl_manager.py 文件源码

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

项目:codecad 作者: bluecube 项目源码 文件源码
def _build_program(self):
        code = "\n".join(itertools.chain(self.common_header.pieces,
                                         itertools.chain.from_iterable(cu.pieces for cu in self._compile_units)))
        program = pyopencl.Program(self.context, code)
        with warnings.catch_warnings():
            # Intel OpenCL generates non empty output and that causes warnings
            # from pyopencl. We just silence them.
            warnings.simplefilter("ignore")
            return program.build(options=DEFAULT_COMPILER_OPTIONS)

        # Working around bug in pyopencl.Program.compile in pyopencl
        # (https://lists.tiker.net/pipermail/pyopencl/2015-September/001986.html)
        # TODO: Fix this in OpenCL
        # compiled_units = [unit.compile(self.context, self.common_header.pieces)
        #                   for unit in self._compile_units]
        # return pyopencl.link_program(self.context, compiled_units)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号