[Bf-blender-cvs] [529a3ec] cycles_kernel_split: Cycles: Compilation error fixes
Sergey Sharybin
noreply at git.blender.org
Mon Mar 30 17:27:10 CEST 2015
Commit: 529a3ecb4841e2cb18c1b0996fcfa78dd52552ab
Author: Sergey Sharybin
Date: Mon Mar 30 16:32:20 2015 +0500
Branches: cycles_kernel_split
https://developer.blender.org/rB529a3ecb4841e2cb18c1b0996fcfa78dd52552ab
Cycles: Compilation error fixes
Also made checks about __SPLIT_KERNEL__ srvive cases
when it's not defined.
===================================================================
M intern/cycles/device/device_opencl.cpp
M intern/cycles/kernel/geom/geom_object.h
M intern/cycles/kernel/geom/geom_primitive.h
M intern/cycles/kernel/kernel_Background_BufferUpdate.cl
M intern/cycles/kernel/kernel_DataInit.cl
M intern/cycles/kernel/kernel_Holdout_Emission_Blurring_Pathtermination_AO.cl
M intern/cycles/kernel/kernel_emission.h
M intern/cycles/kernel/kernel_passes.h
M intern/cycles/kernel/kernel_path_surface.h
M intern/cycles/kernel/kernel_shader.h
M intern/cycles/kernel/kernel_shadow.h
M intern/cycles/kernel/kernel_types.h
M intern/cycles/kernel/kernel_work_stealing.h
M intern/cycles/kernel/svm/svm.h
M intern/cycles/kernel/svm/svm_tex_coord.h
M intern/cycles/kernel/svm/svm_vector_transform.h
M intern/cycles/render/session.cpp
===================================================================
diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index 1475f52..8319135 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -29,8 +29,8 @@
* now we have only one opencl feature set shared by nvidia and amd
*/
-#define __KERNEL_OPENCL__ 1
-#define __SPLIT_KERNEL__ 1
+#define __KERNEL_OPENCL__
+#define __SPLIT_KERNEL__
#include "buffers.h"
@@ -46,7 +46,7 @@ CCL_NAMESPACE_BEGIN
#define CL_MEM_PTR(p) ((cl_mem)(uintptr_t)(p))
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
/* This value may be tuned according to the scene we are rendering */
#define PATH_ITER_INC_FACTOR 8
@@ -119,12 +119,12 @@ static bool opencl_kernel_use_advanced_shading(const string& platform)
static string opencl_kernel_build_options(const string& platform, const string *debug_src = NULL)
{
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
string build_options = " -cl-fast-relaxed-math -D__SPLIT_KERNEL__=1 ";
build_options.append(opt);
build_options.append(compute_device_type_build_option);
#else
- string build_options = " -cl-fast-relaxed-math -D__SPLIT_KERNEL__=0 ";
+ string build_options = " -cl-fast-relaxed-math ";
#endif
if(platform == "NVIDIA CUDA")
@@ -144,7 +144,7 @@ static string opencl_kernel_build_options(const string& platform, const string *
build_options += "-g -s \"" + *debug_src + "\"";
}
-#if !__SPLIT_KERNEL__
+#ifndef __SPLIT_KERNEL__
/* kernel debug currently not supported in __SPLIT_KERNEL__ */
if(opencl_kernel_use_debug())
build_options += "-D__KERNEL_OPENCL_DEBUG__ ";
@@ -370,7 +370,7 @@ public:
cl_device_id cdDevice;
cl_int ciErr;
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
/* Kernel declaration */
cl_kernel ckPathTraceKernel_DataInit_SPLIT_KERNEL;
cl_kernel ckPathTraceKernel_SceneIntersect_SPLIT_KERNEL;
@@ -525,37 +525,37 @@ public:
cl_program sumAllRadiance_program;
/* Required memory size */
- size_t rng_size = sizeof(RNG);
- size_t throughput_size = sizeof(float3);
- size_t L_transparent_size = sizeof(float);
- size_t rayState_size = sizeof(char);
- size_t hostRayState_size = sizeof(char);
- size_t work_element_size = sizeof(unsigned int);
- size_t ISLamp_size = sizeof(int);
+ size_t rng_size;
+ size_t throughput_size;
+ size_t L_transparent_size;
+ size_t rayState_size;
+ size_t hostRayState_size;
+ size_t work_element_size;
+ size_t ISLamp_size;
/* size of structures declared in kernel_types.h */
- size_t PathRadiance_size = sizeof(PathRadiance);
- size_t Ray_size = sizeof(Ray);
- size_t PathState_size = sizeof(PathState);
- size_t Intersection_size = sizeof(Intersection);
+ size_t PathRadiance_size;
+ size_t Ray_size;
+ size_t PathState_size;
+ size_t Intersection_size;
/* Volume of ShaderData; ShaderData (in split_kernel) is a
* Structure-Of-Arrays implementation; We need to calculate memory
* required for a single thread
*/
- size_t ShaderData_volume = 0;
+ size_t ShaderData_volume;
/* This is total ShaderClosure size required for one thread */
- size_t ShaderClosure_size = 0;
+ size_t ShaderClosure_size;
/* Sizes of memory required for shadow blocked function */
- size_t AOAlpha_size = sizeof(float3);
- size_t AOBSDF_size = sizeof(float3);
- size_t AOLightRay_size = sizeof(Ray);
- size_t LightRay_size = sizeof(Ray);
- size_t BSDFEval_size = sizeof(BsdfEval);
- size_t Intersection_coop_AO_size = sizeof(Intersection);
- size_t Intersection_coop_DL_size = sizeof(Intersection);
+ size_t AOAlpha_size;
+ size_t AOBSDF_size;
+ size_t AOLightRay_size;
+ size_t LightRay_size;
+ size_t BSDFEval_size;
+ size_t Intersection_coop_AO_size;
+ size_t Intersection_coop_DL_size;
/* This is sizeof_output_buffer / tile_size */
size_t per_thread_output_buffer_size;
@@ -582,7 +582,7 @@ public:
/* Number of path-iterations to be done in one shot */
unsigned int PathIteration_times;
-#if __WORK_STEALING__
+#ifdef __WORK_STEALING__
/* Work pool with respect to each work group */
cl_mem work_pool_wgs;
@@ -671,7 +671,7 @@ public:
null_mem = 0;
device_initialized = false;
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
/* Initialize kernels */
ckPathTraceKernel_DataInit_SPLIT_KERNEL = NULL;
ckPathTraceKernel_SceneIntersect_SPLIT_KERNEL = NULL;
@@ -840,12 +840,21 @@ public:
Intersection_coop_AO_size = sizeof(Intersection);
Intersection_coop_DL_size = sizeof(Intersection);
+ /* initialize sizes of memory required for shadow blocked function */
+ AOAlpha_size = sizeof(float3);
+ AOBSDF_size = sizeof(float3);
+ AOLightRay_size = sizeof(Ray);
+ LightRay_size = sizeof(Ray);
+ BSDFEval_size = sizeof(BsdfEval);
+ Intersection_coop_AO_size = sizeof(Intersection);
+ Intersection_coop_DL_size = sizeof(Intersection);
+
per_thread_output_buffer_size = 0;
per_thread_memory = 0;
render_scene_input_data_size = 0;
hostRayStateArray = NULL;
PathIteration_times = PATH_ITER_INC_FACTOR;
-#if __WORK_STEALING__
+#ifdef __WORK_STEALING__
work_pool_wgs = NULL;
max_work_groups = 0;
#endif
@@ -954,7 +963,7 @@ public:
}
}
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
ciErr = clGetDeviceInfo(cdDevice, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(size_t), &total_allocatable_memory, NULL);
assert(ciErr == CL_SUCCESS);
if(platform_name == "AMD Accelerated Parallel Processing") {
@@ -1020,7 +1029,7 @@ public:
return true;
}
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
bool load_binary_SPLIT_KERNEL(cl_program *program, const string& kernel_path, const string& clbin, string custom_kernel_build_options, const string *debug_src = NULL)
{
/* read binary into memory */
@@ -1080,7 +1089,7 @@ public:
}
#endif
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
bool save_binary_SPLIT_KERNEL(cl_program *program, const string& clbin) {
size_t size = 0;
clGetProgramInfo(*program, CL_PROGRAM_BINARY_SIZES, sizeof(size_t), &size, NULL);
@@ -1124,8 +1133,11 @@ public:
}
#endif
-#if __SPLIT_KERNEL__
- bool build_kernel_SPLIT_KERNEL(const string& kernel_path, cl_program *kernel_program, string custom_kernel_build_options, const string *debug_src = NULL)
+#ifdef __SPLIT_KERNEL__
+ bool build_kernel_SPLIT_KERNEL(const string& /*kernel_path*/,
+ cl_program *kernel_program,
+ string custom_kernel_build_options,
+ const string *debug_src = NULL)
{
string build_options;
build_options = opencl_kernel_build_options(platform_name, debug_src) + custom_kernel_build_options;
@@ -1183,8 +1195,13 @@ public:
}
#endif
-#if __SPLIT_KERNEL__
- bool compile_kernel_SPLIT_KERNEL(const string& kernel_path, const string& kernel_name, string source, cl_program *kernel_program, string custom_kernel_build_options, const string *debug_src = NULL)
+#ifdef __SPLIT_KERNEL__
+ bool compile_kernel_SPLIT_KERNEL(const string& kernel_path,
+ const string& /*kernel_name*/,
+ string source,
+ cl_program *kernel_program,
+ string custom_kernel_build_options,
+ const string *debug_src = NULL)
{
/* we compile kernels consisting of many files. unfortunately opencl
* kernel caches do not seem to recognize changes in included files.
@@ -1266,8 +1283,14 @@ public:
return md5.get_hex();
}
-#if __SPLIT_KERNEL__
- bool load_split_kernel_SPLIT_KERNEL(cl_program *program, string kernel_path, string kernel_name, string device_md5, string kernel_init_source, string clbin, string custom_kernel_build_options) {
+#ifdef __SPLIT_KERNEL__
+ bool load_split_kernel_SPLIT_KERNEL(cl_program *program,
+ string kernel_path,
+ string kernel_name,
+ string /*device_md5*/,
+ string kernel_init_source,
+ string clbin,
+ string custom_kernel_build_options) {
if(!opencl_version_check())
return false;
@@ -1295,7 +1318,7 @@ public:
}
#endif
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
/* Get enum type names */
string get_node_type_as_string(NodeType node) {
switch (node) {
@@ -1530,7 +1553,7 @@ public:
return false;
}
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
string svm_build_options = "";
opt = "";
/* Enable only the macros related to the scene */
@@ -1561,7 +1584,6 @@ public:
string custom_kernel_build_options;
string kernel_init_source;
string clbin;
- bool retval = false;
kernel_init_source = "#include \"kernel_DataInit.cl\" // " + kernel_md5 + "\n";
device_md5 = device_md5_hash("");
@@ -1683,7 +1705,7 @@ public:
#endif
/* find kernels */
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
ckPathTraceKernel_DataInit_SPLIT_KERNEL = clCreateKernel(dataInit_program, "kernel_ocl_path_trace_data_initialization_SPLIT_KERNEL", &ciErr);
if(opencl_error(ciErr))
@@ -1770,7 +1792,7 @@ public:
delete mt->second;
}
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
/* Release kernels */
if(ckPathTraceKernel_DataInit_SPLIT_KERNEL)
clReleaseKernel(ckPathTraceKernel_DataInit_SPLIT_KERNEL);
@@ -2127,7 +2149,7 @@ public:
if(work_array != NULL)
clReleaseMemObject(work_array);
-#if __WORK_STEALING__
+#ifdef __WORK_STEALING__
if(work_pool_wgs != NULL)
clReleaseMemObject(work_pool_wgs);
@@ -2321,7 +2343,7 @@ public:
opencl_assert(clFlush(cqCommandQueue));
}
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
size_t get_tex_size(const char *tex_name) {
cl_mem ptr;
size_t ret_size;
@@ -2340,7 +2362,7 @@ public:
}
#endif
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_KERNEL__
size_t get_shader_closure_size(int max_closure) {
return (sizeof(ShaderClosure)* max_closure);
}
@@ -2373,10 +2395,10 @@ public:
cl_int d_y = rtile.y;
cl_int d_w = rtile.w;
cl_int d_h = rtile.h;
- cl_int d_sample = sample;
cl_int d_offset = rtile.offset;
cl_int d_stride = rtile.stride;
-#if __SPLIT_KERNEL__
+#ifdef __SPLIT_K
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list