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
Commits
cc7353d8
"torchvision/vscode:/vscode.git/clone" did not exist on "4f1625034d3163256de407e47efe368f341e9d4c"
Commit
cc7353d8
authored
Aug 23, 2022
by
Adam Osewski
Browse files
Surround cout statements with #if
parent
9051a9f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
test/data_type/int4.cpp
test/data_type/int4.cpp
+16
-14
No files found.
test/data_type/int4.cpp
View file @
cc7353d8
...
...
@@ -171,18 +171,19 @@ TEST(Int4, DISABLED_BitwiseRepresentation)
int4_t
a_i4
{
3
};
std
::
int8_t
a_i8
=
*
reinterpret_cast
<
std
::
int8_t
*>
(
&
a_i4
);
std
::
int8_t
b_i8
{
3
};
// std::cout << std::hex << std::showbase << static_cast<int32_t>(a_i8)
// << ", " << static_cast<int32_t>(b_i8) << std::endl;
#if 0
std::cout << std::hex << std::showbase << static_cast<int32_t>(a_i8)
<< ", " << static_cast<int32_t>(b_i8) << std::endl;
#endif
EXPECT_EQ
(
bit8_t
{
static_cast
<
std
::
uint64_t
>
(
a_i8
)},
bit8_t
{
static_cast
<
std
::
uint64_t
>
(
b_i8
)});
a_i4
=
int4_t
{
-
3
};
a_i8
=
*
reinterpret_cast
<
std
::
int8_t
*>
(
&
a_i4
);
b_i8
=
std
::
int8_t
{
-
3
};
//
std::cout << std::hex << std::showbase << static_cast<int32_t>(a_i8)
//
<< ", " << static_cast<int32_t>(b_i8) << std::endl;
#if 0
std::cout << std::hex << std::showbase << static_cast<int32_t>(a_i8)
<< ", " << static_cast<int32_t>(b_i8) << std::endl;
#endif
EXPECT_EQ
(
bit8_t
{
static_cast
<
std
::
uint64_t
>
(
a_i8
)},
bit8_t
{
static_cast
<
std
::
uint64_t
>
(
b_i8
)});
}
...
...
@@ -193,17 +194,18 @@ TEST(Int4, BitwiseRepresentationStaticCast)
int4_t
a_i4
{
3
};
std
::
int8_t
a_i8
=
static_cast
<
std
::
int8_t
>
(
a_i4
);
std
::
int8_t
b_i8
{
3
};
// std::cout << std::hex << std::showbase << static_cast<int32_t>(a_i8)
// << ", " << static_cast<int32_t>(b_i8) << std::endl;
#if 0
std::cout << std::hex << std::showbase << static_cast<int32_t>(a_i8)
<< ", " << static_cast<int32_t>(b_i8) << std::endl;
#endif
EXPECT_EQ
(
bit8_t
{
static_cast
<
std
::
uint64_t
>
(
a_i8
)},
bit8_t
{
static_cast
<
std
::
uint64_t
>
(
b_i8
)});
a_i4
=
int4_t
{
-
3
};
a_i8
=
static_cast
<
std
::
int8_t
>
(
a_i4
);
b_i8
=
std
::
int8_t
{
-
3
};
//
std::cout << std::hex << std::showbase << static_cast<int32_t>(a_i8)
//
<< ", " << static_cast<int32_t>(b_i8) << std::endl;
#if 0
std::cout << std::hex << std::showbase << static_cast<int32_t>(a_i8)
<< ", " << static_cast<int32_t>(b_i8) << std::endl;
#endif
EXPECT_EQ
(
bit8_t
{
static_cast
<
std
::
uint64_t
>
(
a_i8
)},
bit8_t
{
static_cast
<
std
::
uint64_t
>
(
b_i8
)});
}
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