Adding support for multiple icd files specific to ROCm version

- amdocl64.icd is renamed to amdocl64_<ROCM_PATCH_VERSION>.icd
- This will enable support for multiple icd for different versions of
  ROCm

Signed-off-by: Pruthvi Madugundu <pruthvi.madugundu@amd.com>
Change-Id: I8031b19f8579507ffb6727dedcd2e3fbb4e45de8


[ROCm/clr commit: b88a313eff]
This commit is contained in:
Pruthvi Madugundu
2020-07-09 18:04:18 -07:00
parent 0611a0502a
commit 67591d6671
5 changed files with 10 additions and 4 deletions
+6
View File
@@ -17,6 +17,12 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(OPENCL_ICD_LOADER_HEADERS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/khronos/headers/opencl2.2" CACHE PATH "")
option(BUILD_SHARED_LIBS "Build shared libs" ON)
#set a name for icd file
set(OPENCL_AMD_ICD_FILE "amdocl64.icd")
if (DEFINED ROCM_PATCH_VERSION)
set(OPENCL_AMD_ICD_FILE "amdocl64_${ROCM_PATCH_VERSION}.icd")
endif()
# FIXME: Handling legacy custom boolean matching "yes" or "no"
if(DEFINED USE_COMGR_LIBRARY)
if(${USE_COMGR_LIBRARY} MATCHES "yes")
@@ -6,7 +6,7 @@ do_ldconfig() {
if [ -e "/opt/rocm/opencl" ] ; then
echo /opt/rocm/opencl/lib > /etc/ld.so.conf.d/x86_64-rocm-opencl.conf && ldconfig
fi
mkdir -p /etc/OpenCL/vendors && (echo libamdocl64.so > /etc/OpenCL/vendors/amdocl64.icd)
mkdir -p /etc/OpenCL/vendors && (echo libamdocl64.so > /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@)
}
INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@
@@ -4,7 +4,7 @@ set -e
rm_ldconfig() {
rm -f /etc/ld.so.conf.d/x86_64-rocm-opencl.conf && ldconfig
rm -f /etc/OpenCL/vendors/amdocl64.icd
rm -f /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@
}
case "$1" in
@@ -1,7 +1,7 @@
if [ -e "/opt/rocm/opencl" ] ; then
echo /opt/rocm/opencl/lib > /etc/ld.so.conf.d/x86_64-rocm-opencl.conf && ldconfig
fi
mkdir -p /etc/OpenCL/vendors && (echo libamdocl64.so > /etc/OpenCL/vendors/amdocl64.icd)
mkdir -p /etc/OpenCL/vendors && (echo libamdocl64.so > /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@)
INSTALL_PATH=@CPACK_PACKAGING_INSTALL_PREFIX@
ROCM_LIBPATH=@ROCM_PATH@/lib
@@ -1,6 +1,6 @@
if [ $1 -eq 0 ]; then
rm -f /etc/ld.so.conf.d/x86_64-rocm-opencl.conf && ldconfig
rm -f /etc/OpenCL/vendors/amdocl64.icd
rm -f /etc/OpenCL/vendors/@OPENCL_AMD_ICD_FILE@
rm -f @ROCM_PATH@/lib/libOpenCL.so
rm -f @ROCM_PATH@/lib/libOpenCL.so.@OPENCL_LIB_VERSION_MAJOR@
rm -f @ROCM_PATH@/lib/libOpenCL.so.@OPENCL_LIB_VERSION_STRING@