/* @(#)08 1.5 src/samples/tutorial/simple/simple.c, sw.samples, sdk_pub 10/11/05 15:26:30 */ /* -------------------------------------------------------------- */ /* (C) Copyright 2001,2005, */ /* International Business Machines Corporation, */ /* Sony Computer Entertainment Incorporated, */ /* Toshiba Corporation. */ /* */ /* All Rights Reserved. */ /* -------------------------------------------------------------- */ /* PROLOG END TAG zYx */ #include #include #include #include #include #include #include #include #include #define BUFSIZE 2048 extern spe_program_handle_t simple_spu; char buffer[BUFSIZE] __attribute__ ((aligned (128))); #define SPU_THREADS 1 int main(int argc, char **argv) { speid_t spe_ids[SPU_THREADS]; int i, status = 0; int phys_id; int size =1; signed char c; char* cvalue = NULL; fprintf(stderr, "program starts\n"); while ((c = getopt (argc, argv, "n:")) != -1){ switch (c) { case 'n': cvalue = optarg; if (sscanf(cvalue, "%d", &size) ==0 || size < 0){ fprintf(stderr, "Invalid size(%d)\n", size); return -1; } break; default: break; } } for(i=0; i