| shard_crossprod | R Documentation |
Computes crossprod(X, Y) (i.e. t(X) %*% Y) using:
shared/mmap-backed inputs (one copy),
block views (no slice materialization),
BLAS-3 dgemm in each tile,
an explicit shared output buffer (no gather/bind spikes).
shard_crossprod(
X,
Y,
workers = NULL,
block_x = "auto",
block_y = "auto",
backing = c("mmap", "shm"),
materialize = c("auto", "never", "always"),
materialize_max_bytes = 512 * 1024^2,
diagnostics = TRUE
)
X, Y |
Double matrices with the same number of rows. |
workers |
Number of worker processes. |
block_x, block_y |
Tile sizes over |
backing |
Backing for shared inputs and output buffer ( |
materialize |
Whether to return the result as a standard R matrix:
|
materialize_max_bytes |
Threshold for |
diagnostics |
Whether to collect shard_map diagnostics. |
This is intended as an ergonomic entry point for the "wow" path: users
shouldn't have to manually call share(), view_block(), buffer(),
tiles2d(), and shard_map() for common patterns.
A list with:
buffer: shard_buffer for the result (p x v)
value: materialized matrix if requested, otherwise NULL
run: the underlying shard_result from shard_map
tile: chosen tile sizes
X <- matrix(rnorm(2000), 100, 20)
Y <- matrix(rnorm(2000), 100, 20)
res <- shard_crossprod(X, Y, block_x = 50, block_y = 10, workers = 2)
pool_stop()
res$value
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.