Thanks for the update. I will check it out. As for the second one, indeed thats
what I ended up doing:
Here is my kludge. Is there any "real" example of data partitioning and using
multiple GPU's?
// Get some context information for OpenCL compatible GPU devices
viennacl::ocl::platform pf; std::vector<viennacl::ocl::device> devices =
pf.devices(CL_DEVICE_TYPE_GPU); // If no GPU devices are found, we select the
CPU device if (devices.size() > 0) { // Now, often we may have an
integrated GPU with the CPU. We would // like to avoid using that GPU.
Instead, we search for a discrete // GPU. viennacl::ocl::setup_context(0,
devices[1]); } else { devices = pf.devices(CL_DEVICE_TYPE_CPU);
viennacl::ocl::setup_context(0, devices[0]); } Thanks and Regards
Sumit
From: Karl Rupp <[email protected]>
To: Sumit Kumar <[email protected]>
Cc: "[email protected]"
<[email protected]>
Sent: Monday, July 27, 2015 5:43 PM
Subject: Re: [ViennaCL-devel] ViennaCL reductions
Hi Sumit,
> Thanks for the update. Indeed, support for RM matrices would be helpful.
Added right here:
https://github.com/viennacl/viennacl-dev/commit/7d29adf3970d5eaefef448742101c5a5960d773f
> I did take a look at the page and tried all the methods there. My
> architecture contains the following:
> a.) AMD CPU
> b.) AMD Devastator (with the CPU)
> c.) AMD Hainan (discrete GPU card)
>
> No matter whatever I do, it ends up picking up b.) whereas I want to
> pick up c.)
> Can anyone share an example of how to go about doing this?
Try the following at the begin of your program (i.e. before creating any
ViennaCL-objects):
viennacl::ocl::setup_context(0, viennacl::ocl::platform().devices()[2]);
Best regards,
Karli
> ------------------------------------------------------------------------
> *From:* Karl Rupp <[email protected]>
> *To:* Sumit Kumar <[email protected]>
> *Cc:* "[email protected]"
> <[email protected]>
> *Sent:* Sunday, July 26, 2015 11:37 PM
> *Subject:* Re: [ViennaCL-devel] ViennaCL reductions
>
> Hi Sumit,
>
> > Thanks for the information. I have a second problem that has cropped up!
> > a.) Apparently, I cannot copy a Row-Major Eigen matrix to a vcl matrix!
> > It comes up with weird errors. I was using the default statements from
> > the examples folder. The moment I changed it to Column Major eigen
> > matrices the program compiled without any problem!
>
> Our interface currently supports Eigen::MatrixXf and Eigen::MatrixXd,
> which seems like it does not cover the row-major case. I'll look into it
> and extend the interface if needed.
>
>
> > b.) I have an AMD APU (CPU + GPU) and a discrete GPU. How do I force
> > ViennaCl to default to the discrete GPU and not the GPU from the APU? I
> > tried a kludge:
> > /get all available devices
> > viennacl::ocl::platform pf;
> > std::cout << "Platform info: " << pf.info() << std::endl;
> > std::vector<viennacl::ocl::device> devices =
> > pf.devices(CL_DEVICE_TYPE_GPU);// CL_DEVICE_TYPE_DEFAULT);
> > std::cout << devices[1].name() << std::endl;
> > std::cout << "Number of devices for custom context: " <<
> > devices.size() << std::endl;
> >
> > //set up context using all found devices:
> > int gSize = (int)devices.size();
> > for (int i = gSize-1; i >=0 ; --i)
> > {
> > device_id_array.push_back(devices[i].id());
> > }
> >
> > std::cout << "Creating context..." << std::endl;
> > cl_int err;
> > cl_context my_context = clCreateContext(0,
> > cl_uint(device_id_array.size()), &(device_id_array[0]), NULL, NULL,
> &err);
> >
> > and this made it work. However, is there a cleaner way of doing this?
> > This code snippet is from "custom-context.cpp". If i tried
> > &(device_id_array[1]), the program crashes !
>
> http://viennacl.sourceforge.net/doc/manual-multi-device.html
>
>
>
>
> Best regards,
> Karli
>
>
------------------------------------------------------------------------------
_______________________________________________
ViennaCL-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/viennacl-devel