File: multi_graphics_allocation.h

package info (click to toggle)
intel-compute-runtime 22.43.24595.41-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 57,740 kB
  • sloc: cpp: 631,142; lisp: 3,515; sh: 470; makefile: 76; python: 21
file content (53 lines) | stat: -rw-r--r-- 1,421 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * Copyright (C) 2020-2022 Intel Corporation
 *
 * SPDX-License-Identifier: MIT
 *
 */

#pragma once

#include "shared/source/memory_manager/allocation_type.h"
#include "shared/source/utilities/stackvec.h"

#include <functional>

namespace NEO {

class MigrationSyncData;
class GraphicsAllocation;

class MultiGraphicsAllocation {
  public:
    MultiGraphicsAllocation(uint32_t maxRootDeviceIndex);
    MultiGraphicsAllocation(const MultiGraphicsAllocation &multiGraphicsAllocation);
    MultiGraphicsAllocation(MultiGraphicsAllocation &&);
    ~MultiGraphicsAllocation();

    GraphicsAllocation *getDefaultGraphicsAllocation() const;

    void addAllocation(GraphicsAllocation *graphicsAllocation);

    void removeAllocation(uint32_t rootDeviceIndex);

    GraphicsAllocation *getGraphicsAllocation(uint32_t rootDeviceIndex) const;

    AllocationType getAllocationType() const;

    bool isCoherent() const;

    StackVec<GraphicsAllocation *, 1> const &getGraphicsAllocations() const;

    bool requiresMigrations() const;
    MigrationSyncData *getMigrationSyncData() const { return migrationSyncData; }
    void setMultiStorage(bool value);

    static std::function<MigrationSyncData *(size_t size)> createMigrationSyncDataFunc;

  protected:
    bool isMultiStorage = false;
    MigrationSyncData *migrationSyncData = nullptr;
    StackVec<GraphicsAllocation *, 1> graphicsAllocations;
};

} // namespace NEO