Closed ivareske closed 11 years ago
Hello,
Unfortunately I don't have any experience with qmake/QT, so I can not provide a working example.
Regarding the second issue, it was a while since I tested the code in windows. I'll try to do this tomorrow, when I have access to a windows machine.
Best regards, Denis
I suspect MSVC10 doesn't support raw string literals R"(...with linebreaks...)"
— can you try MSVC11?
does e4c6726a33d21e903bb0c61301f715a3c4bbac39 fix it for MSVC10?
Ivar,
Could you please test if the latest version is able to compile with cmake/visual studio?
re qmake/Qt issue: Are you able to compile and run some simple OpenCL test (like this) with qmake/Visual Studio?
The latest commit is tested on Win64 with Visual Studio 2010
Hi, thanks for your reply. I am still getting some errors for the utests.cpp file from the latest master (and many warnings):
[ 20%] Built target benchmark
[ 40%] Built target devlist
[ 60%] Built target exclusive
[ 80%] Building CXX object examples/CMakeFiles/utests.dir/utests.cpp.obj
utests.cpp
C:\Users\IVARES~1\DOWNLO~1\VEXCL-~1\vexcl/types.hpp(119) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Users\IVARES~1\DOWNLO~1\VEXCL-~1\vexcl/types.hpp(119) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Users\IVARES~1\DOWNLO~1\VEXCL-~1\vexcl/types.hpp(119) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Users\IVARES~1\DOWNLO~1\VEXCL-~1\vexcl/types.hpp(119) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Users\IVARES~1\DOWNLO~1\VEXCL-~1\vexcl/types.hpp(120) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Users\IVARES~1\DOWNLO~1\VEXCL-~1\vexcl/types.hpp(120) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Users\IVARES~1\DOWNLO~1\VEXCL-~1\vexcl/types.hpp(120) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Users\IVARES~1\DOWNLO~1\VEXCL-~1\vexcl/types.hpp(120) : warning C4146: unary minus operator applied to unsigned type, result still unsigned
C:\Users\IVARES~1\DOWNLO~1\VEXCL-~1\vexcl/reduce.hpp(314) : warning C4244: 'initializing' : conversion from 'cl::detail::param_traitscl::detail::cl_device_info,4131::param_type' to 'size_t', possible loss of data
C:\Users\Ivar Eskerud Smith\Downloads\vexcl-master\examples\utests.cpp(155) : see reference to function template instantiation 'double vex::Reductor<real,RDC>::operator ()vex::vectoranonymous-namespace'::<lambda34>::()::user_function_times2_body>,0>>,const vex::vector<double> &>,2> ] C:\Users\IVARES~1\DOWNLO~1\VEXCL-~1\vexcl/reduce.hpp(231) : warning C4101: 'fun' : unreferenced local variable C:\Users\IVARES~1\DOWNLO~1\VEXCL-~1\vexcl/reduce.hpp(314) : warning C4244: 'initializing' : conversion from 'cl::detail::param_traitscl::detail::cl_device_info,4131::param_type' to 'size_t', possible loss of data C:\Users\Ivar Eskerud Smith\Downloads\vexcl-master\examples\utests.cpp(1165) : see reference to function template instantiation 'unsigned int vex::Reductor<real,RDC>::operator ()vex::vector_expression<Expr>(const vex::vector_expression<Expr> &) const' being compiled with [ real=size_t, RDC=vex::SUM, Expr=boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::function,boost::proto::argsns_::list2<vex::vector_expression<boost::proto::exprns_::basic_expr<boost::proto::tagns_::tag::terminal,boost::proto::argsns_::term<
anonymous-namespace'::anonymous-namespace'::<lambda55>>(_InIt,_InIt,_Pr)' being compiled with [ T=double, vector_type=vex::vector<double>, element_type=vex::vector<double>::element, _InIt=vex::vector<double>::iterator_type<vex::vector<double>,vex::vector<double>::element>, _Pr=
anonymous-namespace'::
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~2.0\VC\bin\cl.exe' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0 \VC\BIN\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0 \VC\BIN\nmake.exe"' : return code '0x2' Stop.
Regarding compiling with qmake, I am able to compile and run the hello world in OpenCl example. I get as output: Pitcairn 3
Regards, Ivar
Are you building in 32bit mode? I tested in 64bit environment. I'll try to test this in 32bits tomorrow.
Yes, I am using 32 bit. Have not tested 64 bit yet
The latest commit should work with cmake/VS on 32bit windows.
I was able to compile and run utests with the following project.pro file:
TEMPLATE = app
TARGET = utests
INCLUDEPATH += $$quote(C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.0/include)
INCLUDEPATH += ../
INCLUDEPATH += $$quote(C:/boost_1_53_0)
# Input
SOURCES += utests.cpp
CONFIG += console
LIBS += -L$$quote(C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v5.0/lib/Win32) -lOpenCL
LIBS += -L$$quote(C:/boost_1_53_0/stage/lib)
Same file with obvious corrections compiles benchmark.cpp, and the executable does not crash.
I used QT 5.0.1, Boost 1.53.0, Nvidia CUDA Toolkit 5.0 and Visual Studio 2010 on 32bit Windows. I don't have windows machine with AMD GPU, so I can not test that.
Can you try more recent version of Boost if benchmark still crashes on you?
Hi, all examples run fine now when compiled with cmake, except for utests: utests.exe now runs further than before, but crashes at: Line 1263: Two Stencil convolutions in one expression Line 1399: User-defined stencil operator When I comment out those two tests the rest runs fine.
Regarding compiling with Qt:
I downloaded boost 1.53 and build the libraries from source, but the benchmark.cpp example still compiles fine but crashes when I try to run it (the other tests crashes as well). I am using Qt 4.8.4 precompiled for MSVC 2010, and MSVC 2010 32 bit. I also tried with Qt 5.0.1, but the program still crashes at startup... I have a Radeon HD 7850 GPU.
Regards, Ivar
Line 1263: Two Stencil convolutions in one expression
I think @neapel had same problem with boost 1.50. 1.52 worked fine. Did you try it with 1.53?
the program still crashes at startup...
Can you reproduce the bug when CPU is used as a compute device?
Yes, I tried with boost 1.53 in my previous comment (compiled from source). How do I only use the CPU? The line that seems to cause the crash is the first line in the main function:
vex::Context ctx( Filter::DoublePrecision && Filter::Env, CL_QUEUE_PROFILING_ENABLE );
Strange that it works with cmake and not Qt... Could there be some Qt/boost issues?
Hello Ivar,
I have installed amd app v2.8 and was able to reproduce the Qt problem. The solution to it is somewhat strange: the CL/cl.hpp file that is shipped with AMD APP SDK is not working. The one that is included with VexCL (which I got from Khronos site), does work.
To prefer VexCL's copy you need to reorder include paths in qt project file:
INCLUDEPATH += ../
INCLUDEPATH += $$quote(c:/Program Files/AMD APP/include)
INCLUDEPATH += $$quote(C:/boost_1_53_0)
I also had to re-setup the project from scratch for Qt to notice the change.
I could not reproduce the issue with stencil operators.
How do I only use the CPU?
It was indeed impossible for you since the examples crashed inside context creation. But normally the examples are using Filter::Env, so you may define one of supported environment variables to filter available devices:
> set OCL_DEVICE=Intel
> utests.exe
1. Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz
...
> set OCL_DEVICE=K20
> utests.exe
1. Tesla K20c
...
Ivar,
I was able to reproduce segfault in "Two Stencil convolutions in one expression" test with Boost 1.51 on Linux. 1.52 works without problems.
Thanks, now everything works! Maybe you should inform AMD that there might be something wrong with their cl.hpp file?
Great!
I'll try to make a minimal example a bit later in order to inform AMD.
Hi, I am having some toruble compiling a vexcl example with qmake/Qt and MSVC 2010. Could it be possible for you to make an example on the wiki, or to ship vexcl with a working qt project file? I am able to compile the benchmark program using the following porject file in the examples directory, but the program crashes () when I try to run it:
-------------------------------------------------------
TEMPLATE = app TARGET = test INCLUDEPATH += $$quote(C:/Program Files (x86)/AMD APP/include) INCLUDEPATH += ../ INCLUDEPATH += $$quote(C:/Program Files (x86)/boost/boost_1_51)
Input
SOURCES += benchmark.cpp
CONFIG += console
LIBS += -L$$quote(C:/Program Files (x86)/AMD APP/lib/x86) -lOpenCL LIBS += -L$$quote(C:/Program Files (x86)/boost/boost_1_51/lib)
-------------------------------------------------------
It crashes on the following line in benchmark.cpp:
vex::Context ctx( Filter::DoublePrecision && Filter::Env, CL_QUEUE_PROFILING_ENABLE );
I am able to compile and run this benchmark example fine using cmake... By the way, not all examples compiles fine using cmake, it stops at 80%. I`m attaching the error messages I got from cmake compilation at the end of my message here.
Best regards, Ivar
C:\sluggit\vexcl\vexcl/fft/kernels.hpp(101) : error C2001: newline in constant C:\sluggit\vexcl\vexcl/fft/kernels.hpp(102) : error C2059: syntax error : ')' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(102) : error C2001: newline in constant C:\sluggit\vexcl\vexcl/fft/kernels.hpp(103) : error C2059: syntax error : 'else'
C:\sluggit\vexcl\vexcl/fft/kernels.hpp(103) : error C2143: syntax error : missin g ';' before '{' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(103) : error C2447: '{' : missing functio n header (old-style formal list?) C:\sluggit\vexcl\vexcl/fft/kernels.hpp(182) : error C2001: newline in constant C:\sluggit\vexcl\vexcl/fft/kernels.hpp(186) : error C2059: syntax error : ')' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(177) : error C2146: syntax error : missin g ';' before identifier 'radix_kernel' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(177) : error C4430: missing type specifie r - int assumed. Note: C++ does not support default-int C:\sluggit\vexcl\vexcl/fft/kernels.hpp(186) : error C2001: newline in constant C:\sluggit\vexcl\vexcl/fft/kernels.hpp(186) : error C2988: unrecognizable templa te declaration/definition C:\sluggit\vexcl\vexcl/fft/kernels.hpp(186) : error C2059: syntax error : 'strin g' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(191) : error C2988: unrecognizable templa te declaration/definition C:\sluggit\vexcl\vexcl/fft/kernels.hpp(191) : error C2059: syntax error : 'const ant' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(191) : error C2059: syntax error : ')' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(196) : error C2143: syntax error : missin g ';' before '<<' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(197) : error C2988: unrecognizable templa te declaration/definition C:\sluggit\vexcl\vexcl/fft/kernels.hpp(197) : error C2059: syntax error : 'strin g' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(197) : error C2059: syntax error : ')' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(199) : error C2065: 'n' : undeclared iden tifier C:\sluggit\vexcl\vexcl/fft/kernels.hpp(199) : error C2065: 'radix' : undeclared identifier C:\sluggit\vexcl\vexcl/fft/kernels.hpp(200) : error C2065: 'T' : undeclared iden tifier C:\sluggit\vexcl\vexcl/fft/kernels.hpp(200) : error C2065: 'o' : undeclared iden tifier C:\sluggit\vexcl\vexcl/fft/kernels.hpp(200) : error C2065: 'invert' : undeclared identifier C:\sluggit\vexcl\vexcl/fft/kernels.hpp(200) : error C2065: 'radix' : undeclared identifier C:\sluggit\vexcl\vexcl/fft/kernels.hpp(200) : error C2065: 'p' : undeclared iden tifier C:\sluggit\vexcl\vexcl/fft/kernels.hpp(200) : error C4430: missing type specifie r - int assumed. Note: C++ does not support default-int C:\sluggit\vexcl\vexcl/fft/kernels.hpp(200) : error C2365: 'vex::kernel_radix' : redefinition; previous definition was 'function' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(132) : see declaration of 'vex::k ernel_radix' C:\sluggit\vexcl\vexcl/fft/kernels.hpp(202) : error C2065: 'queue' : undeclared identifier C:\sluggit\vexcl\vexcl/fft/kernels.hpp(202) : error C2065: 'o' : undeclared iden tifier C:\sluggit\vexcl\vexcl/fft/kernels.hpp(202) : fatal error C1903: unable to recov er from previous error(s); stopping compilation NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~2.0\VC\bin\cl.exe' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0 \VC\BIN\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0 \VC\BIN\nmake.exe"' : return code '0x2' Stop.