From 3227e5dbf00377f6c104bd5c8e5d7af3d4820ef0 Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Wed, 11 May 2016 11:52:17 +0100 Subject: [PATCH] Print out data type for float or double --- main.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.cpp b/main.cpp index 4fb35c3..c31df9c 100644 --- a/main.cpp +++ b/main.cpp @@ -72,6 +72,11 @@ int main(int argc, char *argv[]) template void run() { + if (sizeof(T) == sizeof(float)) + std::cout << "Precision: float" << std::endl; + else + std::cout << "Precision: double" << std::endl; + // Create host vectors std::vector a(ARRAY_SIZE, 1.0); std::vector b(ARRAY_SIZE, 2.0);