Skip to content

Commit 6c02667

Browse files
committed
Handle not found for cuda
1 parent 5efadf1 commit 6c02667

File tree

1 file changed

+11
-1
lines changed
  • offload/plugins-nextgen/cuda/src

1 file changed

+11
-1
lines changed

offload/plugins-nextgen/cuda/src/rtl.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1526,8 +1526,18 @@ static Error Plugin::check(int32_t Code, const char *ErrFmt, ArgsTy... Args) {
15261526
if (Ret != CUDA_SUCCESS)
15271527
REPORT("Unrecognized " GETNAME(TARGET_NAME) " error code %d\n", Code);
15281528

1529+
// TODO: Add more entries to this switch
1530+
ErrorCode OffloadErrCode;
1531+
switch (ResultCode) {
1532+
case CUDA_ERROR_NOT_FOUND:
1533+
OffloadErrCode = ErrorCode::NOT_FOUND;
1534+
break;
1535+
default:
1536+
OffloadErrCode = ErrorCode::UNKNOWN;
1537+
}
1538+
15291539
// TODO: Create a map for CUDA error codes to Offload error codes
1530-
return Plugin::error(ErrorCode::UNKNOWN, ErrFmt, Args..., Desc);
1540+
return Plugin::error(OffloadErrCode, ErrFmt, Args..., Desc);
15311541
}
15321542

15331543
} // namespace plugin

0 commit comments

Comments
 (0)