MCPcopy Create free account
hub / github.com/AdvancedCompiler/AdvancedCompiler / checkResult

Function checkResult

code/Chapter10/freshman.h:90–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

88
89}
90void checkResult(float * hostRef,float * gpuRef,const int N)
91{
92 double epsilon=1.0E-8;
93 for(int i=0;i<N;i++)
94 {
95 if(abs(hostRef[i]-gpuRef[i])>epsilon)
96 {
97 printf("Results don\'t match!\n");
98 printf("%f(hostRef[%d] )!= %f(gpuRef[%d])\n",hostRef[i],i,gpuRef[i],i);
99 return;
100 }
101 }
102 printf("Check result success!\n");
103}
104#endif//FRESHMAN_H

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected