Simple DPCE Program


#include <dpce.h>  /* header file that must be included in all dpc programs */

shape [10][10]S;  /* defines a shape, 2 dimensional, 10 x 10 */

main()
{
   int sum;
   int:S a;    /* defines a parallel variable int of shape S */
               /* parallel variable "a" has a rank of 2 and is 10x10 */

   a = 1;     /* assigns all 100 elements of parallel variable "a" to 1 */

   sum += a;  /* performs summation reduction of parallel variable "a" into
                 scalar variable "sum" */

   printf(" sum %d \n",sum);   /* value of sum is 100 */

}

You can return to the start of the tutorial, or move on the to next topic (shapes).

©1995 Pacific-Sierra Research Corporation. All rights reserved.

Send comments or suggestions to dpce2 at crescentbaysoftware.com.