Logo de Onetbb Quickstart

Onetbb Quickstart

Organização
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.

Visão geral

Publicado porintel
Repositórioskills
Nome da habilidadeonetbb-quickstart
Estrelas
31
Forks
14
Arquivos incluídos
3
LicençaApache-2.0
Links
  • Instruções em Markdown

    Um arquivo SKILL.md que o modelo carrega sob demanda, consumindo tokens apenas quando uma solicitação é realmente relevante para a habilidade.

  • Funciona com qualquer LLM

    Habilidades de IA são Markdown simples, não código específico de um provedor, por isso funcionam com GPT, Claude, Gemini, Grok ou um modelo local.

  • 3 arquivos incluídos

    Scripts, modelos de documentos e referências que o modelo pode ler enquanto trabalha. Os arquivos são somente leitura e nunca são executados.

  • Código aberto

    Publicada por intel no GitHub. Leia o conteúdo-fonte antes de instalar.

Instalação

Instale a habilidade de IA Onetbb Quickstart no TypingMind para usá-la com qualquer LLM ou adicione-a a outro agente que leia SKILL.md.

1

Instalar no TypingMind

O TypingMind instala uma habilidade diretamente da pasta dela no GitHub — lê o arquivo SKILL.md, reúne os arquivos de recursos em um pacote e armazena o resultado localmente.

  1. Abra o app e vá para Plugins → Habilidades.
  2. Escolha "Instalar do GitHub".
  3. Cole a URL da pasta da habilidade exibida abaixo e confirme.
    https://github.com/intel/skills/tree/main/skills/onetbb-quickstart
  4. Ative a habilidade em cada chat em que quiser disponibilizá-la.
Plugins → Habilidades → Nova habilidade → Via URL GitHub, depois cole a URL da pasta e pressione Continuar.
2

Instalar em outro agente

Qualquer agente que leia o formato Agent Skills pode usar esta habilidade — copie a pasta para o diretório de habilidades desse 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
Reinicie Claude Code após copiar para que a nova habilidade seja reconhecida.

Use no TypingMind

Ative Onetbb Quickstart em qualquer chat do TypingMind e o modelo cuida do resto. O nome e a descrição da habilidade ficam no prompt do sistema e, assim que uma solicitação relevante aparece, o modelo carrega as instruções completas automaticamente — sem precisar de acionamento manual e sem consumir tokens até que ela seja realmente usada.

O modelo carrega Onetbb Quickstart automaticamente assim que uma solicitação é relevante para essa habilidade.

Funciona com qualquer modelo de IA

Habilidades de IA são instruções em Markdown simples, não código específico de um provedor. Por isso, Onetbb Quickstart não fica vinculada ao modelo para o qual foi criada. Instale-a uma vez no TypingMind e use-a com GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama ou um modelo local executado por conta própria — tudo com suas próprias chaves de API.

  • Carregada apenas quando necessário

    O prompt do sistema contém apenas o nome e a descrição. As instruções são buscadas na primeira solicitação relevante, então uma habilidade sem uso não gera custo.

  • Troque de modelo durante a conversa

    Como a habilidade é composta de instruções, não de código, trocar de modelo não afeta seu funcionamento — o próximo modelo lê o mesmo arquivo SKILL.md.

Instruções da habilidade

Este é o conteúdo de SKILL.md que o modelo carrega. Leia antes de instalar — uma habilidade é um conjunto de instruções que seu 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.

Arquivos incluídos

O modelo lê esses arquivos sob demanda enquanto a habilidade está carregada. Eles são disponibilizados para leitura e nunca são executados.

Perguntas frequentes

O que a habilidade de IA Onetbb Quickstart faz?

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 que usar Onetbb Quickstart no TypingMind?

Porque basta instalar uma vez para usar com qualquer modelo. Onetbb Quickstart é escrito em Markdown simples, e não em código específico de um provedor, então a mesma habilidade funciona com GPT-5, Claude, Gemini, Grok ou um modelo local — e é possível trocar de modelo no meio do chat sem que ela deixe de funcionar. O TypingMind usa suas próprias chaves de API, então o pagamento é feito diretamente aos provedores, em vez de uma assinatura por licença de usuário, e suas habilidades e chats permanecem no seu próprio armazenamento.

Como instalar Onetbb Quickstart no TypingMind?

Abra Plugins → Habilidades → Instalar do GitHub no TypingMind e cole https://github.com/intel/skills/tree/main/skills/onetbb-quickstart. O TypingMind lê o arquivo SKILL.md, reúne os arquivos da habilidade e a instala para que possa ser ativada em cada chat.

Quais modelos de IA podem usar Onetbb Quickstart?

Qualquer modelo conectado no TypingMind. As habilidades de IA são instruções em Markdown simples, e não código específico de um provedor. Assim, GPT, Claude, Gemini, Grok e modelos locais podem carregar esta habilidade quando uma solicitação corresponder a ela.

Quantos modelos de IA posso usar com Onetbb Quickstart?

Quantos quiser. Desde que o modelo ofereça suporte a habilidades, é possível usar Onetbb Quickstart com ele — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e outros — tudo no TypingMind com suas próprias chaves de API.

A habilidade de IA Onetbb Quickstart é gratuita?

Sim. A habilidade é publicada no GitHub por intel sob a licença Apache-2.0. O pagamento é feito apenas ao seu provedor de IA pelos tokens usados.

O que são habilidades de IA?

Uma habilidade de IA é um conjunto reutilizável de instruções que ensina um modelo de IA a realizar uma tarefa específica. Ela segue o formato aberto Agent Skills: um arquivo SKILL.md com nome e descrição, além de scripts, modelos de documento ou arquivos de referência de que o modelo possa precisar. O modelo lê as instruções apenas quando sua solicitação corresponde à habilidade, então uma habilidade instalada não gera custos até ser usada.

Qual é a diferença entre habilidades de IA e plugins ou servidores MCP?

Um plugin ou servidor MCP oferece ao modelo novas ferramentas para chamar — código que é executado em algum lugar e retorna um resultado. Já uma habilidade de IA fornece conhecimento e um processo ao modelo: como abordar uma tarefa, quais etapas seguir e como deve ser um bom resultado. As habilidades são escritas em Markdown simples, por isso não precisam de servidor, chave de API nem ambiente de execução, e funcionam com qualquer modelo.

Ver todos

Crie seu próprio espaço de IA agora

Inscreva-se na nossa newsletter para receber novidades sobre recursos e futuros sorteios 👇