Hi Erik,
I committed the first steps for using vecmathlib in pocl.
I added doc/vecmathlib.txt:
----------
Vecmathlib implementations for the built-in math lib can be compiled in
as follows:
a) ensure you have clang++ installed and functions
b) check out the vecmathlib project under 'kernel'
c) generate the pocl files using ./generate-files.py under
vecmathlib/pocl
Then pocl configure script should detect that you want to compile
vecmathlib and tries to compile its versions as a replacement for the math
builtins.
Currently it doesn't compile for me (Pekka) because some C++ header
issues. It's a work in progress.
------------
The libstdc++ headers seem to have some issues so it doesn't compile for
me yet, but at least it's a start.
Issues like:
In file included from ./../vecmathlib/pocl/acos.cc:3:
In file included from ./../vecmathlib/pocl/pocl-compat.h:8:
In file included from ./../vecmathlib/pocl/../vecmathlib.h:31:
In file included from ./../vecmathlib/pocl/../vec_pseudo.h:6:
In file included from ./../vecmathlib/pocl/../floatprops.h:11:
In file included from
/usr/lib64/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/iostream:39:
In file included from
/usr/lib64/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/ostream:39:
In file included from
/usr/lib64/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/ios:39:
In file included from
/usr/lib64/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/exception:148:
/usr/lib64/gcc/x86_64-linux-gnu/4.4/../../../../include/c++/4.4/exception_ptr.h:143:13:
error: unknown type name 'type_info'
This is strange because the configure check for a functioning clang++
is a "Hello world" program using iostream's std::cout and it compiles fine.
Maybe related to the -std=gnu++11.
Also at least:
...
In file included from ./../vecmathlib/pocl/../vecmathlib.h:31:
./../vecmathlib/pocl/../vec_pseudo.h:386:41: error: call to 'to_string' is
ambiguous
name_ = std::string("<libm:") + std::to_string(N) + "*" + base + ">";
^~~~~~~~~~~~~~
...
In file included from ./../vecmathlib/pocl/../vecmathlib.h:39:
./../vecmathlib/pocl/../vec_float_sse2_scalar.h:398:41: error: conversion from
'typename __gnu_cxx::__enable_if<__is_arithmetic<float>::__value,
int>::__type' (aka 'int') to 'boolvec_t'
(aka 'boolvec<real_t, size>') is ambiguous
boolvec_t isfinite() const { return std::isfinite(v); }
^~~~~~~~~~~~~~~~
./../vecmathlib/pocl/../vec_float_sse2_scalar.h:73:5: note: candidate
constructor
boolvec(bvector_t x): v(x) {}
...
I tested it with Clang 3.3 (trunk 176627) in Debian 6.0 (C++ headers from
g++ 4.4). Unless you have ideas on these, I'll get back into it
hopefully later this week.
On 02/18/2013 06:11 PM, Erik Schnetter wrote:
> On Mon, Feb 18, 2013 at 11:03 AM, Pekka Jääskeläinen
> <[email protected] <mailto:[email protected]>> wrote:
>
> On 02/18/2013 04:58 PM, Erik Schnetter wrote:
> > What is missing is integrating this with pocl's build system, and
> > autoconf'ing building C++ files.
>
> The plan is to have also the generated C++ implementations added to the
> pocl, right? Similarly to the convert_type.py. That is, the developers
> or the users of pocl are not going to need to have Vecmathlib available
> to benefit from its fast implementations.
>
> Thus, the build system of pocl should compile the pregenerated
> implementations if C++ is available (and use them over the "default
> ones"),
> and there should be a script or a makefile for easily regenerating the
> implementations (e.g., after Vecmathlib is improved)?
>
>
> Yes, this is the plan.
>
> Vecmathlib is written in C++ using templates. To generate header files
> and implementations for pocl, I created a Python script that mimics the
> C preprocessor magic that we currently use for this. This script creates
> a set of files (some C++, some OpenCL) that need to be compiled. This is
> very similar to how the kernel functions are currently implemented,
> except that there are (necessarily) also C++ files.
>
> Yes, if C++ is not available, the current functions should be used
> instead as fallback; things need to continue to work without C++.
>
> Yes, this script (generating the C++ and OpenCL files) is currently run
> as part of the build process.
>
> Vecmathlib uses cmake. Some of this logic needs to be converted to
> automake; this is what I called "missing" above.
>
> -erik
>
> --
> Erik Schnetter <[email protected]
> <mailto:[email protected]>>
> http://www.perimeterinstitute.ca/personal/eschnetter/
> AIM: eschnett247, Skype: eschnett, Google Talk: [email protected]
> <mailto:[email protected]>
>
>
>
> ------------------------------------------------------------------------------
> The Go Parallel Website, sponsored by Intel - in partnership with Geeknet,
> is your hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials, tech docs,
> whitepapers, evaluation guides, and opinion stories. Check out the most
> recent posts - join the conversation now. http://goparallel.sourceforge.net/
>
>
>
> _______________________________________________
> pocl-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/pocl-devel
--
Pekka
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
pocl-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pocl-devel