Login  Register

Re: HelloJOCL Problems on MacOSX

Posted by Michael Bien on Feb 09, 2011; 7:37pm
URL: https://forum.jogamp.org/HelloJOCL-Problems-on-MacOSX-tp2456996p2461127.html

  that sounds great Martin,

if you already know that you have to use the GPU you could do something
like that:

>         // search a platform supporting GPU devices
>         CLPlatform platform =  CLPlatform.getDefault(CLPlatformFilters.type(Type.GPU));
>
>         // create a context on that platform using all devices
>         CLContext context = CLContext.create(platform);
>         try{
>             // queue on fastest GPU
>             CLCommandQueue queue =  context.getMaxFlopsDevice(Type.GPU).createCommandQueue();
>
>             // start here ...
>
>         }finally {
>             context.release();
>         }

its basically always a two step process:
  - pick a platform
  - create a context on all devices and pick the device for the CommandQueue later
or
  - pick devices of that platform and create the context only on the devices you selected

best regards,

michael


On 02/09/2011 07:39 PM, ralphrmartin [via jogamp] wrote:
>
> Michael, thanks again.
>
> CLCommandQueue queue = context.getDevices()[0].createCommandQueue();
> let me use the GPU and a worksize of 256.
>
> The later build 276 fixed the NPE bug.
>
> All is now looking good!
>
> _______________________________________________
> If you reply to this email, your message will be added to the discussion below:
> http://jogamp.762907.n3.nabble.com/HelloJOCL-Problems-on-MacOSX-tp2456996p2460616.html
> To start a new topic under jogamp, email ml-node+762907-380265080-8131@n3.nabble.com
> To unsubscribe from jogamp, visit http://jogamp.762907.n3.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=762907&code=YmllbmF0b3JAYXJjb3IuZGV8NzYyOTA3fDQxNTEwMDY0OA==

--
http://michael-bien.com/