boostorg / compute

A C++ GPU Computing Library for OpenCL
http://boostorg.github.io/compute/
Boost Software License 1.0
1.55k stars 333 forks source link

Compilation errors with boost::compute 1.67.0 at VS 2017 #792

Closed XNQrE closed 6 years ago

XNQrE commented 6 years ago

I haven't reproduced more specific issues to example code (they are various in relation to adding additional compute headers after using system or vector hpp), but it's telling that if the catch-all boost/compute.hpp is included to an empty main function, there's a compilation failure. It does go away if individual headers are used carefully but that shouldn't be considered normal.

#include <boost/compute.hpp> 

int main()
{
}

1>Source.cpp 1>c:\boost_1_67_0\boost\compute\algorithm\detail\reduce_by_key_with_scan.hpp(96): error C2676: binary '+': 'boost::compute::buffer_iterator' does not define this operator or a conversion to a type acceptable to the predefined operator 1> with 1> [ 1> T=cl_uint 1> ] 1>Done building project "example.vcxproj" -- FAILED.

PS. On gcc 8.2.0 it's fine

XNQrE commented 6 years ago

1.68.0.b1 has additional errors

1>c:_alt\2\boost\range\concepts.hpp(257): error C3646: 'n': unknown override specifier 1>c:_alt\2\boost\range\concepts.hpp(264): note: see reference to class template instantiation 'boost::range_detail::RandomAccessIteratorConcept' being compiled 1>c:_alt\2\boost\range\concepts.hpp(257): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>c:_alt\2\boost\compute\algorithm\detail\reduce_by_key_with_scan.hpp(96): error C2676: binary '+': 'boost::compute::buffer_iterator' does not define this operator or a conversion to a type acceptable to the predefined operator 1> with 1> [ 1> T=cl_uint 1> ] 1>Done building project "example.vcxproj" -- FAILED.

XNQrE commented 6 years ago

I'm closing it since all issues appear to be strictly related to VS at the current stable version and not universal. Emphasis on "appear" since I can't be certain,