cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

hayabusaxps
Journeyman III

openCL tutorial inconsistencies help

im trying to start opencl but the intro to opencl programming presentation doesnt work

so if one were to first configure the compiling on windows then continue to the query for platform ids

 

i hit a wall

#include <CL/cl.hpp>


int main()

{

 

cl_platform_id            platforms;

cl_uint                       num_platforms;

cl_int err = clGetPlatfromIDs(

1,                              // the number of entries that can added to platforms

&platforms,                // list of OpenCL found

&num_platforms         // the number of OpenCL platforms available);

return 0;

}

 

 

 

output

1>------ Build started: Project: HelloGPU, Configuration: Release x64 ------
1>Build started 4/5/2011 11:20:31 AM.
1>InitializeBuildStatus:
1>  Touching "x64\Release\HelloGPU.unsuccessfulbuild".
1>ClCompile:
1>  HelloGPU.cpp
1>HelloGPU.cpp(25): error C2078: too many initializers
1>HelloGPU.cpp(25): error C2440: 'initializing' : cannot convert from 'cl_uint *' to 'cl_int'
1>          There is no context in which this conversion is possible
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:00.73
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

 

 

 

 

 

 

what exactly am i missing?

or is this simple coding just plain wrong????

ive installed everything i think correctly and all of the sample programs compile correctly.

 

0 Likes
5 Replies
nou
Exemplar

you commented out ending );

you should first get number of platforms with

clGetPlatformIDs(0, NULL, &num_platforms);

0 Likes
hayabusaxps
Journeyman III

int main()

{

cl_platform_id            platforms;

cl_uint                       num_platforms;

cl_int err = clGetPlatfromIDs(

1,                              // the number of entries that can added to platforms

&platforms,                // list of OpenCL found

&num_platforms         // the number of OpenCL platforms available);

)

 

return 0;

}

0 Likes

crap now its working but i didnt change anything???

 

i hope it doesnt start acting up later

0 Likes

look again at the end of last comment.

// the number of OpenCL platforms available);

0 Likes

sigh a dam ";"

0 Likes