Documentation
¶
Overview ¶
Package precompile builds device code for cudaprecompile and for cudaprecompiled's run-time fallback, so both compile a set of sources the same way.
Index ¶
- type Config
- func (c *Config) Compiler() (string, error)
- func (c *Config) Image(native []string, portable string) ([]byte, map[string]string, error)
- func (c *Config) Native(target string) ([]byte, map[string]string, error)
- func (c *Config) Portable(target string) ([]byte, error)
- func (c *Config) Sum() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Files fs.FS // sources and headers
Sources []string // translation units, as paths in Files
Headers []string // headers, as paths in Files
Include []string // include directories, as paths in Files
Options []string // other NVRTC options, such as -DN=4 or -std=c++17
Names []string // name expressions; only with one source
NoLTO bool // link several sources without link-time optimization
}
Config describes CUDA C++ sources and how to compile them.
func (*Config) Compiler ¶
Compiler identifies the libraries that Config.Image builds with: NVRTC, nvJitLink when there are several sources, and nvFatbin, as in "nvrtc 13.0 nvjitlink 13.0 nvfatbin 13.0". Sum excludes it, since it describes the build host rather than the sources.
func (*Config) Image ¶
Image builds machine code for each native target and, unless portable is empty, PTX for the portable target, and packages them as one image the driver loads directly. It also returns the lowered name of each name expression.
func (*Config) Native ¶
Native compiles the sources to machine code for target, such as sm_90, linking them when there are several. It also returns the lowered name of each name expression.