Grangeat-based 2D/3D image registration
Loading...
Searching...
No Matches
src
backend
include
reg23
Global.h
Go to the documentation of this file.
1
6
#pragma once
7
8
#include <torch/extension.h>
9
10
#ifdef __CUDACC__
11
#include <cuda.h>
12
#include <cuda_runtime.h>
13
#else
17
#define __host__
18
22
#define __device__
23
#endif
24
25
namespace
reg23
{
26
39
template
<
typename
T>
__host__
__device__
T
Square
(
const
T &x) {
return
x * x; }
40
48
template
<
typename
T>
__host__
__device__
T
Modulo
(
const
T &x,
const
T &y) {
return
(x % y + y) % y; }
49
50
51
template
<
typename
T>
__host__
__device__
T
Sign
(
const
T &x) {
return
static_cast<
T
>
((x > 0) - (x < 0)); }
52
57
}
// namespace reg23
__host__
#define __host__
Definition
Global.h:17
__device__
#define __device__
Definition
Global.h:22
reg23::Sign
__host__ __device__ T Sign(const T &x)
Definition
Global.h:51
reg23::Modulo
__host__ __device__ T Modulo(const T &x, const T &y)
Modulo operation that respect the sign.
Definition
Global.h:48
reg23::Square
__host__ __device__ T Square(const T &x)
Returns the square of the given value.
Definition
Global.h:39
reg23
Definition
GridSample3DCPU.cpp:6
Generated by
1.9.8