Print out data type for float or double

This commit is contained in:
Tom Deakin 2016-05-11 11:52:17 +01:00
parent 5c8b07262b
commit 3227e5dbf0

View File

@ -72,6 +72,11 @@ int main(int argc, char *argv[])
template <typename T> template <typename T>
void run() void run()
{ {
if (sizeof(T) == sizeof(float))
std::cout << "Precision: float" << std::endl;
else
std::cout << "Precision: double" << std::endl;
// Create host vectors // Create host vectors
std::vector<T> a(ARRAY_SIZE, 1.0); std::vector<T> a(ARRAY_SIZE, 1.0);
std::vector<T> b(ARRAY_SIZE, 2.0); std::vector<T> b(ARRAY_SIZE, 2.0);