Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pyopencl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Andreas Klöckner
pyopencl
Commits
a2130ba1
Commit
a2130ba1
authored
10 years ago
by
Yichao Yu
Browse files
Options
Downloads
Patches
Plain Diff
improve trace output
parent
bf49b059
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/c_wrapper/error.h
+11
-2
11 additions, 2 deletions
src/c_wrapper/error.h
src/c_wrapper/utils.h
+3
-9
3 additions, 9 deletions
src/c_wrapper/utils.h
with
14 additions
and
11 deletions
src/c_wrapper/error.h
+
11
−
2
View file @
a2130ba1
...
@@ -97,6 +97,12 @@ struct __CLPost<T, decltype((void)(std::declval<T>().post()))> {
...
@@ -97,6 +97,12 @@ struct __CLPost<T, decltype((void)(std::declval<T>().post()))> {
}
}
};
};
template
<
typename
T
,
class
=
void
>
struct
is_out_arg
:
std
::
false_type
{};
template
<
typename
T
>
struct
is_out_arg
<
T
,
enable_if_t
<
rm_ref_t
<
T
>::
is_out
>
>
:
std
::
true_type
{};
template
<
typename
T
,
class
=
void
>
template
<
typename
T
,
class
=
void
>
struct
__CLPrintOut
{
struct
__CLPrintOut
{
static
PYOPENCL_INLINE
void
static
PYOPENCL_INLINE
void
...
@@ -106,7 +112,7 @@ struct __CLPrintOut {
...
@@ -106,7 +112,7 @@ struct __CLPrintOut {
};
};
template
<
typename
T
>
template
<
typename
T
>
struct
__CLPrintOut
<
T
,
enable_if_t
<
rm_ref_t
<
T
>::
is_out
>
>
{
struct
__CLPrintOut
<
T
,
enable_if_t
<
is_out_arg
<
T
>::
value
>
>
{
static
inline
void
static
inline
void
call
(
T
v
,
std
::
ostream
&
stm
)
call
(
T
v
,
std
::
ostream
&
stm
)
{
{
...
@@ -125,6 +131,9 @@ struct __CLPrint {
...
@@ -125,6 +131,9 @@ struct __CLPrint {
}
else
{
}
else
{
first
=
false
;
first
=
false
;
}
}
if
(
is_out_arg
<
T
>::
value
)
{
stm
<<
"{out}"
;
}
v
.
print
(
stm
);
v
.
print
(
stm
);
}
}
};
};
...
@@ -162,7 +171,7 @@ class CLArgPack : public ArgPack<CLArg, Types...> {
...
@@ -162,7 +171,7 @@ class CLArgPack : public ArgPack<CLArg, Types...> {
std
::
cerr
<<
name
<<
"("
;
std
::
cerr
<<
name
<<
"("
;
__CLCall
<
__CLPrint
,
sizeof
...(
Types
)
-
1
,
__CLCall
<
__CLPrint
,
sizeof
...(
Types
)
-
1
,
decltype
(
*
that
)
>::
call
(
*
that
,
std
::
cerr
,
true
);
decltype
(
*
that
)
>::
call
(
*
that
,
std
::
cerr
,
true
);
std
::
cerr
<<
") = ("
<<
res
;
std
::
cerr
<<
") = (
ret:
"
<<
res
;
__CLCall
<
__CLPrintOut
,
sizeof
...(
Types
)
-
1
,
__CLCall
<
__CLPrintOut
,
sizeof
...(
Types
)
-
1
,
decltype
(
*
that
)
>::
call
(
*
that
,
std
::
cerr
);
decltype
(
*
that
)
>::
call
(
*
that
,
std
::
cerr
);
std
::
cerr
<<
")"
<<
std
::
endl
;
std
::
cerr
<<
")"
<<
std
::
endl
;
...
...
This diff is collapsed.
Click to expand it.
src/c_wrapper/utils.h
+
3
−
9
View file @
a2130ba1
...
@@ -137,9 +137,7 @@ struct CLGenericArgPrinter<std::nullptr_t, void> {
...
@@ -137,9 +137,7 @@ struct CLGenericArgPrinter<std::nullptr_t, void> {
};
};
template
<
typename
T
,
class
=
void
>
template
<
typename
T
,
class
=
void
>
struct
CLGenericArgOut
{
struct
CLGenericArgOut
:
std
::
false_type
{};
constexpr
static
bool
value
=
false
;
};
template
<
typename
T
,
class
=
void
>
template
<
typename
T
,
class
=
void
>
class
CLArg
{
class
CLArg
{
...
@@ -411,16 +409,12 @@ template<typename T>
...
@@ -411,16 +409,12 @@ template<typename T>
using
pyopencl_buf_ele_t
=
typename
rm_ref_t
<
T
>::
element_type
;
using
pyopencl_buf_ele_t
=
typename
rm_ref_t
<
T
>::
element_type
;
template
<
typename
T
,
class
=
void
>
template
<
typename
T
,
class
=
void
>
struct
is_pyopencl_buf
{
struct
is_pyopencl_buf
:
std
::
false_type
{};
constexpr
static
bool
value
=
false
;
};
template
<
typename
T
>
template
<
typename
T
>
struct
is_pyopencl_buf
<
struct
is_pyopencl_buf
<
T
,
enable_if_t
<
std
::
is_base_of
<
pyopencl_buf
<
pyopencl_buf_ele_t
<
T
>
>
,
T
,
enable_if_t
<
std
::
is_base_of
<
pyopencl_buf
<
pyopencl_buf_ele_t
<
T
>
>
,
rm_ref_t
<
T
>
>::
value
>
>
{
rm_ref_t
<
T
>
>::
value
>
>
:
std
::
true_type
{};
constexpr
static
bool
value
=
true
;
};
template
<
ArgType
AT
,
typename
T
>
template
<
ArgType
AT
,
typename
T
>
struct
_ToArgBuffer
<
AT
,
T
,
enable_if_t
<
is_pyopencl_buf
<
T
>::
value
&&
struct
_ToArgBuffer
<
AT
,
T
,
enable_if_t
<
is_pyopencl_buf
<
T
>::
value
&&
...
...
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