File: common.h

package info (click to toggle)
halide 21.0.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 55,752 kB
  • sloc: cpp: 289,334; ansic: 22,751; python: 7,486; makefile: 4,299; sh: 2,508; java: 1,549; javascript: 282; pascal: 207; xml: 127; asm: 9
file content (22 lines) | stat: -rw-r--r-- 1,202 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#ifndef HALIDE_TEST_RUNTIME_COMMON_H_
#define HALIDE_TEST_RUNTIME_COMMON_H_

#include "HalideRuntime.h"

namespace Halide::Runtime::Internal {

size_t get_allocated_system_memory();
void *allocate_system(void *user_context, size_t bytes);
void deallocate_system(void *user_context, void *aligned_ptr);

}  // namespace Halide::Runtime::Internal

#define HALIDE_CHECK(user_context, cond)                                                                                           \
    do {                                                                                                                           \
        if (!(cond)) {                                                                                                             \
            halide_print(user_context, __FILE__ ":" _halide_expand_and_stringify(__LINE__) " HALIDE_CHECK() failed: " #cond "\n"); \
            abort();                                                                                                               \
        }                                                                                                                          \
    } while (0)

#endif  // HALIDE_TEST_RUNTIME_COMMON_H_