g++ - Using "unsigned long long" as iteration-range in for-loop using OpenMP -


if works fine:

#pragma omp parallel for (int = 1; <= 200; i++) { ... } 

this still works fine

#pragma omp parallel for (unsigned long long = 1; <= 200; i++) { ... } 

but isnt working

#pragma omp parallel for (unsigned long long = 1; <= llong_max; i++) { ... } 

-> compiler error: invalid controlling predicate

llong_max coming from

#include <limits.h> 

g++ --version -> g++ (tdm64-1) 5.1.0

it said openmp 3.0 can handle unsigned integer - types.

i searched alot issue, without success. use int iteration-variable. knows solution?

i changed program to:

unsigned long long n = ullong_max; #pragma omp parallel for (unsigned long long = 1; < n; i++) { ... } 

it seems work now. thank jeff hint.

i tried before with:

for (auto = 1; < n; i++) { ... } 

-> no error, loop didnt produce output, strange.


Comments

Popular posts from this blog

php - Zend Framework / Skeleton-Application / Composer install issue -

c# - Better 64-bit byte array hash -

python - PyCharm Type error Message -