Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
DKS
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Code Review
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Uldis Locans
DKS
Commits
3d946f66
Commit
3d946f66
authored
Jan 22, 2019
by
suter_a
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added the two new muSR functions ifgk and ifll (CUDA/OpenCL).
parent
e6021eb6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
100 additions
and
0 deletions
+100
-0
src/CUDA/NVRTCKernels/CudaChiSquareKernel.cu
src/CUDA/NVRTCKernels/CudaChiSquareKernel.cu
+50
-0
src/OpenCL/OpenCLKernels/OpenCLChiSquareRuntime.cl
src/OpenCL/OpenCLKernels/OpenCLChiSquareRuntime.cl
+50
-0
No files found.
src/CUDA/NVRTCKernels/CudaChiSquareKernel.cu
View file @
3d946f66
...
...
@@ -83,6 +83,56 @@ __device__ double ifld(double t, double alpha, double phi, double nu, double lam
return
alpha
*
cos
(
wt
+
ph
)
*
exp
(
-
lambdaT
*
t
)
+
(
1.0
-
alpha
)
*
exp
(
-
lambdaL
*
t
);
}
__device__
double
ifgk
(
double
t
,
double
alpha
,
double
nu
,
double
sigma
,
double
lambda
,
double
beta
)
{
double
wt
=
TWO_PI
*
nu
*
t
;
double
rate2
=
sigma
*
sigma
*
t
*
t
;
double
rateL
=
0.0
;
double
result
=
0.0
;
// make sure lambda > 0
if
(
lambda
<
0.0
)
return
0.0
;
if
(
beta
<
0.001
)
{
rateL
=
1.0
;
}
else
{
rateL
=
pow
(
lambda
*
t
,
beta
);
}
if
(
nu
<
0.01
)
{
result
=
(
1.0
-
alpha
)
*
exp
(
-
rateL
)
+
alpha
*
(
1.0
-
rate2
)
*
exp
(
-
0.5
*
rate2
);
}
else
{
result
=
(
1.0
-
alpha
)
*
exp
(
-
rateL
)
+
alpha
*
(
cos
(
wt
)
-
sigma
*
sigma
*
t
*
t
/
(
wt
)
*
sin
(
wt
))
*
exp
(
-
0.5
*
rate2
);
}
return
result
;
}
__device__
double
ifll
(
double
t
,
double
alpha
,
double
nu
,
double
a
,
double
lambda
,
double
beta
)
{
double
wt
=
TWO_PI
*
nu
*
t
;
double
at
=
a
*
t
;
double
rateL
=
0.0
;
double
result
=
0.0
;
// make sure lambda > 0
if
(
lambda
<
0.0
)
return
0.0
;
if
(
beta
<
0.001
)
{
rateL
=
1.0
;
}
else
{
rateL
=
pow
(
lambda
*
t
,
beta
);
}
if
(
nu
<
0.01
)
{
result
=
(
1.0
-
alpha
)
*
exp
(
-
rateL
)
+
alpha
*
(
1.0
-
at
)
*
exp
(
-
at
);
}
else
{
result
=
(
1.0
-
alpha
)
*
exp
(
-
rateL
)
+
alpha
*
(
cos
(
wt
)
-
a
/
(
TWO_PI
*
nu
)
*
sin
(
wt
))
*
exp
(
-
at
);
}
return
result
;
}
__device__
double
b
(
double
t
,
double
phi
,
double
nu
)
{
return
j0
(
TWO_PI
*
nu
*
t
+
DEG_TO_RAD
*
phi
);
}
...
...
src/OpenCL/OpenCLKernels/OpenCLChiSquareRuntime.cl
View file @
3d946f66
...
...
@@ -106,6 +106,56 @@ double ifld(double t, double alpha, double phi, double nu, double lambdaT, doubl
return
alpha*cos
(
wt+ph
)
*exp
(
-lambdaT*t
)
+
(
1.0-alpha
)
*exp
(
-lambdaL*t
)
;
}
double
ifgk
(
double
t
,
double
alpha,
double
nu,
double
sigma,
double
lambda,
double
beta
)
{
double
wt
=
TWO_PI*nu*t
;
double
rate2
=
sigma*sigma*t*t
;
double
rateL
=
0.0
;
double
result
=
0.0
;
//
make
sure
lambda
>
0
if
(
lambda
<
0.0
)
return
0.0
;
if
(
beta
<
0.001
)
{
rateL
=
1.0
;
}
else
{
rateL
=
pow
(
lambda*t,
beta
)
;
}
if
(
nu
<
0.01
)
{
result
=
(
1.0-alpha
)
*exp
(
-rateL
)
+
alpha*
(
1.0-rate2
)
*exp
(
-0.5*rate2
)
;
}
else
{
result
=
(
1.0-alpha
)
*exp
(
-rateL
)
+
alpha*
(
cos
(
wt
)
-sigma*sigma*t*t/
(
wt
)
*sin
(
wt
))
*exp
(
-0.5*rate2
)
;
}
return
result
;
}
double
ifll
(
double
t
,
double
alpha,
double
nu,
double
a,
double
lambda,
double
beta
)
{
double
wt
=
TWO_PI*nu*t
;
double
at
=
a*t
;
double
rateL
=
0.0
;
double
result
=
0.0
;
//
make
sure
lambda
>
0
if
(
lambda
<
0.0
)
return
0.0
;
if
(
beta
<
0.001
)
{
rateL
=
1.0
;
}
else
{
rateL
=
pow
(
lambda*t,
beta
)
;
}
if
(
nu
<
0.01
)
{
result
=
(
1.0-alpha
)
*exp
(
-rateL
)
+
alpha*
(
1.0-at
)
*exp
(
-at
)
;
}
else
{
result
=
(
1.0-alpha
)
*exp
(
-rateL
)
+
alpha*
(
cos
(
wt
)
-a/
(
TWO_PI*nu
)
*sin
(
wt
))
*exp
(
-at
)
;
}
return
result
;
}
double
b
(
double
t
,
double
phi,
double
nu
)
{
return
bessj0
(
TWO_PI*nu*t
+
DEG_TO_RAD*phi
)
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment