Logotipo de Onetbb Quickstart

Onetbb Quickstart

Organización
intel
onetbb-quickstart

Getting started with Intel oneTBB for C++ parallelism on Intel CPUs. Use when a C++ loop or reduction should run on multiple threads with oneTBB, including a request to make an existing loop or function use all cores with oneTBB or TBB; when the user needs the headers, namespace, or CMake wiring for a first oneTBB program; when a parallel_for body has a data race; or when a reduction is accumulating into a shared variable. Covers parallel_for and parallel_reduce over blocked_range, the build setup, and the pitfalls of the task-based model. Not for tuning grain size or partitioners in a working oneTBB program, OpenMP, std::thread, or GPU offload.

Descripción general

Editorintel
Repositorioskills
Nombre de la habilidadonetbb-quickstart
Estrellas
31
Forks
14
Archivos incluidos
3
LicenciaApache-2.0
Enlaces
  • Instrucciones en Markdown

    Un archivo SKILL.md que el modelo carga cuando lo necesita, de modo que solo consume tokens cuando una petición es realmente relevante.

  • Funciona con cualquier LLM

    Las habilidades de IA están en Markdown, no en código específico de un proveedor, por lo que funcionan con GPT, Claude, Gemini, Grok o un modelo local.

  • 3 archivos incluidos

    Scripts, plantillas y referencias que el modelo puede leer mientras trabaja. Los archivos son de solo lectura y nunca se ejecutan.

  • Código abierto

    Publicada por intel en GitHub. Revisa el contenido original antes de instalarla.

Instalación

Instala la habilidad de IA Onetbb Quickstart en TypingMind para usarla con cualquier LLM, o añádela a otro agente que lea SKILL.md.

1

Instalar en TypingMind

TypingMind instala una habilidad directamente desde su carpeta de GitHub: lee SKILL.md, empaqueta los archivos de recursos y guarda el resultado localmente.

  1. Abre la aplicación y ve a Plugins → Habilidades.
  2. Elige «Instalar desde GitHub».
  3. Pega la URL de la carpeta de la habilidad que se muestra a continuación y confirma.
    https://github.com/intel/skills/tree/main/skills/onetbb-quickstart
  4. Activa la habilidad en cada chat en el que quieras tenerla disponible.
Plugins → Habilidades → Añadir habilidad → Desde URL de GitHub; después, pega la URL de la carpeta y pulsa Continuar.
2

Instalar en otro agente

Cualquier agente que lea el formato Agent Skills puede usar esta habilidad: copia la carpeta en el directorio de habilidades de ese agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/intel/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/onetbb-quickstart .claude/skills/onetbb-quickstart
Reinicia Claude Code después de copiarla para que detecte la nueva habilidad.

Úsala en TypingMind

Activa Onetbb Quickstart en cualquier chat de TypingMind y el modelo se encargará del resto. Su nombre y descripción se incluyen en el prompt del sistema y, en cuanto una petición es relevante, el modelo carga las instrucciones completas por sí solo. No tienes que invocarla manualmente y no consume tokens hasta que se utiliza.

El modelo carga Onetbb Quickstart automáticamente en cuanto una petición es relevante para esa habilidad.

Funciona con cualquier modelo de IA

Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que Onetbb Quickstart no está vinculada al modelo para el que se creó. Instálala una sola vez en TypingMind y úsala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modelo local que ejecutes tú, todo con tus propias claves API.

  • Se carga solo cuando se necesita

    El prompt del sistema solo incluye el nombre y la descripción. Las instrucciones se cargan con la primera petición relevante, por lo que una habilidad que no se usa no supone ningún coste.

  • Cambia de modelo durante el chat

    Como la habilidad contiene instrucciones y no código, cambiar de modelo no impide que funcione: el nuevo modelo lee el mismo archivo SKILL.md.

Instrucciones de la habilidad

Este es el contenido de SKILL.md que carga el modelo. Léelo antes de instalar la habilidad: contiene instrucciones que tu modelo seguirá.

oneTBB quickstart

Purpose

