parallel

package
v0.7.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 2, 2026 License: Apache-2.0 Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package parallel provides parallel execution utilities for the Born ML framework.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func For

func For(n int, f func(i int), cfg Config)

For executes f(i) for i in [0, n) with optional parallelism. Falls back to sequential execution if parallelism is disabled or n is too small.

func ForBatch

func ForBatch(batch, channels int, f func(b, c int), cfg Config)

ForBatch optimized for batch*channels iteration pattern. Common in CNN operations like Conv2D.

Types

type Config

type Config struct {
	Enabled      bool // Whether parallel execution is enabled.
	NumWorkers   int  // Number of worker goroutines to use.
	MinChunkSize int  // Minimum items per goroutine to avoid overhead.
}

Config controls parallel execution behavior.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns sensible defaults based on CPU count.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL