Documentation
¶
Overview ¶
Package abistub builds C libraries that stand in for a vendor library in native ABI tests of the generated bindings.
A stub starts with Prelude and records each argument it receives with its macros. A test loads the stub through the package's own Load, calls a wrapper, and compares Recorder.Recorded with the arguments it passed, bit for bit. The stub returns the value set by Recorder.Reset, so the same call also checks error conversion.
Index ¶
Constants ¶
const Prelude = `` /* 439-byte string literal not displayed */
Prelude declares the record a stub keeps and the macros that fill it. Each function starts with BEGIN and returns RET:
R(x) records an unsigned integer, pointer or handle, zero-extended S(x) records a signed integer, sign-extended F32(x) records a float's bit pattern F64(x) records a double's bit pattern
Variables ¶
This section is empty.
Functions ¶
func Build ¶
Build compiles csrc, with flags, as a shared library and returns its path. It skips tb when there is no C compiler.
func CUDAInclude ¶
CUDAInclude returns the CUDA toolkit include directory holding header, or "" if there is none. It looks in $CUDA_HOME, $CUDA_PATH and /usr/local/cuda, then in /usr, where distribution packages such as NCCL's install their headers. A stub built against the real header with -DSTUB_REAL_HEADER has its prototypes and layouts checked by the compiler.
Types ¶
type Recorder ¶
type Recorder struct {
// contains filtered or unexported fields
}
A Recorder reads the record of a loaded stub.
func NewRecorder ¶
NewRecorder returns a Recorder for the stub whose data symbols lookup resolves.