P4 to Git Change 1614278 by wchau@wchau_OCL_cmake on 2018/10/03 21:04:41
SWDEV-165756 - [ROCm] Backport cmake back into perforce to resolve cmake build broken issue
(Resubmitted CL1613181 with a bug fix)
- porting CMAKE changes in http://git.amd.com:8080/#/c/173995/
- add new source file names in runtime/CMakeLists.txt
-- required additional changes of CMAKE files from Konstantin to build the current OCL driver using CMAKE
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/CMakeLists.txt#17 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/libUtils.cpp#34 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/libUtils.h#34 edit
... //depot/stg/opencl/drivers/opencl/runtime/CMakeLists.txt#13 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/CMakeLists.txt#15 edit
[ROCm/clr commit: 24437ae9d9]
Cette révision appartient à :
@@ -460,6 +460,45 @@ const char *getDeviceName(const aclTargetInfo &target)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const TargetMapping& getTargetMapping(const aclTargetInfo &target)
|
||||
{
|
||||
switch (target.arch_id) {
|
||||
default:
|
||||
break;
|
||||
case aclX64:
|
||||
return X64TargetMapping[target.chip_id];
|
||||
break;
|
||||
case aclX86:
|
||||
return X86TargetMapping[target.chip_id];
|
||||
break;
|
||||
case aclHSAIL:
|
||||
return HSAILTargetMapping[target.chip_id];
|
||||
break;
|
||||
case aclHSAIL64:
|
||||
return HSAIL64TargetMapping[target.chip_id];
|
||||
break;
|
||||
case aclAMDIL:
|
||||
return AMDILTargetMapping[target.chip_id];
|
||||
break;
|
||||
case aclAMDIL64:
|
||||
return AMDIL64TargetMapping[target.chip_id];
|
||||
break;
|
||||
};
|
||||
return UnknownTarget;
|
||||
}
|
||||
|
||||
bool isChipSupported(const aclTargetInfo& target)
|
||||
{
|
||||
if (!isValidTarget(target)) {
|
||||
return false;
|
||||
}
|
||||
const TargetMapping& Mapping = getTargetMapping(target);
|
||||
if (Mapping.family_enum == FAMILY_UNKNOWN) {
|
||||
return false;
|
||||
}
|
||||
return Mapping.supported;
|
||||
}
|
||||
|
||||
/*! Function that returns the library type from the TargetMapping table for
|
||||
*the specific target device id.
|
||||
*/
|
||||
|
||||
@@ -265,32 +265,7 @@ aclutUpdateMetadataWithHiddenKernargsNum(aclCompiler* cl, aclBinary* bin, uint32
|
||||
#endif
|
||||
|
||||
// Returns the TargetMapping for the specific target device.
|
||||
inline const TargetMapping& getTargetMapping(const aclTargetInfo &target)
|
||||
{
|
||||
switch (target.arch_id) {
|
||||
default:
|
||||
break;
|
||||
case aclX64:
|
||||
return X64TargetMapping[target.chip_id];
|
||||
break;
|
||||
case aclX86:
|
||||
return X86TargetMapping[target.chip_id];
|
||||
break;
|
||||
case aclHSAIL:
|
||||
return HSAILTargetMapping[target.chip_id];
|
||||
break;
|
||||
case aclHSAIL64:
|
||||
return HSAIL64TargetMapping[target.chip_id];
|
||||
break;
|
||||
case aclAMDIL:
|
||||
return AMDILTargetMapping[target.chip_id];
|
||||
break;
|
||||
case aclAMDIL64:
|
||||
return AMDIL64TargetMapping[target.chip_id];
|
||||
break;
|
||||
};
|
||||
return UnknownTarget;
|
||||
}
|
||||
const TargetMapping& getTargetMapping(const aclTargetInfo &target);
|
||||
|
||||
inline bool is64BitTarget(const aclTargetInfo& target)
|
||||
{
|
||||
@@ -327,17 +302,7 @@ inline bool isValidTarget(const aclTargetInfo& target)
|
||||
return (target.arch_id && target.chip_id);
|
||||
}
|
||||
|
||||
inline bool isChipSupported(const aclTargetInfo& target)
|
||||
{
|
||||
if (!isValidTarget(target)) {
|
||||
return false;
|
||||
}
|
||||
const TargetMapping& Mapping = getTargetMapping(target);
|
||||
if (Mapping.family_enum == FAMILY_UNKNOWN) {
|
||||
return false;
|
||||
}
|
||||
return Mapping.supported;
|
||||
}
|
||||
bool isChipSupported(const aclTargetInfo& target);
|
||||
|
||||
enum scId {
|
||||
SC_AMDIL = 0,
|
||||
|
||||
@@ -39,6 +39,9 @@ add_library(oclruntime OBJECT
|
||||
device/hwdebug.cpp
|
||||
device/blitcl.cpp
|
||||
device/blit.cpp
|
||||
device/devkernel.cpp
|
||||
device/devwavelimiter.cpp
|
||||
device/devprogram.cpp
|
||||
platform/kernel.cpp
|
||||
platform/context.cpp
|
||||
platform/command.cpp
|
||||
|
||||
@@ -13,13 +13,13 @@ add_library(oclrocm OBJECT
|
||||
rocprogram.cpp
|
||||
rocmemory.cpp
|
||||
rocdevice.cpp
|
||||
roccompiler.cpp
|
||||
rocblit.cpp
|
||||
rockernel.cpp
|
||||
rocvirtual.cpp
|
||||
rocglinterop.cpp
|
||||
rocappprofile.cpp
|
||||
rocsettings.cpp
|
||||
rocschedcl.cpp
|
||||
)
|
||||
set_target_properties(oclrocm PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur