Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SWIFTsim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
SWIFT
SWIFTsim
Commits
fac83953
Commit
fac83953
authored
7 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Revert "Added some 'const' decoration and better documentation to the atomics to make…"
This reverts commit
28127ee8
parent
28127ee8
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
src/atomic.h
+6
-15
6 additions, 15 deletions
src/atomic.h
with
6 additions
and
15 deletions
src/atomic.h
+
6
−
15
View file @
fac83953
...
@@ -39,16 +39,13 @@
...
@@ -39,16 +39,13 @@
*
*
* This is a text-book implementation based on an atomic CAS.
* This is a text-book implementation based on an atomic CAS.
*
*
* We create a temporary union to cope with the int-only atomic CAS
* and the floating-point min that we want.
*
* @param address The address to update.
* @param address The address to update.
* @param y The value to update the address with.
* @param y The value to update the address with.
*/
*/
__attribute__
((
always_inline
))
INLINE
static
void
atomic_min_f
(
__attribute__
((
always_inline
))
INLINE
static
void
atomic_min_f
(
volatile
float
*
const
address
,
const
float
y
)
{
volatile
float
*
address
,
float
y
)
{
int
*
const
int_ptr
=
(
int
*
const
)
address
;
int
*
int_ptr
=
(
int
*
)
address
;
typedef
union
{
typedef
union
{
float
as_float
;
float
as_float
;
...
@@ -70,16 +67,13 @@ __attribute__((always_inline)) INLINE static void atomic_min_f(
...
@@ -70,16 +67,13 @@ __attribute__((always_inline)) INLINE static void atomic_min_f(
*
*
* This is a text-book implementation based on an atomic CAS.
* This is a text-book implementation based on an atomic CAS.
*
*
* We create a temporary union to cope with the int-only atomic CAS
* and the floating-point max that we want.
*
* @param address The address to update.
* @param address The address to update.
* @param y The value to update the address with.
* @param y The value to update the address with.
*/
*/
__attribute__
((
always_inline
))
INLINE
static
void
atomic_max_f
(
__attribute__
((
always_inline
))
INLINE
static
void
atomic_max_f
(
volatile
float
*
const
address
,
const
float
y
)
{
volatile
float
*
address
,
float
y
)
{
int
*
const
int_ptr
=
(
int
*
const
)
address
;
int
*
int_ptr
=
(
int
*
)
address
;
typedef
union
{
typedef
union
{
float
as_float
;
float
as_float
;
...
@@ -101,16 +95,13 @@ __attribute__((always_inline)) INLINE static void atomic_max_f(
...
@@ -101,16 +95,13 @@ __attribute__((always_inline)) INLINE static void atomic_max_f(
*
*
* This is a text-book implementation based on an atomic CAS.
* This is a text-book implementation based on an atomic CAS.
*
*
* We create a temporary union to cope with the int-only atomic CAS
* and the floating-point add that we want.
*
* @param address The address to update.
* @param address The address to update.
* @param y The value to update the address with.
* @param y The value to update the address with.
*/
*/
__attribute__
((
always_inline
))
INLINE
static
void
atomic_add_f
(
__attribute__
((
always_inline
))
INLINE
static
void
atomic_add_f
(
volatile
float
*
const
address
,
const
float
y
)
{
volatile
float
*
address
,
float
y
)
{
int
*
const
int_ptr
=
(
int
*
const
)
address
;
int
*
int_ptr
=
(
int
*
)
address
;
typedef
union
{
typedef
union
{
float
as_float
;
float
as_float
;
...
...
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