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
7f0915f6
Commit
7f0915f6
authored
Mar 03, 2022
by
Chao Liu
Browse files
format
parent
d1e9d6cc
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
20 deletions
+19
-20
test/conv2d_fwd.cpp
test/conv2d_fwd.cpp
+1
-1
test/magic_number_division.cpp
test/magic_number_division.cpp
+2
-3
test/split_k.cpp
test/split_k.cpp
+16
-16
No files found.
test/conv2d_fwd.cpp
View file @
7f0915f6
test/magic_number_division.cpp
View file @
7f0915f6
...
@@ -168,5 +168,4 @@ int main(int, char*[])
...
@@ -168,5 +168,4 @@ int main(int, char*[])
std
::
cout
<<
"test magic number division: Fail"
<<
std
::
endl
;
std
::
cout
<<
"test magic number division: Fail"
<<
std
::
endl
;
return
-
1
;
return
-
1
;
}
}
}
}
test/split_k.cpp
View file @
7f0915f6
...
@@ -69,7 +69,6 @@ struct gemmArgs
...
@@ -69,7 +69,6 @@ struct gemmArgs
int
KBatch
;
int
KBatch
;
};
};
int
test_gemm
(
const
gemmArgs
&
args
)
int
test_gemm
(
const
gemmArgs
&
args
)
{
{
bool
a_row_major
,
b_row_major
,
c_row_major
;
bool
a_row_major
,
b_row_major
,
c_row_major
;
...
@@ -115,8 +114,10 @@ int test_gemm(const gemmArgs& args)
...
@@ -115,8 +114,10 @@ int test_gemm(const gemmArgs& args)
Tensor
<
float
>
a_m_k
(
f_host_tensor_descriptor
(
args
.
M
,
args
.
K
,
args
.
StrideA
,
a_row_major
));
Tensor
<
float
>
a_m_k
(
f_host_tensor_descriptor
(
args
.
M
,
args
.
K
,
args
.
StrideA
,
a_row_major
));
Tensor
<
float
>
b_k_n
(
f_host_tensor_descriptor
(
args
.
K
,
args
.
N
,
args
.
StrideB
,
b_row_major
));
Tensor
<
float
>
b_k_n
(
f_host_tensor_descriptor
(
args
.
K
,
args
.
N
,
args
.
StrideB
,
b_row_major
));
Tensor
<
float
>
c_m_n_host_result
(
f_host_tensor_descriptor
(
args
.
M
,
args
.
N
,
args
.
StrideC
,
c_row_major
));
Tensor
<
float
>
c_m_n_host_result
(
Tensor
<
float
>
c_m_n_device_result
(
f_host_tensor_descriptor
(
args
.
M
,
args
.
N
,
args
.
StrideC
,
c_row_major
));
f_host_tensor_descriptor
(
args
.
M
,
args
.
N
,
args
.
StrideC
,
c_row_major
));
Tensor
<
float
>
c_m_n_device_result
(
f_host_tensor_descriptor
(
args
.
M
,
args
.
N
,
args
.
StrideC
,
c_row_major
));
// init data
// init data
std
::
size_t
num_thread
=
std
::
thread
::
hardware_concurrency
();
std
::
size_t
num_thread
=
std
::
thread
::
hardware_concurrency
();
...
@@ -242,12 +243,11 @@ int main(int argc, char* argv[])
...
@@ -242,12 +243,11 @@ int main(int argc, char* argv[])
printf
(
"arg2 to 7: M, N, K, StrideA, StrideB, StrideC KBatch
\n
"
);
printf
(
"arg2 to 7: M, N, K, StrideA, StrideB, StrideC KBatch
\n
"
);
return
-
1
;
return
-
1
;
}
}
for
(
const
auto
&
kinder
:
test_cases
)
for
(
const
auto
&
kinder
:
test_cases
)
{
{
const
auto
res
=
test_gemm
(
kinder
);
const
auto
res
=
test_gemm
(
kinder
);
if
(
!
res
)
if
(
!
res
)
return
-
1
;
return
-
1
;
}
}
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