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
c0ff964b
Commit
c0ff964b
authored
Nov 22, 2023
by
muozturk
Browse files
validation check in progress
parent
88c36f83
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
25 deletions
+25
-25
example/64_complex_contraction/complex_contraction_bilinear_xdl_fp32.cpp
...lex_contraction/complex_contraction_bilinear_xdl_fp32.cpp
+25
-25
No files found.
example/64_complex_contraction/complex_contraction_bilinear_xdl_fp32.cpp
View file @
c0ff964b
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
#include "ck/library/utility/numeric.hpp"
#include "ck/library/utility/numeric.hpp"
#include "ck/library/reference_tensor_operation/cpu/reference_contraction.hpp"
#include "ck/library/reference_tensor_operation/cpu/reference_contraction.hpp"
#include "Complex.hpp"
//
#include "Complex.hpp"
template
<
ck
::
index_t
...
Is
>
template
<
ck
::
index_t
...
Is
>
using
S
=
ck
::
Sequence
<
Is
...
>
;
using
S
=
ck
::
Sequence
<
Is
...
>
;
...
@@ -182,9 +182,9 @@ int main(int argc, char* argv[])
...
@@ -182,9 +182,9 @@ int main(int argc, char* argv[])
std
::
cout
<<
"a_ms_ks: "
<<
a_ms_ks
.
mDesc
<<
std
::
endl
;
std
::
cout
<<
"a_ms_ks: "
<<
a_ms_ks
_re
.
mDesc
<<
std
::
endl
;
std
::
cout
<<
"b_ns_ks: "
<<
b_ns_ks
.
mDesc
<<
std
::
endl
;
std
::
cout
<<
"b_ns_ks: "
<<
b_ns_ks
_re
.
mDesc
<<
std
::
endl
;
std
::
cout
<<
"d_ms_ns: "
<<
d_ms_ns
.
mDesc
<<
std
::
endl
;
std
::
cout
<<
"d_ms_ns: "
<<
d_ms_ns
_re
.
mDesc
<<
std
::
endl
;
std
::
cout
<<
"e_ms_ns: "
<<
e_ms_ns_host_result_re
.
mDesc
<<
std
::
endl
;
std
::
cout
<<
"e_ms_ns: "
<<
e_ms_ns_host_result_re
.
mDesc
<<
std
::
endl
;
switch
(
init_method
)
switch
(
init_method
)
...
@@ -210,21 +210,21 @@ int main(int argc, char* argv[])
...
@@ -210,21 +210,21 @@ int main(int argc, char* argv[])
break
;
break
;
}
}
DeviceMem
a_device_buf_re
(
sizeof
(
ADataType
)
*
a_ms_ks
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
a_device_buf_re
(
sizeof
(
ADataType
)
*
a_ms_ks
_re
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
b_device_buf_re
(
sizeof
(
BDataType
)
*
b_ns_ks
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
b_device_buf_re
(
sizeof
(
BDataType
)
*
b_ns_ks
_re
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
d_device_buf_re
(
sizeof
(
DDataType
)
*
d_ms_ns
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
d_device_buf_re
(
sizeof
(
DDataType
)
*
d_ms_ns
_re
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
e_device_buf_re
(
sizeof
(
EDataType
)
*
e_ms_ns_device_result
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
e_device_buf_re
(
sizeof
(
EDataType
)
*
e_ms_ns_device_result
_re
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
a_device_buf_img
(
sizeof
(
ADataType
)
*
a_ms_ks
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
a_device_buf_img
(
sizeof
(
ADataType
)
*
a_ms_ks
_img
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
b_device_buf_img
(
sizeof
(
BDataType
)
*
b_ns_ks
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
b_device_buf_img
(
sizeof
(
BDataType
)
*
b_ns_ks
_img
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
d_device_buf_img
(
sizeof
(
DDataType
)
*
d_ms_ns
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
d_device_buf_img
(
sizeof
(
DDataType
)
*
d_ms_ns
_img
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
e_device_buf_img
(
sizeof
(
EDataType
)
*
e_ms_ns_device_result
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
e_device_buf_img
(
sizeof
(
EDataType
)
*
e_ms_ns_device_result
_img
.
mDesc
.
GetElementSpaceSize
());
// Intermediate Value For E Real and Img
// Intermediate Value For E Real and Img
// LookAtHere
// LookAtHere
DeviceMem
e_device_buf_re1
(
sizeof
(
EDataType
)
*
e_ms_ns_device_result
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
e_device_buf_re1
(
sizeof
(
EDataType
)
*
e_ms_ns_device_result
_re
.
mDesc
.
GetElementSpaceSize
());
// DeviceMem e_device_buf_re2(sizeof(EDataType) * e_ms_ns_device_result.mDesc.GetElementSpaceSize());
// DeviceMem e_device_buf_re2(sizeof(EDataType) * e_ms_ns_device_result.mDesc.GetElementSpaceSize());
DeviceMem
e_device_buf_img1
(
sizeof
(
EDataType
)
*
e_ms_ns_device_result
.
mDesc
.
GetElementSpaceSize
());
DeviceMem
e_device_buf_img1
(
sizeof
(
EDataType
)
*
e_ms_ns_device_result
_img
.
mDesc
.
GetElementSpaceSize
());
// DeviceMem e_device_buf_img2(sizeof(EDataType) * e_ms_ns_device_result.mDesc.GetElementSpaceSize());
// DeviceMem e_device_buf_img2(sizeof(EDataType) * e_ms_ns_device_result.mDesc.GetElementSpaceSize());
// LookAtHere
// LookAtHere
...
@@ -273,7 +273,7 @@ int main(int argc, char* argv[])
...
@@ -273,7 +273,7 @@ int main(int argc, char* argv[])
b_element_op
,
b_element_op
,
cde_element_op
);
cde_element_op
);
if
(
!
op
.
IsSupportedArgument
(
argument
))
if
(
!
op
.
IsSupportedArgument
(
argument
_re1
))
{
{
std
::
cout
<<
op
.
GetTypeString
()
<<
" does not support this problem"
<<
std
::
endl
;
std
::
cout
<<
op
.
GetTypeString
()
<<
" does not support this problem"
<<
std
::
endl
;
...
@@ -286,14 +286,14 @@ int main(int argc, char* argv[])
...
@@ -286,14 +286,14 @@ int main(int argc, char* argv[])
alpha
=
-
1.
f
;
alpha
=
-
1.
f
;
beta
=
1.
f
;
beta
=
1.
f
;
auto
a_element_op
=
AElementOp
{};
a_element_op
=
AElementOp
{};
auto
b_element_op
=
BElementOp
{};
b_element_op
=
BElementOp
{};
auto
cde_element_op
=
CDEElementOp
{
alpha
,
beta
};
cde_element_op
=
CDEElementOp
{
alpha
,
beta
};
// device operation
// device operation
// For real Intermediate Value re_2
// For real Intermediate Value re_2
auto
op
=
DeviceOpInstance
{};
//
auto op = DeviceOpInstance{};
auto
invoker
=
op
.
MakeInvoker
();
//
auto invoker = op.MakeInvoker();
auto
argument_re2
=
op
.
MakeArgument
(
a_device_buf_img
.
GetDeviceBuffer
(),
auto
argument_re2
=
op
.
MakeArgument
(
a_device_buf_img
.
GetDeviceBuffer
(),
b_device_buf_img
.
GetDeviceBuffer
(),
b_device_buf_img
.
GetDeviceBuffer
(),
std
::
array
<
const
void
*
,
1
>
{
e_device_buf_re1
.
GetDeviceBuffer
()},
std
::
array
<
const
void
*
,
1
>
{
e_device_buf_re1
.
GetDeviceBuffer
()},
...
@@ -310,7 +310,7 @@ int main(int argc, char* argv[])
...
@@ -310,7 +310,7 @@ int main(int argc, char* argv[])
b_element_op
,
b_element_op
,
cde_element_op
);
cde_element_op
);
if
(
!
op
.
IsSupportedArgument
(
argument
))
if
(
!
op
.
IsSupportedArgument
(
argument
_re2
))
{
{
std
::
cout
<<
op
.
GetTypeString
()
<<
" does not support this problem"
<<
std
::
endl
;
std
::
cout
<<
op
.
GetTypeString
()
<<
" does not support this problem"
<<
std
::
endl
;
...
@@ -408,12 +408,11 @@ int main(int argc, char* argv[])
...
@@ -408,12 +408,11 @@ int main(int argc, char* argv[])
e_device_buf_re
.
FromDevice
(
e_ms_ns_device_result_re
.
mData
.
data
());
e_device_buf_re
.
FromDevice
(
e_ms_ns_device_result_re
.
mData
.
data
());
e_device_buf_img
.
FromDevice
(
e_ms_ns_device_result_img
.
mData
.
data
());
e_device_buf_img
.
FromDevice
(
e_ms_ns_device_result_img
.
mData
.
data
());
auto
isRealOk
=
0
;
if
(
do_verification
)
if
(
do_verification
)
{
{
// Real Part Verification
// Real Part Verification
Tensor
<
CShuffleDataType
>
c_ms_ns_host_result_re
(
e_ms_ns_lengths
,
e_ms_ns_strides
);
Tensor
<
CShuffleDataType
>
c_ms_ns_host_result_re
(
e_ms_ns_lengths
,
e_ms_ns_strides
);
Tensor
<
CShuffleDataType
>
c_ms_ns_host_result_re1
(
e_ms_ns_lengths
,
e_ms_ns_strides
);
Tensor
<
CShuffleDataType
>
c_ms_ns_host_result_re1
(
e_ms_ns_lengths
,
e_ms_ns_strides
);
...
@@ -425,6 +424,7 @@ int main(int argc, char* argv[])
...
@@ -425,6 +424,7 @@ int main(int argc, char* argv[])
BDataType
,
BDataType
,
CShuffleDataType
,
CShuffleDataType
,
AccDataType
,
AccDataType
,
F32
,
AElementOp
,
AElementOp
,
BElementOp
>
;
BElementOp
>
;
...
@@ -469,8 +469,8 @@ int main(int argc, char* argv[])
...
@@ -469,8 +469,8 @@ int main(int argc, char* argv[])
cde_element_op
=
CDEElementOp
{
alpha
,
beta
};
cde_element_op
=
CDEElementOp
{
alpha
,
beta
};
bool
isRealOk
=
ck
::
utils
::
check_err
(
e_ms_ns_device_result_re
,
e_ms_ns_host_result_re
)
?
0
:
1
;
isRealOk
=
ck
::
utils
::
check_err
(
e_ms_ns_device_result_re
,
e_ms_ns_host_result_re
)
?
0
:
1
;
}
}
return
0
;
return
isRealOk
;
}
}
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