nvrtc

package
v0.0.0-...-c9f06ed Latest Latest
Warning

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

Go to latest
Published: May 13, 2020 License: MIT Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Version

func Version() (major, minor int, err error)

Version returns the version major and minor

Types

type Include

type Include struct {
	Source string
	Name   string
}

Include are the headers for include

type Program

type Program struct {
	// contains filtered or unexported fields
}

Program is a wrapper for C.nvrtcProgram

func CreateProgram

func CreateProgram(src, name string, headers ...Include) (p *Program, err error)

CreateProgram creates an instance of nvrtcProgram with the given input parameters, and sets the output parameter prog with it.

func (*Program) AddNameExpression

func (p *Program) AddNameExpression(nameExpression string) error

AddNameExpression notes the given name expression denoting the address of a __global__ function or __device__/__constant__ variable.

The identical name expression string must be provided on a subsequent call to nvrtcGetLoweredName to extract the lowered name.

func (*Program) Compile

func (p *Program) Compile(options ...string) error

Compile compiles the given program.

func (*Program) GetLog

func (p *Program) GetLog() (string, error)

GetLog returns the log generated by the previous compilation

func (*Program) GetLoweredName

func (p *Program) GetLoweredName(nameExpression string) (string, error)

GetLoweredName extracts the lowered (mangled) name for a __global__ function or __device__/__constant__ variable, and updates *lowered_name to point to it. The memory containing the name is released when the NVRTC program is destroyed by nvrtcDestroyProgram. The identical name expression must have been previously provided to nvrtcAddNameExpression.

func (*Program) PTX

func (p *Program) PTX() (ptx string, err error)

PTX returns a string of the ptx code for the program

Jump to

Keyboard shortcuts

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