@@ -68,12 +68,6 @@ cl_context gContext = NULL;
68
68
cl_command_queue gQueue = NULL ;
69
69
int gStartTestNumber = -1 ;
70
70
int gEndTestNumber = 0 ;
71
- #if defined(__APPLE__)
72
- int gTimeResults = 1 ;
73
- #else
74
- int gTimeResults = 0 ;
75
- #endif
76
- int gReportAverageTimes = 0 ;
77
71
void *gIn = NULL ;
78
72
void *gRef = NULL ;
79
73
void *gAllowZ = NULL ;
@@ -103,8 +97,6 @@ const char **argList = NULL;
103
97
int argCount = 0 ;
104
98
105
99
106
- double SubtractTime (uint64_t endTime, uint64_t startTime);
107
-
108
100
cl_half_rounding_mode DataInitInfo::halfRoundingMode = CL_HALF_RTE;
109
101
cl_half_rounding_mode ConversionsTest::defaultHalfRoundingMode = CL_HALF_RTE;
110
102
@@ -904,61 +896,6 @@ int ConversionsTest::DoTest(Type outType, Type inType, SaturationMode sat,
904
896
905
897
log_info (" done.\n " );
906
898
907
- if (gTimeResults )
908
- {
909
- // Kick off tests for the various vector lengths
910
- for (vectorSize = gMinVectorSize ; vectorSize < gMaxVectorSize ;
911
- vectorSize++)
912
- {
913
- size_t workItemCount = blockCount / vectorSizes[vectorSize];
914
- if (vectorSizes[vectorSize] * gTypeSizes [outType] < 4 )
915
- workItemCount /=
916
- 4 / (vectorSizes[vectorSize] * gTypeSizes [outType]);
917
-
918
- double sum = 0.0 ;
919
- double bestTime = INFINITY;
920
- cl_uint k;
921
- for (k = 0 ; k < PERF_LOOP_COUNT; k++)
922
- {
923
- uint64_t startTime = conv_test::GetTime ();
924
- if ((error = conv_test::RunKernel (
925
- writeInputBufferInfo.calcInfo [vectorSize]->kernel ,
926
- gInBuffer , gOutBuffers [vectorSize], workItemCount)))
927
- {
928
- gFailCount ++;
929
- return error;
930
- }
931
-
932
- // Make sure OpenCL is done
933
- if ((error = clFinish (gQueue )))
934
- {
935
- vlog_error (" Error %d at clFinish\n " , error);
936
- return error;
937
- }
938
-
939
- uint64_t endTime = conv_test::GetTime ();
940
- double time = SubtractTime (endTime, startTime);
941
- sum += time;
942
- if (time < bestTime) bestTime = time;
943
- }
944
-
945
- if (gReportAverageTimes ) bestTime = sum / PERF_LOOP_COUNT;
946
- double clocksPerOp = bestTime * (double )gDeviceFrequency
947
- * gComputeDevices * gSimdSize * 1e6
948
- / (workItemCount * vectorSizes[vectorSize]);
949
- if (0 == vectorSize)
950
- vlog_perf (clocksPerOp, LOWER_IS_BETTER, " clocks / element" ,
951
- " implicit convert %s -> %s" , gTypeNames [inType],
952
- gTypeNames [outType]);
953
- else
954
- vlog_perf (clocksPerOp, LOWER_IS_BETTER, " clocks / element" ,
955
- " convert_%s%s%s%s( %s%s )" , gTypeNames [outType],
956
- sizeNames[vectorSize], gSaturationNames [sat],
957
- gRoundingModeNames [round], gTypeNames [inType],
958
- sizeNames[vectorSize]);
959
- }
960
- }
961
-
962
899
if (gWimpyMode )
963
900
vlog (" \t Wimp pass" );
964
901
else
@@ -978,33 +915,6 @@ int ConversionsTest::DoTest(Type outType, Type inType, SaturationMode sat,
978
915
void memset_pattern4 (void *dest, const void *src_pattern, size_t bytes);
979
916
#endif
980
917
981
- #if defined(_MSC_VER)
982
- /* function is defined in "compat.h" */
983
- #else
984
- double SubtractTime (uint64_t endTime, uint64_t startTime)
985
- {
986
- uint64_t diff = endTime - startTime;
987
- static double conversion = 0.0 ;
988
-
989
- if (0.0 == conversion)
990
- {
991
- #if defined(__APPLE__)
992
- mach_timebase_info_data_t info = { 0 , 0 };
993
- kern_return_t err = mach_timebase_info (&info);
994
- if (0 == err)
995
- conversion = 1e-9 * (double )info.numer / (double )info.denom ;
996
- #else
997
- // This function consumes output from GetTime() above, and converts the
998
- // time to secionds.
999
- #warning need accurate ticks to seconds conversion factor here. Times are invalid.
1000
- #endif
1001
- }
1002
-
1003
- // strictly speaking we should also be subtracting out timer latency here
1004
- return conversion * (double )diff;
1005
- }
1006
- #endif
1007
-
1008
918
void MapResultValuesComplete (const std::unique_ptr<CalcRefValsBase> &ptr);
1009
919
1010
920
void CL_CALLBACK CalcReferenceValuesComplete (cl_event e, cl_int status,
@@ -1352,20 +1262,6 @@ cl_int PrepareReference(cl_uint job_id, cl_uint thread_id, void *p)
1352
1262
return CL_SUCCESS;
1353
1263
}
1354
1264
1355
- uint64_t GetTime (void )
1356
- {
1357
- #if defined(__APPLE__)
1358
- return mach_absolute_time ();
1359
- #elif defined(_MSC_VER)
1360
- return ReadTime ();
1361
- #else
1362
- // mach_absolute_time is a high precision timer with precision < 1
1363
- // microsecond.
1364
- #warning need accurate clock here. Times are invalid.
1365
- return 0 ;
1366
- #endif
1367
- }
1368
-
1369
1265
// Note: not called reentrantly
1370
1266
void WriteInputBufferComplete (void *data)
1371
1267
{
0 commit comments