Skip to main content

Crate silvic_gpu

Crate silvic_gpu 

Source
Expand description

Metal and CUDA backends for silvic.

The kernels are written once (kernels/kernels.kern) against a small macro vocabulary that kernels/prelude_metal.h and kernels/prelude_cuda.h define for Metal Shading Language and CUDA C++, and are compiled at run time (Metal newLibraryWithSource, NVRTC). GpuBackend implements silvic_core::Backend once over the GpuDevice primitives, so the Metal and CUDA backends differ only in their device layer.

Structs§

GpuBackend
silvic_core::Backend over any GpuDevice.

Enums§

Arg
A kernel argument. Buffer arguments bind at their position (Metal [[buffer(i)]], CUDA positional parameter); Bytes is a #[repr(C)] parameter struct passed by value (Metal setBytes, at most 4 KiB).

Traits§

GpuDevice

Functions§

kernel_source
The complete kernel source for one API: prelude, the shared capacities as #defines, common.h and kernels.kern.