cuda

package
v0.0.0-...-1b7481c Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package cuda provides helpers for CUDA binary parsing

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CubinKernel

type CubinKernel struct {
	Name string // Name of the kernel

	SymtabIndex int    // Index of this kernel in the ELF symbol table
	KernelSize  uint64 // Size of the kernel in bytes
	SharedMem   uint64 // Size of the shared memory used by the kernel
	ConstantMem uint64 // Size of the constant memory used by the kernel
	// contains filtered or unexported fields
}

CubinKernel holds the information of a CUDA kernel

type CubinKernelKey

type CubinKernelKey struct {
	Name      string
	SmVersion uint32
}

CubinKernelKey is the key to identify a kernel in a fatbin

type Fatbin

type Fatbin struct {
	Kernels map[CubinKernelKey]*CubinKernel
}

Fatbin holds all CUDA binaries found in one fatbin package

func ParseFatbinFromELFFile

func ParseFatbinFromELFFile(elfFile *safeelf.File) (*Fatbin, error)

ParseFatbinFromELFFile parses the fatbin sections of the given ELF file and returns the information found in it

func ParseFatbinFromELFFilePath

func ParseFatbinFromELFFilePath(path string) (*Fatbin, error)

ParseFatbinFromELFFilePath opens the given path and parses the resulting ELF for CUDA kernels

func (*Fatbin) GetKernel

func (fb *Fatbin) GetKernel(name string, smVersion uint32) *CubinKernel

GetKernel returns the kernel with the given name and SM version from the fatbin

type Symbols

type Symbols struct {
	SymbolTable map[uint64]string
	Fatbin      *Fatbin
}

Symbols holds all necessary data from a CUDA executable for getting necessary CUDA kernel data. That is, the symbol table which maps addresses to symbol names and the fatbin data with all the CUDA kernels available in the binary and their metadata.

func GetSymbols

func GetSymbols(path string) (*Symbols, error)

GetSymbols reads an ELF file from the given path and return the parsed CUDA data

Jump to

Keyboard shortcuts

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