Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2022-06-20 19:21:13 +0300
committerSergey Sharybin <sergey@blender.org>2022-06-20 19:23:15 +0300
commit216320127c4617e707285ce4563093a9b397debc (patch)
tree71348bb77e09427dbffc66d2bea570afc666d815 /intern/cycles
parentf99b77258954008aae207e2e2d2e7d188dc8e674 (diff)
Fix oneAPI kernel compilation after recent refactor
Didn't notice such breaking changes while working on the build system. This is a minimum possible change which seems to pass compilation of the oneAPI kernel. Testing on the actual device would take a while. More proper approach seems to wrap those fields into a structure within the global data, so that no prefixing of the name is needed.
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/kernel/device/oneapi/globals.h10
-rw-r--r--intern/cycles/kernel/device/oneapi/image.h8
-rw-r--r--intern/cycles/kernel/device/oneapi/kernel.cpp12
3 files changed, 15 insertions, 15 deletions
diff --git a/intern/cycles/kernel/device/oneapi/globals.h b/intern/cycles/kernel/device/oneapi/globals.h
index 4b3186a309f..d60f4f135ba 100644
--- a/intern/cycles/kernel/device/oneapi/globals.h
+++ b/intern/cycles/kernel/device/oneapi/globals.h
@@ -18,9 +18,9 @@ struct IntegratorQueueCounter;
typedef struct KernelGlobalsGPU {
-#define KERNEL_TEX(type, name) const type *name = nullptr;
-#include "kernel/textures.h"
-#undef KERNEL_TEX
+#define KERNEL_DATA_ARRAY(type, name) const type *__##name = nullptr;
+#include "kernel/data_arrays.h"
+#undef KERNEL_DATA_ARRAY
IntegratorStateGPU *integrator_state;
const KernelData *__data;
#ifdef WITH_ONEAPI_SYCL_HOST_ENABLED
@@ -41,7 +41,7 @@ typedef ccl_global KernelGlobalsGPU *ccl_restrict KernelGlobals;
/* data lookup defines */
-#define kernel_tex_fetch(tex, index) tex[index]
-#define kernel_tex_array(tex) tex
+#define kernel_data_fetch(name, index) __##name[index]
+#define kernel_data_array(name) __##name
CCL_NAMESPACE_END
diff --git a/intern/cycles/kernel/device/oneapi/image.h b/intern/cycles/kernel/device/oneapi/image.h
index f4debcd806a..892558d40bf 100644
--- a/intern/cycles/kernel/device/oneapi/image.h
+++ b/intern/cycles/kernel/device/oneapi/image.h
@@ -74,7 +74,7 @@ ccl_device_inline float4 svm_image_texture_read(const TextureInfo &info, int x,
ccl_device_inline float4 svm_image_texture_read_2d(int id, int x, int y)
{
- const TextureInfo &info = kernel_tex_fetch(__texture_info, id);
+ const TextureInfo &info = kernel_data_fetch(texture_info, id);
/* Wrap */
if (info.extension == EXTENSION_REPEAT) {
@@ -91,7 +91,7 @@ ccl_device_inline float4 svm_image_texture_read_2d(int id, int x, int y)
ccl_device_inline float4 svm_image_texture_read_3d(int id, int x, int y, int z)
{
- const TextureInfo &info = kernel_tex_fetch(__texture_info, id);
+ const TextureInfo &info = kernel_data_fetch(texture_info, id);
/* Wrap */
if (info.extension == EXTENSION_REPEAT) {
@@ -126,7 +126,7 @@ static float svm_image_texture_frac(float x, int *ix)
ccl_device float4 kernel_tex_image_interp(KernelGlobals, int id, float x, float y)
{
- const TextureInfo &info = kernel_tex_fetch(__texture_info, id);
+ const TextureInfo &info = kernel_data_fetch(texture_info, id);
if (info.extension == EXTENSION_CLIP) {
if (x < 0.0f || y < 0.0f || x > 1.0f || y > 1.0f) {
@@ -279,7 +279,7 @@ template<typename T> struct NanoVDBInterpolator {
ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals, int id, float3 P, int interp)
{
- const TextureInfo &info = kernel_tex_fetch(__texture_info, id);
+ const TextureInfo &info = kernel_data_fetch(texture_info, id);
if (info.use_transform_3d) {
Transform tfm = info.transform_3d;
diff --git a/intern/cycles/kernel/device/oneapi/kernel.cpp b/intern/cycles/kernel/device/oneapi/kernel.cpp
index 10579fa8873..6352fd9977f 100644
--- a/intern/cycles/kernel/device/oneapi/kernel.cpp
+++ b/intern/cycles/kernel/device/oneapi/kernel.cpp
@@ -215,27 +215,27 @@ void oneapi_set_global_memory(SyclQueue *queue_,
std::string matched_name(memory_name);
// This macros will change global ptr of KernelGlobals via name matching
-# define KERNEL_TEX(type, name) \
+# define KERNEL_DATA_ARRAY(type, name) \
else if (#name == matched_name) \
{ \
- globals->name = (type *)memory_device_pointer; \
+ globals->__##name = (type *)memory_device_pointer; \
return; \
}
if (false) {
}
- else if ("__integrator_state" == matched_name) {
+ else if ("integrator_state" == matched_name) {
globals->integrator_state = (IntegratorStateGPU *)memory_device_pointer;
return;
}
- KERNEL_TEX(KernelData, __data)
-# include "kernel/textures.h"
+ KERNEL_DATA_ARRAY(KernelData, data)
+# include "kernel/data_arrays.h"
else
{
std::cerr << "Can't found global/constant memory with name \"" << matched_name << "\"!"
<< std::endl;
assert(false);
}
-# undef KERNEL_TEX
+# undef KERNEL_DATA_ARRAY
}
// TODO: Move device information to OneapiDevice initialized on creation and use it.