Menu

Choosing device_type of OpenCL?

2013-03-20
2013-07-16
  • Roland Deschain

    Roland Deschain - 2013-03-20

    Hi,

    how can i select the Device-type when using OpenCL?

    In my case I want to compare the OpenCL-performance of CL_DEVICE_TYPE_CPU and CL_DEVICE_TYPE_GPU.

    I'm working on the sparse.cpp from the ViennaCL framework (./examples/benchmark/sparse.cpp) and enabled OpenCL by
    #define VIENNACL_WITH_OPENCL 1

    greetings

     
  • Karl Rupp

    Karl Rupp - 2013-03-20

    Hi,

    the function
      viennacl::ocl::set_context_device_type(id, viennacl::ocl::gpu_tag());
    (and similarly for CPUs and accelerators) described in Section 8.1 in the manual (http://viennacl.sourceforge.net/viennacl-manual-current.pdf) is what you're looking for. Note that the device type must be set before any ViennaCL object is created.

    Best regards,
    Karli

     
  • Roland Deschain

    Roland Deschain - 2013-03-20

    Hi,

    thanks for your answer, works well.

    greetings

     
    • ngagewj

      ngagewj - 2013-07-16

      intel CPUs or AMD CPUs?

       

Log in to post a comment.