Merge android-port & kernel-cache feature

Android port for merge

Major changes are in enabling kernel-cache
pocl_util.c : 
pocl_choose_dir() - chooses root folder for caching
pocl_create_source_dirs() - searches for matching program in sub-directories
other changes are either retaining files for caching or deleting unwanted files after cmpilation
use /sys/devices/system/cpu/possible file to find num-cores. Some android kernel shows no processor info on /proc/cpuinfo
plus pocl-android-sample in examples/
Idea of program specific cache storage came for android. Android is very
strict in giving write access to apps. Applications can write only into
their folders and sdcard, and sdcard is mounted as noexec! So only place
for cache would be /data/data/[program-name]/cache
SHA calculation at every launch could be considerably slow on mobile! It
runs multiple passes on the string



On Sat, Aug 2, 2014 at 9:11 PM, Pekka Jääskeläinen <notifications@github.com
> wrote:

> In lib/CL/pocl_util.c:
>
> >  {
> > -  char *path_name;
> > -  if (getenv(POCL_TEMPDIR_ENV) != NULL &&
> > -      access (getenv(POCL_TEMPDIR_ENV), F_OK) == 0)
> > +    char *path_name, *process_name;
> > +
> > +    path_name = (char*)malloc(TEMP_DIR_PATH_CHARS);
> > +    process_name = pocl_get_process_name();
>
> OK, I see. The lack of hashing requires one to create some kind of
> directory where to store the cached built kernels. Initially I thought this
> dir to be a hash of the preprocessed program source + build options etc.,
> just like in ccache. Then it would not matter if the same kernel is
> accessed from multiple processes. You consider the hash function
> contributed by @clementleger <https://github.com/clementleger> too slow?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/pocl/pocl/pull/106/files#r15729567>.
>