Learn R Programming

shard (version 0.1.0)

register_kernel: Register a shard kernel

Description

Registers a named kernel implementation that can be selected by shard_map(..., kernel = "name").

Usage

register_kernel(
  name,
  impl,
  signature = NULL,
  footprint = NULL,
  supports_views = TRUE,
  description = NULL
)

Value

Invisibly, the registered kernel metadata.

Arguments

name

Kernel name (string).

impl

Function implementing the kernel. It must accept the shard descriptor as its first argument.

signature

Optional short signature string for documentation.

footprint

Optional footprint hint. Either a constant (bytes) or a function (shard, ...) -> list(class='tiny'|'medium'|'huge', bytes=...).

supports_views

Logical. Whether the kernel is intended to operate on shard views without slice materialization.

description

Optional human-readable description.

Details

A "kernel" is just a function that shard_map can call for each shard. The registry lets shard_map attach additional metadata (footprint hints, supports_views) for scheduling/autotuning.

Examples

Run this code
list_kernels()

Run the code above in your browser using DataLab