P4 to Git Change 2051060 by michliao@hliao-dev-00-hip.rocm-workspace on 2019/12/30 16:42:07
SWDEV-145570 - Clean up after `hipError_t` unification. - Replace deprecated `hipError_t` enums. Affected files ... ... //depot/stg/opencl/drivers/opencl/api/hip/hip_device_runtime.cpp#24 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_error.cpp#4 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_event.cpp#19 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_memory.cpp#94 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_module.cpp#52 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_stream.cpp#27 edit ... //depot/stg/opencl/drivers/opencl/api/hip/hip_texture.cpp#32 edit ... //depot/stg/opencl/drivers/opencl/api/hip/trace_helper.h#5 edit
This commit is contained in:
@@ -535,7 +535,7 @@ hipError_t hipExtGetLinkTypeAndHopCount(int device1, int device2, uint32_t* link
|
||||
amd_dev_obj2 = g_devices[device2]->devices()[0];
|
||||
|
||||
if (!amd_dev_obj1->findLinkTypeAndHopCount(amd_dev_obj2, linktype, hopcount)) {
|
||||
HIP_RETURN(hipErrorInvalidResourceHandle);
|
||||
HIP_RETURN(hipErrorInvalidHandle);
|
||||
}
|
||||
|
||||
HIP_RETURN(hipSuccess);
|
||||
|
||||
@@ -114,10 +114,6 @@ const char *hipGetErrorName(hipError_t hip_error)
|
||||
return "hipErrorIllegalAddress";
|
||||
case hipErrorMissingConfiguration:
|
||||
return "hipErrorMissingConfiguration";
|
||||
case hipErrorMemoryAllocation:
|
||||
return "hipErrorMemoryAllocation";
|
||||
case hipErrorInitializationError:
|
||||
return "hipErrorInitializationError";
|
||||
case hipErrorLaunchFailure:
|
||||
return "hipErrorLaunchFailure";
|
||||
case hipErrorPriorLaunchFailure:
|
||||
@@ -140,8 +136,6 @@ const char *hipGetErrorName(hipError_t hip_error)
|
||||
return "hipErrorInvalidMemcpyDirection";
|
||||
case hipErrorUnknown:
|
||||
return "hipErrorUnknown";
|
||||
case hipErrorInvalidResourceHandle:
|
||||
return "hipErrorInvalidResourceHandle";
|
||||
case hipErrorNotReady:
|
||||
return "hipErrorNotReady";
|
||||
case hipErrorNoDevice:
|
||||
|
||||
@@ -36,7 +36,7 @@ hipError_t Event::query() {
|
||||
amd::ScopedLock lock(lock_);
|
||||
|
||||
if (event_ == nullptr) {
|
||||
return hipErrorInvalidResourceHandle;
|
||||
return hipErrorInvalidHandle;
|
||||
}
|
||||
|
||||
return ready() ? hipSuccess : hipErrorNotReady;
|
||||
@@ -46,7 +46,7 @@ hipError_t Event::synchronize() {
|
||||
amd::ScopedLock lock(lock_);
|
||||
|
||||
if (event_ == nullptr) {
|
||||
return hipErrorInvalidResourceHandle;
|
||||
return hipErrorInvalidHandle;
|
||||
}
|
||||
|
||||
event_->awaitCompletion();
|
||||
@@ -59,11 +59,11 @@ hipError_t Event::elapsedTime(Event& eStop, float& ms) {
|
||||
|
||||
if (this == &eStop) {
|
||||
if (event_ == nullptr) {
|
||||
return hipErrorInvalidResourceHandle;
|
||||
return hipErrorInvalidHandle;
|
||||
}
|
||||
|
||||
if (flags & hipEventDisableTiming) {
|
||||
return hipErrorInvalidResourceHandle;
|
||||
return hipErrorInvalidHandle;
|
||||
}
|
||||
|
||||
if (!ready()) {
|
||||
@@ -77,11 +77,11 @@ hipError_t Event::elapsedTime(Event& eStop, float& ms) {
|
||||
|
||||
if (event_ == nullptr ||
|
||||
eStop.event_ == nullptr) {
|
||||
return hipErrorInvalidResourceHandle;
|
||||
return hipErrorInvalidHandle;
|
||||
}
|
||||
|
||||
if ((flags | eStop.flags) & hipEventDisableTiming) {
|
||||
return hipErrorInvalidResourceHandle;
|
||||
return hipErrorInvalidHandle;
|
||||
}
|
||||
|
||||
if (!ready() || !eStop.ready()) {
|
||||
@@ -173,7 +173,7 @@ hipError_t ihipEventCreateWithFlags(hipEvent_t* event, unsigned flags) {
|
||||
|
||||
hipError_t ihipEventQuery(hipEvent_t event) {
|
||||
if (event == nullptr) {
|
||||
return hipErrorInvalidResourceHandle;
|
||||
return hipErrorInvalidHandle;
|
||||
}
|
||||
|
||||
hip::Event* e = reinterpret_cast<hip::Event*>(event);
|
||||
@@ -197,7 +197,7 @@ hipError_t hipEventDestroy(hipEvent_t event) {
|
||||
HIP_INIT_API(hipEventDestroy, event);
|
||||
|
||||
if (event == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidResourceHandle);
|
||||
HIP_RETURN(hipErrorInvalidHandle);
|
||||
}
|
||||
|
||||
delete reinterpret_cast<hip::Event*>(event);
|
||||
@@ -209,7 +209,7 @@ hipError_t hipEventElapsedTime(float *ms, hipEvent_t start, hipEvent_t stop) {
|
||||
HIP_INIT_API(hipEventElapsedTime, ms, start, stop);
|
||||
|
||||
if (start == nullptr || stop == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidResourceHandle);
|
||||
HIP_RETURN(hipErrorInvalidHandle);
|
||||
}
|
||||
|
||||
if (ms == nullptr) {
|
||||
@@ -226,7 +226,7 @@ hipError_t hipEventRecord(hipEvent_t event, hipStream_t stream) {
|
||||
HIP_INIT_API(hipEventRecord, event, stream);
|
||||
|
||||
if (event == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidResourceHandle);
|
||||
HIP_RETURN(hipErrorInvalidHandle);
|
||||
}
|
||||
|
||||
hip::Event* e = reinterpret_cast<hip::Event*>(event);
|
||||
@@ -249,7 +249,7 @@ hipError_t hipEventSynchronize(hipEvent_t event) {
|
||||
HIP_INIT_API(hipEventSynchronize, event);
|
||||
|
||||
if (event == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidResourceHandle);
|
||||
HIP_RETURN(hipErrorInvalidHandle);
|
||||
}
|
||||
|
||||
hip::Event* e = reinterpret_cast<hip::Event*>(event);
|
||||
|
||||
@@ -70,11 +70,11 @@ hipError_t ihipMalloc(void** ptr, size_t sizeBytes, unsigned int flags)
|
||||
hip::host_context : hip::getCurrentContext();
|
||||
|
||||
if (amdContext == nullptr) {
|
||||
return hipErrorMemoryAllocation;
|
||||
return hipErrorOutOfMemory;
|
||||
}
|
||||
|
||||
if (amdContext->devices()[0]->info().maxMemAllocSize_ < sizeBytes) {
|
||||
return hipErrorMemoryAllocation;
|
||||
return hipErrorOutOfMemory;
|
||||
}
|
||||
|
||||
*ptr = amd::SvmBuffer::malloc(*amdContext, flags, sizeBytes, amdContext->devices()[0]->info().memBaseAddrAlign_);
|
||||
@@ -347,7 +347,7 @@ hipError_t ihipMallocPitch(void** ptr, size_t* pitch, size_t width, size_t heigh
|
||||
device->info().memBaseAddrAlign_);
|
||||
|
||||
if (*ptr == nullptr) {
|
||||
return hipErrorMemoryAllocation;
|
||||
return hipErrorOutOfMemory;
|
||||
}
|
||||
|
||||
return hipSuccess;
|
||||
@@ -552,7 +552,7 @@ hipError_t hipHostRegister(void* hostPtr, size_t sizeBytes, unsigned int flags)
|
||||
constexpr bool forceAlloc = true;
|
||||
if (!mem->create(hostPtr, sysMemAlloc, skipAlloc, forceAlloc)) {
|
||||
mem->release();
|
||||
HIP_RETURN(hipErrorMemoryAllocation);
|
||||
HIP_RETURN(hipErrorOutOfMemory);
|
||||
}
|
||||
|
||||
for (const auto& device: hip::getCurrentContext()->devices()) {
|
||||
|
||||
@@ -342,7 +342,7 @@ hipError_t ihipModuleLaunchKernel(hipFunction_t f,
|
||||
// Capture the kernel arguments
|
||||
if (CL_SUCCESS != command->captureAndValidate()) {
|
||||
delete command;
|
||||
return hipErrorMemoryAllocation;
|
||||
return hipErrorOutOfMemory;
|
||||
}
|
||||
|
||||
command->enqueue();
|
||||
|
||||
@@ -183,7 +183,7 @@ hipError_t hipStreamDestroy(hipStream_t stream) {
|
||||
HIP_INIT_API(hipStreamDestroy, stream);
|
||||
|
||||
if (stream == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidResourceHandle);
|
||||
HIP_RETURN(hipErrorInvalidHandle);
|
||||
}
|
||||
|
||||
amd::ScopedLock lock(streamSetLock);
|
||||
@@ -210,7 +210,7 @@ hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int
|
||||
}
|
||||
|
||||
if (event == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidResourceHandle);
|
||||
HIP_RETURN(hipErrorInvalidHandle);
|
||||
}
|
||||
|
||||
hip::Event* e = reinterpret_cast<hip::Event*>(event);
|
||||
@@ -252,7 +252,7 @@ hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback
|
||||
|
||||
if(!event.setCallback(CL_COMPLETE, ihipStreamCallback, reinterpret_cast<void*>(cbo))) {
|
||||
command->release();
|
||||
return hipErrorInvalidResourceHandle;
|
||||
return hipErrorInvalidHandle;
|
||||
}
|
||||
|
||||
event.notifyCmdQueue();
|
||||
|
||||
@@ -371,7 +371,7 @@ hipError_t hipCreateTextureObject(hipTextureObject_t* pTexObject, const hipResou
|
||||
|
||||
if (!image->create()) {
|
||||
delete image;
|
||||
HIP_RETURN(hipErrorMemoryAllocation);
|
||||
HIP_RETURN(hipErrorOutOfMemory);
|
||||
}
|
||||
|
||||
amd::Sampler* sampler = fillSamplerDescriptor(pTexDesc->addressMode[0], pTexDesc->filterMode, pTexDesc->normalizedCoords);
|
||||
@@ -467,7 +467,7 @@ hipError_t ihipBindTexture(cl_mem_object_type type,
|
||||
type, memory->getMemFlags(), imageFormat, width, height, depth, rowPitch, slicePitch);
|
||||
if (!image->create()) {
|
||||
delete image;
|
||||
return hipErrorMemoryAllocation;
|
||||
return hipErrorOutOfMemory;
|
||||
}
|
||||
|
||||
*offset = 0;
|
||||
|
||||
@@ -77,8 +77,6 @@ inline const char* ihipErrorString(hipError_t hip_error) {
|
||||
CASE_STR(hipErrorNotFound);
|
||||
CASE_STR(hipErrorIllegalAddress);
|
||||
CASE_STR(hipErrorMissingConfiguration);
|
||||
CASE_STR(hipErrorMemoryAllocation);
|
||||
CASE_STR(hipErrorInitializationError);
|
||||
CASE_STR(hipErrorLaunchFailure);
|
||||
CASE_STR(hipErrorPriorLaunchFailure);
|
||||
CASE_STR(hipErrorLaunchTimeOut);
|
||||
@@ -90,7 +88,6 @@ inline const char* ihipErrorString(hipError_t hip_error) {
|
||||
CASE_STR(hipErrorInvalidDevicePointer);
|
||||
CASE_STR(hipErrorInvalidMemcpyDirection);
|
||||
CASE_STR(hipErrorUnknown);
|
||||
CASE_STR(hipErrorInvalidResourceHandle);
|
||||
CASE_STR(hipErrorNotReady);
|
||||
CASE_STR(hipErrorNoDevice);
|
||||
CASE_STR(hipErrorPeerAccessAlreadyEnabled);
|
||||
|
||||
Reference in New Issue
Block a user