Blender  V3.3
device/oneapi/globals.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2021-2022 Intel Corporation */
3 
4 #pragma once
5 
7 #include "kernel/types.h"
9 
11 
12 /* NOTE(@nsirgien): With SYCL we can't declare __constant__ global variable, which will be
13  * accessible from device code, like it has been done for Cycles CUDA backend. So, the backend will
14  * allocate this "constant" memory regions and store pointers to them in oneAPI context class */
15 
16 struct IntegratorStateGPU;
18 
19 typedef struct KernelGlobalsGPU {
20 
21 #define KERNEL_DATA_ARRAY(type, name) const type *__##name = nullptr;
22 #include "kernel/data_arrays.h"
23 #undef KERNEL_DATA_ARRAY
26 #ifdef WITH_ONEAPI_SYCL_HOST_ENABLED
27  size_t nd_item_local_id_0;
28  size_t nd_item_local_range_0;
29  size_t nd_item_group_0;
30  size_t nd_item_group_range_0;
31 
32  size_t nd_item_global_id_0;
33  size_t nd_item_global_range_0;
34 #endif
36 
38 
39 #define kernel_data (*(__data))
40 #define kernel_integrator_state (*(integrator_state))
41 
42 /* data lookup defines */
43 
44 #define kernel_data_fetch(name, index) __##name[index]
45 #define kernel_data_array(name) __##name
46 
#define ccl_restrict
Definition: cuda/compat.h:50
#define ccl_global
Definition: cuda/compat.h:43
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
struct KernelGlobalsGPU KernelGlobalsGPU
ccl_global KernelGlobalsGPU *ccl_restrict KernelGlobals
const KernelData * __data
IntegratorStateGPU * integrator_state