Sorry to continue this thread but I am very confused as I am trying to add
the public method you have suggested.  I thought the following simple
function would be sufficient in the backend.hpp file.

  /** @brief Returns the current context index */
  long current_context_id()
  {
    return current_context_id_;
  }

However, I am unable to call this function.  I have tried:

long context_id = viennacl::ocl::backend<false>::current_context_id();

but I just get an error:

error: cannot call member function ‘long int
viennacl::ocl::backend<dummy>::current_context_id() [with bool dummy =
false]’ without object

Have I missed something with the structure of these files that is
preventing this from working?

Regards,
Charles

On Fri, Jan 29, 2016 at 2:04 PM, Karl Rupp <r...@iue.tuwien.ac.at> wrote:

> Hi Charles,
>
> sorry for the late response. Currently there is no way of getting the
> internal index. You can, however, edit viennacl/ocl/backend.hpp and add a
> public member function in viennacl::ocl::backend returning the index.
>
> Best regards,
> Karli
>
>
>
> On 01/29/2016 04:00 PM, Charles Determan wrote:
>
>> While trying to figure out the device index I thought the following
>> would work:
>>
>> viennacl::ocl::current_context().current_device_id_
>>
>> but apparently the `current_device_id_` is private (which didn't appear
>> to be the case in the context.hpp file).  Perhaps a simple method for
>> its' accession?  If this functionality doesn't exist I can likely write
>> this.
>>
>> I still have made no headway on the context index.
>>
>> Regards,
>> Charles
>>
>> On Thu, Jan 28, 2016 at 1:30 PM, Charles Determan <cdeterma...@gmail.com
>> <mailto:cdeterma...@gmail.com>> wrote:
>>
>>     A user can switch contexts easily with
>>
>>     long id = 1;
>>     viennacl::ocl::switch_context(id);
>>
>>     Is there a way to determine the current context index?  In this case
>>     it would return 1?
>>
>>     The corollary for platform is:
>>
>>     viennacl::ocl::current_context().platform_index()
>>
>>
>>     I also don't see a method for device_index() either.  But it is
>>     possible I am simply overlooking this somewhere in the documentation.
>>
>>     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
>>
>>
>
------------------------------------------------------------------------------
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