Blender  V3.3
device/cuda/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_CUDA
7 
8 # include "device/kernel.h"
9 
10 # ifdef WITH_CUDA_DYNLOAD
11 # include "cuew.h"
12 # else
13 # include <cuda.h>
14 # endif
15 
17 
18 class CUDADevice;
19 
20 /* CUDA kernel and associate occupancy information. */
21 class CUDADeviceKernel {
22  public:
23  CUfunction function = nullptr;
24 
25  int num_threads_per_block = 0;
26  int min_blocks = 0;
27 };
28 
29 /* Cache of CUDA kernels for each DeviceKernel. */
30 class CUDADeviceKernels {
31  public:
32  void load(CUDADevice *device);
33  const CUDADeviceKernel &get(DeviceKernel kernel) const;
34  bool available(DeviceKernel kernel) const;
35 
36  protected:
37  CUDADeviceKernel kernels_[DEVICE_KERNEL_NUM];
38  bool loaded = false;
39 };
40 
42 
43 #endif /* WITH_CUDA */
#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