[rocm][hip] Name the function for excessive shared memory in error (#16460)
diff --git a/experimental/hip/native_executable.c b/experimental/hip/native_executable.c
index b3f7253..03512a5 100644
--- a/experimental/hip/native_executable.c
+++ b/experimental/hip/native_executable.c
@@ -220,11 +220,11 @@
}
if (shared_memory_sizes_vec[i] > max_shared_memory) {
- status =
- iree_make_status(IREE_STATUS_OUT_OF_RANGE,
- "requested shared memory size of %u bytes "
- "larger than allowed size of %u bytes",
- shared_memory_sizes_vec[i], max_shared_memory);
+ status = iree_make_status(
+ IREE_STATUS_INVALID_ARGUMENT,
+ "function '%s' requested shared memory size of %u bytes larger "
+ "than allowed size of %u bytes",
+ entry_name, shared_memory_sizes_vec[i], max_shared_memory);
} else {
status = IREE_HIP_RESULT_TO_STATUS(
symbols,
diff --git a/experimental/rocm/native_executable.c b/experimental/rocm/native_executable.c
index 0168687..b6b74bf 100644
--- a/experimental/rocm/native_executable.c
+++ b/experimental/rocm/native_executable.c
@@ -125,11 +125,11 @@
break;
}
if (shared_memory_sizes[i] > max_shared_mem) {
- status =
- iree_make_status(IREE_STATUS_INTERNAL,
- "ROCM driver error: Requested shared memory "
- "size of %d larger than allowed size of %d",
- shared_memory_sizes[i], max_shared_mem);
+ status = iree_make_status(IREE_STATUS_INVALID_ARGUMENT,
+ "function '%s' requested shared memory "
+ "size of %d larger than allowed size of %d",
+ entry_name, shared_memory_sizes[i],
+ max_shared_mem);
} else if (shared_memory_sizes[i] != 0) {
status = ROCM_RESULT_TO_STATUS(
context->syms,