18MassIntegrator::Kernels::Kernels()
78void OccaPAMassApply2D(
const int D1D,
87 occa::properties props;
88 props[
"defines/D1D"] = D1D;
89 props[
"defines/Q1D"] = Q1D;
95 const occa_id_t id = std::make_pair(D1D,Q1D);
96 if (!Device::Allows(Backend::OCCA_CUDA))
99 if (OccaMassApply2D_cpu.find(
id) == OccaMassApply2D_cpu.end())
101 const occa::kernel MassApply2D_CPU =
103 "MassApply2D_CPU", props);
104 OccaMassApply2D_cpu.emplace(
id, MassApply2D_CPU);
106 OccaMassApply2D_cpu.at(
id)(NE, o_B, o_Bt, o_D, o_X, o_Y);
110 static occa_kernel_t OccaMassApply2D_gpu;
111 if (OccaMassApply2D_gpu.find(
id) == OccaMassApply2D_gpu.end())
113 const occa::kernel MassApply2D_GPU =
115 "MassApply2D_GPU", props);
116 OccaMassApply2D_gpu.emplace(
id, MassApply2D_GPU);
118 OccaMassApply2D_gpu.at(
id)(NE, o_B, o_Bt, o_D, o_X, o_Y);
122void OccaPAMassApply3D(
const int D1D,
125 const Array<real_t> &B,
126 const Array<real_t> &Bt,
131 occa::properties props;
132 props[
"defines/D1D"] = D1D;
133 props[
"defines/Q1D"] = Q1D;
135 const occa::memory o_Bt =
OccaMemoryRead(Bt.GetMemory(), Bt.Size());
139 const occa_id_t id = std::make_pair(D1D,Q1D);
140 if (!Device::Allows(Backend::OCCA_CUDA))
143 if (OccaMassApply3D_cpu.find(
id) == OccaMassApply3D_cpu.end())
145 const occa::kernel MassApply3D_CPU =
147 "MassApply3D_CPU", props);
148 OccaMassApply3D_cpu.emplace(
id, MassApply3D_CPU);
150 OccaMassApply3D_cpu.at(
id)(NE, o_B, o_Bt, o_D, o_X, o_Y);
155 if (OccaMassApply3D_gpu.find(
id) == OccaMassApply3D_gpu.end())
157 const occa::kernel MassApply3D_GPU =
159 "MassApply3D_GPU", props);
160 OccaMassApply3D_gpu.emplace(
id, MassApply3D_GPU);
162 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