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
ColossalAI
Commits
10afec72
Commit
10afec72
authored
Apr 02, 2022
by
Xue Fuzhao
Committed by
binmakeswell
Apr 06, 2022
Browse files
[NFC] polish colossalai/kernel/cuda_native/csrc/kernels/include/cuda_util.h code style (#641)
parent
055d0270
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
colossalai/kernel/cuda_native/csrc/kernels/include/cuda_util.h
...salai/kernel/cuda_native/csrc/kernels/include/cuda_util.h
+3
-4
colossalai/kernel/cuda_native/csrc/kernels/include/dropout.h
colossalai/kernel/cuda_native/csrc/kernels/include/dropout.h
+4
-5
No files found.
colossalai/kernel/cuda_native/csrc/kernels/include/cuda_util.h
View file @
10afec72
...
...
@@ -20,8 +20,7 @@ void check_gpu_error(T result, char const *const func, const char *const file,
template
<
typename
T
>
void
print_vec
(
const
T
*
outv
,
std
::
string
outn
,
int
num_output_ele
);
template
<
typename
T
>
T
*
cuda_malloc
(
size_t
ele_num
);
template
<
typename
T
>
T
*
cuda_malloc
(
size_t
ele_num
);
void
cuda_free
(
void
*
pdata
);
...
...
@@ -29,6 +28,6 @@ template <typename T>
void
check_nan_inf
(
const
T
*
data_ptr
,
int
dsize
,
bool
check_nan_inf
,
std
::
string
file
,
int
line
,
cudaStream_t
stream
);
#define CHECK_NAN_INF(ptr, size, stream) \
check_nan_inf((ptr), (size), true, __FILE__, __LINE__, (stream)); \
#define CHECK_NAN_INF(ptr, size, stream)
\
check_nan_inf((ptr), (size), true, __FILE__, __LINE__, (stream));
\
check_nan_inf((ptr), (size), false, __FILE__, __LINE__, (stream))
colossalai/kernel/cuda_native/csrc/kernels/include/dropout.h
View file @
10afec72
#pragma once
#include <string>
#include <cuda.h>
#include <cuda_fp16.h>
#include <stdio.h>
#include <string>
#include "kernels.h"
template
<
typename
T
>
class
Dropout
{
public:
template
<
typename
T
>
class
Dropout
{
public:
struct
Config
{
float
ratio
;
bool
training
;
...
...
@@ -89,7 +88,7 @@ class Dropout {
void
SetTrainingMode
(
bool
training
)
{
_config
.
training
=
training
;
}
private:
private:
uint8_t
*
_mask
;
Config
_config
;
};
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