-
Notifications
You must be signed in to change notification settings - Fork 221
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
Use the cmake variable HALF_INCLUDE_DIR to find half.hpp #3170
base: develop
Are you sure you want to change the base?
Conversation
@trixirt In order to make this change complete, we need to update the submodule MIFin too: https://github.com/search?q=repo%3AROCm%2FMIFin%20half&type=code Actually you can go into ${MIOpen}/fin and pull the submodule, then make necessary changes there. |
There are other instances in the ROCm stack that need this fix. |
See here |
@junliume @trixirt @shurale-nkn I suspect this is overkill, because ROCm does not officially support Fedora, https://rocm.docs.amd.com/en/latest/compatibility/compatibility-matrix.html.
Maybe suggesting the simplest workaround for the Fedora users is enough: put a copy of half.hpp into /usr/include/half/. It does not require any modifications in MIOpen, Fin and other components of the ROCm stack. Otherwise, no objections. |
CMakeLists.txt
Outdated
message(STATUS "HALF_INCLUDE_DIR: ${HALF_INCLUDE_DIR}") | ||
string(APPEND CMAKE_CXX_FLAGS " -I${HALF_INCLUDE_DIR}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This thrashes the location of the header and causes confusion for the users of the header. The AMD version of half itself does this, the older version installed it to opt/rocm/include, the newer opt/rocm/include/half. |
On Fedora half.hpp is installed in the system /usr/include dir The use assumes it is installed in half/half.hpp and looks for this path in the cmake configury. Instead of assuming the path has a half/, pass the found half.hpp path as an include argument -I ${HALF_INCLUDE_DIR} convert all uses of half/half.hpp with a sed script for f in `find . -type f -name '*.hpp' -o -name '*.cpp' `; do sed -i -e 's@#include <half/half.hpp>@#include <half.hpp>@' $f done Signed-off-by: Tom Rix <[email protected]>
Removed the global change to cxx flags and am using target_include_directories similar to MIFin |
On Fedora half.hpp is installed in the system /usr/include dir The use assumes it is installed in half/half.hpp and looks for this path in the cmake configury. Instead of assuming the path has a half/, pass the found half.hpp path as an include argument -I ${HALF_INCLUDE_DIR}
convert all uses of half/half.hpp with a sed script for f in
find . -type f -name '*.hpp' -o -name '*.cpp'
; dosed -i -e 's@#include <half/half.hpp>@#include <half.hpp>@' $f
done
Fixes this issue that was incorrectly closed
#2672