Files
compute-runtime/shared/source/memory_manager/prefetch_manager.h
Milczarek, Slawomir f3f623900a fix: memory prefetch for kmd migrated shared alloc to check for invalid usm ptr
Fix for SIGSEGV in SYCL_CTSO0Debug-usm_api_prefetch_handler_no_events_l0
./run_l0.sh usm_api_prefetch_handler_no_events test_usm

Related-To: LOCI-4742

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
2023-08-08 11:29:14 +02:00

42 lines
978 B
C++

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