boostorg / boostorg/compute

Compiler warning when copying from std::array.

Open
#734 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
1.7k
Forks
340
PR merge metrics
No merged PRs in 30d

Description

When copying a std::array to a compute::vector, e.g.,

std::array host_tmp{ 1.0, 2.0, 3.0 };
compute::vector device_tmp(host_tmp.size(), context);
compute::copy(host_tmp.begin(), host_tmp.end(), device_tmp.begin(), queue);

I get a compiler warning `'argument': conversion from 'size_t' to 'boost::compute::uint_', possible loss of data` coming from lines 332 and 336 of boost\compute\algorithm\copy.hpp, i.e. the lines

map_copy_threshold =
parameters->get(
cache_key, "map_copy_threshold", map_copy_threshold
);
direct_copy_threshold =
parameters->get(
cache_key, "direct_copy_threshold", direct_copy_threshold
);

This doesn't happen if I use a std::vector instead of a std::array.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.