Parallelizes C++ loops and reductions with Intel oneAPI Threading Building Blocks on Intel CPUs: the umbrella header, parallel_for and parallel_reduce over a blocked_range, the CMake lines that link it, and the assumptions the task-based model breaks.

Prefer oneTBB over hand-rolled threads when the work is a bounded loop or a reduction over a container: the partitioner decides the split, and the runtime composes with other oneTBB-based libraries in the same process instead of oversubscribing the machine.

When to Use This Skill

Use this skill when:

  • A C++ loop or reduction is a candidate for multithreading.
  • A first oneTBB program needs headers, namespace, and CMake wiring.
  • A parallel_for body has a race on shared state.
  • A reduction accumulates into one variable from many threads.

Do not use this skill for GPU offload, for OpenMP or std::thread questions, or for tuning an existing oneTBB program's grain size and partitioners — that is past "getting started" and belongs with a profile in hand.

Quick Start

cpp
#include <oneapi/tbb.h>            // umbrella header

int main() {
    oneapi::tbb::parallel_for(
        oneapi::tbb::blocked_range<size_t>(0, n),
        [&](const oneapi::tbb::blocked_range<size_t>& r) {
            for (size_t i = r.begin(); i != r.end(); ++i)
                out[i] = f(in[i]);
        });
}

using namespace oneapi::tbb; shortens the calls; qualifying them keeps the origin visible in code that mixes threading libraries.

Implementation Guide

  1. Parallelize a loop with parallel_for over a range. The body receives a subrange, not a single index — iterate inside it, as above. The range type carries the index type, so blocked_range<size_t> and blocked_range<int> are different instantiations.

  2. Reduce with parallel_reduce, not a shared accumulator. The body folds a subrange into a partial result and the last argument combines two partials:

    cpp
    double sum = oneapi::tbb::parallel_reduce(
        oneapi::tbb::blocked_range<size_t>(0, n), 0.0,
        [&](const auto& r, double acc) {
            for (size_t i = r.begin(); i != r.end(); ++i) acc += a[i];
            return acc;
        },
        std::plus<double>());
  3. Link it in CMake. oneTBB ships a package config, so the two lines are the whole build change:

    cmake
    find_package(TBB REQUIRED)
    target_link_libraries(my_app PRIVATE TBB::tbb)
  4. Leave the grain size alone at first. The auto-partitioner chooses the split; a hand-set grain size is a tuning decision that needs a measurement behind it, and a wrong one is worse than none.

  5. Make shared state safe or remove it. If the body must write to a shared structure, use one of the concurrent_* containers or restructure as a reduction. A mutex around the body of a parallel_for usually gives back the parallelism it was added to protect.

Performance

No measured numbers ship with this skill, and a parallel version is not automatically a faster one. What to measure:

  • Compare against the serial loop on the same input, with the same compiler flags and optimization level.
  • Watch for a body too small to cover the task overhead: at that size the partitioner's fixed cost shows up as a slowdown.
  • Check whether the loop is memory-bandwidth bound before adding threads — more threads on a saturated bus do not help.
  • Count the threads in the process. Nested parallelism from another library, or an OpenMP region around a oneTBB call, oversubscribes the cores and the slowdown is not in either loop.

Gotchas & Limitations

  • The body runs many times, concurrently. It is not called once per loop and not once per thread; the range is split as the runtime sees fit. Anything captured by reference and written to is shared mutable state.
  • parallel_reduce is not deterministic in floating point. The combination order varies between runs, so sums can differ in the last bits. Use parallel_deterministic_reduce when a reproducible result matters more than speed.
  • Exceptions propagate out of the algorithm, not out of the body where they were thrown — one is rethrown on the caller's thread and the rest are lost.
  • find_package(TBB) needs oneTBB's own config, which the environment script or the package install puts on CMAKE_PREFIX_PATH. A build that cannot find it usually has not sourced the environment.
  • Not covered: flow graph, task groups, arenas and thread affinity, and the deprecated tbb:: (pre-oneAPI) spellings.

References

