Add stronger checking

- Add assertions to enforce that objects are of the correct kind and
  have been allocated.

- Make destructors check if objects have been allocated before
  deleting.

- Operations that require a non-NullDevice return failure if given a
  NullDevice.

- Use static_cast rather than reinterpret_cast when cohersing from a
  base class to a derived class.

Change-Id: I02ee0ea9d7982fd7ca29d49c9b02cfae111b7127


[ROCm/clr commit: e5431676d4]
Cette révision appartient à :
Tony Tye
2021-01-10 02:09:00 +00:00
Parent 2cb73c8b82
révision 29ca46821b
11 fichiers modifiés avec 96 ajouts et 13 suppressions
+3
Voir le fichier
@@ -68,6 +68,9 @@ void HSAILKernel::setWorkGroupInfo(const uint32_t privateSegmentSize,
}
bool HSAILKernel::setKernelCode(amd::hsa::loader::Symbol* sym, amd_kernel_code_t* akc) {
if (prog().isNull()) {
return false;
}
if (!sym) {
return false;
}