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 {