From d660425e00ca4cae8bbf43279dd2f87fc8947cdc Mon Sep 17 00:00:00 2001 From: Cloud Han Date: Tue, 25 Jan 2022 11:44:23 +0800 Subject: [PATCH] mute warnings --- examples/OpenCLVectorAdd/OpenCLVectorAdd.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/OpenCLVectorAdd/OpenCLVectorAdd.cpp b/examples/OpenCLVectorAdd/OpenCLVectorAdd.cpp index 71184e00..3a59f2d8 100644 --- a/examples/OpenCLVectorAdd/OpenCLVectorAdd.cpp +++ b/examples/OpenCLVectorAdd/OpenCLVectorAdd.cpp @@ -105,8 +105,8 @@ int main() hostB.resize(N); hostC.resize(N); - std::iota(std::begin(hostA), std::end(hostA), 0); - std::iota(std::begin(hostB), std::end(hostB), 0); + std::iota(std::begin(hostA), std::end(hostA), 0.0f); + std::iota(std::begin(hostB), std::end(hostB), 0.0f); } { @@ -178,7 +178,7 @@ int main() CL_ASSERT(clGetEventProfilingInfo(evt, CL_PROFILING_COMMAND_START, sizeof(cl_ulong), &start, nullptr)); CL_ASSERT(clGetEventProfilingInfo(evt, CL_PROFILING_COMMAND_END, sizeof(cl_ulong), &end, nullptr)); CL_ASSERT(clReleaseEvent(evt)); - durations[i] = (end - start) * 0.001; + durations[i] = (end - start) * 0.001f; std::cout << "VectorAdd Kernel " << i << " tooks " << static_cast(durations[i]) << "us" << std::endl; }; float avg = std::accumulate(durations.cbegin(), durations.cend(), 0.0f) / durations.size();