From 6d14df5b328f7b2c2fa2262ca47cda3de71c470c Mon Sep 17 00:00:00 2001 From: Uldis Locans Date: Thu, 17 Aug 2017 16:57:30 +0200 Subject: [PATCH] update chiSquare test functions to check the created kernel before execution --- auto-tuning/testChiSquareRT.cpp | 7 +++++-- auto-tuning/testChiSquareRTRandom.cpp | 13 ++++++++++--- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/auto-tuning/testChiSquareRT.cpp b/auto-tuning/testChiSquareRT.cpp index 01e4ae0..b24b4b5 100644 --- a/auto-tuning/testChiSquareRT.cpp +++ b/auto-tuning/testChiSquareRT.cpp @@ -292,6 +292,9 @@ int runTest(const char *api_name, const char *device_name, bool autotune, bool m //set autotuning on/off if (autotune) dksbase.setAutoTuningOn(); + + //check kernel + dksbase.checkMuSRKernels(1); //tmp values to store results and tmp values for time steps and start time double result_gpu = 0.0; @@ -373,11 +376,11 @@ int main(int argc, char* argv[]) { } - int numPlatforms = 2; + int numPlatforms = 3; const char *api[] = {"Cuda","OpenCL","OpenCL","OpenCL","OpenMP"}; const char *device[] = {"-gpu","-gpu","-cpu","-mic","-mic"}; - for (int i = 0; i < numPlatforms; i++) { + for (int i = 2; i < numPlatforms; i++) { runTest(api[i], device[i], autotune, mlh, asym); } diff --git a/auto-tuning/testChiSquareRTRandom.cpp b/auto-tuning/testChiSquareRTRandom.cpp index b9e9b53..8c4374b 100644 --- a/auto-tuning/testChiSquareRTRandom.cpp +++ b/auto-tuning/testChiSquareRTRandom.cpp @@ -392,7 +392,10 @@ int main(int argc, char *argv[]) { dksbase.setAPI(api_name); dksbase.setDevice(device_name); + std::cout << "Init device" << std::endl; dksbase.initDevice(); + + std::cout << "Init chi square" << std::endl; dksbase.initChiSquare(Ndata, np, nf, nm); dksbase.writeParams(p, np); @@ -401,20 +404,24 @@ int main(int argc, char *argv[]) { dksbase.callSetConsts(N0, TAU, BKG); + std::cout << "Compile program" << std::endl; dksbase.callCompileProgram(sfunc); + + dksbase.checkMuSRKernels(1); if (autotune) dksbase.setAutoTuningOn(); - int oper = 0; - dksbase.getOperations(oper); + //std::cout << "Get operations" << std::endl; + //int oper = 0; + //dksbase.getOperations(oper); cout << "=========================BEGIN TEST=========================" << endl; cout << "Use api: " << api_name << "\t" << device_name << endl; cout << "Number of params: " << np << endl; cout << "Number of maps: " << nm << endl; cout << "Number of predefined functions: " << nfunc << endl; - cout << "Number of ptx instructions: " << oper << endl; + //cout << "Number of ptx instructions: " << oper << endl; cout << "------------------------------------------------------------" << endl; cout << sfunc << endl; cout << "------------------------------------------------------------" << endl;