// A library to parallelize code on the Mellanox TILE-Gx easily.
// Written by Nils Liaaen Corneliusen 2017.
// License: CC0 1.0 Universal (CC0 1.0) Public Domain Dedication license
// Please refer to the article at http://www.ignorantus.com/pages/tilegx_integer_raytracer/
// for more information.
#ifndef PARH
#define PARH

#define DATA_LEN_MAX ((126-2)*8)

int par_init( unsigned int cores );
void par_shutdown( void );

void par_sendjob( void *func, void *data, unsigned int len );
void par_wait( void );
void par_set_cores( unsigned int cores );

unsigned int par_get_cores_total( void );

void par_measure_start( void );
void par_measure_stop( void );
void par_measure_report( void );

uint64_t __attribute__((noinline)) par_get_cycle_count( void );

#endif
