[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Parallella Community • View topic - Query re software caching example
Page 1 of 1

Query re software caching example

PostPosted: Thu Apr 23, 2015 9:13 pm
by cmcconnell
I've been taking a look at the software caching example which is included in the Jan 30th 2015 headless Ubuntu image. I'm a bit confused by how it is being built.

My starting point was the description here - https://github.com/adapteva/epiphany-sd ... re-caching. But the Makefile in the example contradicts this description - There is no use of the -fsoftware-cache flag, instead there is -fpic. (I wondered if there had been a change since the 2014.11 release, but the Github history of the example indicates it's always been like this -
https://github.com/embecosm/parallella- ... h/Makefile)

It makes sense to me that the code to be cached needs to be position independent, and hence that the -fpie flag needed to be implemented as part of the software caching release, but wouldn't it be the target code (not the calling code) that needs this flag to be applied to its compilation (in this case, the math functions in the standard library)?

What is happening in the compilation of the calling code? Does -fpie imply -fsoftware-cache too? (If so, wouldn't there be instances where you want position independent code without software caching of any function calls made by that code?) And why does the main module of the caching example need to be position independent?

I may be misunderstanding something fundamental, but hopefully the above questions make some sort of sense.

[Edit: Ah, is the -fpie flag for the linker? (So it's all or nothing, with regard to whether you have position independent code or not?) If that's the case, then I suppose the only question is where the -fsoftware-cache option is hiding.]

Re: Query re software caching example

PostPosted: Wed May 06, 2015 7:58 am
by jeremybennett
Hi Colin,

Providing -fsoftware-cache on the command line provides -fpic (not pie) to cc1, so in that regards it is a synonym. However, the cachemanager object file is only linked in if -fsoftware-cache is provided.

The relevant lines in GCC:

https://github.com/adapteva/epiphany-gc ... hany.h#L58 (for linker)
https://github.com/adapteva/epiphany-gc ... hany.h#L60 (for cc1)

(Thanks to Simon Cook for the above - I'm just the messenger).

Re: Query re software caching example

PostPosted: Wed May 06, 2015 8:15 am
by cmcconnell

Re: Query re software caching example

PostPosted: Wed May 06, 2015 8:20 am
by jeremybennett
Hmmm - that sounds like a mistake in the example. Does it work? Does it work better if you use -fsoftware-cache?

I seem to recall that at an ealier stage they were synonyms, so it may be just a legacy thing.

HTH,


Jeremy

Re: Query re software caching example

PostPosted: Wed May 06, 2015 8:24 am
by cmcconnell
I must admit, I didn't try adding -fsoftware-cache, but I saw the expected speedup of the second call of the cached functions when I ran the examples as they are.