From 0722704f35caaccf8ec829044662f2f39bdb16e8 Mon Sep 17 00:00:00 2001 From: Sarbojit2019 <52527887+SarbojitAMD@users.noreply.github.com> Date: Thu, 29 Aug 2019 06:32:59 +0530 Subject: [PATCH] Updated hipErrorString and CUDAErrorTohipError (#1365) --- include/hip/nvcc_detail/hip_runtime_api.h | 82 +++++++++++++++++------ src/hip_hcc.cpp | 10 +++ 2 files changed, 72 insertions(+), 20 deletions(-) diff --git a/include/hip/nvcc_detail/hip_runtime_api.h b/include/hip/nvcc_detail/hip_runtime_api.h index 6150969b25..095943313c 100644 --- a/include/hip/nvcc_detail/hip_runtime_api.h +++ b/include/hip/nvcc_detail/hip_runtime_api.h @@ -216,38 +216,80 @@ inline static hipError_t hipCUDAErrorTohipError(cudaError_t cuError) { switch (cuError) { case cudaSuccess: return hipSuccess; + case cudaErrorProfilerDisabled: + return hipErrorProfilerDisabled; + case cudaErrorProfilerNotInitialized: + return hipErrorProfilerNotInitialized; + case cudaErrorProfilerAlreadyStarted: + return hipErrorProfilerAlreadyStarted; + case cudaErrorProfilerAlreadyStopped: + return hipErrorProfilerAlreadyStopped; + case cudaErrorInsufficientDriver: + return hipErrorInsufficientDriver; + case cudaErrorUnsupportedLimit: + return hipErrorUnsupportedLimit; + case cudaErrorPeerAccessUnsupported: + return hipErrorPeerAccessUnsupported; + case cudaErrorInvalidGraphicsContext: + return hipErrorInvalidGraphicsContext; + case cudaErrorSharedObjectSymbolNotFound: + return hipErrorSharedObjectSymbolNotFound; + case cudaErrorSharedObjectInitFailed: + return hipErrorSharedObjectInitFailed; + case cudaErrorOperatingSystem: + return hipErrorOperatingSystem; + case cudaErrorSetOnActiveProcess: + return hipErrorSetOnActiveProcess; + case cudaErrorIllegalAddress: + return hipErrorIllegalAddress; + case cudaErrorInvalidSymbol: + return hipErrorInvalidSymbol; + case cudaErrorMissingConfiguration: + return hipErrorMissingConfiguration; case cudaErrorMemoryAllocation: return hipErrorMemoryAllocation; - case cudaErrorLaunchOutOfResources: - return hipErrorLaunchOutOfResources; - case cudaErrorInvalidValue: - return hipErrorInvalidValue; - case cudaErrorInvalidResourceHandle: - return hipErrorInvalidResourceHandle; - case cudaErrorInvalidDevice: - return hipErrorInvalidDevice; - case cudaErrorInvalidMemcpyDirection: - return hipErrorInvalidMemcpyDirection; - case cudaErrorInvalidDevicePointer: - return hipErrorInvalidDevicePointer; case cudaErrorInitializationError: return hipErrorInitializationError; - case cudaErrorNoDevice: - return hipErrorNoDevice; - case cudaErrorNotReady: - return hipErrorNotReady; + case cudaErrorLaunchFailure: + return hipErrorLaunchFailure; + case cudaErrorPriorLaunchFailure: + return hipErrorPriorLaunchFailure; + case cudaErrorLaunchOutOfResources: + return hipErrorLaunchOutOfResources; + case cudaErrorInvalidDeviceFunction: + return hipErrorInvalidDeviceFunction; + case cudaErrorInvalidConfiguration: + return hipErrorInvalidConfiguration; + case cudaErrorInvalidDevice: + return hipErrorInvalidDevice; + case cudaErrorInvalidValue: + return hipErrorInvalidValue; + case cudaErrorInvalidDevicePointer: + return hipErrorInvalidDevicePointer; + case cudaErrorInvalidMemcpyDirection: + return hipErrorInvalidMemcpyDirection; case cudaErrorUnknown: return hipErrorUnknown; - case cudaErrorPeerAccessNotEnabled: - return hipErrorPeerAccessNotEnabled; + case cudaErrorInvalidResourceHandle: + return hipErrorInvalidResourceHandle; + case cudaErrorNotReady: + return hipErrorNotReady; + case cudaErrorNoDevice: + return hipErrorNoDevice; case cudaErrorPeerAccessAlreadyEnabled: return hipErrorPeerAccessAlreadyEnabled; + case cudaErrorPeerAccessNotEnabled: + return hipErrorPeerAccessNotEnabled; case cudaErrorHostMemoryAlreadyRegistered: return hipErrorHostMemoryAlreadyRegistered; case cudaErrorHostMemoryNotRegistered: return hipErrorHostMemoryNotRegistered; - case cudaErrorUnsupportedLimit: - return hipErrorUnsupportedLimit; + case cudaErrorMapBufferObjectFailed: + return hipErrorMapBufferObjectFailed; + case cudaErrorAssert: + return hipErrorAssert; + case cudaErrorNotSupported: + return hipErrorNotSupported; default: return hipErrorUnknown; // Note - translated error. } diff --git a/src/hip_hcc.cpp b/src/hip_hcc.cpp index da0b38ed4f..96b8e84298 100644 --- a/src/hip_hcc.cpp +++ b/src/hip_hcc.cpp @@ -1671,6 +1671,8 @@ const char* ihipErrorString(hipError_t hip_error) { return "hipErrorProfilerAlreadyStarted"; case hipErrorProfilerAlreadyStopped: return "hipErrorProfilerAlreadyStopped"; + case hipErrorInsufficientDriver: + return "hipErrorInsufficientDriver"; case hipErrorInvalidImage: return "hipErrorInvalidImage"; case hipErrorInvalidContext: @@ -1725,6 +1727,8 @@ const char* ihipErrorString(hipError_t hip_error) { return "hipErrorNotFound"; case hipErrorIllegalAddress: return "hipErrorIllegalAddress"; + case hipErrorInvalidSymbol: + return "hipErrorInvalidSymbol"; case hipErrorMissingConfiguration: return "hipErrorMissingConfiguration"; @@ -1773,6 +1777,12 @@ const char* ihipErrorString(hipError_t hip_error) { return "hipErrorHostMemoryAlreadyRegistered"; case hipErrorHostMemoryNotRegistered: return "hipErrorHostMemoryNotRegistered"; + case hipErrorMapBufferObjectFailed: + return "hipErrorMapBufferObjectFailed"; + case hipErrorAssert: + return "hipErrorAssert"; + case hipErrorNotSupported: + return "hipErrorNotSupported"; case hipErrorTbd: return "hipErrorTbd"; default: