[Openmp-commits] [PATCH] D102230: [libomptarget][amdgpu][nfc] Expand errorcheck macros

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Wed May 12 07:05:26 PDT 2021


protze.joachim added inline comments.


================
Comment at: openmp/libomptarget/plugins/amdgpu/impl/data.cpp:52-54
+    printf("[%s:%d] %s failed: %s\n", __FILE__, __LINE__, "atmi_malloc",
+           get_error_string(err));
+    exit(1);
----------------
JonChesterfield wrote:
> pdhaliwal wrote:
> > Will it be better to use assert's here?
> No, malloc can fail, and its failure can be handled. Assert might be better than exit, but what we actually need is return some-error-code
Isn't that was the lines below do?


================
Comment at: openmp/libomptarget/plugins/amdgpu/impl/data.cpp:60
   if (err != HSA_STATUS_SUCCESS)
     ret = ATMI_STATUS_ERROR;
 
----------------
This line cannot be reached with your change.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D102230/new/

https://reviews.llvm.org/D102230



More information about the Openmp-commits mailing list