Blender V4.3
device/hip/kernel.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#ifdef WITH_HIP
8
9# include "device/kernel.h"
10
11# ifdef WITH_HIP_DYNLOAD
12# include "hipew.h"
13# endif
14
16
17class HIPDevice;
18
19/* HIP kernel and associate occupancy information. */
20class HIPDeviceKernel {
21 public:
22 hipFunction_t function = nullptr;
23
24 int num_threads_per_block = 0;
25 int min_blocks = 0;
26};
27
28/* Cache of HIP kernels for each DeviceKernel. */
29class HIPDeviceKernels {
30 public:
31 void load(HIPDevice *device);
32 const HIPDeviceKernel &get(DeviceKernel kernel) const;
33 bool available(DeviceKernel kernel) const;
34
35 protected:
36 HIPDeviceKernel kernels_[DEVICE_KERNEL_NUM];
37 bool loaded = false;
38};
39
41
42#endif /* WITH_HIP */
#define CCL_NAMESPACE_END
DeviceKernel
@ DEVICE_KERNEL_NUM
void load(const VolumeGridData &grid)
std::shared_ptr< const T > get(const GenericKey &key, FunctionRef< std::unique_ptr< T >()> compute_fn)