Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fdt
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FSL
fdt
Commits
109eaed0
Commit
109eaed0
authored
12 years ago
by
Moises Fernandez
Browse files
Options
Downloads
Patches
Plain Diff
Some maths operations used by diffmodels
parent
f44ef5fd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
CUDA/diffmodels_utils.h
+39
-0
39 additions, 0 deletions
CUDA/diffmodels_utils.h
with
39 additions
and
0 deletions
CUDA/diffmodels_utils.h
0 → 100644
+
39
−
0
View file @
109eaed0
#ifndef __DIFFMODELS_UTILS
#define __DIFFMODELS_UTILS
//defined in diffmodels.h
#define two_pi_gpu 0.636619772
//defined in diffmodels.h
#define FSMALL_gpu 0.001
//defined in diffmodels.h
#define f2beta_gpu(f) (asin(double(sqrt(double(f)))))
//defined in diffmodels.h
#define d2lambda_gpu(d) (sqrt(double(d)))
//defined in diffmodels.h
#define beta2f_gpu(beta) (pow(sin(double(beta)),2.0))
//defined in diffmodels.h
#define lambda2d_gpu(lambda) (lambda*lambda)
//defined in diffmodels.h
__device__
inline
double
f2x_gpu
(
double
x
){
return
tan
(
double
((
x
)
/
two_pi
));
}
//defined in diffmodels.h
__device__
inline
double
x2f_gpu
(
double
x
){
return
abs
(
two_pi
*
atan
(
x
));
}
//defined in miscmaths.h
__device__
inline
int
sign_gpu
(
int
x
){
if
(
x
>
0
)
return
1
;
else
{
if
(
x
<
0
)
return
-
1
;
else
return
0
;
}
}
__device__
inline
int
sign_gpu
(
float
x
){
if
(
x
>
0
)
return
1
;
else
{
if
(
x
<
0
)
return
-
1
;
else
return
0
;
}
}
__device__
inline
int
sign_gpu
(
double
x
){
if
(
x
>
0
)
return
1
;
else
{
if
(
x
<
0
)
return
-
1
;
else
return
0
;
}
}
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment