main.h

来自「用于GPU通用计算的编程语言BrookGPU 0.4」· C头文件 代码 · 共 58 行

H
58
字号
/* * main.h * *      Exports from main.cpp.  Pretty much infrastructure type functions *      (timing, logging, etc.) plus command line arguments. */#ifndef __MAIN_H_#define __MAIN_H_#ifdef WIN32typedef __int64 int64;#define printf64(a) printf("%8I64d", a)#elsetypedef long long int64;#define printf64(a) printf("%8Ld", a)#endif#ifdef WIN32static inlineint64 GetTimeTSC() {   __asm _emit 0x0f __asm _emit 0x31}#else#if defined(__ppc__)static inlinelong long GetTimeTSC() {   int64 t;   int tl, th;   __asm__ __volatile__("mftbu %0" : "=b" (th));   __asm__ __volatile__("mftb %0" : "=b" (tl));   t = th;   t <<= 32;   t += tl;   return t;}#elsestatic inlineint64 GetTimeTSC() {   int64 t;   __asm__ __volatile__("rdtsc" : "=A" (t));   return t;}#endif#endifextern int64 GetTime(void);extern unsigned int GetTimeMillis(void);extern int64 CyclesToUsecs(int64 cycles);/* * XXX brcc currently has grief with typedefs mixed with Brook code, so we * just prototype all these here.  Since brcc runs before cpp, we sidestep * the issue.  I apologize deeply.  --Jeremy. */extern int64 start, stop, t1, t2;#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?