Make hipHostMalloc() respect hipSetDevice()

Change-Id: Ibdb666fe8dd049735df2288878501a66f7eedc28


[ROCm/clr commit: db10d42e50]
이 커밋은 다음에 포함됨:
Tao Sang 작성하고 Tao Sang가 2020-06-12 18:32:10 -04:00를 커밋함
1 부모 7c1591d98c
커밋 7ab0bcb3b6
4 파일이 변경됨
+30 -12

검색과 일치하는 파일 없음

+5 -4
파일 보기
@@ -1454,12 +1454,13 @@ bool SvmBuffer::Contains(uintptr_t ptr) {
}
// The allocation flags are ignored for now.
void* SvmBuffer::malloc(Context& context, cl_svm_mem_flags flags, size_t size, size_t alignment) {
void* SvmBuffer::malloc(Context& context, cl_svm_mem_flags flags, size_t size, size_t alignment,
const amd::Device* curDev) {
bool atomics = (flags & CL_MEM_SVM_ATOMICS) != 0;
void* ret = context.svmAlloc(size, alignment, flags);
if (ret == NULL) {
void* ret = context.svmAlloc(size, alignment, flags, curDev);
if (ret == nullptr) {
LogError("Unable to allocate aligned memory");
return NULL;
return nullptr;
}
uintptr_t ret_u = reinterpret_cast<uintptr_t>(ret);
Add(ret_u, ret_u + size);