Hi,

I would like to use ViennaCL in order to use the block-ILU0 preconditioner to 
solve iteratively my linear system using the 4 cores of my Macbook Pro. I am 
using Mac OSX 10.10.3 and ViennalCL 1.6.2.

I have no problem running the following program on what I think is the GPU.

#include <iostream>
#include <vector>

#define VIENNACL_WITH_OPENCL
#include <viennacl/scalar.hpp>
#include <viennacl/vector.hpp>
#include <viennacl/compressed_matrix.hpp>
#include <viennacl/linalg/bicgstab.hpp>
#include <viennacl/linalg/ilu.hpp>

int main(int argc, const char *argv[])
{
    //viennacl::ocl::set_context_device_type(0, viennacl::ocl::cpu_tag());
    auto n = std::size_t{1000};

    auto cpu_sparse_matrix = std::vector<std::map<unsigned int, float>>(n);
    for (std::size_t i = 0; i < n; i++) {
        cpu_sparse_matrix[i][i] = 1.0;
    }
    auto vcl_matrix = viennacl::compressed_matrix<float>(n, n);
    viennacl::copy(cpu_sparse_matrix, vcl_matrix);


    auto vcl_rhs = viennacl::vector<float>(n);
    for (std::size_t i = 0; i < n; i++) {
        vcl_rhs[i] = 1.0;
    }

    auto vcl_block_ilu0 = viennacl::linalg::block_ilu_precond<
        viennacl::compressed_matrix<float>, viennacl::linalg::ilu0_tag>(
        vcl_matrix, viennacl::linalg::ilu0_tag());

    auto vcl_result = viennacl::linalg::solve(vcl_matrix, vcl_rhs,
        viennacl::linalg::bicgstab_tag(), vcl_block_ilu0); 

    std::cout << vcl_result[0] << std::endl;
    std::cout << vcl_result[n - 1] << std::endl;

    
    return 0;
}

The bad news come when I want to use the CPU, and I uncomment the first line of 
the program. I get the following message:

clang++ -std=c++11 -I/usr/local/viennacl/include -framework OpenCL 
vienna-main.cpp -o main
./main

ViennaCL: FATAL ERROR: Kernel start failed for '_norm_2_0'.
ViennaCL: Smaller work sizes could not solve the problem. 
libc++abi.dylib: terminating with uncaught exception of type 
viennacl::ocl::invalid_work_group_size: ViennaCL: FATAL ERROR: 
CL_INVALID_WORK_GROUP_SIZE 
 The supplied work group size is invalid. If you have set this value manually, 
please reconsider your choice.
If you think that this is a bug in ViennaCL, please report it at 
viennacl-support@lists.sourceforge.net and supply at least the following 
information:
 * Operating System
 * Which OpenCL implementation (AMD, NVIDIA, etc.)
 * ViennaCL version
Many thanks in advance!
Abort trap: 6

Is there something I have not done correctly ?

François Fayard
Founder & Consultant - Inside Loop
Tel: +33 (0)6 01 44 06 93 <tel:+33%206%2001%2044%2006%2093>
Web: www.insideloop.io <http://www.insideloop.io/>
Twitter: @insideloop_io

------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
ViennaCL-support mailing list
ViennaCL-support@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viennacl-support

Reply via email to