OpenMP_demo: Some details

git-svn-id: svn://ultimatepp.org/upp/trunk@9901 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
koldo 2016-06-05 07:17:55 +00:00
parent 241522378f
commit 3f94ac5541
3 changed files with 5 additions and 5 deletions

View file

@ -15,7 +15,7 @@ static void MatMult_device() {
#pragma omp parallel shared(hsize, chunk) private(row, col, inner)
{
// Do matrix multiply sharing iterations on outer loop
#pragma omp for schedule (static, chunk)
#pragma omp for schedule(static, chunk)
for (row = 0; row < hsize; ++row) {
for (col = 0; col < hsize; ++col) {
float sum = 0;

View file

@ -7,7 +7,7 @@ static double pi_device() {
long count = 0, i;
// Parallel loop with reduction for calculating PI
#pragma omp parallel for private(i, x, y) shared (samples) reduction(+:count)
#pragma omp parallel for private(i, x, y) shared(samples) reduction(+:count)
for (i = 0; i < samples; ++i) {
x = Random(1000000)/1000000.;
y = Random(1000000)/1000000.;
@ -15,7 +15,6 @@ static double pi_device() {
count++;
}
return 4.0 * count / samples;
}
static double pi_host() {

View file

@ -3,7 +3,7 @@ topic "OpenMP";
[a83;*R6 $$1,0#31310162474203024125188417583966:caption]
[{_}%EN-US
[s1; [+184 OpenMP]&]
[s0; [2 OpenMP package includes simple ][^https`:`/`/en`.wikipedia`.org`/wiki`/OpenMP^2 O
[s0; [2 OpenMP`_demo package includes simple ][^https`:`/`/en`.wikipedia`.org`/wiki`/OpenMP^2 O
penMP][2 benchmarks and demos.]&]
[s0;2 &]
[s0; [2 OpenMP (Open Multi`-Processing) is a standard API that supports
@ -14,7 +14,8 @@ C and C`+`+. ]&]
all main compilers. See Project/Package organizer and include
file for details.]&]
[s0;2 &]
[s0; [2 More OpenMP in FAQ ][^http`:`/`/openmp`.org`/openmp`-faq`.html`#WhatIs^2 here][2 .]&]
[s0; [2 More OpenMP info in FAQ ][^http`:`/`/openmp`.org`/openmp`-faq`.html`#WhatIs^2 her
e][2 .]&]
[s0;2 &]
[s0; [2 Benchmarks and demos are:]&]
[s0;i150;O0; [2 Pi-|-|Pi number benchmark]&]