SWDEV-332606 - SWDEV-333585 - Fix hipMemcpySymbol* and hipGetSymbol* APIs
- hipMemcpy[From/To]Symbol APIs to return hipErrorInvalidMemcpyDirection
if the copy kind is incorrect
- hipGetSymbolSize and hipGetSymbolAddress APIs to return hipErrorInvalidValue
if the pointer is null
Change-Id: I32f428045c804b1e4f648e91b507f749f60c09d0
[ROCm/clr commit: f1fb612774]
This commit is contained in:
@@ -278,6 +278,9 @@ hipError_t hipGetSymbolAddress(void** devPtr, const void* symbol) {
|
||||
HIP_INIT_API(hipGetSymbolAddress, devPtr, symbol);
|
||||
|
||||
hipError_t hip_error = hipSuccess;
|
||||
if (devPtr == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
size_t sym_size = 0;
|
||||
|
||||
HIP_RETURN_ONFAIL(PlatformState::instance().getStatGlobalVar(symbol, ihipGetDevice(), devPtr, &sym_size));
|
||||
@@ -288,6 +291,9 @@ hipError_t hipGetSymbolAddress(void** devPtr, const void* symbol) {
|
||||
hipError_t hipGetSymbolSize(size_t* sizePtr, const void* symbol) {
|
||||
HIP_INIT_API(hipGetSymbolSize, sizePtr, symbol);
|
||||
|
||||
if (sizePtr == nullptr) {
|
||||
HIP_RETURN(hipErrorInvalidValue);
|
||||
}
|
||||
hipDeviceptr_t device_ptr = nullptr;
|
||||
HIP_RETURN_ONFAIL(PlatformState::instance().getStatGlobalVar(symbol, ihipGetDevice(), &device_ptr, sizePtr));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user