dot-ggmlr_normalize_gpu: GPU-accelerated LogNormalize (op = "normalize")

.ggmlr_normalize_gpuR Documentation

GPU-accelerated LogNormalize (op = "normalize")

Description

Library-size normalisation followed by log1p, matching Seurat's NormalizeData(method = "LogNormalize"): log1p(x / colSums(x) * scale_factor). The per-cell scaling and the log1p run elementwise on the GPU (broadcast a per-cell factor across genes); the column sums are a cheap reduction.

Usage

.ggmlr_normalize_gpu(
  mat,
  scale_factor = 10000,
  backend = c("vulkan", "cpu"),
  chunk_size = NULL
)

Arguments

mat

Dense numeric matrix, features x cells (raw/counts).

scale_factor

Library size to scale each cell to (default 1e4).

backend

"vulkan" or "cpu" (dispatch resolves "auto").

Value

A ggml_result whose embedding is the normalised features x cells matrix; metadata$kind = "transform", metadata$layer = "data".


ggmlR documentation built on July 14, 2026, 1:08 a.m.