Files
compute-runtime/shared/source/memory_manager/prefetch_manager.h
Slawomir Milczarek 5c1b50bccf Add memory prefetch modes for single and multiple subdevices
Single-subdevice prefetch for cmd list copy-only (with bcs) and acc mode.
Multi-subdevice prefetch (default) for shared allocation with multiple BOs.

Related-To: NEO-6740

Signed-off-by: Slawomir Milczarek <slawomir.milczarek@intel.com>
2022-12-07 15:25:32 +01:00

42 lines
995 B
C++

/*
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/helpers/non_copyable_or_moveable.h"
#include "shared/source/memory_manager/unified_memory_manager.h"
#include "shared/source/utilities/spinlock.h"
#include <memory>
#include <vector>
namespace NEO {
class CommandStreamReceiver;
class Device;
class SVMAllocsManager;
struct PrefetchContext {
std::vector<SvmAllocationData> allocations;
SpinLock lock;
};
class PrefetchManager : public NonCopyableOrMovableClass {
public:
static std::unique_ptr<PrefetchManager> create();
virtual ~PrefetchManager() = default;
void insertAllocation(PrefetchContext &context, SvmAllocationData &svmData);
MOCKABLE_VIRTUAL void migrateAllocationsToGpu(PrefetchContext &context, SVMAllocsManager &unifiedMemoryManager, Device &device, CommandStreamReceiver &csr);
MOCKABLE_VIRTUAL void removeAllocations(PrefetchContext &context);
};
} // namespace NEO