Skip to content

Conversation

@tcojean
Copy link
Member

@tcojean tcojean commented Feb 16, 2022

Gives the ability to select DPC++ hardware parameters from CMake.

This is old code and needs to be retested.

  • Fix ELL deadlock on DevEP
  • Fix per_source on CPU through generic file splitting.

Fixes #919

@tcojean tcojean added 1:ST:WIP This PR is a work in progress. Not ready for review. plat:intel This is related to the Intel compilers. labels Feb 16, 2022
@tcojean tcojean self-assigned this Feb 16, 2022
@ginkgo-bot ginkgo-bot added mod:dpcpp This is related to the DPC++ module. reg:build This is related to the build system. reg:testing This is related to testing. type:matrix-format This is related to the Matrix formats labels Feb 16, 2022
Comment on lines 158 to 197
function(insertionSortRecursive sort_list)
# Get list length
list(LENGTH sort_list len)

# Base case, return.
if(${len} LESS_EQUAL 1)
return()
endif()

math(EXPR len_minus_one "${len} - 1")
# Recursively sort the sublist of size (len - 1).
insertionSortRecursive("${sort_list}" ${len_minus_one})
set(_sort_list ${sort_list})

# Get the last element in the sublist.
list(GET _sort_list ${len_minus_one} last_element)
# Define a counter for the sublist we will operate on.
math(EXPR sublist_counter "${len} - 2")
# Get the element at the counter index.
list(GET _sort_list ${sublist_counter} counter_element)

# Loop to move those elements greater than last_element up one position.
while((${sublist_counter} GREATER_EQUAL 0) AND (${counter_element} GREATER ${last_element}))
# Move elem at counter index up one position in list.
math(EXPR counter_plus_one "${sublist_counter} + 1")
list(REMOVE_AT _sort_list ${counter_plus_one})
list(INSERT _sort_list ${counter_plus_one} ${counter_element})
# Decrement the sublist counter.
math(EXPR sublist_counter "${sublist_counter} - 1")
# Get the element at the new counter value.
list(GET _sort_list ${sublist_counter} counter_element)
endwhile()

# Place the last element at the correct position.
math(EXPR counter_plus_one "${sublist_counter} + 1")
list(REMOVE_AT _sort_list ${counter_plus_one})
list(INSERT _sort_list ${counter_plus_one} ${last_element})
# Send the modified list back up to parent scope.
set(sort_list ${_sort_list} PARENT_SCOPE)
endfunction()
Copy link
Member

Choose a reason for hiding this comment

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

I think it's better to do that at compile-time in C++, CMake is not really a language for complex algorithms

Copy link
Member Author

Choose a reason for hiding this comment

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

Well in CMake 3.18 this whole thing disappears as there is native support for this. But I understand your point.

@tcojean tcojean force-pushed the dpcpp_devep branch 3 times, most recently from f6b3fc7 to a89907d Compare February 16, 2022 11:15
Terry Cojean added 3 commits February 18, 2022 19:46
+ Now the DPC++ configuration of workgroups/subgroups is generated from
  CMake using a `config.hpp.in` file.
+ AOT support is added thanks to a new `GINKGO_DPCPP_AOT_TARGETS`
  variable
@tcojean tcojean force-pushed the dpcpp_devep branch 2 times, most recently from ab8d26f to 01f10b0 Compare February 18, 2022 19:18
Terry Cojean added 5 commits February 18, 2022 20:22
+ Sorting, with/without keeping duplicates, in ascending or descending order
+ Accessing functionality
+ min, max, median
+ Converting to a plain value
+ Also add a syn::merge function which allows merging lists thanks to an
  ::encode() function.
@tcojean tcojean added 1:ST:ready-for-review This PR is ready for review and removed 1:ST:WIP This PR is a work in progress. Not ready for review. labels Feb 18, 2022
@tcojean
Copy link
Member Author

tcojean commented Feb 18, 2022

format!

ginkgo-bot and others added 2 commits February 18, 2022 19:32
Co-authored-by: Terry Cojean <tcojean@users.noreply.github.com>
dpcpp seems to be unhappy with atomic on UninitializedArray
@ginkgo-bot
Copy link
Member

Note: This PR changes the Ginkgo ABI:

Functions changes summary: 21 Removed, 1383 Changed (17196 filtered out), 0 Added functions
Variables changes summary: 0 Removed, 0 Changed, 0 Added variable

For details check the full ABI diff under Artifacts here

@ginkgo-bot
Copy link
Member

Error: The following files need to be formatted:

common/unified/matrix/dense_cmnpr.cpp
common/unified/matrix/dense_compute_norm1.cpp
common/unified/matrix/dense_compute_norm2.cpp
common/unified/matrix/dense_css.cpp
common/unified/matrix/dense_kernels_2.cpp
common/unified/matrix/dense_kernels_3.cpp
common/unified/matrix/dense_kernels_4.cpp
common/unified/matrix/dense_kernels_5.cpp
common/unified/matrix/dense_kernels_6.cpp
dpcpp/solver/cb_gmres_kernels.dp.cpp
dpcpp/solver/gmres_kernels.dp.cpp
dpcpp/solver/idr_kernels.dp.cpp

You can find a formatting patch under Artifacts here or run format! if you have write access to Ginkgo

@yhmtsai yhmtsai mentioned this pull request Feb 28, 2022
Comment on lines +82 to +83
target_compile_options(ginkgo_dpcpp PUBLIC -fsycl-targets=${GINKGO_DPCPP_AOT_TARGETS_FORMATTED})
target_link_options(ginkgo_dpcpp PUBLIC -fsycl-targets=${GINKGO_DPCPP_AOT_TARGETS_FORMATTED})
Copy link
Member Author

Choose a reason for hiding this comment

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

Good catch on adding link_options. But does this need to be public? This would probably fail if some program links against Ginkgo but uses a non DPC++ compiler which does not have the option (like gcc).

Copy link
Member

Choose a reason for hiding this comment

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

it's mainly from cpu side of https://www.intel.com/content/www/us/en/develop/documentation/oneapi-dpcpp-cpp-compiler-dev-guide-and-reference/top/compilation/ahead-of-time-compilation.html. If do not add it with the final execution, it can only use host queue (no subgroup or others support).
I am not pretty sure the compile or linking

@tcojean tcojean added 1:ST:WIP This PR is a work in progress. Not ready for review. and removed 1:ST:ready-for-review This PR is ready for review labels Mar 17, 2022
@MarcelKoch MarcelKoch marked this pull request as draft July 11, 2024 13:19
@MarcelKoch MarcelKoch added this to the Ginkgo 1.9.0 milestone Aug 26, 2024
@MarcelKoch MarcelKoch modified the milestones: Ginkgo 1.9.0, Ginkgo 1.10.0 Dec 9, 2024
@MarcelKoch
Copy link
Member

We need to reevaluate this approach to fix #919. I will close this PR for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1:ST:WIP This PR is a work in progress. Not ready for review. mod:dpcpp This is related to the DPC++ module. plat:intel This is related to the Intel compilers. reg:build This is related to the build system. reg:testing This is related to testing. type:matrix-format This is related to the Matrix formats

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dpcpp debug build issue

5 participants