void TinySpeedTest ( pfHash hash, int hashsize, int keysize, uint32_t seed, bool verbose, double & /*outCycles*/ ) { const int trials = 999999; if(verbose) printf("Small key speed test - %4d-byte keys - ",keysize); double cycles = SpeedTest(hash,seed,trials,keysize,0); printf("%8.2f cycles/hash\n",cycles); }
void APP_Run(void) { for(;;) { SHM1_Clear(); SpeedTest(); Test(); TestSingleLine(); TestDoVCOM(); LED1_Neg(); WAIT1_Waitms(100); } }
void BulkSpeedTest ( pfHash hash, uint32_t seed ) { const int trials = 2999; const int blocksize = 256 * 1024; printf("Bulk speed test - %d-byte keys\n",blocksize); double sumbpc = 0.0; volatile double warmup_cycles = SpeedTest(hash,seed,trials,blocksize,0); for(int align = 7; align >= 0; align--) { double cycles = SpeedTest(hash,seed,trials,blocksize,align); double bestbpc = double(blocksize)/cycles; double bestbps = (bestbpc * 3000000000.0 / 1048576.0); printf("Alignment %2d - %6.3f bytes/cycle - %7.2f MiB/sec @ 3 ghz\n",align,bestbpc,bestbps); sumbpc += bestbpc; } sumbpc = sumbpc / 8.0; printf("Average - %6.3f bytes/cycle - %7.2f MiB/sec @ 3 ghz\n",sumbpc,(sumbpc * 3000000000.0 / 1048576.0)); }
void BulkSpeedTest ( pfHash hash, uint32_t seed ) { const int trials = 2999; const int blocksize = 256 * 1024; printf("Bulk speed test - %d-byte keys\n",blocksize); for(int align = 0; align < 8; align++) { double cycles = SpeedTest(hash,seed,trials,blocksize,align); double bestbpc = double(blocksize)/cycles; double bestbps = (bestbpc * 3000000000.0 / 1048576.0); printf("Alignment %2d - %6.3f bytes/cycle - %7.2f MiB/sec @ 3 ghz\n",align,bestbpc,bestbps); } }
int main() { if ((rawdatafd = open(RAWDATA_FILENAME, O_RDWR)) < 0) { printf("Failed open %s\n", RAWDATA_FILENAME); return -1; } if ((xdmadatafd = open(XDMA_FILENAME, O_RDONLY)) < 0) { printf("Failed open %s\n", XDMA_FILENAME); return -1; } SpeedTest(); // FileGen(); // FileTest(); close(rawdatafd); close(xdmadatafd); return 0; }
void CallFunction(FunctionCall fc) { int function = GetFunction(fc->function); switch (function) { case VAR : NewVariable(fc); break; case NMX : NewMatrix(fc); break; case ADD : Addition(fc); break; case SUB : Substraction(fc); break; case MUL : Multiplication(fc); break; case MSC : Scalar_Mult(fc); break; case EXP : Exponentiation(fc); break; case TRA : Transpose(fc); break; case DET : Determinant(fc); break; case DLU : Decomposition(fc); break; case SOL : Solve(fc); break; case INV : Inversion(fc); break; case RNK : Rank(fc); break; case DSP : Display(fc); break; case NOF : // default default : { if (GetFunction(fc->name)==SPT) SpeedTest(fc); else if (IndexVariable(fc->function)!=-1) NewVariable(fc); else if (IndexMatrix(fc->function)!=-1) NewMatrix(fc); else { printf("\t%s : Function Not Implemented\n", fc->function); fni++; } break; } } if (function!=NOF && function !=VAR) fni = 0; }
s32 DVDSelectGame( void ) { FIL BootInfo; char *str = (char *)malloca( 0x400, 32 ); if( ConfigGetConfig(DML_CFG_GAME_PATH) ) { sprintf( str, "%s", ConfigGetGamePath() ); } else { sprintf( str, "/games/boot.bin" ); switch( f_open( &BootInfo, str, FA_READ ) ) { case FR_OK: { char *Path = (char*)malloca( BootInfo.fsize, 32 ); f_read( &BootInfo, Path, BootInfo.fsize, &read ); f_close( &BootInfo ); f_unlink(str); // Delete the boot.bin, so retail discs can be loaded via the disc channel sprintf( str, "/games/%s/game.iso", Path ); free( Path ); } break; default: { dbgprintf("DIP:Couldn't open /games/boot.bin!\n"); return -1; } break; } } s32 fres = f_open( &GameFile, str, FA_READ ); if( fres != FR_OK ) { dbgprintf("Failed to open:\"%s\" fres:%d\n", str, fres ); return -2; } f_lseek( &GameFile, 0 ); f_read( &GameFile, (void*)0, 0x20, &read ); f_lseek( &GameFile, 0 ); f_read( &GameFile, str, 0x400, &read ); dbgprintf("DIP:Loading game %.6s: %s\n", str, (char *)(str+0x20)); f_lseek( &GameFile, 0x420 ); f_read( &GameFile, str, 0x40, &read ); #ifdef SPEEDTEST SpeedTest(); #endif GC_SRAM *sram = SRAM_Unlock(); dbgprintf("DIP:Region:%u\n", *(u32*)(str+0x38) ); dbgprintf("SRAM:Mode:%u(%u) EURGB60:%u Prog:%u\n", sram->Flags&3, read32(0xCC), !!(sram->BootMode&0x40), !!(sram->Flags&0x80) ); switch( ConfigGetVideMode() & 0xFFFF0000 ) { case DML_VID_FORCE: { if( ConfigGetVideMode() & DML_VID_FORCE_PAL50 ) SRAM_SetVideoMode( GCVideoModeNone ); if( ConfigGetVideMode() & DML_VID_FORCE_PAL60 ) SRAM_SetVideoMode( GCVideoModePAL60 ); if( ConfigGetVideMode() & DML_VID_FORCE_NTSC ) SRAM_SetVideoMode( GCVideoModeNTSC ); if( ConfigGetVideMode() & DML_VID_FORCE_PROG ) SRAM_SetVideoMode( GCVideoModePROG ); } break; case DML_VID_NONE: { } break; case DML_VID_DML_AUTO: default: { switch( *(u32*)(str+0x38) ) { default: case 0: // JAP case 1: // USA { switch( sram->Flags&3 ) { case 0: // NTSC { if( !(sram->Flags&0x80) ) // PROG flag SRAM_SetVideoMode( GCVideoModePROG ); } break; case 1: // PAL case 2: // MPAL { SRAM_SetVideoMode( GCVideoModeNTSC ); SRAM_SetVideoMode( GCVideoModePROG ); write32( 0x1312078, 0x60000000 ); write32( 0x1312070, 0x38000001 ); } break; default: { dbgprintf("SRAM:Invalid Video mode setting:%d\n", SRAM_GetVideoMode() ); } break; } } break; case 2: // EUR { switch( sram->Flags&3 ) { case 0: { SRAM_SetVideoMode( GCVideoModePAL60 ); SRAM_SetVideoMode( GCVideoModePROG ); write32( 0x1312078, 0x60000000 ); write32( 0x1312070, 0x38000001 ); } break; case 1: case 2: { if( !(sram->BootMode&0x40) ) // PAL60 flag if( !(sram->Flags&0x80) ) // PROG flag SRAM_SetVideoMode( GCVideoModePAL60 ); } break; default: { dbgprintf("SRAM:Invalid Video mode setting:%d\n", SRAM_GetVideoMode() ); } break; } } break; } } break; } SRAM_Flush(); dbgprintf("SRAM:Mode:%u(%u) EURGB60:%u Prog:%u\n", sram->Flags&3, read32(0xCC), !!(sram->BootMode&0x40), !!(sram->Flags&0x80) ); free( str ); return DI_SUCCESS; }