From 0bd4bbe82df941a8809b43d17bbb8c7ebf352971 Mon Sep 17 00:00:00 2001 From: Tom Deakin Date: Wed, 29 Jul 2015 14:47:37 +0100 Subject: [PATCH] Make init arrays 1.0f, etc if float --- cuda-stream.cu | 6 +++--- ocl-stream.cpp | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cuda-stream.cu b/cuda-stream.cu index d5eaa31..846bba4 100644 --- a/cuda-stream.cu +++ b/cuda-stream.cu @@ -131,9 +131,9 @@ int main(int argc, char *argv[]) { if (useFloat) { - ((float*)h_a)[i] = 1.0; - ((float*)h_b)[i] = 2.0; - ((float*)h_c)[i] = 0.0; + ((float*)h_a)[i] = 1.0f; + ((float*)h_b)[i] = 2.0f; + ((float*)h_c)[i] = 0.0f; } else { diff --git a/ocl-stream.cpp b/ocl-stream.cpp index e64548a..76961a0 100644 --- a/ocl-stream.cpp +++ b/ocl-stream.cpp @@ -163,9 +163,9 @@ int main(int argc, char *argv[]) { if (useFloat) { - ((float*)h_a)[i] = 1.0; - ((float*)h_b)[i] = 2.0; - ((float*)h_c)[i] = 0.0; + ((float*)h_a)[i] = 1.0f; + ((float*)h_b)[i] = 2.0f; + ((float*)h_c)[i] = 0.0f; } else {