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
313bbea5
Unverified
Commit
313bbea5
authored
Mar 24, 2022
by
Jianfeng Yan
Committed by
GitHub
Mar 24, 2022
Browse files
ctest of batched_gemm returns 0 or 1 (#149)
* ctest of batched_gemm returns 0 or 1 * minor change
parent
3ba14932
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
13 deletions
+11
-13
test/batched_gemm/batched_gemm_fp16.cpp
test/batched_gemm/batched_gemm_fp16.cpp
+9
-7
test/space_filling_curve/space_filling_curve.cpp
test/space_filling_curve/space_filling_curve.cpp
+2
-6
No files found.
test/batched_gemm/batched_gemm_fp16.cpp
View file @
313bbea5
...
@@ -109,13 +109,13 @@ bool TestBatchedGemm(const std::size_t batch_count, DeviceBatchedGemmPtr& gemmPt
...
@@ -109,13 +109,13 @@ bool TestBatchedGemm(const std::size_t batch_count, DeviceBatchedGemmPtr& gemmPt
gemmPtr
,
params
,
a
,
b
,
c_device
,
a_element_op
,
b_element_op
,
c_element_op
);
gemmPtr
,
params
,
a
,
b
,
c_device
,
a_element_op
,
b_element_op
,
c_element_op
);
// Assert
// Assert
// bool
re
s = test::check_err(
// bool
pas
s = test::check_err(
// c_device.mData, c_host.mData, "Error: incorrect results!", 1e-5f, 1e-4f);
// c_device.mData, c_host.mData, "Error: incorrect results!", 1e-5f, 1e-4f);
bool
re
s
=
check_error
(
c_device
,
c_host
)
<
0.007815
f
;
bool
pas
s
=
check_error
(
c_device
,
c_host
)
<
0.007815
f
;
std
::
cout
<<
(
re
s
?
"SUCCESS"
:
"FAILURE"
)
<<
std
::
endl
;
std
::
cout
<<
(
pas
s
?
"SUCCESS"
:
"FAILURE"
)
<<
std
::
endl
;
return
re
s
;
return
pas
s
;
}
}
}
// namespace
}
// namespace
...
@@ -125,13 +125,15 @@ int main()
...
@@ -125,13 +125,15 @@ int main()
ck
::
tensor_operation
::
device
::
device_batched_gemm_instance
::
ck
::
tensor_operation
::
device
::
device_batched_gemm_instance
::
add_device_batched_gemm_xdl_f16_f16_f16_gmk_gnk_gmn_instances
(
batched_gemm_ptrs
);
add_device_batched_gemm_xdl_f16_f16_f16_gmk_gnk_gmn_instances
(
batched_gemm_ptrs
);
bool
re
s
=
true
;
bool
pas
s
=
true
;
const
std
::
size_t
batch_count
=
4
;
const
std
::
size_t
batch_count
=
4
;
for
(
auto
&
gemmPtr
:
batched_gemm_ptrs
)
for
(
auto
&
gemmPtr
:
batched_gemm_ptrs
)
{
{
re
s
&=
TestBatchedGemm
(
batch_count
,
gemmPtr
);
pas
s
&=
TestBatchedGemm
(
batch_count
,
gemmPtr
);
}
}
std
::
cout
<<
"TestGemm ..... "
<<
(
res
?
"SUCCESS"
:
"FAILURE"
)
<<
std
::
endl
;
std
::
cout
<<
"TestGemm ..... "
<<
(
pass
?
"SUCCESS"
:
"FAILURE"
)
<<
std
::
endl
;
return
pass
?
0
:
1
;
}
}
test/space_filling_curve/space_filling_curve.cpp
View file @
313bbea5
...
@@ -14,12 +14,8 @@ int main(int argc, char** argv)
...
@@ -14,12 +14,8 @@ int main(int argc, char** argv)
(
void
)
argc
;
(
void
)
argc
;
(
void
)
argv
;
(
void
)
argv
;
{
traverse_using_space_filling_curve
();
traverse_using_space_filling_curve
();
auto
err
=
hipDeviceSynchronize
();
(
void
)
err
;
assert
(
err
==
hipSuccess
);
}
return
0
;
return
0
;
}
}
...
...
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