https://www.liblfds.org/mediawiki/index.php?title=r7.1.0:Porting_Guide_(benchmark)&feed=atom&action=historyr7.1.0:Porting Guide (benchmark) - Revision history2024-03-29T08:35:15ZRevision history for this page on the wikiMediaWiki 1.36.0https://www.liblfds.org/mediawiki/index.php?title=r7.1.0:Porting_Guide_(benchmark)&diff=917&oldid=prevAdmin: /* The Porting Abstraction Layer */2016-05-30T17:07:24Z<p><span dir="auto"><span class="autocomment">The Porting Abstraction Layer</span></span></p>
<p><b>New page</b></p><div>{{DISPLAYTITLE:Porting Guide (benchmark)}}<br />
==Introduction==<br />
To permit ''benchmark'' to work on a range of platforms a porting abstraction layer has been written. Porting simply involves implementing the porting abstraction layer; the library will then compile and work. Implementation involves providing values to a small set defines, macros and typedefs and implementing one or two functions.<br />
<br />
==The Porting Abstraction Layer==<br />
The porting abstraction layer consists of two C and one header files, thus;<br />
<br />
└───test_and_benchmark<br />
└───benchmark<br />
└───src<br />
├───porting_abstraction_layer_numa_free.c<br />
├───porting_abstraction_layer_numa_malloc.c<br />
└───porting_abstraction_layer_operating_system.h<br />
<br />
Accordingly, to add a new platform, introduce a new #ifdef, which matches the appropriate compiler defined macros for your platform.<br />
<br />
The NUMA free/malloc functions only need to be implemented on NUMA systems. On SMP systems, a hosted implementation is assumed, and ''malloc'' is used.<br />
<br />
===''porting_abstraction_layer_numa_free.c''===<br />
<br />
void [[r7.1.0:function benchmark_pal_numa_free|benchmark_pal_numa_free]]( void *memory, lfds710_pal_uint_t size_in_bytes );<br />
<br />
===''porting_abstraction_layer_numa_malloc.c''===<br />
<br />
void [[r7.1.0:function benchmark_pal_numa_malloc|benchmark_pal_numa_malloc]]( lfds710_pal_uint_t numa_node_id, lfds710_pal_uint_t size_in_bytes );<br />
<br />
===''porting_abstraction_layer_operating_system.h''===<br />
<br />
#define [[r7.1.0:define BENCHMARK_PAL_OS_STRING|BENCHMARK_PAL_OS_STRING]]<br />
#define [[r7.1.0:define BENCHMARK_PAL_MEMORY_TYPE|BENCHMARK_PAL_MEMORY_TYPE]]<br />
#define [[r7.1.0:define BENCHMARK_PAL_MEMORY_TYPE_STRING|BENCHMARK_PAL_MEMORY_TYPE_STRING]]<br />
<br />
==See Also==<br />
* [[r7.1.0:Porting Guide (benchmarking)|Porting Guide (benchmarking)]]</div>Admin