HoviTron Video Pipeline
types.h
1/* ----------------------
2* Copyright 2023 Université Libre de Bruxelles(ULB), Universidad Politécnica de Madrid(UPM), CREAL, Deutsches Zentrum für Luft - und Raumfahrt(DLR)
3
4* Licensed under the Apache License, Version 2.0 (the "License");
5* you may not use this file except in compliance with the License.
6* You may obtain a copy of the License at < http://www.apache.org/licenses/LICENSE-2.0%3E
7
8* Unless required by applicable law or agreed to in writing, software
9* distributed under the License is distributed on an "AS IS" BASIS,
10* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11* See the License for the specific language governing permissionsand
12* limitations under the License.
13---------------------- */
14
15
16#ifndef TYPES_CUH
17#define TYPES_CUH
18
19#include "stdio.h"
20
21using uchar = unsigned char;
22
23#define gpuErrchk(ans) \
24 { \
25 gpuAssert((ans), __FILE__, __LINE__); \
26 }
27inline void gpuAssert(cudaError_t code, const char* file, int line, bool abort = true)
28{
29 if (code != cudaSuccess)
30 {
31 fprintf(stderr, "GPUassert: %s %s %d\n", cudaGetErrorString(code), file, line);
32 if (abort)
33 exit(code);
34 }
35};
36
37#endif