1#ifndef __MAPPING_KERNELS__
2#define __MAPPING_KERNELS__
47 T* __restrict__
x,
const T edge0,
const T edge1,
const int n) {
49 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
50 const int str = blockDim.x * gridDim.x;
52 for (
int i = idx;
i < n;
i += str) {
53 T t = (
x[
i] - edge0) / (edge1 - edge0);
54 t = min(
max(t, 0.0), 1.0);
55 x[
i] = pow(t, 3.0) * (t * (t * 6.0 - 15.0) + 10.0);
70 T* __restrict__
x,
const T edge,
const T left,
const T right,
const int n) {
72 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
73 const int str = blockDim.x * gridDim.x;
75 for (
int i = idx;
i < n;
i += str) {
77 x[
i] = (x_i < edge) ? left : right;
92 T* __restrict__
x,
const T k_0,
const T k_1,
const T q,
const int n) {
94 const int idx = blockIdx.x * blockDim.x + threadIdx.x;
95 const int str = blockDim.x * gridDim.x;
97 for (
int i = idx;
i < n;
i += str) {
99 x[
i] = k_0 + (k_1 - k_0) * x_i * (q + 1.0) / (q + x_i);
__global__ void const T *__restrict__ x
__global__ void permeability_kernel(T *__restrict__ x, const T k_0, const T k_1, const T q, const int n)
__global__ void smooth_step_kernel(T *__restrict__ x, const T edge0, const T edge1, const int n)
__global__ void step_kernel(T *__restrict__ x, const T edge, const T left, const T right, const int n)