FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
taskflow/taskflow/cuda/cuda_error.hpp at master · githubCode3a/taskflow · GitHub
githubCode3a
/
taskflow
Public
forked from
taskflow/taskflow
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
taskflow
/
taskflow
/
cuda
/
cuda_error.hpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
31 lines (26 loc) · 1.34 KB
Breadcrumbs
taskflow
/
taskflow
/
cuda
/
cuda_error.hpp
Copy path
File metadata and controls
31 lines (26 loc) · 1.34 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
pragma
once
#
include
<
cuda.h
>
#
include
<
iostream
>
#
include
<
sstream
>
#
include
<
exception
>
#
include
"
../utility/stream.hpp
"
#
define
TF_CUDA_REMOVE_FIRST_HELPER
(N, ...) __VA_ARGS__
#
define
TF_CUDA_REMOVE_FIRST
(...)
TF_CUDA_REMOVE_FIRST_HELPER
(__VA_ARGS__)
#
define
TF_CUDA_GET_FIRST_HELPER
(N, ...) N
#
define
TF_CUDA_GET_FIRST
(...)
TF_CUDA_GET_FIRST_HELPER
(__VA_ARGS__)
#
define
TF_CHECK_CUDA
(...) \
if
(
TF_CUDA_GET_FIRST
(__VA_ARGS__) != cudaSuccess) { \
std::ostringstream oss; \
auto
ev =
TF_CUDA_GET_FIRST
(__VA_ARGS__); \
auto
unknown_str =
"
unknown error
"
; \
auto
unknown_name =
"
cudaErrorUnknown
"
; \
auto
error_str = ::
cudaGetErrorString
(ev); \
auto
error_name = ::
cudaGetErrorName
(ev); \
oss <<
"
[
"
<< __FILE__ <<
"
:
"
<< __LINE__ <<
"
]
"
\
<< (error_str ? error_str : unknown_str) \
<<
"
(
"
\
<< (error_name ? error_name : unknown_name) \
<<
"
) -
"
; \
tf::ostreamize
(oss,
TF_CUDA_REMOVE_FIRST
(__VA_ARGS__)); \
throw
std::runtime_error
(oss.
str
()); \
}
Back
|
FazBrowse Home
|
New Git URL