diff options
author | Cloud Han <cloudhan@outlook.com> | 2022-01-25 06:44:23 +0300 |
---|---|---|
committer | Cloud Han <cloudhan@outlook.com> | 2022-01-25 07:17:11 +0300 |
commit | d660425e00ca4cae8bbf43279dd2f87fc8947cdc (patch) | |
tree | 1dff41cf52cda4460b13f65ea42639cd60ba8642 /examples | |
parent | f8d231bbc9922ff97ab57b0b358f279917a48f12 (diff) |
mute warnings
Diffstat (limited to 'examples')
-rw-r--r-- | examples/OpenCLVectorAdd/OpenCLVectorAdd.cpp | 6 |
1 files 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<int>(durations[i]) << "us" << std::endl; }; float avg = std::accumulate(durations.cbegin(), durations.cend(), 0.0f) / durations.size(); |