Blame view

src/kernels/cl_ttl.h 1.05 KB
94b2b13d   Pedro Roque   PHACT source
1
2
3
4
/*
 * cl_ttl.h
 *
 *  Created on: 21/05/2017
4d26a735   Pedro Roque   Increased recogni...
5
 *      Author: pedro
94b2b13d   Pedro Roque   PHACT source
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
 */

#ifndef SRC_KERNELS_CL_TTL_H_
#define SRC_KERNELS_CL_TTL_H_

#if USE_TTL == 1

#define TTL_CTR_E , &ttl_ctr
#define TTL_CTR , unsigned int* ttl_ctr
#define TTL_CTR_V , ttl_ctr
#define CHECK_TTL_V(ttl_ctr, where) if ((ttl_ctr) >= TTL_LIMIT) { printf((__constant char *)"Exiting on TTL %u, %u, %d!\n", (where), (ttl_ctr), TTL_LIMIT); return; } else (ttl_ctr) = (ttl_ctr) + 1;
#define CHECK_TTL(ttl_ctr, where) if ((*(ttl_ctr)) >= TTL_LIMIT) { printf((__constant char *)"Exiting on TTL %u, %u, %d!\n", (where), (*(ttl_ctr)), TTL_LIMIT); return; } else (*(ttl_ctr)) = (*(ttl_ctr)) + 1;
#define CHECK_TTL_R(ttl_ctr, where) if ((*(ttl_ctr)) >= TTL_LIMIT) { printf((__constant char *)"Exiting on TTL %u, %u, %d!\n", (where), (*(ttl_ctr)), TTL_LIMIT); return 0; } else (*(ttl_ctr)) = (*(ttl_ctr)) + 1;

#else

#define CHECK_TTL_V(ttl_ctr, where)
#define CHECK_TTL(ttl_ctr, where)
#define CHECK_TTL_R(ttl_ctr, where)
#define TTL_CTR_E
#define TTL_CTR
#define TTL_CTR_V

#endif

#endif /* SRC_KERNELS_CL_TTL_H_ */