From 7ba0b8fc18f6425972d0aa82e20c04fdc7343b59 Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Mon, 27 Jul 2015 17:19:19 +0100 Subject: [PATCH] Display precision in the header output --- cuda-stream.cu | 7 ++++++- ocl-stream.cpp | 9 ++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/cuda-stream.cu b/cuda-stream.cu index 9797133..1f9b805 100644 --- a/cuda-stream.cu +++ b/cuda-stream.cu @@ -162,7 +162,7 @@ int main(int argc, char *argv[]) std::cout << "GPU-STREAM" << std::endl << "Version: " << VERSION_STRING << std::endl - << "Implementation: CUDA" << std::endl << std::endl; + << "Implementation: CUDA" << std::endl; try { @@ -170,6 +170,11 @@ int main(int argc, char *argv[]) if (NTIMES < 2) throw badntimes(); + std::cout << "Precision: "; + if (useFloat) std::cout << "float"; + else std::cout << "double"; + std::cout << std::endl << std::endl; + if (ARRAY_SIZE % 1024 != 0) { unsigned int OLD_ARRAY_SIZE = ARRAY_SIZE; diff --git a/ocl-stream.cpp b/ocl-stream.cpp index a4e7a67..e7c69ee 100644 --- a/ocl-stream.cpp +++ b/ocl-stream.cpp @@ -127,7 +127,7 @@ int main(int argc, char *argv[]) std::cout << "GPU-STREAM" << std::endl << "Version: " << VERSION_STRING << std::endl - << "Implementation: OpenCL" << std::endl << std::endl; + << "Implementation: OpenCL" << std::endl; try { @@ -135,6 +135,13 @@ int main(int argc, char *argv[]) if (NTIMES < 2) throw badntimes(); + std::cout << "Precision: "; + if (useFloat) std::cout << "float"; + else std::cout << "double"; + std::cout << std::endl << std::endl; + + + // Open the Kernel source std::ifstream in("ocl-stream-kernels.cl"); if (!in.is_open()) throw badfile();