added support for lgammaf and lgamma
1. Implementation inside HIP Change-Id: I657263b7276a57c56081d3336fef816b5f204eff
This commit is contained in:
@@ -66,7 +66,7 @@ __device__ float j0f(float x);
|
||||
__device__ float j1f(float x);
|
||||
__device__ float jnf(int n, float x);
|
||||
__device__ float ldexpf(float x, int exp);
|
||||
//__device__ float lgammaf(float x);
|
||||
__device__ float lgammaf(float x);
|
||||
__device__ long long int llrintf(float x);
|
||||
__device__ long long int llroundf(float x);
|
||||
__device__ float log10f(float x);
|
||||
|
||||
@@ -188,8 +188,12 @@ __device__ float ldexpf(float x, int exp)
|
||||
}
|
||||
__device__ float lgammaf(float x)
|
||||
{
|
||||
int sign;
|
||||
return hc::precise_math::lgammaf(x, &sign);
|
||||
float val = 0.0f;
|
||||
float y = x - 1;
|
||||
while(y > 0){
|
||||
val += logf(y--);
|
||||
}
|
||||
return val;
|
||||
}
|
||||
__device__ long long int llrintf(float x)
|
||||
{
|
||||
@@ -570,8 +574,12 @@ __device__ double ldexp(double x, int exp)
|
||||
}
|
||||
__device__ double lgamma(double x)
|
||||
{
|
||||
int sign;
|
||||
return hc::precise_math::lgamma(x, &sign);
|
||||
double val = 0.0;
|
||||
double y = x - 1;
|
||||
while(y > 0){
|
||||
val += log(y--);
|
||||
}
|
||||
return val;
|
||||
}
|
||||
__device__ long long int llrint(double x)
|
||||
{
|
||||
|
||||
Viittaa uudesa ongelmassa
Block a user