parallel_for 함수

parallel_for가 인덱스의 범위에서 반복하고 각 반복에서 사용자가 제공한 함수를 병렬로 실행합니다.

template <
   typename _Index_type,
   typename _Function,
   typename _Partitioner
>
void parallel_for(
   _Index_type_First,
   _Index_type_Last,
   _Index_type_Step,
   const _Function& _Func,
   _Partitioner&& _Part
);

template <
   typename _Index_type,
   typename _Function
>
void parallel_for(
   _Index_type_First,
   _Index_type_Last,
   _Index_type_Step,
   const _Function& _Func
);

template <
   typename _Index_type,
   typename _Function
>
void parallel_for(
   _Index_type_First,
   _Index_type_Last,
   const _Function& _Func,
   const auto_partitioner& _Part = auto_partitioner()
);

template <
   typename _Index_type,
   typename _Function
>
void parallel_for(
   _Index_type_First,
   _Index_type_Last,
   const _Function& _Func,
   const static_partitioner& _Part
);

template <
   typename _Index_type,
   typename _Function
>
void parallel_for(
   _Index_type_First,
   _Index_type_Last,
   const _Function& _Func,
   const simple_partitioner& _Part
);

template <
   typename _Index_type,
   typename _Function
>
void parallel_for(
   _Index_type_First,
   _Index_type_Last,
   const _Function& _Func,
   affinity_partitioner& _Part
);

매개 변수

  • _Index_type
    반복에 사용되는 인덱스의 형식입니다.

  • _Function
    각 반복 시 실행할 함수 형식입니다.

  • _Partitioner
    제공 된 범위를 분할 하는 데 사용 되는 partitioner 유형을 지정 합니다.

  • _First
    반복에 포함된 첫 번째 인덱스입니다.

  • _Last
    반복에 포함할 마지막 인덱스를 하나 지난 인덱스입니다.

  • _Step
    _First에서 _Last까지 반복할 때 단계의 값입니다.단계는 양수여야 합니다.단계가 1보다 작은 경우 invalid_argument가 throw됩니다.

  • _Func
    각 반복 시 실행되는 함수입니다.이는 시그니처 void operator()(_Index_type**)**를 갖는 함수 호출 연산자의 버전을 지원하는 람다 식, 함수 포인터 또는 개체일 수 있습니다.

  • _Part
    Partitioner 개체에 대 한 참조입니다.인수 중 하나가 될 수 있습니다 constauto_partitioner&, conststatic_partitioner&, constsimple_partitioner& 또는 affinity_partitioner& 경우는 affinity_partitioner 개체를 사용 하 되, 알고리즘 재사용할 향후 루프에 대 한 상태를 저장할 수 있도록 참조는 l-value 비 const 참조 여야 합니다.

설명

자세한 내용은 병렬 알고리즘를 참조하십시오.

요구 사항

헤더: ppl.h

네임 스페이스: 동시성

참고 항목

참조

동시성 네임스페이스