SWDEV-408586 - set device active when malloc is called
Signed-off-by: sdashmiz <shadi.dashmiz@amd.com> Change-Id: Ib930d997b7d544d8b6fb42d2fea01fa8a4418e98
Этот коммит содержится в:
коммит произвёл
Shadi Dashmiz
родитель
8c7f59663f
Коммит
173de06658
@@ -464,11 +464,16 @@ namespace hip {
|
||||
void setFlags(unsigned int flags) { flags_ = flags; }
|
||||
void Reset();
|
||||
|
||||
hip::Stream* NullStream();
|
||||
Stream* GetNullStream();
|
||||
hip::Stream* NullStream();
|
||||
Stream* GetNullStream();
|
||||
|
||||
void SetActiveStatus() {
|
||||
isActive_ = true;
|
||||
}
|
||||
|
||||
bool GetActiveStatus() {
|
||||
amd::ScopedLock lock(lock_);
|
||||
/// Either stream is active or device is active
|
||||
if (isActive_) return true;
|
||||
if (Stream::existsActiveStreamForDevice(this)) {
|
||||
isActive_ = true;
|
||||
|
||||
@@ -290,6 +290,7 @@ hipError_t ihipMalloc(void** ptr, size_t sizeBytes, unsigned int flags)
|
||||
}
|
||||
|
||||
const auto& dev_info = amdContext->devices()[0]->info();
|
||||
hip::getCurrentDevice()->SetActiveStatus();
|
||||
|
||||
if ((!useHostDevice && (dev_info.maxMemAllocSize_ < sizeBytes)) ||
|
||||
(useHostDevice && (dev_info.maxPhysicalMemAllocSize_ < sizeBytes))) {
|
||||
|
||||
Ссылка в новой задаче
Block a user