File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -113,18 +113,13 @@ function(compileDeviceRTLLibrary target_name target_triple)
113113 set (target_bc_flags ${ARGN} )
114114
115115 if (${target_name} MATCHES "amdgpu" )
116- set (amdbc_dirs
117- "${CMAKE_BINARY_DIR} /../rocm-device-libs-prefix/src/rocm-device-libs-build/lib/llvm/lib/clang/${LLVM_VERSION_MAJOR} /lib/amdgcn/bitcode"
118- "${CMAKE_INSTALL_PREFIX} /../../amdgcn/bitcode"
119- "/opt/rocm/amdgcn/bitcode" )
120- foreach (amdbc_dir ${amdbc_dirs} )
121- if (EXISTS "${amdbc_dir} /ockl.bc" AND NOT _ockl_bc)
122- set (_ockl_bc ${amdbc_dir} /ockl.bc)
123- endif ()
124- if (EXISTS "${amdbc_dir} /ocml.bc" AND NOT _ocml_bc)
125- set (_ocml_bc ${amdbc_dir} /ocml.bc)
126- endif ()
127- endforeach ()
116+ find_package (AMDDeviceLibs REQUIRED CONFIG
117+ HINTS ${CMAKE_BINARY_DIR} /../../tools/rocm-device-libs
118+ ${CMAKE_BINARY_DIR} /../rocm-device-libs-prefix /src/rocm-device-libs-build
119+ ${CMAKE_INSTALL_PREFIX}
120+ )
121+ get_target_property (_ocml_bc ocml IMPORTED_LOCATION )
122+ get_target_property (_ockl_bc ockl IMPORTED_LOCATION )
128123 if (NOT _ockl_bc)
129124 message (FATAL_ERROR "Could not find ockl.bc" )
130125 endif ()
You can’t perform that action at this time.
0 commit comments