Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tacho : compile warnings on Mi300 #13482

Merged
merged 2 commits into from
Oct 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1939,7 +1939,7 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> {
s0.rowptrU, s0.colindU, s0.nzvalsU,
rocsparse_indextype_i32, rocsparse_indextype_i32, rocsparse_index_base_zero, rocsparse_compute_type);
// workspace
#if ROCM_VERSION >= 50400
#if (ROCM_VERSION >= 50400 && ROCM_VERSION < 60000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this could be made more consistent with similar changes by swapping the order of the check and function api, e.g. change L1942-1945 to be:

      #if (ROCM_VERSION >= 60000)
      rocsparse_spmv
      #else
      rocsparse_spmv_ex

rocsparse_spmv_ex
#else
rocsparse_spmv
Expand All @@ -1958,7 +1958,11 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> {
#if ROCM_VERSION >= 50400
// preprocess
buffer_size_U = buffer_U.extent(0);
#if (ROCM_VERSION >= 60000)
rocsparse_spmv
#else
rocsparse_spmv_ex
#endif
(rocsparseHandle, rocsparse_operation_none,
&alpha, s0.descrU, vecX, &beta, vecY,
rocsparse_compute_type, rocsparse_spmv_alg_default,
Expand All @@ -1971,7 +1975,7 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> {
s0.rowptrL, s0.colindL, s0.nzvalsL,
rocsparse_indextype_i32, rocsparse_indextype_i32, rocsparse_index_base_zero, rocsparse_compute_type);
// workspace
#if ROCM_VERSION >= 50400
#if (ROCM_VERSION >= 50400 && ROCM_VERSION < 60000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this could be made more consistent with similar changes by swapping the order of the check and function api, e.g. change L1978-1981 to be:

      #if (ROCM_VERSION >= 60000)
      rocsparse_spmv
      #else
      rocsparse_spmv_ex

rocsparse_spmv_ex
#else
rocsparse_spmv
Expand All @@ -1990,7 +1994,11 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> {
#if ROCM_VERSION >= 50400
// preprocess
buffer_size_L = buffer_L.extent(0);
#if (ROCM_VERSION >= 60000)
rocsparse_spmv
#else
rocsparse_spmv_ex
#endif
(rocsparseHandle, rocsparse_operation_none,
&alpha, s0.descrL, vecX, &beta, vecY,
rocsparse_compute_type, rocsparse_spmv_alg_default,
Expand All @@ -2003,7 +2011,7 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> {
s0.rowptrU, s0.colindU, s0.nzvalsU,
rocsparse_indextype_i32, rocsparse_indextype_i32, rocsparse_index_base_zero, rocsparse_compute_type);
// workspace (transpose)
#if ROCM_VERSION >= 50400
#if (ROCM_VERSION >= 50400 && ROCM_VERSION < 60000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this could be made more consistent with similar changes by swapping the order of the check and function api, e.g. change L2014-2017 to be:

      #if (ROCM_VERSION >= 60000)
      rocsparse_spmv
      #else
      rocsparse_spmv_ex

rocsparse_spmv_ex
#else
rocsparse_spmv
Expand All @@ -2022,7 +2030,11 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> {
#if ROCM_VERSION >= 50400
// preprocess
buffer_size_L = buffer_L.extent(0);
#if (ROCM_VERSION >= 60000)
rocsparse_spmv
#else
rocsparse_spmv_ex
#endif
(rocsparseHandle, rocsparse_operation_transpose,
&alpha, s0.descrL, vecX, &beta, vecY,
rocsparse_compute_type, rocsparse_spmv_alg_default,
Expand Down Expand Up @@ -2491,7 +2503,7 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> {
auto vecY = ((nlvls-1-lvl)%2 == 0 ? vecW : vecL);
if (s0.spmv_explicit_transpose) {
status =
#if ROCM_VERSION >= 50400
#if (ROCM_VERSION >= 50400 && ROCM_VERSION < 60000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this could be made more consistent with similar changes by swapping the order of the check and function api, e.g. change to:

      #if (ROCM_VERSION >= 60000)
      rocsparse_spmv
      #else
      rocsparse_spmv_ex

rocsparse_spmv_ex
#else
rocsparse_spmv
Expand All @@ -2505,7 +2517,7 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> {
&buffer_size_L, (void*)buffer_L.data());
} else {
status =
#if ROCM_VERSION >= 50400
#if (ROCM_VERSION >= 50400 && ROCM_VERSION < 60000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this could be made more consistent with similar changes by swapping the order of the check and function api, e.g. change to:

      #if (ROCM_VERSION >= 60000)
      rocsparse_spmv
      #else
      rocsparse_spmv_ex

rocsparse_spmv_ex
#else
rocsparse_spmv
Expand Down Expand Up @@ -2827,7 +2839,7 @@ class NumericToolsLevelSet : public NumericToolsBase<ValueType, DeviceType> {
auto vecX = (lvl%2 == 0 ? vecU : vecW);
auto vecY = (lvl%2 == 0 ? vecW : vecU);
status =
#if ROCM_VERSION >= 50400
#if (ROCM_VERSION >= 50400 && ROCM_VERSION < 60000)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this could be made more consistent with similar changes by swapping the order of the check and function api, e.g. change to:

      #if (ROCM_VERSION >= 60000)
      rocsparse_spmv
      #else
      rocsparse_spmv_ex

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @ndellingwood !! Yea, my checks are ugly. I was trying to reduce the code lines.. With ROCM_VERSION >= 60000, it went back to an older naming of spmv (same as ROCM_VERSION < 50400) but with the same argument list as ROCM_VERSION >= 50400. Maybe, I'll try defining the function name based on ROCM_VERSION on the top.

rocsparse_spmv_ex
#else
rocsparse_spmv
Expand Down
Loading