kylelutz/compute — pull request #15 by ddemidov (2013-06-24 12:15:50+00:00)
Title: Fixes compilation errors and warnings for VS2010

This fixes some compilation errors and warnings (mostly type-conversion related) for Visual Studio C++ 2010. I am still not able to compile test_issue_11 project. It fails with the following error:
```
2>c:/boost_1_53_0\boost/type_traits/common_type.hpp(91): error C2070: 'void': illegal sizeof operand
2> D:/work/compute/include\boost/compute/lambda/result_of.hpp(66) : see reference to class template instantiation 'boost::common_type' being compiled
2> with
2> [
2> T=void,
2> U=void
2> ]
2> D:/work/compute/include\boost/compute/lambda/context.hpp(329) : see reference to class template instantiation 'boost::compute::lambda::result_of' being compiled
2> with
2> [
2> Expr=boost::proto::exprns_::basic_expr>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>,
2> Args=boost::tuples::tuple,boost::compute::detail::meta_kernel_variable>
2> ]
2> c:/boost_1_53_0\boost/utility/result_of.hpp(167) : see reference to class template instantiation 'boost::compute::lambda::expression::result' being compiled
2> with
2> [
2> Expr=boost::proto::exprns_::basic_expr>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>,
2> Signature=boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>> (boost::compute::detail::meta_kernel_variable,boost::compute::detail::meta_kernel_variable)
2> ]
2> c:/boost_1_53_0\boost/utility/result_of.hpp(174) : see reference to class template instantiation 'boost::detail::result_of_nested_result' being compiled
2> with
2> [
2> F=boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>>,
2> FArgs=boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>> (boost::compute::detail::meta_kernel_variable,boost::compute::detail::meta_kernel_variable)
2> ]
2> c:/boost_1_53_0\boost/utility/detail/result_of_iterate.hpp(37) : see reference to class template instantiation 'boost::detail::tr1_result_of_impl' being compiled
2> with
2> [
2> F=boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>>,
2> FArgs=boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>> (boost::compute::detail::meta_kernel_variable,boost::compute::detail::meta_kernel_variable),
2> HasResultType=false
2> ]
2> D:/work/compute/include\boost/compute/lambda/context.hpp(251) : see reference to class template instantiation 'boost::tr1_result_of' being compiled
2> with
2> [
2> F=boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>> (boost::compute::detail::meta_kernel_variable,boost::compute::detail::meta_kernel_variable)
2> ]
2> D:/work/compute/include\boost/compute/algorithm/detail/insertion_sort.hpp(54) : see reference to class template instantiation 'boost::compute::lambda::detail::invoked_binary_expression' being compiled
2> with
2> [
2> Expr=boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>>,
2> Arg1=boost::compute::detail::meta_kernel_variable,
2> Arg2=boost::compute::detail::meta_kernel_variable
2> ]
2> D:/work/compute/include\boost/compute/algorithm/sort.hpp(42) : see reference to function template instantiation 'void boost::compute::detail::serial_insertion_sort(Iterator,Iterator,Compare,boost::compute::command_queue &)' being compiled
2> with
2> [
2> Iterator=boost::compute::buffer_iterator,
2> Compare=boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>>
2> ]
2> ..\..\test\test_issue_11.cpp(66) : see reference to function template instantiation 'void boost::compute::sort,boost::compute::lambda::expression>(Iterator,Iterator,Compare,boost::compute::command_queue &)' being compiled
2> with
2> [
2> T=compute_test::UDD,
2> Expr=boost::proto::exprns_::basic_expr>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>,
2> Iterator=boost::compute::buffer_iterator,
2> Compare=boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &,const boost::compute::lambda::expression>,0>>,const boost::compute::lambda::expression>,0>> &>,2>> &>,2>>
2> ]
2>c:/boost_1_53_0\boost/type_traits/common_type.hpp(91): error C2338: must be complete type
```

Also, although the rest of the tests do compile, I get runtime errors from them. E.g. test_buffer results in:
```
D:\work\compute\build\test\Release>test_buffer.exe
Running 6 test cases...
unknown location(0): fatal error in "size": memory access violation

*** 1 failure detected in test suite "TestBuffer"
```

I suspect this is some kind of Boost.Test issue.