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
MIGraphX
Commits
6b0dfe0f
Commit
6b0dfe0f
authored
May 25, 2023
by
Paul
Browse files
Disable warnings for ck headers
parent
891be203
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
7 deletions
+48
-7
src/targets/gpu/jit/ck_gemm.cpp
src/targets/gpu/jit/ck_gemm.cpp
+48
-7
No files found.
src/targets/gpu/jit/ck_gemm.cpp
View file @
6b0dfe0f
...
@@ -78,6 +78,53 @@ __global__ void ${kernel}(${params})
...
@@ -78,6 +78,53 @@ __global__ void ${kernel}(${params})
)__migraphx__"
;
)__migraphx__"
;
// NOLINTNEXTLINE
static
const
char
*
const
disable_warning_pragma
=
R"__migraphx__(
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Weverything"
${content}
#pragma clang diagnostic pop
)__migraphx__"
;
template
<
class
P
>
static
std
::
string
ck_disable_warnings
(
P
p
)
{
return
interpolate_string
(
disable_warning_pragma
,
{{
"content"
,
std
::
string
{
p
.
first
,
p
.
second
}}});
}
static
std
::
unordered_map
<
std
::
string
,
std
::
string
>
create_ck_header_strings
()
{
std
::
unordered_map
<
std
::
string
,
std
::
string
>
result
;
auto
ck_headers
=
ck
::
host
::
GetHeaders
();
std
::
transform
(
ck_headers
.
begin
(),
ck_headers
.
end
(),
std
::
inserter
(
result
,
result
.
begin
()),
[
&
](
auto
&&
p
)
{
return
std
::
make_pair
(
p
.
first
,
ck_disable_warnings
(
p
.
second
));
});
return
result
;
}
static
std
::
vector
<
src_file
>
create_ck_headers
()
{
static
const
auto
&
header_strings
=
create_ck_header_strings
();
std
::
vector
<
src_file
>
srcs
;
std
::
transform
(
header_strings
.
begin
(),
header_strings
.
end
(),
std
::
back_inserter
(
srcs
),
[
&
](
auto
&&
p
)
{
return
src_file
{
fs
::
path
{
p
.
first
},
{
p
.
second
.
data
(),
p
.
second
.
data
()
+
p
.
second
.
size
()}};
});
return
srcs
;
}
static
const
std
::
vector
<
src_file
>&
ck_headers
()
{
static
const
auto
&
headers
=
create_ck_headers
();
return
headers
;
}
static
bool
transposed_matrix
(
const
shape
&
s
)
{
return
s
.
strides
().
back
()
!=
1
;
}
static
bool
transposed_matrix
(
const
shape
&
s
)
{
return
s
.
strides
().
back
()
!=
1
;
}
using
tuning_entry
=
std
::
pair
<
std
::
vector
<
shape
>
,
size_t
>
;
using
tuning_entry
=
std
::
pair
<
std
::
vector
<
shape
>
,
size_t
>
;
...
@@ -280,7 +327,6 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler>
...
@@ -280,7 +327,6 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler>
cde_op
};
cde_op
};
const
auto
include_header
=
problem
.
GetIncludeHeader
();
const
auto
include_header
=
problem
.
GetIncludeHeader
();
const
auto
ck_headers
=
ck
::
host
::
GetHeaders
();
const
auto
solutions
=
problem
.
GetSolutions
(
"gfx90a"
);
const
auto
solutions
=
problem
.
GetSolutions
(
"gfx90a"
);
const
auto
solution
=
solutions
.
at
(
tuning_value
);
const
auto
solution
=
solutions
.
at
(
tuning_value
);
const
auto
template_str
=
solution
.
template_str
;
const
auto
template_str
=
solution
.
template_str
;
...
@@ -288,12 +334,7 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler>
...
@@ -288,12 +334,7 @@ struct ck_gemm_compiler : compiler<ck_gemm_compiler>
const
auto
block_size
=
solution
.
block_size
;
const
auto
block_size
=
solution
.
block_size
;
hip_compile_options
options
;
hip_compile_options
options
;
std
::
transform
(
ck_headers
.
begin
(),
options
.
additional_src_files
=
ck_headers
();
ck_headers
.
end
(),
std
::
back_inserter
(
options
.
additional_src_files
),
[
&
](
auto
&&
p
)
{
return
src_file
{
fs
::
path
{
p
.
first
},
p
.
second
};
});
auto
grid_size
=
can_fold_batch
?
blocks_per_batch
:
batch_count
*
blocks_per_batch
;
auto
grid_size
=
can_fold_batch
?
blocks_per_batch
:
batch_count
*
blocks_per_batch
;
options
.
set_launch_params
(
v
,
grid_size
*
block_size
,
block_size
);
options
.
set_launch_params
(
v
,
grid_size
*
block_size
,
block_size
);
options
.
inputs
=
inputs
;
options
.
inputs
=
inputs
;
...
...
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