SWDEV-229840 - fixing return HIP_RETURN instances in hip.
Change-Id: I48763d7268bf5649bf2242c962c185f5f4af159c
This commit is contained in:
committed by
Karthik Jayaprakash
parent
e44d7f578b
commit
aae3e13296
@@ -761,7 +761,7 @@ hipError_t hipMemcpyToSymbol(const void* symbol, const void* src, size_t sizeByt
|
||||
if ((offset + sizeBytes) > sym_size) {
|
||||
DevLogPrintfError("Trying to access out of bounds, offset: %u sizeBytes: %u sym_size: %u \n",
|
||||
offset, sizeBytes, sym_size);
|
||||
return HIP_RETURN(hipErrorInvalidDevicePointer);
|
||||
HIP_RETURN(hipErrorInvalidDevicePointer);
|
||||
}
|
||||
|
||||
device_ptr = reinterpret_cast<address>(device_ptr) + offset;
|
||||
@@ -794,7 +794,7 @@ hipError_t hipMemcpyFromSymbol(void* dst, const void* symbol, size_t sizeBytes,
|
||||
if ((offset + sizeBytes) > sym_size) {
|
||||
DevLogPrintfError("Trying to access out of bounds, offset: %u sizeBytes: %u sym_size: %u \n",
|
||||
offset, sizeBytes, sym_size);
|
||||
return HIP_RETURN(hipErrorInvalidDevicePointer);
|
||||
HIP_RETURN(hipErrorInvalidDevicePointer);
|
||||
}
|
||||
|
||||
device_ptr = reinterpret_cast<address>(device_ptr) + offset;
|
||||
@@ -827,7 +827,7 @@ hipError_t hipMemcpyToSymbolAsync(const void* symbol, const void* src, size_t si
|
||||
if ((offset + sizeBytes) > sym_size) {
|
||||
DevLogPrintfError("Trying to access out of bounds, offset: %u sizeBytes: %u sym_size: %u \n",
|
||||
offset, sizeBytes, sym_size);
|
||||
return HIP_RETURN(hipErrorInvalidDevicePointer);
|
||||
HIP_RETURN(hipErrorInvalidDevicePointer);
|
||||
}
|
||||
|
||||
device_ptr = reinterpret_cast<address>(device_ptr) + offset;
|
||||
@@ -860,7 +860,7 @@ hipError_t hipMemcpyFromSymbolAsync(void* dst, const void* symbol, size_t sizeBy
|
||||
if ((offset + sizeBytes) > sym_size) {
|
||||
DevLogPrintfError("Trying to access out of bounds, offset: %u sizeBytes: %u sym_size: %u \n",
|
||||
offset, sizeBytes, sym_size);
|
||||
return HIP_RETURN(hipErrorInvalidDevicePointer);
|
||||
HIP_RETURN(hipErrorInvalidDevicePointer);
|
||||
}
|
||||
|
||||
device_ptr = reinterpret_cast<address>(device_ptr) + offset;
|
||||
|
||||
+10
-10
@@ -951,11 +951,11 @@ hipError_t hipOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize,
|
||||
{
|
||||
HIP_INIT_API(hipOccupancyMaxPotentialBlockSize, f, dynSharedMemPerBlk, blockSizeLimit);
|
||||
if ((gridSize == nullptr) || (blockSize == nullptr)) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
hipFunction_t func = PlatformState::instance().getFunc(f, ihipGetDevice());
|
||||
if (func == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
const amd::Device& device = *hip::getCurrentDevice()->devices()[0];
|
||||
int max_blocks_per_grid = 0;
|
||||
@@ -976,7 +976,7 @@ hipError_t hipModuleOccupancyMaxPotentialBlockSize(int* gridSize, int* blockSize
|
||||
{
|
||||
HIP_INIT_API(hipModuleOccupancyMaxPotentialBlockSize, f, dynSharedMemPerBlk, blockSizeLimit);
|
||||
if ((gridSize == nullptr) || (blockSize == nullptr)) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
const amd::Device& device = *hip::getCurrentDevice()->devices()[0];
|
||||
int max_blocks_per_grid = 0;
|
||||
@@ -997,7 +997,7 @@ hipError_t hipModuleOccupancyMaxPotentialBlockSizeWithFlags(int* gridSize, int*
|
||||
{
|
||||
HIP_INIT_API(hipModuleOccupancyMaxPotentialBlockSizeWithFlags, f, dynSharedMemPerBlk, blockSizeLimit, flags);
|
||||
if ((gridSize == nullptr) || (blockSize == nullptr)) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
const amd::Device& device = *hip::getCurrentDevice()->devices()[0];
|
||||
int max_blocks_per_grid = 0;
|
||||
@@ -1017,7 +1017,7 @@ hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks,
|
||||
{
|
||||
HIP_INIT_API(hipModuleOccupancyMaxActiveBlocksPerMultiprocessor, f, blockSize, dynSharedMemPerBlk);
|
||||
if (numBlocks == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
const amd::Device& device = *hip::getCurrentDevice()->devices()[0];
|
||||
|
||||
@@ -1036,7 +1036,7 @@ hipError_t hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numB
|
||||
{
|
||||
HIP_INIT_API(hipModuleOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, f, blockSize, dynSharedMemPerBlk, flags);
|
||||
if (numBlocks == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
const amd::Device& device = *hip::getCurrentDevice()->devices()[0];
|
||||
|
||||
@@ -1054,12 +1054,12 @@ hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessor(int* numBlocks,
|
||||
{
|
||||
HIP_INIT_API(hipOccupancyMaxActiveBlocksPerMultiprocessor, f, blockSize, dynamicSMemSize);
|
||||
if (numBlocks == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
hipFunction_t func = PlatformState::instance().getFunc(f, ihipGetDevice());
|
||||
if (func == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
const amd::Device& device = *hip::getCurrentDevice()->devices()[0];
|
||||
@@ -1079,12 +1079,12 @@ hipError_t hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags(int* numBlocks,
|
||||
{
|
||||
HIP_INIT_API(hipOccupancyMaxActiveBlocksPerMultiprocessorWithFlags, f, blockSize, dynamicSMemSize, flags);
|
||||
if (numBlocks == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
hipFunction_t func = PlatformState::instance().getFunc(f, ihipGetDevice());
|
||||
if (func == nullptr) {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
const amd::Device& device = *hip::getCurrentDevice()->devices()[0];
|
||||
|
||||
Regular → Executable
+2
-2
@@ -208,7 +208,7 @@ hipError_t hipStreamCreateWithPriority(hipStream_t* stream, unsigned int flags,
|
||||
priority = static_cast<int>(amd::CommandQueue::Priority::Normal);
|
||||
}
|
||||
|
||||
return HIP_RETURN(ihipStreamCreate(stream, flags, static_cast<amd::CommandQueue::Priority>(priority)));
|
||||
HIP_RETURN(ihipStreamCreate(stream, flags, static_cast<amd::CommandQueue::Priority>(priority)));
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
@@ -222,7 +222,7 @@ hipError_t hipDeviceGetStreamPriorityRange(int* leastPriority, int* greatestPrio
|
||||
// Only report one kind of priority for now.
|
||||
*greatestPriority = static_cast<int>(amd::CommandQueue::Priority::Normal);
|
||||
}
|
||||
return HIP_RETURN(hipSuccess);
|
||||
HIP_RETURN(hipSuccess);
|
||||
}
|
||||
|
||||
// ================================================================================================
|
||||
|
||||
@@ -772,7 +772,7 @@ hipError_t hipTexRefGetArray(hipArray_t* pArray,
|
||||
// TODO use ihipGetTextureObjectResourceDesc() to not pollute the API trace.
|
||||
hipError_t error = hipGetTextureObjectResourceDesc(&resDesc, texRef->textureObject);
|
||||
if (error != hipSuccess) {
|
||||
return HIP_RETURN(error);
|
||||
HIP_RETURN(error);
|
||||
}
|
||||
|
||||
switch (resDesc.resType) {
|
||||
@@ -848,7 +848,7 @@ hipError_t hipTexRefGetAddress(hipDeviceptr_t* dptr,
|
||||
if (error != hipSuccess) {
|
||||
DevLogPrintfError("hipGetTextureObjectResourceDesc failed with error code: %s \n",
|
||||
hipGetErrorName(error));
|
||||
return HIP_RETURN(error);
|
||||
HIP_RETURN(error);
|
||||
}
|
||||
|
||||
switch (resDesc.resType) {
|
||||
@@ -903,7 +903,7 @@ hipError_t hipTexRefSetAddress(size_t* ByteOffset,
|
||||
// Align the user ptr to HW requirments.
|
||||
resDesc.res.linear.devPtr = static_cast<char*>(dptr) - *ByteOffset;
|
||||
} else {
|
||||
return HIP_RETURN(hipErrorInvalidValue);
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
|
||||
hipTextureDesc texDesc = hip::getTextureDesc(texRef);
|
||||
@@ -1108,7 +1108,7 @@ hipError_t hipTexRefGetMipmappedArray(hipMipmappedArray_t* pArray,
|
||||
// TODO use ihipGetTextureObjectResourceDesc() to not pollute the API trace.
|
||||
hipError_t error = hipGetTextureObjectResourceDesc(&resDesc, texRef->textureObject);
|
||||
if (error != hipSuccess) {
|
||||
return HIP_RETURN(error);
|
||||
HIP_RETURN(error);
|
||||
}
|
||||
|
||||
switch (resDesc.resType) {
|
||||
|
||||
Reference in New Issue
Block a user