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
15106d9f
Commit
15106d9f
authored
5 years ago
by
Matthieu Schaller
Browse files
Options
Downloads
Patches
Plain Diff
Changed the char atomic max to a int8_t atomic max
parent
001c818b
No related branches found
No related tags found
1 merge request
!1048
Atomic gravity and time-step limiter
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/atomic.h
+6
-3
6 additions, 3 deletions
src/atomic.h
with
6 additions
and
3 deletions
src/atomic.h
+
6
−
3
View file @
15106d9f
...
...
@@ -26,6 +26,9 @@
#include
"inline.h"
#include
"minmax.h"
/* Standard includes */
#include
<stdint.h>
#define atomic_add(v, i) __sync_fetch_and_add(v, i)
#define atomic_sub(v, i) __sync_fetch_and_sub(v, i)
#define atomic_or(v, i) __sync_fetch_and_or(v, i)
...
...
@@ -122,7 +125,7 @@ __attribute__((always_inline)) INLINE static void atomic_min_d(
}
/**
* @brief Atomic max operation on
chars
.
* @brief Atomic max operation on
int8_t
.
*
* This is a text-book implementation based on an atomic CAS.
*
...
...
@@ -130,9 +133,9 @@ __attribute__((always_inline)) INLINE static void atomic_min_d(
* @param y The value to update the address with.
*/
__attribute__
((
always_inline
))
INLINE
static
void
atomic_max_c
(
volatile
char
*
const
address
,
const
char
y
)
{
volatile
int8_t
*
const
address
,
const
int8_t
y
)
{
char
test_val
,
old_val
,
new_val
;
int8_t
test_val
,
old_val
,
new_val
;
old_val
=
*
address
;
do
{
...
...
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