17MassIntegrator::Kernels::Kernels()
75void OccaPAMassApply2D(
const int D1D,
84 occa::properties props;
85 props[
"defines/D1D"] = D1D;
86 props[
"defines/Q1D"] = Q1D;
92 const occa_id_t id = std::make_pair(D1D,Q1D);
93 if (!Device::Allows(Backend::OCCA_CUDA))
96 if (OccaMassApply2D_cpu.find(
id) == OccaMassApply2D_cpu.end())
98 const occa::kernel MassApply2D_CPU =
100 "MassApply2D_CPU", props);
101 OccaMassApply2D_cpu.emplace(
id, MassApply2D_CPU);
103 OccaMassApply2D_cpu.at(
id)(NE, o_B, o_Bt, o_D, o_X, o_Y);
107 static occa_kernel_t OccaMassApply2D_gpu;
108 if (OccaMassApply2D_gpu.find(
id) == OccaMassApply2D_gpu.end())
110 const occa::kernel MassApply2D_GPU =
112 "MassApply2D_GPU", props);
113 OccaMassApply2D_gpu.emplace(
id, MassApply2D_GPU);
115 OccaMassApply2D_gpu.at(
id)(NE, o_B, o_Bt, o_D, o_X, o_Y);
119void OccaPAMassApply3D(
const int D1D,
122 const Array<real_t> &B,
123 const Array<real_t> &Bt,
128 occa::properties props;
129 props[
"defines/D1D"] = D1D;
130 props[
"defines/Q1D"] = Q1D;
132 const occa::memory o_Bt =
OccaMemoryRead(Bt.GetMemory(), Bt.Size());
136 const occa_id_t id = std::make_pair(D1D,Q1D);
137 if (!Device::Allows(Backend::OCCA_CUDA))
140 if (OccaMassApply3D_cpu.find(
id) == OccaMassApply3D_cpu.end())
142 const occa::kernel MassApply3D_CPU =
144 "MassApply3D_CPU", props);
145 OccaMassApply3D_cpu.emplace(
id, MassApply3D_CPU);
147 OccaMassApply3D_cpu.at(
id)(NE, o_B, o_Bt, o_D, o_X, o_Y);
152 if (OccaMassApply3D_gpu.find(
id) == OccaMassApply3D_gpu.end())
154 const occa::kernel MassApply3D_GPU =
156 "MassApply3D_GPU", props);
157 OccaMassApply3D_gpu.emplace(
id, MassApply3D_GPU);
159 OccaMassApply3D_gpu.at(
id)(NE, o_B, o_Bt, o_D, o_X, o_Y);
Memory< T > & GetMemory()
Return a reference to the Memory object used by the Array.
int Size() const
Return the logical size of the array.
static void AddSpecialization()
Memory< real_t > & GetMemory()
Return a reference to the Memory object used by the Vector.
int Size() const
Returns the size of the vector.
occa::memory OccaMemoryReadWrite(Memory< T > &mem, size_t size)
Wrap a Memory object as occa::memory for read-write access with the mfem::Device MemoryClass....
std::map< occa_id_t, occa::kernel > occa_kernel_t
const occa::memory OccaMemoryRead(const Memory< T > &mem, size_t size)
Wrap a Memory object as occa::memory for read only access with the mfem::Device MemoryClass....
occa::device & OccaDev()
Return the default occa::device used by MFEM.
std::pair< int, int > occa_id_t