citHeader(
  paste0(
    "To cite opencltools as software, use the first entry. ",
    "If your work uses the likelihood subgradient envelope computation ",
    "illustrated in the glmbayes examples (f2_f3_* kernels), also cite ",
    "Nygren and Nygren (2006). If you report OpenCL GPU execution, cite ",
    "Stone et al. (2010). Cite glmbayes separately when describing that ",
    "downstream application rather than the opencltools runtime layer."
  )
)

year <- sub("-.*", "", meta$Date)
if (!nzchar(year)) {
  year <- format(Sys.Date(), "%Y")
}

c(
  bibentry(
    bibtype  = "Manual",
    title    = "{opencltools}: OpenCL Tools for {R} Package Developers",
    author   = person("Kjell", "Nygren"),
    year     = year,
    note     = paste("R package version", meta$Version),
    url      = "https://github.com/knygren/opencltools"
  ),
  bibentry(
    bibtype  = "Article",
    title    = "Likelihood Subgradient Densities",
    author   = c(
      person("Kjell N.", "Nygren"),
      person("Lance M.", "Nygren")
    ),
    journal  = "Journal of the American Statistical Association",
    volume   = "101",
    number   = "475",
    pages    = "1144--1156",
    year     = "2006",
    doi      = "10.1198/016214506000000357"
  ),
  bibentry(
    bibtype  = "Article",
    title    = "OpenCL: A Parallel Programming Standard for Heterogeneous Computing Systems",
    author   = c(
      person("James E.", "Stone"),
      person("David", "Gohara"),
      person("Guochun", "Shi")
    ),
    journal  = "Computing in Science \\& Engineering",
    volume   = "12",
    number   = "3",
    pages    = "66--72",
    year     = "2010",
    doi      = "10.1109/MCSE.2010.69"
  ),
  bibentry(
    bibtype  = "Manual",
    title    = "{glmbayes}: Bayesian Generalized Linear Models (IID Samples)",
    author   = person("Kjell", "Nygren"),
    year     = "2025",
    note     = "R package; reference application for envelope gradient kernels",
    url      = "https://CRAN.R-project.org/package=glmbayes"
  )
)
