diff --git a/samples/99_matrixexperiments/main.cpp b/samples/99_matrixexperiments/main.cpp index 8b8385e..d79ca8e 100644 --- a/samples/99_matrixexperiments/main.cpp +++ b/samples/99_matrixexperiments/main.cpp @@ -20,6 +20,7 @@ using test_clock = std::chrono::high_resolution_clock; +bool zeroData = false; bool identityData = false; bool fixedData = false; bool validate = false; @@ -77,7 +78,10 @@ static size_t findMinSubGroupSize(cl::Device& device) template static void fill_matrix(std::vector& M, size_t numRows, size_t numCols) { - if (identityData) { + if (zeroData) { + std::generate(std::begin(M), std::end(M), [&]{ return 0.0f; }); + } + else if (identityData) { std::generate(std::begin(M), std::end(M), [&]{ return 1.0f; }); } else if (fixedData) { for (size_t r = 0; r < numRows; r++) { @@ -648,6 +652,7 @@ int main(int argc, char** argv) op.add>("m", "matrixsize", "Matrix Size", matrixSize, &matrixSize); op.add>("i", "iterations", "Test Iterations", testIterations, &testIterations); op.add("", "validate", "Validate Results", &validate); + op.add("", "zero", "Use Zero Data", &zeroData); op.add("", "identity", "Use Identity Data", &identityData); op.add("", "fixed", "Use Fixed Data", &fixedData); op.add("", "emulate", "Unconditionally Emulate dpas", &emulate);