Skip to content

Commit

Permalink
ViennaCL example works with any backend
Browse files Browse the repository at this point in the history
  • Loading branch information
ddemidov committed Apr 6, 2015
1 parent 75630e4 commit c158c75
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions examples/viennacl/solvers.cpp
Expand Up @@ -63,13 +63,8 @@ int main() {
}

// Move data to GPU(s).
vex::Context ctx(
vex::Filter::Type(CL_DEVICE_TYPE_GPU) &&
vex::Filter::DoublePrecision
);

vex::Context ctx(vex::Filter::Env && vex::Filter::DoublePrecision);
if (!ctx) throw std::runtime_error("No GPUs with double precision found");

std::cout << ctx << std::endl;

vex::SpMat <real> A(ctx, n, n, row.data(), col.data(), val.data());
Expand All @@ -90,8 +85,6 @@ int main() {

std::cout << prof << std::endl;

} catch(const cl::Error &err) {
std::cerr << "OpenCL Error: " << err << std::endl;
} catch(const std::exception &err) {
std::cerr << "Error: " << err.what() << std::endl;
}
Expand Down

0 comments on commit c158c75

Please sign in to comment.