45void OccaPAMassApply2D(
const int D1D,
54 occa::properties props;
55 props[
"defines/D1D"] = D1D;
56 props[
"defines/Q1D"] = Q1D;
62 const occa_id_t id = std::make_pair(D1D,Q1D);
63 if (!Device::Allows(Backend::OCCA_CUDA))
66 if (OccaMassApply2D_cpu.find(
id) == OccaMassApply2D_cpu.end())
68 const occa::kernel MassApply2D_CPU =
70 "MassApply2D_CPU", props);
71 OccaMassApply2D_cpu.emplace(
id, MassApply2D_CPU);
73 OccaMassApply2D_cpu.at(
id)(NE, o_B, o_Bt, o_D, o_X, o_Y);
77 static occa_kernel_t OccaMassApply2D_gpu;
78 if (OccaMassApply2D_gpu.find(
id) == OccaMassApply2D_gpu.end())
80 const occa::kernel MassApply2D_GPU =
82 "MassApply2D_GPU", props);
83 OccaMassApply2D_gpu.emplace(
id, MassApply2D_GPU);
85 OccaMassApply2D_gpu.at(
id)(NE, o_B, o_Bt, o_D, o_X, o_Y);
89void OccaPAMassApply3D(
const int D1D,
92 const Array<real_t> &B,
93 const Array<real_t> &Bt,
98 occa::properties props;
99 props[
"defines/D1D"] = D1D;
100 props[
"defines/Q1D"] = Q1D;
102 const occa::memory o_Bt =
OccaMemoryRead(Bt.GetMemory(), Bt.Size());
106 const occa_id_t id = std::make_pair(D1D,Q1D);
107 if (!Device::Allows(Backend::OCCA_CUDA))
110 if (OccaMassApply3D_cpu.find(
id) == OccaMassApply3D_cpu.end())
112 const occa::kernel MassApply3D_CPU =
114 "MassApply3D_CPU", props);
115 OccaMassApply3D_cpu.emplace(
id, MassApply3D_CPU);
117 OccaMassApply3D_cpu.at(
id)(NE, o_B, o_Bt, o_D, o_X, o_Y);
122 if (OccaMassApply3D_gpu.find(
id) == OccaMassApply3D_gpu.end())
124 const occa::kernel MassApply3D_GPU =
126 "MassApply3D_GPU", props);
127 OccaMassApply3D_gpu.emplace(
id, MassApply3D_GPU);
129 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