sir.um

SOLVED: Problem Compiling OpenCL to 64-bit (C++)

Discussion created by sir.um on Aug 31, 2010
Latest reply on Apr 3, 2011 by sfmraja
MinGW 64

I'm using the C++ bindings for OpenCL and the MinGW 64-bit compiler for Windows 7, 64-bit.

My Build Commands, Source code, and Program Output are attached.

The code compiles fine, and will run as a 64-bit program, until it hits OpenCL code. When it hits OpenCL It hangs for a while then crashes.

Any help is appreciated.

Thanks
-Chris

 

----- Build Command ----- g++ -IC:\Users\Chris\workspaceC++_64\OpenCL\includes -O0 -g3 -Wall -c -fmessage-length=0 -osrc\HelloWorld.o ..\src\HelloWorld.cpp In file included from C:\Users\Chris\workspaceC++_64\OpenCL\includes/CL/opencl.h:44:0, from C:\Users\Chris\workspaceC++_64\OpenCL\includes/CL/cl.hpp:161, from ..\src\HelloWorld.cpp:9: C:\Users\Chris\workspaceC++_64\OpenCL\includes/CL/cl_gl_ext.h:44:4: warning: "/*" within comment g++ -LC:\Program Files (x86)\ATI Stream\lib\x86_64 -oOpenCL.exe src\HelloWorld.o -lOpenCL Build complete for project OpenCL Time consumed: 1470 ms. ----- Program ----- //OpenCL Includes #define __NO_STD_VECTOR //Use cl::vector instead of STL version #include <CL/cl.hpp> //C++ API Includes #include <iostream> #include <cstdlib> using namespace std; using namespace cl; int main() { cout<<"Hello, World!"<<endl; cl_int err; //Request Supported Platforms from OpenCL vector<Platform> platformList; cout<<"Platform Vector Created"<<endl; err = Platform::get(&platformList); cout<<"After Get Platform List"<<endl; } ----- Program Output ----- Hello, World! Platform Vector Created (Hangs here and then crashes)

Outcomes