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
gaoqiong
composable_kernel_ROCM
Commits
ee75f0d0
Commit
ee75f0d0
authored
Jul 16, 2024
by
root
Browse files
Simple dbg mode to print error-warrnings etc logs
parent
82e8a78a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
40 additions
and
0 deletions
+40
-0
include/ck/utility/dbg.hpp
include/ck/utility/dbg.hpp
+40
-0
No files found.
include/ck/utility/dbg.hpp
0 → 100644
View file @
ee75f0d0
// SPDX-License-Identifier: MIT
// Copyright (c) 2024, Advanced Micro Devices, Inc. All rights reserved.
#pragma once
#include "ck/ck.hpp"
namespace
ck
{
namespace
dbg
{
template
<
typename
TH
>
void
_dbg
(
const
char
*
sdbg
,
TH
h
)
{
std
::
cerr
<<
sdbg
<<
"="
<<
h
<<
"
\n
"
;
}
template
<
typename
TH
,
typename
...
TA
>
void
_dbg
(
const
char
*
sdbg
,
TH
h
,
TA
...
t
)
{
while
(
*
sdbg
!=
','
)
{
std
::
cerr
<<
*
sdbg
++
;
}
std
::
cerr
<<
"="
<<
h
<<
","
;
_dbg
(
sdbg
+
1
,
t
...);
}
#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#define debugv(x) \
{ \
{ \
std::cerr << #x << " = "; \
FORE(itt, (x)) std::cerr << *itt << ", "; \
std::cerr << "\n"; \
} \
}
#else
#define debug(...) (__VA_ARGS__)
#define debugv(x)
#define std ::cerr if (0) cout
#endif
}
// namespace dbg
}
// namespace ck
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