Tensor Tiling Library
 
Loading...
Searching...
No Matches
TTL_cpp/TTL_macros.h
Go to the documentation of this file.
1/*
2 * TTL_macros.h
3 *
4 * Copyright (c) 2025 Mobileye
5 *
6 * Licensed under the Apache License, Version 2.0 (the License);
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an AS IS BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19#pragma once
20
21/**
22 * @def __TTL_STR_CONCAT1
23 *
24 * Concatenate x and y, must be used within another macro.
25 */
26#define __TTL_STR_CONCAT1(x, y) x##y
27
28/**
29 * @def __TTL_STR_CONCAT2
30 *
31 * Concatenate x and y, can be used standalone
32 */
33#define __TTL_STR_CONCAT2(x, y) __TTL_STR_CONCAT1(x, y)
34
35/**
36 * @def __TTL_STRINGFY1
37 *
38 * Turn s into a "string", must be used within another macro
39 */
40#define __TTL_STRINGFY1(s) #s
41
42/**
43 * @def __TTL_STRINGFY2
44 *
45 * Turn s into a "string", can be used standalone
46 */
47#define __TTL_STRINGFY2(s) __TTL_STRINGFY1(s)
48
49/**
50 * @def TTL_ARRAYSIZE
51 *
52 * @brief Return the number of elements in the array x
53 *
54 * @param x The array to return the size of
55 */
56#define TTL_ARRAYSIZE(x) (sizeof((x)) / sizeof((x)[0]))