[Bf-blender-cvs] [6c94344] cycles_kernel_split: Cycles kernel split: Make device_opencl even closer to master

Sergey Sharybin noreply at git.blender.org
Sat May 9 12:13:47 CEST 2015


Commit: 6c943448a0828c5b5317f6b0525e374fac3f80be
Author: Sergey Sharybin
Date:   Sat May 9 13:45:41 2015 +0500
Branches: cycles_kernel_split
https://developer.blender.org/rB6c943448a0828c5b5317f6b0525e374fac3f80be

Cycles kernel split: Make device_opencl even closer to master

===================================================================

M	intern/cycles/device/device_opencl.cpp

===================================================================

diff --git a/intern/cycles/device/device_opencl.cpp b/intern/cycles/device/device_opencl.cpp
index 8368bba..ce6c18a 100644
--- a/intern/cycles/device/device_opencl.cpp
+++ b/intern/cycles/device/device_opencl.cpp
@@ -717,7 +717,7 @@ public:
 		return true;
 	}
 
-	string device_md5_hash(string kernel_custom_build_options)
+	string device_md5_hash(string kernel_custom_build_options = "")
 	{
 		MD5Hash md5;
 		char version[256], driver[256], name[256], vendor[256];
@@ -759,8 +759,7 @@ public:
 			/* md5 hash to detect changes */
 			string kernel_path = path_get("kernel");
 			string kernel_md5 = path_files_md5_hash(kernel_path);
-			string custom_kernel_build_options = "";
-			string device_md5 = device_md5_hash(custom_kernel_build_options);
+			string device_md5 = device_md5_hash();
 
 			/* path to cached binary */
 			string clbin = string_printf("cycles_kernel_%s_%s.clbin", device_md5.c_str(), kernel_md5.c_str());
@@ -776,7 +775,7 @@ public:
 			}
 
 			/* if exists already, try use it */
-			if(path_exists(clbin) && load_binary(kernel_path, clbin, custom_kernel_build_options, &cpProgram)) {
+			if(path_exists(clbin) && load_binary(kernel_path, clbin, "", &cpProgram)) {
 				/* kernel loaded from binary */
 			}
 			else {
@@ -784,7 +783,7 @@ public:
 				string init_kernel_source = "#include \"kernel.cl\" // " + kernel_md5 + "\n";
 
 				/* if does not exist or loading binary failed, compile kernel */
-				if (!compile_kernel(kernel_path, init_kernel_source, custom_kernel_build_options, &cpProgram, debug_src))
+				if (!compile_kernel(kernel_path, init_kernel_source, "", &cpProgram, debug_src))
 					return false;
 
 				/* save binary for reuse */
@@ -797,19 +796,19 @@ public:
 		}
 
 		/* find kernels */
-		ckShaderKernel = clCreateKernel(cpProgram, "kernel_ocl_shader", &ciErr);
+		ckFilmConvertByteKernel = clCreateKernel(cpProgram, "kernel_ocl_convert_to_byte", &ciErr);
 		if(opencl_error(ciErr))
 			return false;
 
-		ckBakeKernel = clCreateKernel(cpProgram, "kernel_ocl_bake", &ciErr);
+		ckFilmConvertHalfFloatKernel = clCreateKernel(cpProgram, "kernel_ocl_convert_to_half_float", &ciErr);
 		if(opencl_error(ciErr))
 			return false;
 
-		ckFilmConvertByteKernel = clCreateKernel(cpProgram, "kernel_ocl_convert_to_byte", &ciErr);
+		ckShaderKernel = clCreateKernel(cpProgram, "kernel_ocl_shader", &ciErr);
 		if(opencl_error(ciErr))
 			return false;
 
-		ckFilmConvertHalfFloatKernel = clCreateKernel(cpProgram, "kernel_ocl_convert_to_half_float", &ciErr);
+		ckBakeKernel = clCreateKernel(cpProgram, "kernel_ocl_bake", &ciErr);
 		if(opencl_error(ciErr))
 			return false;
 
@@ -948,7 +947,7 @@ public:
 	size_t global_size_round_up(int group_size, int global_size)
 	{
 		int r = global_size % group_size;
-		return global_size + ((r == 0)? 0 : group_size - r);
+		return global_size + ((r == 0)? 0: group_size - r);
 	}
 
 	void enqueue_kernel(cl_kernel kernel, size_t w, size_t h)




More information about the Bf-blender-cvs mailing list