P4 to Git Change 1310350 by lmoriche@lmoriche_opencl_dev on 2016/09/02 12:29:12

SWDEV-101853 - Use the PointeeAlignment metadata to align the dynamic LDS allocations at dispatch.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/amdgpu_metadata.cpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/amdgpu_metadata.hpp#3 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rockernel.cpp#11 edit
This commit is contained in:
foreman
2016-09-02 12:33:55 -04:00
orang tua 411cf8cc1d
melakukan b581f2510b
3 mengubah file dengan 16 tambahan dan 3 penghapusan
@@ -124,7 +124,7 @@ namespace code {
namespace KernelArg {
using namespace AMDGPU::RuntimeMD::KernelArg;
Metadata::Metadata()
: size(0), align(0),
: size(0), align(0), pointeeAlign(0),
isConst(false), isRestrict(false), isVolatile(false), isPipe(false)
{}
@@ -177,6 +177,7 @@ namespace code {
case KeyArgName: return Read(in, name);
case KeyArgTypeKind: return Read(in, typeKind);
case KeyArgValueType: return Read(in, valueType);
case KeyArgPointeeAlign: return Read(in, pointeeAlign);
case KeyArgAddrQual: return Read(in, addrQual);
case KeyArgAccQual: return Read(in, accQual);
case KeyArgIsConst: isConst = true; return true;
@@ -261,6 +262,7 @@ namespace code {
case KeyArgName:
case KeyArgTypeKind:
case KeyArgValueType:
case KeyArgPointeeAlign:
case KeyArgAddrQual:
case KeyArgAccQual:
case KeyArgIsConst:
@@ -424,6 +426,7 @@ namespace code {
case KeyArgName:
case KeyArgTypeKind:
case KeyArgValueType:
case KeyArgPointeeAlign:
case KeyArgAddrQual:
case KeyArgAccQual:
case KeyArgIsConst:
@@ -61,6 +61,7 @@ namespace code {
private:
uint32_t size;
uint32_t align;
uint32_t pointeeAlign;
std::string typeName;
std::string name;
AMDGPU::RuntimeMD::KernelArg::TypeKind typeKind;
@@ -73,6 +74,7 @@ namespace code {
Metadata();
uint32_t Size() const { return size; }
uint32_t Align() const { return align; }
uint32_t PointeeAlign() const { return pointeeAlign; }
const std::string& TypeName() const { return typeName; }
const std::string& Name() const { return name; }
AMDGPU::RuntimeMD::KernelArg::TypeKind TypeKind() const { return typeKind; }
+10 -2
Melihat File
@@ -56,9 +56,17 @@ GetHSAILArgType(const aclArgData* argInfo)
inline static size_t
GetHSAILArgAlignment(const amd::hsa::code::KernelArg::Metadata* lcArg)
{
if (lcArg->TypeKind() == AMDGPU::RuntimeMD::KernelArg::Pointer)
if (lcArg->TypeKind() == AMDGPU::RuntimeMD::KernelArg::Pointer) {
if (lcArg->AddrQual() == AMDGPU::RuntimeMD::KernelArg::Local) {
uint32_t align = lcArg->PointeeAlign();
if (align == 0) {
LogWarning("Missing dynamic_shared_pointer alignment");
align = 128; /* worst case alignment */;
}
return align;
}
return lcArg->Align();
}
return 1;
}
#endif // defined(WITH_LIGHTNING_COMPILER)