Skip to content

Latest commit

 

History

History
executable file
·
38 lines (28 loc) · 981 Bytes

File metadata and controls

executable file
·
38 lines (28 loc) · 981 Bytes
id compile
title 编译
type reference
displayed_sidebar api

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

torchpipe.utils.cpp_extension.load {#load}

编译并加载c++文件。

def load(name="", 
        sources=[],  
        rebuild_if_exist=True, 
        is_python_module=False, 
        extra_include_paths=[], 
        extra_ldflags=[],  
        with_cuda=True)

:::tip 参数

  • name - 编译好的动态库名称,可为空,自动根据源文件名生成。
  • sources - 需要编译的cpp源文件
  • rebuild_if_exist - 动态库已经存在的话,是否需要重新启动编译流程。注意:即使为True,如果源代码没改变,可能也不会重新编译。
  • is_python_module 是否为python模块,如果是,将返回一个python库
  • extra_include_paths 额外的头文件路径
  • extra_ldflags 额外的ldflags
  • with_cuda - 是否有cuda相关代码 :::