Forum Groups
  All forums
    Help & Feedback
      Questions
      Work in progress
      Finished Art
      Non-Max related
    Community
      Offtopic
      News
    Hardware
    Photography



Maxunderground news unavailable

Any OpenCL wizard around here?
show user profile  Garp
I've just started learning OpenCL. I'm having a lot of fun but also a few questions.




read 396 times
11/9/2014 1:50:11 AM (last edit: 11/9/2014 1:50:11 AM)
show user profile  gogodr
if you are talking about Cuda, I have some experience.

Hello there

beautiful ;3


read 376 times
11/9/2014 4:32:33 PM (last edit: 11/9/2014 4:32:33 PM)
show user profile  Garp
Thanks a lot gogodr but I'm talking about OpenCL specifically.
For example, I'm getting some odd results for my graphics card from clGetDeviceInfo and I'm not sure how to interpret them.




read 373 times
11/9/2014 4:59:27 PM (last edit: 11/9/2014 4:59:27 PM)
show user profile  gogodr
what are you getting?
care to show how you are calling the function?
I'm looking at this for reference. http://www.mql5.com/en/docs/opencl/clgetdeviceinfo

Hello there

beautiful ;3


read 363 times
11/9/2014 7:16:51 PM (last edit: 11/9/2014 7:16:51 PM)
show user profile  Garp
gogodr, the function calls are fine.
When querying preferred and natives sizes for vector types (stored on long registers), it always returns 1. For preferred sizes, it makes sense since OpenCL prefers dealing with vectors by itself. But getting 1 for native sizes 'should' mean that there are no long registers on my card! It's a GTX 560. Not the high end of cards but I'm pretty sure it has 128-bit registers.
So now I'm wondering whether it's a problem with Nvidia's implementation or something else. When I'll have time, I'll install AMD's SDK (and perhaps Intel's as well) to check.

edit: your link shows some kind of wrapper, not the standard function.




read 356 times
11/9/2014 9:00:53 PM (last edit: 11/9/2014 9:04:26 PM)
show user profile  gogodr
you are telling me that it is returning 1, so I don't really have the whole context of your problem. It might be this tho:

You do know that CLGetDeviceInfo always return 1 right?
(unless there is an error, on which it returns 0)
what you want to read is the data third parameter of that function which is an output parameter.

say:

uchar data[1024];
uint size;
if(CLGetDeviceInfo(CLContextCreate(0),CL_DEVICE_PREFERRED_VECTOR_WIDTH_INT,data,size,null)){
Print("The preferred vector width is: " + CharArrayToString(data));
}else{
Print("There was an error");
}


Hello there

beautiful ;3


read 353 times
11/9/2014 10:41:02 PM (last edit: 11/9/2014 10:41:02 PM)
show user profile  Garp
By 'return value', I mean the out parameter, not the error code that the function actually returns. I've been reading infos from my GPU and they're all fine, except for those I mentionned. So, as I said, it's not the function call.
And I'm using standard OpenCL (the signature is a little different), the idea being to write portable code. Below is a sample.

where device is a cl_device_id and vector_width is a cl_uint.



read 349 times
11/9/2014 11:08:08 PM (last edit: 11/9/2014 11:14:26 PM)
show user profile  gogodr
it might be a hardware limitation. To my knowledge OpenCL is a thing, but it is not standardized yet.

Hello there

beautiful ;3


read 335 times
11/10/2014 3:17:23 AM (last edit: 11/10/2014 3:17:23 AM)
show user profile  Garp
OpenCL is a standard. How compliant the various implementations are is a different story.
There seem to be small discrepancies between implementations (on top of not implementing the same version). This could become a nuisance when dispatching/customizing code to make the best possible use of the client's hardware. That's what I'm mostly worried about after getting those strange results.
But as I said, I've just started learning. So I won't panick just yet ;)




read 321 times
11/10/2014 3:38:43 PM (last edit: 11/10/2014 3:38:43 PM)
#Maxforums IRC
Open chat window


Support Maxforums.org