P4 to Git Change 1402945 by lmoriche@lmoriche_palamida on 2017/04/26 16:03:39

SWDEV-102733 - [OCL-LC-ROCm] Cmake build Write CMakeLists.txt to enable building with and without the DK environment

Affected files ...

... //depot/stg/opencl/drivers/opencl/CMakeLists.txt#5 edit
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/CMakeLists.txt#1 add
... //depot/stg/opencl/drivers/opencl/compiler/lib/loaders/elf/utils/libelf/CMakeLists.txt#1 add
... //depot/stg/opencl/drivers/opencl/runtime/CMakeLists.txt#1 add
... //depot/stg/opencl/drivers/opencl/runtime/device/appprofile.cpp#18 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/CMakeLists.txt#1 add
... //depot/stg/opencl/drivers/opencl/tools/bc2h/CMakeLists.txt#1 add


[ROCm/clr commit: a1efbe4b5b]
This commit is contained in:
foreman
2017-04-26 16:10:30 -04:00
parent e121e9beb2
commit c2cfba473d
2 changed files with 66 additions and 1 deletions
@@ -0,0 +1,49 @@
find_library(HSA_LIB hsa-runtime64 HINTS /opt/rocm/lib)
set(CMAKE_CXX_FLAGS "-std=c++11")
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--unresolved-symbols=report-all")
add_definitions(-DLINUX -D__x86_64__ -D__AMD64__ -DUNIX_OS -DqLittleEndian -DAMD_LIBELF -DOPENCL_MAJOR=2 -DOPENCL_MINOR=0 -DWITH_AQL -DWITH_ONLINE_COMPILER -DATI_OS_LINUX -DATI_ARCH_X86 -DLITTLEENDIAN_CPU -DATI_BITS_64 -DATI_COMP_GCC -DWITH_HSA_DEVICE -DWITH_TARGET_AMDGCN -DOPENCL_EXPORTS -DCL_USE_DEPRECATED_OPENCL_1_1_APIS -DCL_USE_DEPRECATED_OPENCL_1_2_APIS -DCL_USE_DEPRECATED_OPENCL_2_0_APIS -DWITH_VERSION_0_8=1 -DVEGA10_ONLY=false -DWITH_LIGHTNING_COMPILER)
include_directories(${CMAKE_SOURCE_DIR}/runtime)
include_directories(${CMAKE_SOURCE_DIR}/api/opencl)
include_directories(${CMAKE_SOURCE_DIR}/api/opencl/khronos)
include_directories(${CMAKE_SOURCE_DIR}/api/opencl/khronos/headers)
include_directories(${CMAKE_SOURCE_DIR}/api/opencl/khronos/headers/opencl2.0)
include_directories(${CMAKE_SOURCE_DIR}/compiler/driver/src)
include_directories(${CMAKE_SOURCE_DIR}/compiler/lib)
include_directories(${CMAKE_SOURCE_DIR}/compiler/lib/include)
include_directories(${CMAKE_SOURCE_DIR}/compiler/lib/backends/common)
include_directories(${CMAKE_SOURCE_DIR}/compiler/lib/loaders)
include_directories(${CMAKE_SOURCE_DIR}/compiler/tools)
add_library(amdocl64 SHARED
cl_memobj.cpp
cl_program.cpp
cl_sdi_amd.cpp
cl_device.cpp
cl_debugger_amd.cpp
cl_svm.cpp
cl_sampler.cpp
cl_thread_trace_amd.cpp
cl_object.cpp
cl_counter.cpp
cl_d3d10.cpp
cl_d3d9.cpp
cl_command.cpp
cl_platform_amd.cpp
cl_event.cpp
cl_lqdflash_amd.cpp
cl_kernel_info_amd.cpp
cl_execute.cpp
cl_gl.cpp
cl_icd.cpp
cl_pipe.cpp
cl_d3d11.cpp
cl_context.cpp
cl_profile_amd.cpp
$<TARGET_OBJECTS:oclruntime>
$<TARGET_OBJECTS:oclrocm>
)
target_link_libraries(amdocl64 opencl_driver oclelf pthread dl ${HSA_LIB})