P4 to Git Change 1523412 by emankov@em-hsa on 2018/03/06 13:28:34

SWDEV-143465 - HSAIL - Compiler Lib - sync with legacy AMDIL libUtils

	Sync with CL 1522654 (AMDIL)

	[Reason] New Utility functions will be used in the upcomming changes in HSAIL path.

	[Testing] p4precheckin (clean): http://ocltc.amd.com:8111/viewModification.html?modId=98811&personal=true&init=1&tab=vcsModificationBuilds

	[Reviewd] by Stas: http://ocltc.amd.com/reviews/r/14345

Affected files ...

... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/libUtils.cpp#30 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/libUtils.h#31 edit
... //depot/stg/opencl/drivers/opencl/compiler/lib/utils/v0_8/target_mappings.h#54 edit
... //depot/stg/opencl/drivers/opencl/runtime/build/Makefile.runtime#73 edit
Этот коммит содержится в:
foreman
2018-03-06 13:43:26 -05:00
родитель 936cfbb4b9
Коммит 119cedf0e6
3 изменённых файлов: 48 добавлений и 34 удалений
-32
Просмотреть файл
@@ -5,7 +5,6 @@
#include "api/v0_8/aclValidation.h"
#include "libUtils.h"
#include "bif/bifbase.hpp"
#include "utils/target_mappings.h"
#include "utils/versions.hpp"
#include "utils/options.hpp"
#include <cstring>
@@ -461,37 +460,6 @@ const char *getDeviceName(const aclTargetInfo &target)
return NULL;
}
/*! Function that returns the TargetMapping for
*the specific target device.
*/
static const TargetMapping& getTargetMapping(const aclTargetInfo &target)
{
switch(target.arch_id) {
default:
assert(!"Passed a device id that is invalid!");
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;
}
/*! Function that returns the library type from the TargetMapping table for
*the specific target device id.
*/
+46
Просмотреть файл
@@ -11,6 +11,7 @@
#include <cassert>
#include <cstring>
#include "library.hpp"
#include "utils/target_mappings.h"
#include "utils/bif_section_labels.hpp"
#include "utils/options.hpp"
using namespace bif;
@@ -263,6 +264,34 @@ 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;
}
inline bool is64BitTarget(const aclTargetInfo& target)
{
return (target.arch_id == aclX64 ||
@@ -293,6 +322,23 @@ inline bool isHSAILTarget(const aclTargetInfo& target)
const std::string& getLegacyLibName();
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;
}
enum scId {
SC_AMDIL = 0,
SC_HSAIL = 0,
+2 -2
Просмотреть файл
@@ -34,9 +34,9 @@ typedef struct _target_mappings_rec {
} TargetMapping;
const TargetMapping UnknownTarget = { "UnknownFamily", "UnknownChip", "UnknownCodeGen",
amd::LibraryUndefined, 0, 0, false, false, FAMILY_UNKNOWN};
amd::LibraryUndefined, 0, 0, false, false, FAMILY_UNKNOWN, false};
const TargetMapping InvalidTarget = { NULL, NULL, NULL,
amd::LibraryUndefined, 0, 0, false, false, FAMILY_UNKNOWN};
amd::LibraryUndefined, 0, 0, false, false, FAMILY_UNKNOWN, false};
typedef struct _family_map_rec {
const TargetMapping* target;