2

i've been writing some OpenCL code lately on linux (ubuntu 10.4, ati catalyst 10.4 and ati sdk v2.1) and its working great on linux.

When i wanted to run my code on windows, i got program build errors complaining about

"this declaration has no storage class or type specifier"

and then "global variable must be declared in addrSapce constant"

even having a void kernel doesn't do, hell i commented the code and it still gave same errors lol!

weird enough that samples r working just fine. when i copied my code into the samples projects, it gave same errors.

i'm using windows 7 32-bit, ati stream sdk v2.1 and v10.6 drivers (cause i couldn't find the 10.4 for windows anywhere, which is sad since 10.6 doesn't have a guarantee to support OpenCL, way to go amd lol! )

i cut all the kernels out and left just this one, i still got same errors, here it is

__kernel void set_float( __global float* buff ,
                                   float v) { 
            buff[get_global_id(0)]=v;
}
elmattic
  • 12,046
  • 5
  • 43
  • 79
omarzouk
  • 933
  • 10
  • 23
  • maybe look this thread: http://devforums.amd.com/forum/messageview.cfm?catid=390&threadid=124622 – elmattic Jul 20 '10 at 09:49
  • i already saw that post, his mistake is declaring a global variable right above (outside) the kernel, like declaring a global variable in C after ur includes so that it would be used by all functions, and I don't have anything similar to that in my kernel code. I think the reason i got the "global variable must be declared in addrSpace constant" is because of the first error since the kernel declaration failed so it considered the parameter to be a variable declaration. – omarzouk Jul 20 '10 at 18:21

2 Answers2

3

Man, no matter how many times u get bitten by strings, one never learns.

It was just a non-null terminated string problem lol.

omarzouk
  • 933
  • 10
  • 23
0

It works for me (successfully compiled using AMD Stream Kernel Analyzer). On Win7 64-bit, sdk v2.1 and v10.6 drivers. Your formatting is horrible though.

elmattic
  • 12,046
  • 5
  • 43
  • 79
  • oO i can't seem to find what u edited though... and anyway yes it compiled on the stream kernel analyzer for me too (the code is clearly correct), it just won't compile when running from the visual studio :S – omarzouk Jul 20 '10 at 18:24