Hi Charles,

 > Is there any way to filter device types without initializing a context
> and changing the default device type for example:
>
>      viennacl::ocl::set_context_device_type(id, viennacl::ocl::gpu_tag());
>      viennacl::ocl::current_context().devices().size();
>
> I can access the platform(s) with
>
>      viennacl::ocl::get_platforms();
>
> and iterate through them and get the overall size:
>
>      platforms[platform_index].devices().size();
>
> but that includes all devices (GPU, CPU, etc.).  Is there any way to
> filter on the platform object itself?

Sure, you can just query the type from each device. Use the member 
function .type() an compare against 
CL_DEVICE_TYPE_GPU/CL_DEVICE_TYPE_CPU/CL_DEVICE_TYPE_ACCELERATOR
Push the devices you want to keep to an std::vector<> to get the desired 
behavior.

Am I missing something?

Best regards,
Karli


>
> Regards,
> Charles
>
>
> ------------------------------------------------------------------------------
> Find and fix application performance issues faster with Applications Manager
> Applications Manager provides deep performance insights into multiple tiers of
> your business applications. It resolves application problems quickly and
> reduces your MTTR. Get your free trial!
> https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
>
>
>
> _______________________________________________
> ViennaCL-devel mailing list
> ViennaCL-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/viennacl-devel
>


------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to