1 /* 2 * Copyright (C) 2018-2021 Intel Corporation 3 * 4 * SPDX-License-Identifier: MIT 5 * 6 */ 7 8 #pragma once 9 #include "opencl/source/api/cl_types.h" 10 11 #include <vector> 12 13 namespace NEO { 14 class GraphicsAllocation; 15 class CommandStreamReceiver; 16 struct KernelInfo; 17 18 class BlockKernelManager { 19 public: 20 BlockKernelManager() = default; 21 virtual ~BlockKernelManager(); 22 void addBlockKernelInfo(KernelInfo *); 23 const KernelInfo *getBlockKernelInfo(size_t ordinal); getCount()24 size_t getCount() const { 25 return blockKernelInfoArray.size(); 26 } getIfBlockUsesPrintf()27 bool getIfBlockUsesPrintf() const { 28 return blockUsesPrintf; 29 } 30 31 void pushPrivateSurface(GraphicsAllocation *allocation, size_t ordinal); 32 GraphicsAllocation *getPrivateSurface(size_t ordinal); 33 34 void makeInternalAllocationsResident(CommandStreamReceiver &); 35 36 protected: 37 bool blockUsesPrintf = false; 38 std::vector<KernelInfo *> blockKernelInfoArray; 39 std::vector<GraphicsAllocation *> blockPrivateSurfaceArray; 40 }; 41 } // namespace NEO