MCPcopy Create free account
hub / github.com/CRVI/OpenCLIPP / main

Function main

Bench/src/main.cpp:328–373  ·  view source on GitHub ↗

-------------------------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

326void RunBench();
327//-------------------------------------------------------------------------------------------------
328int main()
329{
330 ocipContext CLContext;
331
332 ocipInitialize(&CLContext, OPENCL_PLATFORM, OPENCL_DEVICE_TYPE);
333
334#ifdef HAS_CV
335 SelectOpenCVOCLDevice(OPENCL_DEVICE_TYPE);
336#endif
337
338 ocipSetCLFilesPath(CL_FILES_PATH);
339
340#ifdef FULL_TESTS
341 printf("Running unit tests using randomly generated images\n");
342 printf("All primitives having an IPP equivalent and a test class are run and compared with IPP\n");
343 printf("Only failing tests will be listed below\n");
344#else // FULL_TESTS
345 printf("Starting Bench using randomly generated images\n");
346 printf("Each test is run %d times, result is average time per run in ms\n", BENCH_ITERATIONS);
347#endif // FULL_TESTS
348
349 char CLDeviceName[100];
350 ocipGetDeviceName(CLDeviceName, 100);
351
352 printf("Bench using: %s for OpenCL\n", CLDeviceName);
353
354 {
355 printf("Preparing random input images ... ");
356
357 SImage SImg = {10, 10, 10, 1, SImage::U8};
358 CSimpleImage Img(SImg);
359 FillRandomImg(Img);
360
361 printf("Done\n");
362 }
363
364 RunBench();
365
366 printf("Testing complete\n");
367
368 getchar();
369
370 ocipUninitialize(CLContext);
371
372 return 0;
373}
374//-------------------------------------------------------------------------------------------------
375#include "bench.hpp"
376//-------------------------------------------------------------------------------------------------

Callers

nothing calls this directly

Calls 5

SelectOpenCVOCLDeviceFunction · 0.85
ocipSetCLFilesPathFunction · 0.85
FillRandomImgFunction · 0.85
RunBenchFunction · 0.85
ocipUninitializeFunction · 0.85

Tested by

no test coverage detected