I am trying to convert some more of my raw OpenCL code over to use ViennaCL
in my gpuR package (https://github.com/cdeterman/gpuR).  However, I have
run in to a very strange result that I can't seem to understand.  I simply
want to count the number of devices for a given platform.

I can do this within a C++ file with the following excerpt which results
with the correct answer of '1' device.

    typedef std::vector< viennacl::ocl::platform > platforms_type;
    platforms_type platforms = viennacl::ocl::get_platforms();
    int num_gpus = platforms[0].devices().size();
    std::cout << num_gpus << std::endl;

However, when I place the EXACT same code in my R package (which links
against the exact same ViennaCL headers in the RViennaCL package) I get the
following output (with VIENNACL_DEBUG_ALL defined):

ViennaCL: Getting platform...
ViennaCL: Querying devices available at current platform.
ViennaCL: Found 1 devices.
ViennaCL: Creating device object (CTOR with cl_device_id)
ViennaCL: Creating device object (Copy CTOR)
[1] 1365402079

Clearly I don't have millions of devices.  I do see that it is finding the
'1' device successfully but the size of 'devices' seems to be behaving
strangely for me.  Do you have any idea why this could be happening?

Regards,
Charles
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=267308311&iu=/4140
_______________________________________________
ViennaCL-devel mailing list
ViennaCL-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-devel

Reply via email to