Download PathScale ENZO User Guide
Transcript
Listing 17 - map directive example
...
#pragma hmpp <myGroup> group, target=TESLA1 // definition of the group
#pragma hmpp <myGroup> map, args[init::v1;dotSum::v1]
#pragma hmpp <myGroup> map, args[init::lxp;dotSum::v2]
#pragma hmpp <myGroup> init codelet, args[v1].io=out
void init(int n, float v1[n], float initval, float lxp[n]) {
int j;
for (j = 0 ; j < n ; j++)
v1[j] = initval + lxp[j];
...
}
#pragma hmpp <myGroup> dotSum codelet, args[v1].io=inout
void dotSum(int n, float v1[n], float v2[n])
{
int j;
for (j = 0 ; j < n ; j++)
v1[j] += v2[j];
}
To be able to be mapped, the variables must:
•
•
Have the same dimensions
Have the same type
The example given below shows an illegal map association between two array variables and a scalar. In such
situations an error message will be generated.
NVIDIA ® is a registered trademark of the NVIDIA Corporation
This information is the property of PathScale Inc. and cannot be used, reproduced or transmitted without authorization.
Page 38
Copyright © 2010 PathScale Inc. - DOC-ENZO08022010