Changeset 3200 in CLRX


Ignore:
Timestamp:
Jun 28, 2017, 6:25:22 AM (3 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Remove DEFAULT_AMDOCLPATH and introduce its runtime detection.

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/CLRX/Config.h.in

    r3199 r3200  
    3535#cmakedefine HAVE_INT128
    3636
    37 #cmakedefine HAVE_UBUNTU_GPUPRO
    38 
    39 #cmakedefine HAVE_GPUPRO_NEW
    40 
    41 #cmakedefine HAVE_GPUPRO_SLES
    42 
    4337/* architecture setup */
    4438
     
    140134#  ifdef HAVE_32BIT
    141135#    define DEFAULT_AMDOCLNAME "libamdocl32.so"
    142 #    ifdef HAVE_UBUNTU_GPUPRO
    143 #    define DEFAULT_AMDOCLPATH "/usr/lib/i386-linux-gnu/amdgpu-pro/libamdocl32.so"
    144 #    elif defined(HAVE_GPUPRO_NEW)
    145 #    define DEFAULT_AMDOCLPATH "/opt/amdgpu-pro/lib/i386-linux-gnu/libamdocl32.so"
    146 #    elif defined(HAVE_GPUPRO_SLES)
    147 #    define DEFAULT_AMDOCLPATH "/opt/amdgpu-pro/lib/libamdocl32.so"
    148 #    else
    149 #    define DEFAULT_AMDOCLPATH "/usr/lib/libamdocl32.so"
    150 #    endif
    151136#  else
    152137#    define DEFAULT_AMDOCLNAME "libamdocl64.so"
    153 #    ifdef HAVE_UBUNTU_GPUPRO
    154 #    define DEFAULT_AMDOCLPATH "/usr/lib/x86_64-linux-gnu/amdgpu-pro/libamdocl64.so"
    155 #    elif defined(HAVE_GPUPRO_NEW)
    156 #    define DEFAULT_AMDOCLPATH "/opt/amdgpu-pro/lib/x86_64-linux-gnu/libamdocl64.so"
    157 #    elif defined(HAVE_GPUPRO_SLES)
    158 #    define DEFAULT_AMDOCLPATH "/opt/amdgpu-pro/lib64/libamdocl64.so"
    159 #    else
    160 #    define DEFAULT_AMDOCLPATH "/usr/lib64/libamdocl64.so"
    161 #    endif
    162138#  endif
    163139
     
    173149#  ifdef HAVE_32BIT
    174150#  define DEFAULT_AMDOCLNAME "amdocl.dll"
    175 #  define DEFAULT_AMDOCLPATH "c:\\Windows\\System32\\amdocl.dll"
    176151#  else
    177152#  define DEFAULT_AMDOCLNAME "amdocl64.dll"
    178 #  define DEFAULT_AMDOCLPATH "c:\\Windows\\System32\\amdocl64.dll"
    179153#  endif
    180154
  • CLRadeonExtender/trunk/CMakeLists.txt

    r3198 r3200  
    123123ENDIF(BUILD_32BIT)
    124124
    125 IF(IS_DIRECTORY "/usr/lib/x86_64-linux-gnu/amdgpu-pro")
     125IF(IS_DIRECTORY "/usr/lib/x86_64-linux-gnu/amdgpu-pro" OR
     126    IS_DIRECTORY "/usr/lib/i386-linux-gnu/amdgpu-pro")
    126127    SET(HAVE_UBUNTU_GPUPRO TRUE)
    127128    MESSAGE(STATUS "AMDGPU-PRO for Ubuntu is found")
    128 ENDIF(IS_DIRECTORY "/usr/lib/x86_64-linux-gnu/amdgpu-pro")
     129ENDIF(IS_DIRECTORY "/usr/lib/x86_64-linux-gnu/amdgpu-pro" OR
     130    IS_DIRECTORY "/usr/lib/i386-linux-gnu/amdgpu-pro")
    129131IF(IS_DIRECTORY "/opt/amdgpu-pro/lib/x86_64-linux-gnu" OR
    130132        IS_DIRECTORY "/opt/amdgpu-pro/lib/i386-linux-gnu")
     
    235237            EXISTS ${OPENCL_DIST_DIR}/lib/x86/OpenCL.lib)
    236238    ENDIF((CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_CL_64) AND NOT BUILD_32BIT)
     239    IF(HAVE_UBUNTU_GPUPRO)
     240        IF((CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_CL_64) AND NOT BUILD_32BIT)
     241            SET(OPENCL_LIBRARY_DIRS "/usr/lib/x86_64-linux-gnu/amdgpu-pro")
     242        ELSE((CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_CL_64) AND NOT BUILD_32BIT)
     243            SET(OPENCL_LIBRARY_DIRS "/usr/lib/i386-linux-gnu/amdgpu-pro")
     244        ENDIF((CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_CL_64) AND NOT BUILD_32BIT)
     245    ENDIF(HAVE_UBUNTU_GPUPRO)
    237246    IF(HAVE_GPUPRO_NEW)
    238247        IF((CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR CMAKE_CL_64) AND NOT BUILD_32BIT)
  • CLRadeonExtender/trunk/utils/Utilities.cpp

    r3199 r3200  
    559559     "/usr/lib/i386-linux-gnu/amdgpu-pro",
    560560     "/opt/amdgpu-pro/lib/i386-linux-gnu",
     561     "/opt/amdgpu-pro/lib32",
    561562     "/opt/amdgpu-pro/lib",
     563     "/usr/lib/i386-linux-gnu",
    562564     "/usr/lib32",
    563565     "/usr/lib"
     
    565567     "/usr/lib/x86_64-linux-gnu/amdgpu-pro",
    566568     "/opt/amdgpu-pro/lib/x86_64-linux-gnu",
     569     "/usr/lib/x86_64-linux-gnu",
    567570     "/opt/amdgpu-pro/lib64",
    568571     "/usr/lib64"
     
    576579{
    577580    std::string amdOclPath = parseEnvVariable<std::string>("CLRX_AMDOCL_PATH", "");
    578     if (!amdOclPath.empty() && isFileExists(amdOclPath.c_str()))
    579         return amdOclPath;
    580     else if (isFileExists(DEFAULT_AMDOCLPATH))
    581         return DEFAULT_AMDOCLPATH;
     581    if (!amdOclPath.empty())
     582    {
     583        if (isFileExists(amdOclPath.c_str()))
     584            return amdOclPath;
     585    }
    582586    else
    583587        for (const char* libPath: libAmdOCLPaths)
Note: See TracChangeset for help on using the changeset viewer.