FileLoad it when
references/official-sources.mdyou need the current oneTBB API for an algorithm, the deprecation status of a tbb:: name, or the supported CMake integration for the installed version

Two things here should not be answered from memory: the current name and signature of an algorithm (oneTBB renamed and dropped parts of the pre-oneAPI API, and the old spellings still compile in some builds) and how the package is found by CMake in the installed layout.

Archivos incluidos

El modelo los lee según los necesita mientras la habilidad está cargada. Se ofrecen como archivos de lectura y nunca se ejecutan.

Preguntas frecuentes

¿Qué hace la habilidad de IA Onetbb Quickstart?

Getting started with Intel oneTBB for C++ parallelism on Intel CPUs. Use when a C++ loop or reduction should run on multiple threads with oneTBB, including a request to make an existing loop or function use all cores with oneTBB or TBB; when the user needs the headers, namespace, or CMake wiring for a first oneTBB program; when a parallel_for body has a data race; or when a reduction is accumulating into a shared variable. Covers parallel_for and parallel_reduce over blocked_range, the build setup, and the pitfalls of the task-based model. Not for tuning grain size or partitioners in a work...

¿Por qué usar Onetbb Quickstart en TypingMind?

Porque la instalas una vez y la usas con cualquier modelo. Onetbb Quickstart está escrita en Markdown, no en código específico de un proveedor, por lo que la misma habilidad funciona con GPT-5, Claude, Gemini, Grok o un modelo local, y puedes cambiar de modelo en mitad del chat sin que deje de funcionar. TypingMind utiliza tus propias claves API, de modo que pagas directamente a los proveedores en lugar de pagar una suscripción por puesto, y tus habilidades y chats permanecen en tu propio almacenamiento.

¿Cómo instalo Onetbb Quickstart en TypingMind?

Abre Plugins → Habilidades → Instalar desde GitHub en TypingMind y pega https://github.com/intel/skills/tree/main/skills/onetbb-quickstart. TypingMind lee su archivo SKILL.md, empaqueta sus archivos y la instala como una habilidad que puedes activar en cada chat.

¿Qué modelos de IA pueden usar Onetbb Quickstart?

Cualquier modelo que conectes en TypingMind. Las habilidades de IA son instrucciones en Markdown, no código específico de un proveedor, por lo que GPT, Claude, Gemini, Grok y los modelos locales pueden cargar esta habilidad cuando una solicitud se corresponda con ella.

¿Con cuántos modelos de IA puedo usar Onetbb Quickstart?

Con tantos como quieras. Siempre que un modelo admita habilidades, puedes usar Onetbb Quickstart con él: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama y muchos más, todos en TypingMind con tus propias claves API.

¿Es gratuita la habilidad de IA Onetbb Quickstart?

Sí. intel la ha publicado en GitHub bajo la licencia Apache-2.0. Solo pagas a tu proveedor de IA por los tokens que utilizas.

¿Qué son las habilidades de IA?

Una habilidad de IA es un conjunto de instrucciones reutilizables que enseña a un modelo de IA a realizar una tarea concreta. Sigue el formato abierto Agent Skills: un archivo SKILL.md con un nombre y una descripción, además de los scripts, plantillas o archivos de referencia que pueda necesitar el modelo. El modelo solo lee las instrucciones cuando tu solicitud se corresponde con la habilidad, por lo que una habilidad instalada no supone ningún coste hasta que se utiliza.

¿En qué se diferencian las habilidades de IA de los plugins o los servidores MCP?

Un plugin o un servidor MCP proporciona al modelo nuevas herramientas que puede invocar: código que se ejecuta en algún lugar y devuelve un resultado. En cambio, una habilidad de IA aporta conocimientos y procedimientos al modelo: cómo abordar una tarea, qué pasos seguir y qué se considera un buen resultado. Las habilidades son instrucciones en Markdown, por lo que no necesitan servidor, clave API ni entorno de ejecución, y funcionan con cualquier modelo.

Ver todos

Crea ya tu propio espacio de trabajo IA

Suscríbete a nuestro boletín para recibir avisos sobre nuevas funciones y próximos sorteos 👇