Skip to content

Commit cdc1ea8

Browse files
committed
[Comgr] Handle amdgcnspirv when used as an ISA name
1 parent 3dce363 commit cdc1ea8

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

amd/comgr/src/comgr.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,16 @@ amd_comgr_status_t COMGR::parseTargetIdentifier(StringRef IdentStr,
344344
Ident.Processor = Ident.Features[0];
345345
Ident.Features.erase(Ident.Features.begin());
346346

347-
size_t IsaIndex;
348347

348+
// TODO: Add a LIT test for this
349+
if (IdentStr == "amdgcn-amd-amdhsa--amdgcnspirv") {
350+
// Features not supported for SPIR-V
351+
if (!Ident.Features.empty())
352+
return AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT;
353+
return AMD_COMGR_STATUS_SUCCESS;
354+
}
355+
356+
size_t IsaIndex;
349357
amd_comgr_status_t Status = metadata::getIsaIndex(IdentStr, IsaIndex);
350358
if (Status != AMD_COMGR_STATUS_SUCCESS) {
351359
return Status;
@@ -1017,6 +1025,10 @@ amd_comgr_status_t AMD_COMGR_API
10171025
return AMD_COMGR_STATUS_SUCCESS;
10181026
}
10191027

1028+
if (StringRef(IsaName) == "amdgcn-amd-amdhsa--amdgcnspirv") {
1029+
return ActionP->setIsaName(IsaName);
1030+
}
1031+
10201032
if (!metadata::isValidIsaName(IsaName)) {
10211033
return AMD_COMGR_STATUS_ERROR_INVALID_ARGUMENT;
10221034
}

0 commit comments

Comments
 (0)