mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Create all GPU bound allocations using memory manager
Change-Id: I2e88b8ee7c3a2b4e2c3fc2c887bfcb68e35ef539
This commit is contained in:

committed by
sys_ocldev

parent
8d68788807
commit
8c43b674ff
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2017, Intel Corporation
|
||||
* Copyright (c) 2017 - 2018, Intel Corporation
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@ -28,6 +28,7 @@
|
||||
#include "runtime/context/context.h"
|
||||
#include "runtime/helpers/validators.h"
|
||||
#include "runtime/mem_obj/buffer.h"
|
||||
#include "runtime/memory_manager/memory_manager.h"
|
||||
|
||||
using namespace gtpin;
|
||||
|
||||
@ -40,7 +41,7 @@ GTPIN_DI_STATUS gtpinCreateBuffer(context_handle_t context, uint32_t reqSize, re
|
||||
return GTPIN_DI_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
size_t size = alignUp(reqSize, MemoryConstants::cacheLineSize);
|
||||
void *hostPtr = alignedMalloc(size, MemoryConstants::pageSize);
|
||||
void *hostPtr = pContext->getMemoryManager()->allocateSystemMemory(size, MemoryConstants::pageSize);
|
||||
if (hostPtr == nullptr) {
|
||||
return GTPIN_DI_ERROR_ALLOCATION_FAILED;
|
||||
}
|
||||
@ -90,4 +91,4 @@ GTPIN_DI_STATUS gtpinUnmapBuffer(context_handle_t context, resource_handle_t res
|
||||
}
|
||||
return GTPIN_DI_SUCCESS;
|
||||
}
|
||||
}
|
||||
} // namespace OCLRT
|
||||
|
Reference in New Issue
Block a user