35#ifndef __BC_METAL_SHADER_UTILS_H__
36#define __BC_METAL_SHADER_UTILS_H__
38#include <metal_stdlib>
45 const int idx2 = idx - 1;
46 index[3] =
idx2 / (lx * lx * lx);
47 index[2] = (
idx2 - (lx * lx * lx) * index[3]) / (lx * lx);
48 index[1] = (
idx2 - (lx * lx * lx) * index[3] - (lx * lx) * index[2]) / lx;
49 index[0] =
idx2 - (lx * lx * lx) * index[3]
50 - (lx * lx) * index[2]
63 int l,
int lx,
int nf) {
64 return (
i + lx * ((
j - 1) + lx * ((
k - 1) +
nf * (l - 1)))) - 1;
__inline__ __device__ void nonlinear_index(const int idx, const int lx, int *index)
__global__ void dirichlet_apply_scalar_kernel(const int *__restrict__ msk, T *__restrict__ x, const T g, const int m)
#define coef_normal_area_idx(i, j, k, l, lx, nf)