ROCm / clr

MIT License
85 stars 35 forks source link

hipUserObjectRetain return hipErrorInvalidValue? #25

Open Dustray opened 7 months ago

Dustray commented 7 months ago

Should it be returning unsuccessful?

hipError_t hipUserObjectRetain(hipUserObject_t object, unsigned int count) {
  HIP_INIT_API(hipUserObjectRetain, object, count);
  if (object == nullptr || count == 0 || count > INT_MAX) {
    HIP_RETURN(hipErrorInvalidValue);
  }
  if (!hipUserObject::isUserObjvalid(object)) {
    HIP_RETURN(hipSuccess);  <<<<<<<<<<<<<
  }
  object->increaseRefCount(count);
  HIP_RETURN(hipSuccess);
}

https://github.com/ROCm-Developer-Tools/clr/blob/9fdee05aeea7db0e20bc65770556aefd1d2c78f0/hipamd/src/hip_graph.cpp#L2460C20-L2460C20

iassiour commented 7 months ago

Returning success when the userObject is invalid seems to be consistent with cuda behaviour. But it is counter-intuitive. Let me follow up on this.