SWDEV-308983 - Fix hipGraphKernelNodeSetParams

Change-Id: I8a57a4e33048931955b7ba5ed567631703bd6c5d


[ROCm/clr commit: 9c8b6b65e0]
이 커밋은 다음에 포함됨:
anusha GodavarthySurya
2021-11-17 01:02:50 -08:00
부모 71215f1231
커밋 f675e61387
+18 -3
파일 보기
@@ -31,6 +31,7 @@
#include "hip_internal.hpp"
#include "hip_graph_helper.hpp"
#include "hip_event.hpp"
#include "hip_platform.hpp"
typedef hipGraphNode* Node;
hipError_t ihipValidateKernelParams(const hipKernelNodeParams* pNodeParams);
@@ -400,7 +401,6 @@ class hipGraphKernelNode : public hipGraphNode {
commands_.emplace_back(command);
return status;
}
void GetParams(hipKernelNodeParams* params) {
std::memcpy(params, pKernelParams_, sizeof(hipKernelNodeParams));
}
@@ -410,12 +410,27 @@ class hipGraphKernelNode : public hipGraphNode {
if (hipSuccess != status) {
return status;
}
if (params->func != pKernelParams_->func) {
hipFunction_t func = nullptr;
hipError_t status =
PlatformState::instance().getStatFunc(&func, params->func, ihipGetDevice());
if ((status != hipSuccess) || (func == nullptr)) {
return hipErrorInvalidDeviceFunction;
}
func_ = func;
}
std::memcpy(pKernelParams_, params, sizeof(hipKernelNodeParams));
return hipSuccess;
return status;
}
hipError_t SetCommandParams(const hipKernelNodeParams* params) {
if (params->func != pKernelParams_->func) {
return hipErrorInvalidValue;
hipFunction_t func = nullptr;
hipError_t status =
PlatformState::instance().getStatFunc(&func, params->func, ihipGetDevice());
if ((status != hipSuccess) || (func == nullptr)) {
return hipErrorInvalidDeviceFunction;
}
func_ = func;
}
// updates kernel params
hipError_t status = ihipValidateKernelParams(params);