Skip to content

Commit 671a68e

Browse files
gregrodgersronlieb
authored andcommitted
[OPENMP] [FLANG] Updates to hostexec to support fortran runtime io. This requires amd-trunk-dev updates be applied
Change-Id: Icc423473c555ddd067ea99492117182f0bb01519
1 parent 673c177 commit 671a68e

File tree

6 files changed

+568
-9
lines changed

6 files changed

+568
-9
lines changed

clang/lib/CodeGen/CodeGenFunction.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4634,9 +4634,9 @@ class CodeGenFunction : public CodeGenTypeCache {
46344634
ReturnValueSlot ReturnValue);
46354635

46364636
std::vector<std::string> HostexecFns{
4637-
"printf", "fprintf", "hostexec",
4638-
"hostexec_uint", "hostexec_uint64", "hostexec_int",
4639-
"hostexec_long", "hostexec_float", "hostexec_double"};
4637+
"printf", "fprintf", "hostexec", "hostexec_uint",
4638+
"hostexec_uint64", "hostexec_int", "hostexec_long", "hostexec_float",
4639+
"hostexec_double", "hostexec_fortrt"};
46404640
RValue EmitHostexecAllocAndExecFns(const CallExpr *E,
46414641
const char *allocate_name,
46424642
const char *execute_name);

offload/hostexec/CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,13 @@ endif()
6767
add_compile_options($<$<OR:$<COMPILE_LANGUAGE:C>,$<COMPILE_LANGUAGE:CXX>>:-UNDEBUG>)
6868
set_property(TARGET amdgcn_hostexec_services PROPERTY POSITION_INDEPENDENT_CODE ON)
6969

70+
option(LIBOMPTARGET_BUILD_DEVICE_FORTRT "Build device fortran IO runtime to use hostexec" OFF)
71+
if (LIBOMPTARGET_BUILD_DEVICE_FORTRT)
72+
add_compile_definitions(_HOSTEXEC_BUILD_DEVICE_FORTRT)
73+
target_link_libraries(amdgcn_hostexec_services FortranDecimal -L${CMAKE_BINARY_DIR}/../../lib -L${CMAKE_INSTALL_PREFIX}/lib)
74+
target_link_libraries(amdgcn_hostexec_services FortranRuntime -L${CMAKE_BINARY_DIR}/../../lib -L${CMAKE_INSTALL_PREFIX}/lib)
75+
endif()
76+
7077
if (LIBOMPTARGET_DEP_CUDA_FOUND)
7178
list(APPEND HOSTRPC_ARCHS "nvptx")
7279
add_library(nvptx_hostexec_services STATIC
@@ -156,8 +163,8 @@ foreach(archname ${HOSTRPC_ARCHS})
156163
foreach(mcpu ${mcpus})
157164
if (${archname} STREQUAL "amdgcn")
158165
find_package(AMDDeviceLibs REQUIRED CONFIG
159-
HINTS ${CMAKE_INSTALL_PREFIX}
160-
${CMAKE_BINARY_DIR}/../../tools/rocm-device-libs
166+
HINTS ${CMAKE_BINARY_DIR}/../../tools/rocm-device-libs
167+
${CMAKE_INSTALL_PREFIX}
161168
PATHS /opt/rocm
162169
)
163170
get_target_property(ocml_path ocml IMPORTED_LOCATION)

0 commit comments

Comments
 (0)