Beispiel #1
0
int main(void)
{
	int status;
	speid_t speid;

	speid = spe_create_thread (0, &hello_spu, NULL, NULL, -1, 0 );
	spe_wait (speid, &status, 1);

	return 0;
}
Beispiel #2
0
/**
 * Clean up all allocations etc
 * @return int     Returns 0 on success
 */
int TaskCoreCell::finalize() 
{ 
   int status;

   /* tell SPE to exit */
   cb.terminate_flag = 1;
   spe_write_in_mbox(this->speid, 0x1234);

   /* wait for the SPE program to exit */
   spe_wait(this->speid, &status, 0);

   #if 1
   cout << "SPE of rank " << rank << " completed, total time " << (double(total_time)/__timebase__) << "s, "
        << " total FFTs " << total_ffts_count << ", total spectra " << total_spectra_count << endl;
   #endif

   return 0; 
}