Blender  V3.3
device/hip/kernel.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 #pragma once
5 
6 #ifdef WITH_HIP
7 
8 # include "device/kernel.h"
9 
10 # ifdef WITH_HIP_DYNLOAD
11 # include "hipew.h"
12 # endif
13 
15 
16 class HIPDevice;
17 
18 /* HIP kernel and associate occupancy information. */
19 class HIPDeviceKernel {
20  public:
21  hipFunction_t function = nullptr;
22 
23  int num_threads_per_block = 0;
24  int min_blocks = 0;
25 };
26 
27 /* Cache of HIP kernels for each DeviceKernel. */
28 class HIPDeviceKernels {
29  public:
30  void load(HIPDevice *device);
31  const HIPDeviceKernel &get(DeviceKernel kernel) const;
32  bool available(DeviceKernel kernel) const;
33 
34  protected:
35  HIPDeviceKernel kernels_[DEVICE_KERNEL_NUM];
36  bool loaded = false;
37 };
38 
40 
41 #endif /* WITH_HIP */
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
SyclQueue void void size_t num_bytes SyclQueue void const char void *memory_device_pointer KernelContext int kernel
DeviceKernel
@ DEVICE_KERNEL_NUM