P4 to Git Change 1723529 by lmoriche@lmoriche_opencl_dev2 on 2018/12/21 14:55:55
SWDEV-174895 - OCL generic changes and code clean-up
- Rename the AMDGCN builtins libraries to be compatible with comgr.
Affected files ...
... //depot/stg/opencl/drivers/opencl/compiler/comgr/lib/comgr/src/comgr-device-libs.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/library/build/Makefile.library#73 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#24 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/CMakeLists.txt#17 edit
[ROCm/clr commit: 0b238e4420]
Этот коммит содержится в:
@@ -798,10 +798,10 @@ bool Program::compileImplLC(const std::string& sourceCode,
|
||||
case 100:
|
||||
case 110:
|
||||
case 120:
|
||||
hdr = { opencl1_2_c_amdgcn, opencl1_2_c_amdgcn_size };
|
||||
hdr = { opencl1_2_c, opencl1_2_c_size };
|
||||
break;
|
||||
case 200:
|
||||
hdr = { opencl2_0_c_amdgcn, opencl2_0_c_amdgcn_size };
|
||||
hdr = { opencl2_0_c, opencl2_0_c_size };
|
||||
break;
|
||||
default:
|
||||
buildLog_ += "Unsupported requested OpenCL C version (-cl-std).\n";
|
||||
@@ -1479,9 +1479,9 @@ bool Program::linkImplLC(amd::option::Options* options) {
|
||||
inputs.push_back(input); // must be the first input
|
||||
// open the bitcode libraries
|
||||
Data* opencl_bc =
|
||||
C->NewBufferReference(DT_LLVM_BC, (const char*)opencl_amdgcn, opencl_amdgcn_size);
|
||||
Data* ocml_bc = C->NewBufferReference(DT_LLVM_BC, (const char*)ocml_amdgcn, ocml_amdgcn_size);
|
||||
Data* ockl_bc = C->NewBufferReference(DT_LLVM_BC, (const char*)ockl_amdgcn, ockl_amdgcn_size);
|
||||
C->NewBufferReference(DT_LLVM_BC, (const char*)opencl_lib, opencl_lib_size);
|
||||
Data* ocml_bc = C->NewBufferReference(DT_LLVM_BC, (const char*)ocml_lib, ocml_lib_size);
|
||||
Data* ockl_bc = C->NewBufferReference(DT_LLVM_BC, (const char*)ockl_lib, ockl_lib_size);
|
||||
|
||||
if (!opencl_bc || !ocml_bc || !ockl_bc) {
|
||||
buildLog_ += "Error: Failed to open the bitcode library.\n";
|
||||
|
||||
@@ -31,7 +31,7 @@ foreach(AMDGCN_LIB_TARGET ${AMDGCN_LIB_TARGETS})
|
||||
get_target_property(lib_file_path ${AMDGCN_LIB_TARGET} ARCHIVE_OUTPUT_DIRECTORY)
|
||||
set(bclib "${lib_file_path}/${lib_file_name}.amdgcn.bc")
|
||||
set(header "${lib_file_name}.${INC_SUFFIX}")
|
||||
set(symbol "${lib_file_name}_amdgcn")
|
||||
set(symbol "${lib_file_name}_lib")
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${header}
|
||||
COMMAND bc2h ${bclib} ${CMAKE_CURRENT_BINARY_DIR}/${header} ${symbol}
|
||||
DEPENDS bc2h ${AMDGCN_LIB_TARGET}
|
||||
@@ -53,8 +53,8 @@ foreach(AMDGCN_LIB_TARGET ${AMDGCN_LIB_TARGETS})
|
||||
if (${AMDGCN_LIB_TARGET} MATCHES "^oclc_isa_version_[0-9]+_lib$")
|
||||
string(REGEX REPLACE "^oclc_isa_version_([0-9]+)_lib$" "\\1" gfxip ${AMDGCN_LIB_TARGET})
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libraries.amdgcn.inc
|
||||
"case ${gfxip}: return std::make_tuple( \"oclc_isa_version_${gfxip}_amdgcn.bc\","
|
||||
" oclc_isa_version_${gfxip}_amdgcn, oclc_isa_version_${gfxip}_amdgcn_size); break;\n")
|
||||
"case ${gfxip}: return std::make_tuple( \"oclc_isa_version_${gfxip}_lib.bc\","
|
||||
" oclc_isa_version_${gfxip}_lib, oclc_isa_version_${gfxip}_lib_size); break;\n")
|
||||
endif()
|
||||
endforeach()
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libraries.amdgcn.inc
|
||||
@@ -66,8 +66,8 @@ foreach(AMDGCN_LIB_TARGET ${AMDGCN_LIB_TARGETS})
|
||||
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/libraries.amdgcn.inc
|
||||
"static inline std::tuple<const char*,const void*,size_t> get_oclc_${function}(bool on)"
|
||||
" { return std::make_tuple( on ? \"oclc_${function}_on_lib.bc\" : \"oclc_${function}_off_lib.bc\","
|
||||
" (const void*)(on ? oclc_${function}_on_amdgcn : oclc_${function}_off_amdgcn),"
|
||||
" on ? oclc_${function}_on_amdgcn_size : oclc_${function}_off_amdgcn_size); }\n")
|
||||
" (const void*)(on ? oclc_${function}_on_lib : oclc_${function}_off_lib),"
|
||||
" on ? oclc_${function}_on_lib_size : oclc_${function}_off_lib_size); }\n")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@@ -78,7 +78,7 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch
|
||||
COMMENT "Generating opencl1.2-c.amdgcn.pch"
|
||||
)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.inc
|
||||
COMMAND bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.inc opencl1_2_c_amdgcn
|
||||
COMMAND bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.inc opencl1_2_c
|
||||
DEPENDS bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.amdgcn.pch
|
||||
COMMENT "Generating opencl1.2-c.amdgcn.inc"
|
||||
)
|
||||
@@ -92,7 +92,7 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch
|
||||
COMMENT "Generating opencl2.0-c.amdgcn.pch"
|
||||
)
|
||||
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.inc
|
||||
COMMAND bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.inc opencl2_0_c_amdgcn
|
||||
COMMAND bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.inc opencl2_0_c
|
||||
DEPENDS bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.amdgcn.pch
|
||||
COMMENT "Generating opencl2.0-c.amdgcn.inc"
|
||||
)
|
||||
|
||||
Ссылка в новой задаче
Block a user