support sincosf on msvc
This commit is contained in:
parent
906fdc7a69
commit
483f653480
|
@ -24,6 +24,7 @@
|
|||
#include <algorithm>
|
||||
#include <thread>
|
||||
#include <tuple>
|
||||
#include <cmath>
|
||||
#include "nlohmann/json.hpp"
|
||||
#include "backend/common/session/anf_runtime_algorithm.h"
|
||||
#include "include/common/utils/anfalgo.h"
|
||||
|
@ -1387,5 +1388,12 @@ bool AlignedBroadCastShape(size_t align_rank, std::vector<size_t> *broadcast, st
|
|||
return true;
|
||||
}
|
||||
} // namespace broadcast_utils
|
||||
|
||||
namespace math {
|
||||
void SinCosf(float x, float *sinv, float *cosv) {
|
||||
*sinv = sinf(x);
|
||||
*cosv = cosf(x);
|
||||
}
|
||||
} // namespace math
|
||||
} // namespace kernel
|
||||
} // namespace mindspore
|
||||
|
|
|
@ -402,6 +402,10 @@ bool AlignedBroadCastShape(size_t align_rank, std::vector<size_t> *broadcast, st
|
|||
std::vector<size_t> *rhs);
|
||||
} // namespace broadcast_utils
|
||||
|
||||
namespace math {
|
||||
void SinCosf(float x, float *sinv, float *cosv);
|
||||
}
|
||||
|
||||
#define CHECK_KERNEL_INPUTS_NUM(actual_inputs_num, expect_inputs_num, kernel_name) \
|
||||
do { \
|
||||
if ((actual_inputs_num) != (expect_inputs_num)) { \
|
||||
|
|
|
@ -179,7 +179,7 @@ class PMEEnergyGpuKernelMod : public DeprecatedNativeGpuKernelMod {
|
|||
cufftComplex expc(cufftComplex z) {
|
||||
cufftComplex res;
|
||||
float t = expf(z.x);
|
||||
sincosf(z.y, &res.y, &res.x);
|
||||
mindspore::kernel::math::SinCosf(z.y, &res.y, &res.x);
|
||||
res.x *= t;
|
||||
res.y *= t;
|
||||
return res;
|
||||
|
|
|
@ -209,7 +209,7 @@ class PMEEnergyUpdateGpuKernelMod : public DeprecatedNativeGpuKernelMod {
|
|||
cufftComplex expc(cufftComplex z) {
|
||||
cufftComplex res;
|
||||
float t = expf(z.x);
|
||||
sincosf(z.y, &res.y, &res.x);
|
||||
mindspore::kernel::math::SinCosf(z.y, &res.y, &res.x);
|
||||
res.x *= t;
|
||||
res.y *= t;
|
||||
return res;
|
||||
|
|
|
@ -161,7 +161,7 @@ class PMEReciprocalForceGpuKernelMod : public DeprecatedNativeGpuKernelMod {
|
|||
cufftComplex expc(cufftComplex z) {
|
||||
cufftComplex res;
|
||||
float t = expf(z.x);
|
||||
sincosf(z.y, &res.y, &res.x);
|
||||
mindspore::kernel::math::SinCosf(z.y, &res.y, &res.x);
|
||||
res.x *= t;
|
||||
res.y *= t;
|
||||
return res;
|
||||
|
|
|
@ -185,7 +185,7 @@ class PMEReciprocalForceUpdateGpuKernelMod : public DeprecatedNativeGpuKernelMod
|
|||
cufftComplex expc(cufftComplex z) {
|
||||
cufftComplex res;
|
||||
float t = expf(z.x);
|
||||
sincosf(z.y, &res.y, &res.x);
|
||||
mindspore::kernel::math::SinCosf(z.y, &res.y, &res.x);
|
||||
res.x *= t;
|
||||
res.y *= t;
|
||||
return res;
|
||||
|
|
Loading…
Reference in New Issue