nvtx 2.0.0

NVIDIA Tools Extension SDK
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

use core::marker::PhantomData;

/// Named resource handle
pub struct Resource<'a> {
    pub(super) handle: nvtx_sys::ResourceHandle,
    pub(super) _lifetime: PhantomData<&'a ()>,
}

impl Drop for Resource<'_> {
    fn drop(&mut self) {
        nvtx_sys::domain_resource_destroy(self.handle);
    }
}