From: @jiahongqian Reviewed-by: @ljl0711,@wang_zi_dong Signed-off-by: @wang_zi_dongpull/15042/MERGE
| @@ -29,6 +29,5 @@ MS_REG_GPU_KERNEL_TWO(AngleAtomEnergy, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| AngleAtomEnergyGpuKernel, float, int) | AngleAtomEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -29,6 +29,5 @@ MS_REG_GPU_KERNEL_TWO(AngleEnergy, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| AngleEnergyGpuKernel, float, int) | AngleEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -29,6 +29,5 @@ MS_REG_GPU_KERNEL_TWO(AngleForce, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| AngleForceGpuKernel, float, int) | AngleForceGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -30,6 +30,5 @@ MS_REG_GPU_KERNEL_TWO(AngleForceWithAtomEnergy, | |||||
| .AddOutputAttr(kNumberTypeFloat32) | .AddOutputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| AngleForceWithAtomEnergyGpuKernel, float, int) | AngleForceWithAtomEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,6 +28,5 @@ MS_REG_GPU_KERNEL_TWO(BondAtomEnergy, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| BondAtomEnergyCudaGpuKernel, float, int) | BondAtomEnergyCudaGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,6 +28,5 @@ MS_REG_GPU_KERNEL_TWO(BondEnergy, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| BondEnergyCudaGpuKernel, float, int) | BondEnergyCudaGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,6 +28,5 @@ MS_REG_GPU_KERNEL_TWO(BondForce, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| BondForceCudaGpuKernel, float, int) | BondForceCudaGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -29,6 +29,5 @@ MS_REG_GPU_KERNEL_TWO(BondForceWithAtomEnergy, | |||||
| .AddOutputAttr(kNumberTypeFloat32) | .AddOutputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| BondForceWithAtomEnergyGpuKernel, float, int) | BondForceWithAtomEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -29,6 +29,5 @@ MS_REG_GPU_KERNEL_TWO(BondForceWithAtomVirial, | |||||
| .AddOutputAttr(kNumberTypeFloat32) | .AddOutputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| BondForceWithAtomVirialGpuKernel, float, int) | BondForceWithAtomVirialGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -22,6 +22,5 @@ MS_REG_GPU_KERNEL_TWO( | |||||
| CrdToUintCrd, | CrdToUintCrd, | ||||
| KernelAttr().AddInputAttr(kNumberTypeFloat32).AddInputAttr(kNumberTypeFloat32).AddOutputAttr(kNumberTypeUInt32), | KernelAttr().AddInputAttr(kNumberTypeFloat32).AddInputAttr(kNumberTypeFloat32).AddOutputAttr(kNumberTypeUInt32), | ||||
| CrdToUintCrdGpuKernel, float, unsigned int) | CrdToUintCrdGpuKernel, float, unsigned int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,7 +28,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace kernel { | namespace kernel { | ||||
| template <typename T, typename T1> | template <typename T, typename T1> | ||||
| class CrdToUintCrdGpuKernel : public GpuKernel { | class CrdToUintCrdGpuKernel : public GpuKernel { | ||||
| public: | public: | ||||
| @@ -22,6 +22,5 @@ MS_REG_GPU_KERNEL_TWO( | |||||
| GetCenterOfGeometry, | GetCenterOfGeometry, | ||||
| KernelAttr().AddInputAttr(kNumberTypeInt32).AddInputAttr(kNumberTypeFloat32).AddOutputAttr(kNumberTypeFloat32), | KernelAttr().AddInputAttr(kNumberTypeInt32).AddInputAttr(kNumberTypeFloat32).AddOutputAttr(kNumberTypeFloat32), | ||||
| GetCenterOfGeometryGpuKernel, float, int) | GetCenterOfGeometryGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,7 +28,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace kernel { | namespace kernel { | ||||
| template <typename T, typename T1> | template <typename T, typename T1> | ||||
| class GetCenterOfGeometryGpuKernel : public GpuKernel { | class GetCenterOfGeometryGpuKernel : public GpuKernel { | ||||
| public: | public: | ||||
| @@ -26,6 +26,5 @@ MS_REG_GPU_KERNEL_TWO(MDTemperature, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| MDTemperatureGpuKernel, float, int) | MDTemperatureGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,7 +28,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace kernel { | namespace kernel { | ||||
| template <typename T, typename T1> | template <typename T, typename T1> | ||||
| class MDTemperatureGpuKernel : public GpuKernel { | class MDTemperatureGpuKernel : public GpuKernel { | ||||
| public: | public: | ||||
| @@ -22,6 +22,5 @@ MS_REG_GPU_KERNEL_TWO( | |||||
| TransferCrd, | TransferCrd, | ||||
| KernelAttr().AddInputAttr(kNumberTypeFloat32).AddOutputAttr(kNumberTypeFloat32).AddOutputAttr(kNumberTypeFloat32), | KernelAttr().AddInputAttr(kNumberTypeFloat32).AddOutputAttr(kNumberTypeFloat32).AddOutputAttr(kNumberTypeFloat32), | ||||
| TransferGpuKernel, float, int) | TransferGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -33,6 +33,5 @@ MS_REG_GPU_KERNEL_TWO(DihedralAtomEnergy, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| DihedralAtomEnergyGpuKernel, float, int) | DihedralAtomEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -33,6 +33,5 @@ MS_REG_GPU_KERNEL_TWO(DihedralEnergy, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| DihedralEnergyGpuKernel, float, int) | DihedralEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -33,6 +33,5 @@ MS_REG_GPU_KERNEL_TWO(DihedralForce, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| DihedralForceGpuKernel, float, int) | DihedralForceGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -34,6 +34,5 @@ MS_REG_GPU_KERNEL_TWO(DihedralForceWithAtomEnergy, | |||||
| .AddOutputAttr(kNumberTypeFloat32) | .AddOutputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| DihedralForceWithAtomEnergyGpuKernel, float, int) | DihedralForceWithAtomEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -29,6 +29,5 @@ MS_REG_GPU_KERNEL_TWO(LJEnergy, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| LJEnergyGpuKernel, float, int) | LJEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -29,6 +29,5 @@ MS_REG_GPU_KERNEL_TWO(LJForce, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| LJForceGpuKernel, float, int) | LJForceGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -29,6 +29,5 @@ MS_REG_GPU_KERNEL_TWO(LJForceWithPMEDirectForce, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| LJForceWithPMEDirectForceGpuKernel, float, int) | LJForceWithPMEDirectForceGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -29,6 +29,5 @@ MS_REG_GPU_KERNEL_TWO(Dihedral14CFAtomEnergy, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| Dihedral14CFAtomEnergyGpuKernel, float, int) | Dihedral14CFAtomEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,7 +28,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace kernel { | namespace kernel { | ||||
| template <typename T, typename T1> | template <typename T, typename T1> | ||||
| class Dihedral14CFAtomEnergyGpuKernel : public GpuKernel { | class Dihedral14CFAtomEnergyGpuKernel : public GpuKernel { | ||||
| public: | public: | ||||
| @@ -29,6 +29,5 @@ MS_REG_GPU_KERNEL_TWO(Dihedral14CFEnergy, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| Dihedral14CFEnergyGpuKernel, float, int) | Dihedral14CFEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,7 +28,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace kernel { | namespace kernel { | ||||
| template <typename T, typename T1> | template <typename T, typename T1> | ||||
| class Dihedral14CFEnergyGpuKernel : public GpuKernel { | class Dihedral14CFEnergyGpuKernel : public GpuKernel { | ||||
| public: | public: | ||||
| @@ -31,6 +31,5 @@ MS_REG_GPU_KERNEL_TWO(Dihedral14LJAtomEnergy, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| Dihedral14LJAtomEnergyGpuKernel, float, int) | Dihedral14LJAtomEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,7 +28,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace kernel { | namespace kernel { | ||||
| template <typename T, typename T1> | template <typename T, typename T1> | ||||
| class Dihedral14LJAtomEnergyGpuKernel : public GpuKernel { | class Dihedral14LJAtomEnergyGpuKernel : public GpuKernel { | ||||
| public: | public: | ||||
| @@ -33,6 +33,5 @@ MS_REG_GPU_KERNEL_TWO(Dihedral14LJCFForceWithAtomEnergy, | |||||
| .AddOutputAttr(kNumberTypeFloat32) | .AddOutputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| Dihedral14LJCFForceWithAtomEnergyGpuKernel, float, int) | Dihedral14LJCFForceWithAtomEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,7 +28,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace kernel { | namespace kernel { | ||||
| template <typename T, typename T1> | template <typename T, typename T1> | ||||
| class Dihedral14LJCFForceWithAtomEnergyGpuKernel : public GpuKernel { | class Dihedral14LJCFForceWithAtomEnergyGpuKernel : public GpuKernel { | ||||
| public: | public: | ||||
| @@ -31,6 +31,5 @@ MS_REG_GPU_KERNEL_TWO(Dihedral14LJEnergy, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| Dihedral14LJEnergyGpuKernel, float, int) | Dihedral14LJEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,7 +28,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace kernel { | namespace kernel { | ||||
| template <typename T, typename T1> | template <typename T, typename T1> | ||||
| class Dihedral14LJEnergyGpuKernel : public GpuKernel { | class Dihedral14LJEnergyGpuKernel : public GpuKernel { | ||||
| public: | public: | ||||
| @@ -31,6 +31,5 @@ MS_REG_GPU_KERNEL_TWO(Dihedral14LJForce, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| Dihedral14LJForceGpuKernel, float, int) | Dihedral14LJForceGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,7 +28,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace kernel { | namespace kernel { | ||||
| template <typename T, typename T1> | template <typename T, typename T1> | ||||
| class Dihedral14LJForceGpuKernel : public GpuKernel { | class Dihedral14LJForceGpuKernel : public GpuKernel { | ||||
| public: | public: | ||||
| @@ -32,6 +32,5 @@ MS_REG_GPU_KERNEL_TWO(Dihedral14LJForceWithDirectCF, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| Dihedral14LJForceWithDirectCFGpuKernel, float, int) | Dihedral14LJForceWithDirectCFGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,7 +28,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace kernel { | namespace kernel { | ||||
| template <typename T, typename T1> | template <typename T, typename T1> | ||||
| class Dihedral14LJForceWithDirectCFGpuKernel : public GpuKernel { | class Dihedral14LJForceWithDirectCFGpuKernel : public GpuKernel { | ||||
| public: | public: | ||||
| @@ -41,6 +41,5 @@ MS_REG_GPU_KERNEL_TWO(NeighborListUpdate, | |||||
| .AddInputAttr(kNumberTypeInt32) | .AddInputAttr(kNumberTypeInt32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| NeighborListUpdateGpuKernel, int, float) | NeighborListUpdateGpuKernel, int, float) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -27,6 +27,5 @@ MS_REG_GPU_KERNEL_ONE(MDIterationLeapFrog, | |||||
| .AddOutputAttr(kNumberTypeFloat32) | .AddOutputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| MDIterationLeapFrogGpuKernel, float) | MDIterationLeapFrogGpuKernel, float) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -28,7 +28,6 @@ | |||||
| namespace mindspore { | namespace mindspore { | ||||
| namespace kernel { | namespace kernel { | ||||
| template <typename T> | template <typename T> | ||||
| class MDIterationLeapFrogGpuKernel : public GpuKernel { | class MDIterationLeapFrogGpuKernel : public GpuKernel { | ||||
| public: | public: | ||||
| @@ -30,6 +30,5 @@ MS_REG_GPU_KERNEL_TWO(MDIterationLeapFrogLiujian, | |||||
| .AddInputAttr(kNumberTypeFloat32) | .AddInputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| MDIterationLeapFrogLiujianCudaGpuKernel, float, int) | MDIterationLeapFrogLiujianCudaGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -20,6 +20,5 @@ namespace mindspore { | |||||
| namespace kernel { | namespace kernel { | ||||
| MS_REG_GPU_KERNEL_TWO(MDIterationSetupRandState, KernelAttr().AddOutputAttr(kNumberTypeFloat32), | MS_REG_GPU_KERNEL_TWO(MDIterationSetupRandState, KernelAttr().AddOutputAttr(kNumberTypeFloat32), | ||||
| MDIterationSetupRandStateGpuKernel, float, int) | MDIterationSetupRandStateGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -32,6 +32,5 @@ MS_REG_GPU_KERNEL_TWO(PMEEnergy, | |||||
| .AddOutputAttr(kNumberTypeFloat32) | .AddOutputAttr(kNumberTypeFloat32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| PMEEnergyGpuKernel, float, int) | PMEEnergyGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -42,10 +42,7 @@ class PMEEnergyGpuKernel : public GpuKernel { | |||||
| float box_length_0 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_0")); | float box_length_0 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_0")); | ||||
| float box_length_1 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_1")); | float box_length_1 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_1")); | ||||
| float box_length_2 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_2")); | float box_length_2 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_2")); | ||||
| std::vector<float> h_box_length(3); | |||||
| h_box_length[0] = box_length_0; | |||||
| h_box_length[1] = box_length_1; | |||||
| h_box_length[2] = box_length_2; | |||||
| std::vector<float> h_box_length{box_length_0, box_length_1, box_length_2}; | |||||
| VECTOR *box_length = reinterpret_cast<VECTOR *>(h_box_length.data()); | VECTOR *box_length = reinterpret_cast<VECTOR *>(h_box_length.data()); | ||||
| cufftPlan3d(&PME_plan_r2c, fftx, ffty, fftz, CUFFT_R2C); | cufftPlan3d(&PME_plan_r2c, fftx, ffty, fftz, CUFFT_R2C); | ||||
| cufftPlan3d(&PME_plan_c2r, fftx, ffty, fftz, CUFFT_C2R); | cufftPlan3d(&PME_plan_c2r, fftx, ffty, fftz, CUFFT_C2R); | ||||
| @@ -191,6 +188,7 @@ class PMEEnergyGpuKernel : public GpuKernel { | |||||
| res.y *= t; | res.y *= t; | ||||
| return res; | return res; | ||||
| } | } | ||||
| float M_(float u, int n) { | float M_(float u, int n) { | ||||
| if (n == 2) { | if (n == 2) { | ||||
| if (u > 2 || u < 0) return 0; | if (u > 2 || u < 0) return 0; | ||||
| @@ -199,6 +197,7 @@ class PMEEnergyGpuKernel : public GpuKernel { | |||||
| return u / (n - 1) * M_(u, n - 1) + (n - u) / (n - 1) * M_(u - 1, n - 1); | return u / (n - 1) * M_(u, n - 1) + (n - u) / (n - 1) * M_(u - 1, n - 1); | ||||
| } | } | ||||
| } | } | ||||
| float getb(int k, int NFFT, int B_order) { | float getb(int k, int NFFT, int B_order) { | ||||
| cufftComplex tempc, tempc2, res; | cufftComplex tempc, tempc2, res; | ||||
| float tempf; | float tempf; | ||||
| @@ -211,7 +210,12 @@ class PMEEnergyGpuKernel : public GpuKernel { | |||||
| for (int kk = 0; kk < (B_order - 1); kk++) { | for (int kk = 0; kk < (B_order - 1); kk++) { | ||||
| tempc.x = 0; | tempc.x = 0; | ||||
| tempc.y = 2 * PI * k / NFFT * kk; | |||||
| if (NFFT == 0) { | |||||
| MS_LOG(ERROR) << "Divide by zero."; | |||||
| break; | |||||
| } else { | |||||
| tempc.y = 2 * PI * k / NFFT * kk; | |||||
| } | |||||
| tempc = expc(tempc); | tempc = expc(tempc); | ||||
| tempf = M_(kk + 1, B_order); | tempf = M_(kk + 1, B_order); | ||||
| tempc2.x += tempf * tempc.x; | tempc2.x += tempf * tempc.x; | ||||
| @@ -27,6 +27,5 @@ MS_REG_GPU_KERNEL_TWO(PMEExcludedForce, | |||||
| .AddInputAttr(kNumberTypeInt32) | .AddInputAttr(kNumberTypeInt32) | ||||
| .AddOutputAttr(kNumberTypeFloat32), | .AddOutputAttr(kNumberTypeFloat32), | ||||
| PMEExcludedForceGpuKernel, float, int) | PMEExcludedForceGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -21,6 +21,5 @@ MS_REG_GPU_KERNEL_TWO( | |||||
| PMEReciprocalForce, | PMEReciprocalForce, | ||||
| KernelAttr().AddInputAttr(kNumberTypeUInt32).AddInputAttr(kNumberTypeFloat32).AddOutputAttr(kNumberTypeFloat32), | KernelAttr().AddInputAttr(kNumberTypeUInt32).AddInputAttr(kNumberTypeFloat32).AddOutputAttr(kNumberTypeFloat32), | ||||
| PMEReciprocalForceGpuKernel, float, int) | PMEReciprocalForceGpuKernel, float, int) | ||||
| } // namespace kernel | } // namespace kernel | ||||
| } // namespace mindspore | } // namespace mindspore | ||||
| @@ -46,10 +46,7 @@ class PMEReciprocalForceGpuKernel : public GpuKernel { | |||||
| float box_length_0 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_0")); | float box_length_0 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_0")); | ||||
| float box_length_1 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_1")); | float box_length_1 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_1")); | ||||
| float box_length_2 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_2")); | float box_length_2 = static_cast<float>(GetAttr<float_t>(kernel_node, "box_length_2")); | ||||
| std::vector<float> h_box_length(3); | |||||
| h_box_length[0] = box_length_0; | |||||
| h_box_length[1] = box_length_1; | |||||
| h_box_length[2] = box_length_2; | |||||
| std::vector<float> h_box_length{box_length_0, box_length_1, box_length_2}; | |||||
| VECTOR *box_length = reinterpret_cast<VECTOR *>(h_box_length.data()); | VECTOR *box_length = reinterpret_cast<VECTOR *>(h_box_length.data()); | ||||
| PME_inverse_box_vector.x = static_cast<float>(fftx) / box_length[0].x; | PME_inverse_box_vector.x = static_cast<float>(fftx) / box_length[0].x; | ||||
| PME_inverse_box_vector.y = static_cast<float>(ffty) / box_length[0].y; | PME_inverse_box_vector.y = static_cast<float>(ffty) / box_length[0].y; | ||||
| @@ -170,6 +167,7 @@ class PMEReciprocalForceGpuKernel : public GpuKernel { | |||||
| res.y *= t; | res.y *= t; | ||||
| return res; | return res; | ||||
| } | } | ||||
| float M_(float u, int n) { | float M_(float u, int n) { | ||||
| if (n == 2) { | if (n == 2) { | ||||
| if (u > 2 || u < 0) return 0; | if (u > 2 || u < 0) return 0; | ||||
| @@ -178,6 +176,7 @@ class PMEReciprocalForceGpuKernel : public GpuKernel { | |||||
| return u / (n - 1) * M_(u, n - 1) + (n - u) / (n - 1) * M_(u - 1, n - 1); | return u / (n - 1) * M_(u, n - 1) + (n - u) / (n - 1) * M_(u - 1, n - 1); | ||||
| } | } | ||||
| } | } | ||||
| float getb(int k, int NFFT, int B_order) { | float getb(int k, int NFFT, int B_order) { | ||||
| cufftComplex tempc, tempc2, res; | cufftComplex tempc, tempc2, res; | ||||
| float tempf; | float tempf; | ||||
| @@ -190,7 +189,12 @@ class PMEReciprocalForceGpuKernel : public GpuKernel { | |||||
| for (int kk = 0; kk < (B_order - 1); kk++) { | for (int kk = 0; kk < (B_order - 1); kk++) { | ||||
| tempc.x = 0; | tempc.x = 0; | ||||
| tempc.y = 2 * PI * k / NFFT * kk; | |||||
| if (NFFT == 0) { | |||||
| MS_LOG(ERROR) << "Divide by zero."; | |||||
| break; | |||||
| } else { | |||||
| tempc.y = 2 * PI * k / NFFT * kk; | |||||
| } | |||||
| tempc = expc(tempc); | tempc = expc(tempc); | ||||
| tempf = M_(kk + 1, B_order); | tempf = M_(kk + 1, B_order); | ||||
| tempc2.x += tempf * tempc.x; | tempc2.x += tempf * tempc.x; | ||||
| @@ -1833,6 +1833,9 @@ class PMEReciprocalForce(PrimitiveWithInfer): | |||||
| validator.check_value_type('fftx', fftx, (int), self.name) | validator.check_value_type('fftx', fftx, (int), self.name) | ||||
| validator.check_value_type('ffty', ffty, (int), self.name) | validator.check_value_type('ffty', ffty, (int), self.name) | ||||
| validator.check_value_type('fftz', fftz, (int), self.name) | validator.check_value_type('fftz', fftz, (int), self.name) | ||||
| validator.check_value_type('box_length_0', box_length_0, (float), self.name) | |||||
| validator.check_value_type('box_length_1', box_length_1, (float), self.name) | |||||
| validator.check_value_type('box_length_2', box_length_2, (float), self.name) | |||||
| self.atom_numbers = atom_numbers | self.atom_numbers = atom_numbers | ||||
| self.beta = beta | self.beta = beta | ||||
| self.fftx = fftx | self.fftx = fftx | ||||
| @@ -2002,6 +2005,9 @@ class PMEEnergy(PrimitiveWithInfer): | |||||
| validator.check_value_type('fftx', fftx, (int), self.name) | validator.check_value_type('fftx', fftx, (int), self.name) | ||||
| validator.check_value_type('ffty', ffty, (int), self.name) | validator.check_value_type('ffty', ffty, (int), self.name) | ||||
| validator.check_value_type('fftz', fftz, (int), self.name) | validator.check_value_type('fftz', fftz, (int), self.name) | ||||
| validator.check_value_type('box_length_0', box_length_0, (float), self.name) | |||||
| validator.check_value_type('box_length_1', box_length_1, (float), self.name) | |||||
| validator.check_value_type('box_length_2', box_length_2, (float), self.name) | |||||
| self.atom_numbers = atom_numbers | self.atom_numbers = atom_numbers | ||||
| self.excluded_numbers = excluded_numbers | self.excluded_numbers = excluded_numbers | ||||
| self.beta = beta | self.beta = beta | ||||