Check Boost::Compute issues
henryiii opened this issue · 14 comments
On my Mac, a simple test program fails to build using the boost compute library (obtained through brew, 1.65.1):
#include <iostream>
#include <stdexcept>
#include <vexcl/vexcl.hpp>
int main() {
vex::Context ctx( vex::Filter::All);
if (!ctx) throw std::runtime_error("No devices available.");
// Print out list of selected devices:
std::cout << ctx << std::flush;
}
cmake_minimum_required(VERSION 3.9)
project(muproject)
add_subdirectory(extern/vexcl)
vexcl_add_executables(muproject src/muproject.cpp)
If I run make muproject_cl
, it is fine, but make
or make muproject_comp
fails. Error:
henrys-mbp:build henryiii$ make muproject_comp
[ 50%] Building CXX object CMakeFiles/muproject_comp.dir/src/muproject.cpp.o
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:34:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend.hpp:63:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute.hpp:38:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/error.hpp:35:
In file included from /usr/local/include/boost/compute/core.hpp:18:
In file included from /usr/local/include/boost/compute/buffer.hpp:17:
In file included from /usr/local/include/boost/compute/memory_object.hpp:16:
/usr/local/include/boost/compute/kernel.hpp:397:31: error: no type named 'type' in 'boost::enable_if<boost::compute::is_fundamental<unsigned long>, void>'; 'enable_if' cannot be
used to disable this declaration
typename boost::enable_if<is_fundamental<T> >::type
^~~~~~~~~~~~~~~~~
/usr/local/include/boost/compute/kernel.hpp:251:9: note: in instantiation of template class 'boost::compute::detail::set_kernel_arg<unsigned long>' requested here
detail::set_kernel_arg<T>()(*this, index, value);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:105:15: note: in instantiation of function template specialization
'boost::compute::kernel::set_arg<unsigned long>' requested here
K.set_arg(argpos++, arg);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/element_index.hpp:97:16: note: in instantiation of function template specialization
'vex::backend::compute::kernel::push_arg<unsigned long>' requested here
kernel.push_arg(term.offset + index_offset);
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:34:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend.hpp:63:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute.hpp:38:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/error.hpp:35:
In file included from /usr/local/include/boost/compute/core.hpp:18:
In file included from /usr/local/include/boost/compute/buffer.hpp:17:
In file included from /usr/local/include/boost/compute/memory_object.hpp:16:
/usr/local/include/boost/compute/kernel.hpp:251:9: error: type 'detail::set_kernel_arg<unsigned long>' does not provide a call operator
detail::set_kernel_arg<T>()(*this, index, value);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:105:15: note: in instantiation of function template specialization
'boost::compute::kernel::set_arg<unsigned long>' requested here
K.set_arg(argpos++, arg);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/element_index.hpp:97:16: note: in instantiation of function template specialization
'vex::backend::compute::kernel::push_arg<unsigned long>' requested here
kernel.push_arg(term.offset + index_offset);
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:34:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend.hpp:63:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute.hpp:57:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:105:15: error: no matching member function for call to 'set_arg'
K.set_arg(argpos++, arg);
~~^~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/operations.hpp:234:16: note: in instantiation of function template specialization
'vex::backend::compute::kernel::push_arg<const unsigned long &>' requested here
kernel.push_arg(term);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/operations.hpp:245:8: note: in instantiation of member function
'vex::traits::kernel_arg_setter<unsigned long, void>::set' requested here
>::set(term, kernel, device, index_offset, state);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/operations.hpp:1407:17: note: in instantiation of function template specialization
'vex::traits::set_kernel_args<unsigned long>' requested here
traits::set_kernel_args(boost::proto::value(term), krn, part, part_start, state);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/operations.hpp:965:13: note: in instantiation of function template specialization
'vex::detail::set_expression_argument::operator()<boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<const unsigned long &>, 0>
>' requested here
process(term);
^
/usr/local/include/boost/proto/transform/impl.hpp:255:9: note: in instantiation of member function 'vex::detail::process_terminal::impl<const
boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<const unsigned long &>, 0> &, vex::detail::set_expression_argument &,
boost::proto::envns_::empty_env>::operator()' requested here
BOOST_PROTO_TRANSFORM_(PrimitiveTransform, X)
^
/usr/local/include/boost/proto/transform/impl.hpp:213:16: note: expanded from macro 'BOOST_PROTO_TRANSFORM_'
return boost::proto::detail::apply_transform<transform_type(Expr const &, State const &)>()(e, s, d); \
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/operations.hpp:1892:13: note: in instantiation of function template specialization
'boost::proto::transform<boost::proto::or_<boost::proto::when<boost::proto::terminal<boost::proto::_>, vex::detail::process_terminal>,
boost::proto::function<boost::proto::_, boost::proto::vararg<vex::detail::extract_terminals>, void, void, void, void, void, void, void, void>,
boost::proto::when<boost::proto::nary_expr<boost::proto::_, boost::proto::vararg<vex::detail::extract_terminals>, void, void, void, void, void, void, void, void, void>,
boost::proto::nary_expr<boost::proto::_, boost::proto::vararg<vex::detail::extract_terminals>, void, void, void, void, void, void, void, void, void> >, void, void, void,
void, void, void, void>, void>::operator()<const boost::proto::exprns_::expr<boost::proto::tagns_::tag::terminal, boost::proto::argsns_::term<const unsigned long &>, 0>,
vex::detail::set_expression_argument &>' requested here
extract_terminals()( boost::proto::as_child(rhs), setarg);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vector.hpp:678:27: note: in instantiation of function template specialization
'vex::detail::assign_expression<vex::assign::SUB, vex::vector<unsigned long>, unsigned long>' requested here
VEXCL_ASSIGNMENTS(VEXCL_ASSIGNMENT)
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/csr.inl:67:67: note: in instantiation of function template specialization
'vex::vector<unsigned long>::operator-=<unsigned long>' requested here
if (*row_begin > 0) vector<idx_t>(queue, loc.row) -= *row_begin;
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:91:37: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatCSR::SpMatCSR' requested here
new SpMatCSR(queue[d],
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:466:24: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned long>::SpMat'
requested here
vex::SpMat<float> A(queue, n3, n3, row.data(), col.data(), val.data());
^
/usr/local/include/boost/compute/kernel.hpp:255:10: note: candidate function not viable: no known conversion from 'const unsigned long' to 'const cl_mem' (aka '_cl_mem *const')
for 2nd argument
void set_arg(size_t index, const cl_mem mem)
^
/usr/local/include/boost/compute/kernel.hpp:261:10: note: candidate function not viable: no known conversion from 'const unsigned long' to 'const cl_sampler'
(aka '_cl_sampler *const') for 2nd argument
void set_arg(size_t index, const cl_sampler sampler)
^
/usr/local/include/boost/compute/kernel.hpp:247:10: note: candidate template ignored: substitution failure [with T = unsigned long]
void set_arg(size_t index, const T &value)
^
/usr/local/include/boost/compute/kernel.hpp:214:10: note: candidate function not viable: requires 3 arguments, but 2 were provided
void set_arg(size_t index, size_t size, const void *value)
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:48:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:258:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/csr.inl:177:24: error: no matching member function for call to 'push_arg'
kernel->second.push_arg(n);
~~~~~~~~~~~~~~~^~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/csr.inl:194:26: note: in instantiation of function template specialization 'vex::SpMat<float, unsigned long,
unsigned long>::SpMatCSR::mul<vex::assign::ADD>' requested here
if (loc.nnz) mul<assign::ADD>(loc, in, out, scale);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/csr.inl:45:5: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatCSR::mul_local' requested here
SpMatCSR(
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:91:37: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatCSR::SpMatCSR' requested here
new SpMatCSR(queue[d],
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:466:24: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned long>::SpMat'
requested here
vex::SpMat<float> A(queue, n3, n3, row.data(), col.data(), val.data());
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:98:14: note: candidate template ignored: could not match 'device_vector<type-parameter-0-0>'
against 'unsigned long'
void push_arg(device_vector<T> arg) {
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:104:14: note: candidate template ignored: substitution failure
[with Arg = const unsigned long &]
void push_arg(Arg &&arg) {
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:48:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:258:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/csr.inl:177:24: error: no matching member function for call to 'push_arg'
kernel->second.push_arg(n);
~~~~~~~~~~~~~~~^~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/csr.inl:197:17: note: in instantiation of function template specialization 'vex::SpMat<float, unsigned long,
unsigned long>::SpMatCSR::mul<vex::assign::SET>' requested here
mul<assign::SET>(loc, in, out, scale);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/csr.inl:45:5: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatCSR::mul_local' requested here
SpMatCSR(
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:91:37: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatCSR::SpMatCSR' requested here
new SpMatCSR(queue[d],
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:466:24: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned long>::SpMat'
requested here
vex::SpMat<float> A(queue, n3, n3, row.data(), col.data(), val.data());
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:98:14: note: candidate template ignored: could not match 'device_vector<type-parameter-0-0>'
against 'unsigned long'
void push_arg(device_vector<T> arg) {
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:104:14: note: candidate template ignored: substitution failure
[with Arg = const unsigned long &]
void push_arg(Arg &&arg) {
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:48:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:258:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/csr.inl:208:22: error: no matching member function for call to 'mul'
if (rem.nnz) mul<assign::ADD>(rem, in, out, scale);
^~~~~~~~~~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/csr.inl:45:5: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatCSR::mul_remote' requested here
SpMatCSR(
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:91:37: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatCSR::SpMatCSR' requested here
new SpMatCSR(queue[d],
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:466:24: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned long>::SpMat'
requested here
vex::SpMat<float> A(queue, n3, n3, row.data(), col.data(), val.data());
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/csr.inl:136:10: note: candidate template ignored: substitution failure [with OP = vex::assign::ADD]
void mul(const matrix_part &part,
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:48:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:257:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:275:24: error: no matching member function for call to 'push_arg'
kernel->second.push_arg(n);
~~~~~~~~~~~~~~~^~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:309:13: note: in instantiation of function template specialization 'vex::SpMat<float, unsigned long,
unsigned long>::SpMatHELL::mul<vex::assign::ADD>' requested here
mul<assign::ADD>(loc, in, out, scale);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:53:5: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatHELL::mul_local' requested here
SpMatHELL(
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:97:37: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatHELL::SpMatHELL' requested here
new SpMatHELL(queue[d],
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:466:24: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned long>::SpMat'
requested here
vex::SpMat<float> A(queue, n3, n3, row.data(), col.data(), val.data());
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:98:14: note: candidate template ignored: could not match 'device_vector<type-parameter-0-0>'
against 'unsigned long'
void push_arg(device_vector<T> arg) {
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:104:14: note: candidate template ignored: substitution failure
[with Arg = const unsigned long &]
void push_arg(Arg &&arg) {
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:48:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:257:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:277:24: error: no matching member function for call to 'push_arg'
kernel->second.push_arg(part.ell.width);
~~~~~~~~~~~~~~~^~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:98:14: note: candidate template ignored: could not match 'device_vector<type-parameter-0-0>'
against 'unsigned long'
void push_arg(device_vector<T> arg) {
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:104:14: note: candidate template ignored: substitution failure
[with Arg = const unsigned long &]
void push_arg(Arg &&arg) {
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:48:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:257:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:278:24: error: no matching member function for call to 'push_arg'
kernel->second.push_arg(pitch);
~~~~~~~~~~~~~~~^~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:98:14: note: candidate template ignored: could not match 'device_vector<type-parameter-0-0>'
against 'unsigned long'
void push_arg(device_vector<T> arg) {
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:104:14: note: candidate template ignored: substitution failure
[with Arg = const unsigned long &]
void push_arg(Arg &&arg) {
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:48:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:257:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:275:24: error: no matching member function for call to 'push_arg'
kernel->second.push_arg(n);
~~~~~~~~~~~~~~~^~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:311:13: note: in instantiation of function template specialization 'vex::SpMat<float, unsigned long,
unsigned long>::SpMatHELL::mul<vex::assign::SET>' requested here
mul<assign::SET>(loc, in, out, scale);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:53:5: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatHELL::mul_local' requested here
SpMatHELL(
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:97:37: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatHELL::SpMatHELL' requested here
new SpMatHELL(queue[d],
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:466:24: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned long>::SpMat'
requested here
vex::SpMat<float> A(queue, n3, n3, row.data(), col.data(), val.data());
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:98:14: note: candidate template ignored: could not match 'device_vector<type-parameter-0-0>'
against 'unsigned long'
void push_arg(device_vector<T> arg) {
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:104:14: note: candidate template ignored: substitution failure
[with Arg = const unsigned long &]
void push_arg(Arg &&arg) {
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:48:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:257:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:277:24: error: no matching member function for call to 'push_arg'
kernel->second.push_arg(part.ell.width);
~~~~~~~~~~~~~~~^~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:98:14: note: candidate template ignored: could not match 'device_vector<type-parameter-0-0>'
against 'unsigned long'
void push_arg(device_vector<T> arg) {
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:104:14: note: candidate template ignored: substitution failure
[with Arg = const unsigned long &]
void push_arg(Arg &&arg) {
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:48:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:257:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:278:24: error: no matching member function for call to 'push_arg'
kernel->second.push_arg(pitch);
~~~~~~~~~~~~~~~^~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:98:14: note: candidate template ignored: could not match 'device_vector<type-parameter-0-0>'
against 'unsigned long'
void push_arg(device_vector<T> arg) {
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:104:14: note: candidate template ignored: substitution failure
[with Arg = const unsigned long &]
void push_arg(Arg &&arg) {
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:48:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:257:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:319:9: error: no matching member function for call to 'mul'
mul<assign::ADD>(rem, in, out, scale);
^~~~~~~~~~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:53:5: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatHELL::mul_remote' requested here
SpMatHELL(
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:97:37: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatHELL::SpMatHELL' requested here
new SpMatHELL(queue[d],
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:466:24: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned long>::SpMat'
requested here
vex::SpMat<float> A(queue, n3, n3, row.data(), col.data(), val.data());
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:220:10: note: candidate template ignored: substitution failure [with OP = vex::assign::ADD]
void mul(
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:381:13: error: no matching member function for call to 'push_arg'
krn.push_arg(loc.ell.width);
~~~~^~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:53:5: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatHELL::setArgs' requested here
SpMatHELL(
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:97:37: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned
long>::SpMatHELL::SpMatHELL' requested here
new SpMatHELL(queue[d],
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:466:24: note: in instantiation of member function 'vex::SpMat<float, unsigned long, unsigned long>::SpMat'
requested here
vex::SpMat<float> A(queue, n3, n3, row.data(), col.data(), val.data());
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:98:14: note: candidate template ignored: could not match 'device_vector<type-parameter-0-0>'
against 'unsigned long'
void push_arg(device_vector<T> arg) {
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:104:14: note: candidate template ignored: substitution failure
[with Arg = const unsigned long &]
void push_arg(Arg &&arg) {
^
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:48:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat.hpp:257:
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/spmat/hybrid_ell.inl:382:13: error: no matching member function for call to 'push_arg'
krn.push_arg(pitch);
~~~~^~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:98:14: note: candidate template ignored: could not match 'device_vector<type-parameter-0-0>'
against 'unsigned long'
void push_arg(device_vector<T> arg) {
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:104:14: note: candidate template ignored: substitution failure
[with Arg = const unsigned long &]
void push_arg(Arg &&arg) {
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:105:15: error: no matching member function for call to 'set_arg'
K.set_arg(argpos++, arg);
~~^~~~~~~
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/generator.hpp:582:23: note: in instantiation of function template specialization
'vex::backend::compute::kernel::push_arg<unsigned long &>' requested here
K.push_arg(psize[d]);
^
/usr/local/include/boost/compute/kernel.hpp:255:10: note: candidate function not viable: no known conversion from 'unsigned long' to 'const cl_mem' (aka '_cl_mem *const') for
2nd argument
void set_arg(size_t index, const cl_mem mem)
^
/usr/local/include/boost/compute/kernel.hpp:261:10: note: candidate function not viable: no known conversion from 'unsigned long' to 'const cl_sampler'
(aka '_cl_sampler *const') for 2nd argument
void set_arg(size_t index, const cl_sampler sampler)
^
/usr/local/include/boost/compute/kernel.hpp:247:10: note: candidate template ignored: substitution failure [with T = unsigned long]
void set_arg(size_t index, const T &value)
^
/usr/local/include/boost/compute/kernel.hpp:214:10: note: candidate function not viable: requires 3 arguments, but 2 were provided
void set_arg(size_t index, size_t size, const void *value)
^
16 errors generated.
make[3]: *** [CMakeFiles/muproject_comp.dir/src/muproject.cpp.o] Error 1
make[2]: *** [CMakeFiles/muproject_comp.dir/all] Error 2
make[1]: *** [CMakeFiles/muproject_comp.dir/rule] Error 2
make: *** [muproject_comp] Error 2
It does look like a duplicate of #222, which was fixed by boostorg/compute#737.
Still occurs with master:
git submodule add git@github.com:boostorg/compute.git extern/compute
cd extern/compute
git log | grep "need special treatment on OSX"
size_t and ptrdiff_t need special treatment on OSX
size_t and ptrdiff_t need special treatment on OSX
add extern/compute/include
to include_directories
Rerun:
henrys-mbp:build henryiii$ make
[ 75%] Building CXX object CMakeFiles/muproject_comp.dir/src/muproject.cpp.o
[ 75%] Built target muproject_cl
In file included from /Users/henryiii/git/utexas/muproject/src/muproject.cpp:3:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/vexcl.hpp:34:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend.hpp:63:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute.hpp:38:
In file included from /Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/error.hpp:35:
In file included from /Users/henryiii/git/utexas/muproject/extern/compute/include/boost/compute/core.hpp:18:
In file included from /Users/henryiii/git/utexas/muproject/extern/compute/include/boost/compute/buffer.hpp:17:
In file included from /Users/henryiii/git/utexas/muproject/extern/compute/include/boost/compute/memory_object.hpp:16:
/Users/henryiii/git/utexas/muproject/extern/compute/include/boost/compute/kernel.hpp:512:31: error: no type named 'type' in
'boost::enable_if<boost::compute::is_fundamental<unsigned long>, void>'; 'enable_if' cannot be used to disable this declaration
typename boost::enable_if<is_fundamental<T> >::type
^~~~~~~~~~~~~~~~~
/Users/henryiii/git/utexas/muproject/extern/compute/include/boost/compute/kernel.hpp:366:9: note: in instantiation of template class
'boost::compute::detail::set_kernel_arg<unsigned long>' requested here
detail::set_kernel_arg<T>()(*this, index, value);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/backend/compute/kernel.hpp:105:15: note: in instantiation of function template specialization
'boost::compute::kernel::set_arg<unsigned long>' requested here
K.set_arg(argpos++, arg);
^
/Users/henryiii/git/utexas/muproject/extern/vexcl/vexcl/element_index.hpp:97:16: note: in instantiation of function template specialization
'vex::backend::compute::kernel::push_arg<unsigned long>' requested here
kernel.push_arg(term.offset + index_offset);
...
(Though it does look like it might be a boost compute issue).
That is strange. I am sorry, I don't have access to a MacOS machine; could you test the output of the example from #222 (comment)?
Ahah, the following Boost::Compute only program fails to pass even syntastic on macOS:
#include <iostream>
#include <boost/compute/core.hpp>
namespace compute = boost::compute;
int main() {
// get the default device
compute::device device = compute::system::default_device();
int a;
unsigned int b;
unsigned long c;
compute::program program_;
compute::kernel kernel(program_, "something");
kernel.set_arg(0, a);
kernel.set_arg(1, b);
kernel.set_arg(2, c); // Failure!
return 0;
}
It fails on the final set_arg
, the unsigned long
one.
I would still be interested in the result of #222 (comment). Does unsigned long
need same treatment as size_t
and ptrdiff_t
?
I"m getting
unsigned long: 1
size_t: 1
So it looks like the patch from boostorg/compute#737 is working as intended. Is it possible we just need to #include <boost/compute/types.hpp>
before including <boost/compute/core.hpp>
? Would your example compile with this?
That does look like it fixes the example.
I can give that a go, but may take a day or two. I'll need to write a test that fails currently.
I don't think it did; see the CI build on mac, compute build. I'll have to retest this later to see if it really fixed my special case. It seems as if there is a problem with unsigned long macOS and OpenCL?
CI build uses boost-1.65.1, which does not have the fix from boostorg/compute#737.