Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-scatter
Commits
88b7f56b
Commit
88b7f56b
authored
Dec 20, 2017
by
rusty1s
Browse files
typos
parent
6372815e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
15 deletions
+18
-15
torch_scatter/kernel/THCAtomics.cuh
torch_scatter/kernel/THCAtomics.cuh
+18
-15
No files found.
torch_scatter/kernel/THCAtomics.cuh
View file @
88b7f56b
...
...
@@ -58,29 +58,32 @@ struct AtomicMaxIntegerImpl<T, 4> {
template
<
typename
T
>
struct
AtomicMaxIntegerImpl
<
T
,
8
>
{
inline
__device__
void
operator
()(
T
*
address
,
T
val
)
{
unsigned
long
long
*
address_as_ui
=
(
unsigned
long
long
*
)
(
address
);
unsigned
long
long
old
=
*
address_as_ui
;
unsigned
long
long
newval
;
unsigned
long
long
assumed
;
do
{
assumed
=
old
;
newval
=
val
+
(
T
)
old
;
old
=
atomicCAS
(
address_as_ui
,
assumed
,
newval
);
}
while
(
assumed
!=
old
);
int
*
address_as_ull
=
(
int
*
)
(
address
);
int
newval
=
*
address_as_ull
;
atomicMax
(
address_as_ull
,
newval
);
/* unsigned long long newval; */
/* unsigned long long assumed; */
/* do { */
/* assumed = old; */
/* newval = val + (T)old; */
/* old = atomicCAS(address_as_ui, assumed, newval); */
/* } while (assumed != old); */
}
};
static
inline
__device__
void
atomicMax
(
uint8_t
*
address
,
uint8_t
val
)
{}
static
inline
__device__
void
atomicMax
(
int8_t
*
address
,
int8_t
val
)
{}
static
inline
__device__
void
atomicMax
(
int8_t
*
address
,
int8_t
val
)
{}
static
inline
__device__
void
atomicMax
(
int16_t
*
address
,
int16_t
val
)
{}
static
inline
__device__
void
atomicMax
(
int16_t
*
address
,
int16_t
val
)
{}
static
inline
__device__
void
atomicMax
(
int64_t
*
address
,
int64_t
val
)
{}
static
inline
__device__
void
atomicMax
(
int64_t
*
address
,
int64_t
val
)
{
AtomicMaxIntegerImpl
<
int64_t
,
sizeof
(
int64_t
)
>
()(
address
,
val
);
}
#ifdef CUDA_HALF_TENSOR
static
inline
__device__
void
atomicMax
(
half
*
address
,
half
val
)
{}
static
inline
__device__
void
atomicMax
(
half
*
address
,
half
val
)
{}
#endif
static
inline
__device__
void
atomicMax
(
float
*
address
,
float
val
)
{
...
...
@@ -94,7 +97,7 @@ static inline __device__ void atomicMax(float *address, float val) {
}
while
(
assumed
!=
old
);
}
static
inline
__device__
void
atomicMax
(
double
*
address
,
double
val
)
{
static
inline
__device__
void
atomicMax
(
double
*
address
,
double
val
)
{
unsigned
long
long
int
*
address_as_ull
=
(
unsigned
long
long
int
*
)
address
;
unsigned
long
long
int
old
=
*
address_as_ull
;
unsigned
long
long
int
assumed
;
...
...
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