precompile

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2026 License: Apache-2.0 Imports: 16 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

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

func (c *Config) Compiler() (string, error)

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

func (c *Config) Image(native []string, portable string) ([]byte, map[string]string, error)

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

func (c *Config) Native(target string) ([]byte, map[string]string, error)

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.

func (*Config) Portable

func (c *Config) Portable(target string) ([]byte, error)

Portable compiles the sources to PTX for the virtual architecture of target, such as compute_80. Several sources need link-time optimization, because only nvJitLink's LTO path emits PTX.

func (*Config) Sum

func (c *Config) Sum() (string, error)

Sum returns a digest of everything that determines the compiled code except the target architectures.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL