mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 22:43:00 +08:00
Change-Id: I67a3ff2d30d8f8485394bd2744de0924205f092e Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
21 lines
402 B
C++
21 lines
402 B
C++
/*
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include <memory>
|
|
|
|
namespace OCLRT {
|
|
|
|
template <typename T>
|
|
using ReleaseableObjectPtr = std::unique_ptr<T, void (*)(T *)>;
|
|
|
|
template <typename T>
|
|
static ReleaseableObjectPtr<T> clUniquePtr(T *object) {
|
|
return ReleaseableObjectPtr<T>{object, [](T *p) { p->release(); }};
|
|
}
|
|
} // namespace OCLRT
|