SWDEV-252801 - Fix return HIP_RETURN(x)
HIP_RETURN(x) is not a value, it is a statement ending with a return, this commit replaces all instances of "return HIP_RETURN(x)" with simply "HIP_RETURN(x)" Change-Id: I03293b2684a65367ff55e02b3a71ea49ec7a517a
This commit is contained in:
@@ -419,7 +419,7 @@ hipError_t hipDeviceGetPCIBusId ( char* pciBusId, int len, int device ) {
|
||||
hipError_t hipDeviceGetSharedMemConfig ( hipSharedMemConfig * pConfig ) {
|
||||
HIP_INIT_API(hipDeviceGetSharedMemConfig, pConfig);
|
||||
if (pConfig == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
*pConfig = hipSharedMemBankSizeFourByte;
|
||||
|
||||
|
||||
+12
-12
@@ -427,7 +427,7 @@ hipError_t hipGraphAddEmptyNode(hipGraphNode_t* pGraphNode, hipGraph_t graph,
|
||||
HIP_INIT_API(hipGraphAddEmptyNode, pGraphNode, graph, pDependencies, numDependencies);
|
||||
if (pGraphNode == nullptr || graph == nullptr ||
|
||||
(numDependencies > 0 && pDependencies == nullptr)) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
*pGraphNode = new hipGraphEmptyNode();
|
||||
if (numDependencies == 0) {
|
||||
@@ -480,7 +480,7 @@ hipError_t hipGraphLaunch(hipGraphExec_t graphExec, hipStream_t stream) {
|
||||
hipError_t hipGraphGetNodes(hipGraph_t graph, hipGraphNode_t* nodes, size_t* numNodes) {
|
||||
HIP_INIT_API(hipGraphGetNodes, graph, nodes, numNodes);
|
||||
if (graph == nullptr || numNodes == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
*numNodes = graph->GetNodeCount();
|
||||
if (*numNodes > 0) {
|
||||
@@ -493,7 +493,7 @@ hipError_t hipGraphGetRootNodes(hipGraph_t graph, hipGraphNode_t* pRootNodes,
|
||||
size_t* pNumRootNodes) {
|
||||
HIP_INIT_API(hipGraphGetRootNodes, graph, pRootNodes, pNumRootNodes);
|
||||
if (graph == nullptr || pNumRootNodes == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
std::vector<Node> rootNodes = graph->GetRootNodes();
|
||||
pRootNodes = rootNodes.data();
|
||||
@@ -504,7 +504,7 @@ hipError_t hipGraphGetRootNodes(hipGraph_t graph, hipGraphNode_t* pRootNodes,
|
||||
hipError_t hipGraphKernelNodeGetParams(hipGraphNode_t node, hipKernelNodeParams* pNodeParams) {
|
||||
HIP_INIT_API(hipGraphKernelNodeGetParams, node, pNodeParams);
|
||||
if (node == nullptr || pNodeParams == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
reinterpret_cast<hipGraphKernelNode*>(node)->GetParams(pNodeParams);
|
||||
HIP_RETURN(hipSuccess);
|
||||
@@ -514,7 +514,7 @@ hipError_t hipGraphKernelNodeSetParams(hipGraphNode_t node,
|
||||
const hipKernelNodeParams* pNodeParams) {
|
||||
HIP_INIT_API(hipGraphKernelNodeSetParams, node, pNodeParams);
|
||||
if (node == nullptr || pNodeParams == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
reinterpret_cast<hipGraphKernelNode*>(node)->SetParams(pNodeParams);
|
||||
HIP_RETURN(hipSuccess);
|
||||
@@ -523,7 +523,7 @@ hipError_t hipGraphKernelNodeSetParams(hipGraphNode_t node,
|
||||
hipError_t hipGraphMemcpyNodeGetParams(hipGraphNode_t node, hipMemcpy3DParms* pNodeParams) {
|
||||
HIP_INIT_API(hipGraphMemcpyNodeGetParams, node, pNodeParams);
|
||||
if (node == nullptr || pNodeParams == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
reinterpret_cast<hipGraphMemcpyNode*>(node)->GetParams(pNodeParams);
|
||||
HIP_RETURN(hipSuccess);
|
||||
@@ -532,7 +532,7 @@ hipError_t hipGraphMemcpyNodeGetParams(hipGraphNode_t node, hipMemcpy3DParms* pN
|
||||
hipError_t hipGraphMemcpyNodeSetParams(hipGraphNode_t node, const hipMemcpy3DParms* pNodeParams) {
|
||||
HIP_INIT_API(hipGraphMemcpyNodeSetParams, node, pNodeParams);
|
||||
if (node == nullptr || pNodeParams == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
reinterpret_cast<hipGraphMemcpyNode*>(node)->SetParams(pNodeParams);
|
||||
HIP_RETURN(hipSuccess);
|
||||
@@ -541,7 +541,7 @@ hipError_t hipGraphMemcpyNodeSetParams(hipGraphNode_t node, const hipMemcpy3DPar
|
||||
hipError_t hipGraphMemsetNodeGetParams(hipGraphNode_t node, hipMemsetParams* pNodeParams) {
|
||||
HIP_INIT_API(hipGraphMemsetNodeGetParams, node, pNodeParams);
|
||||
if (node == nullptr || pNodeParams == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
reinterpret_cast<hipGraphMemsetNode*>(node)->GetParams(pNodeParams);
|
||||
HIP_RETURN(hipSuccess);
|
||||
@@ -550,7 +550,7 @@ hipError_t hipGraphMemsetNodeGetParams(hipGraphNode_t node, hipMemsetParams* pNo
|
||||
hipError_t hipGraphMemsetNodeSetParams(hipGraphNode_t node, const hipMemsetParams* pNodeParams) {
|
||||
HIP_INIT_API(hipGraphMemsetNodeSetParams, node, pNodeParams);
|
||||
if (node == nullptr || pNodeParams == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
reinterpret_cast<hipGraphMemsetNode*>(node)->SetParams(pNodeParams);
|
||||
HIP_RETURN(hipSuccess);
|
||||
@@ -560,12 +560,12 @@ hipError_t hipGraphAddDependencies(hipGraph_t graph, const hipGraphNode_t* from,
|
||||
const hipGraphNode_t* to, size_t numDependencies) {
|
||||
HIP_INIT_API(hipGraphAddDependencies, graph, from, to, numDependencies);
|
||||
if (graph == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
if (numDependencies == 0) {
|
||||
HIP_RETURN(hipSuccess);
|
||||
} else if (from == nullptr || to == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
for (size_t i = 0; i < numDependencies; i++) {
|
||||
if (graph->AddEdge(from[i], to[i]) != hipSuccess) {
|
||||
@@ -579,7 +579,7 @@ hipError_t hipGraphExecKernelNodeSetParams(hipGraphExec_t hGraphExec, hipGraphNo
|
||||
const hipKernelNodeParams* pNodeParams) {
|
||||
HIP_INIT_API(hipGraphExecKernelNodeSetParams, hGraphExec, node, pNodeParams);
|
||||
if (hGraphExec == nullptr || node == nullptr || pNodeParams == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
return reinterpret_cast<hipGraphKernelNode*>(node)->SetCommandParams(pNodeParams);
|
||||
}
|
||||
|
||||
@@ -642,7 +642,7 @@ hipError_t hipLaunchCooperativeKernelMultiDevice(hipLaunchParams* launchParamsLi
|
||||
{
|
||||
HIP_INIT_API(hipLaunchCooperativeKernelMultiDevice, launchParamsList, numDevices, flags);
|
||||
|
||||
return HIP_RETURN(ihipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags,
|
||||
HIP_RETURN(ihipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags,
|
||||
(amd::NDRangeKernelCommand::CooperativeGroups |
|
||||
amd::NDRangeKernelCommand::CooperativeMultiDeviceGroups)));
|
||||
}
|
||||
@@ -651,7 +651,7 @@ hipError_t hipExtLaunchMultiKernelMultiDevice(hipLaunchParams* launchParamsList,
|
||||
int numDevices, unsigned int flags) {
|
||||
HIP_INIT_API(hipExtLaunchMultiKernelMultiDevice, launchParamsList, numDevices, flags);
|
||||
|
||||
return HIP_RETURN(ihipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags, 0));
|
||||
HIP_RETURN(ihipLaunchCooperativeKernelMultiDevice(launchParamsList, numDevices, flags, 0));
|
||||
}
|
||||
|
||||
hipError_t hipModuleGetTexRef(textureReference** texRef, hipModule_t hmod, const char* name) {
|
||||
|
||||
@@ -438,7 +438,7 @@ hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
|
||||
hipFunction_t func = nullptr;
|
||||
hipError_t hip_error = PlatformState::instance().getStatFunc(&func, f, ihipGetDevice());
|
||||
if ((hip_error != hipSuccess) || (func == nullptr)) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
const amd::Device& device = *hip::getCurrentDevice()->devices()[0];
|
||||
int max_blocks_per_grid = 0;
|
||||
@@ -543,7 +543,7 @@ hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks,
|
||||
hipFunction_t func = nullptr;
|
||||
hipError_t hip_error = PlatformState::instance().getStatFunc(&func, f, ihipGetDevice());
|
||||
if ((hip_error != hipSuccess) || (func == nullptr)) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
const amd::Device& device = *hip::getCurrentDevice()->devices()[0];
|
||||
@@ -569,7 +569,7 @@ hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks,
|
||||
hipFunction_t func = nullptr;
|
||||
hipError_t hip_error = PlatformState::instance().getStatFunc(&func, f, ihipGetDevice());
|
||||
if ((hip_error != hipSuccess) || (func == nullptr)) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
const amd::Device& device = *hip::getCurrentDevice()->devices()[0];
|
||||
|
||||
@@ -371,7 +371,7 @@ hipError_t hipStreamGetFlags(hipStream_t stream, unsigned int* flags) {
|
||||
|
||||
if ((flags != nullptr) && (stream != nullptr)) {
|
||||
if (!hip::isValid(stream)) {
|
||||
return HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
}
|
||||
*flags = reinterpret_cast<hip::Stream*>(stream)->Flags();
|
||||
} else {
|
||||
@@ -386,7 +386,7 @@ hipError_t hipStreamSynchronize(hipStream_t stream) {
|
||||
HIP_INIT_API(hipStreamSynchronize, stream);
|
||||
|
||||
if (!hip::isValid(stream)) {
|
||||
return HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
}
|
||||
|
||||
// Wait for the current host queue
|
||||
@@ -404,7 +404,7 @@ hipError_t hipStreamDestroy(hipStream_t stream) {
|
||||
}
|
||||
|
||||
if (!hip::isValid(stream)) {
|
||||
return HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
}
|
||||
|
||||
delete reinterpret_cast<hip::Stream*>(stream);
|
||||
@@ -437,7 +437,7 @@ hipError_t hipStreamWaitEvent(hipStream_t stream, hipEvent_t event, unsigned int
|
||||
}
|
||||
|
||||
if (!hip::isValid(stream)) {
|
||||
return HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
}
|
||||
|
||||
amd::HostQueue* queue = hip::getQueue(stream);
|
||||
@@ -465,7 +465,7 @@ hipError_t hipStreamQuery(hipStream_t stream) {
|
||||
HIP_INIT_API(hipStreamQuery, stream);
|
||||
|
||||
if (!hip::isValid(stream)) {
|
||||
return HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
}
|
||||
|
||||
amd::HostQueue* hostQueue = hip::getQueue(stream);
|
||||
@@ -500,7 +500,7 @@ hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback
|
||||
}
|
||||
|
||||
if (!hip::isValid(stream)) {
|
||||
return HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
}
|
||||
|
||||
amd::HostQueue* hostQueue = hip::getQueue(stream);
|
||||
@@ -567,7 +567,7 @@ hipError_t hipStreamGetPriority(hipStream_t stream, int* priority) {
|
||||
|
||||
if ((priority != nullptr) && (stream != nullptr)) {
|
||||
if (!hip::isValid(stream)) {
|
||||
return HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
HIP_RETURN(hipErrorContextIsDestroyed);
|
||||
}
|
||||
*priority = static_cast<int>(reinterpret_cast<hip::Stream*>(stream)->GetPriority());
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user