/* * Copyright (C) 2020 Intel Corporation * * SPDX-License-Identifier: MIT * */ #pragma once #include "CL/cl.h" namespace NEO { template class DestructorCallback { public: DestructorCallback(void(CL_CALLBACK *funcNotify)(T, void *), void *userData) : funcNotify(funcNotify), userData(userData){}; inline void invoke(T object) { this->funcNotify(object, userData); } private: void(CL_CALLBACK *funcNotify)(T, void *); void *userData; }; using ContextDestructorCallback = DestructorCallback; using MemObjDestructorCallback = DestructorCallback; } // namespace NEO