% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/declare.R
\name{declare}
\alias{declare}
\title{Declare quickr annotations}
\usage{
declare(...)
}
\arguments{
\item{...}{Declarations, typically calls like \code{type(x = double(n))}.}
}
\value{
\code{NULL}, invisibly.
}
\description{
\code{declare()} marks declarations (e.g., \code{type(x = double(n))}) for use by
\code{quickr}'s compiler. It is a runtime no-op and does not evaluate its
arguments.
}
\details{
\code{declare()} is provided by the base package starting in R 4.4.0; for older
versions of R, quickr exports a compatible backport.

\code{declare(parallel())} or \code{declare(omp())} applies an OpenMP \verb{parallel do}
directive to the next \code{for} loop or \code{sapply()} assignment. \code{for} loops can
iterate values over symbols or index iterables (\code{1:n}, \code{seq_len()},
\code{seq_along()}, \code{seq()}), and \code{sapply()} iterates over vector inputs with a
known length.

Control the number of OpenMP threads using environment variables such as
\code{OMP_NUM_THREADS} (threads per region), \code{OMP_THREAD_LIMIT} (global cap),
and \code{OMP_DYNAMIC} (disable/enable runtime adjustment). Set them before
calling a compiled function, e.g. \code{Sys.setenv(OMP_NUM_THREADS = "4")}.
}
\keyword{internal}
