Hi Aanchan, > Sorry this might be a newbie question. I was going through qr.cpp under > the examples/tutorials directory in gdb. I noticed that as soon as a > ViennaCL MatrixType object was created, 7/8 threads were spawned. I've > compiled it with OpenCL. Is it OpenCL that decides to create these > threads?
Yes, this is the OpenCL runtime which initializes the data in the clear() kernel with zeros. The number of hardware threads used by the OpenCL runtime is implementation-specific. > How does it decide when to optimize with the GPU and when to > optimize with the CPU? This is at our control. By default we create one OpenCL context containing the first device returned by the OpenCL SDK. Since this is typically the recommended device, or there may be only one OpenCL device available through the SDK anyway, this is a reasonable choice. So, if you compile with OpenCL and don't customize anything, then all operations on a ViennaCL matrix are run through OpenCL, typically on your GPU. There is no automatic fallback to the CPU for 'small' data sizes, yet there is some logic to use the CPU for sequential stages where appropriate (e.g. ILU preconditioner setup). Hope this helps :-) Best regards, Karli ------------------------------------------------------------------------------ _______________________________________________ ViennaCL-devel mailing list ViennaCL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/viennacl-devel