[Bf-blender-cvs] [34bf894da9] cycles_split_kernel: Cycles: Report device maximum allocation and detected global size
Sergey Sharybin
noreply at git.blender.org
Mon Feb 20 13:02:44 CET 2017
Commit: 34bf894da9c90bc6b03ec45967fad0b53cbb9d9a
Author: Sergey Sharybin
Date: Mon Feb 20 13:02:11 2017 +0100
Branches: cycles_split_kernel
https://developer.blender.org/rB34bf894da9c90bc6b03ec45967fad0b53cbb9d9a
Cycles: Report device maximum allocation and detected global size
===================================================================
M intern/cycles/device/opencl/opencl_split.cpp
M intern/cycles/util/util_logging.cpp
M intern/cycles/util/util_logging.h
===================================================================
diff --git a/intern/cycles/device/opencl/opencl_split.cpp b/intern/cycles/device/opencl/opencl_split.cpp
index 8a93fdc3c3..a7064c30a6 100644
--- a/intern/cycles/device/opencl/opencl_split.cpp
+++ b/intern/cycles/device/opencl/opencl_split.cpp
@@ -25,6 +25,7 @@
#include "device_split_kernel.h"
+#include "util_logging.h"
#include "util_md5.h"
#include "util_path.h"
#include "util_time.h"
@@ -300,10 +301,14 @@ public:
{
size_t max_buffer_size;
clGetDeviceInfo(device->cdDevice, CL_DEVICE_MAX_MEM_ALLOC_SIZE, sizeof(size_t), &max_buffer_size, NULL);
+ VLOG(1) << "Maximum device allocation side: "
+ << string_human_readable_number(max_buffer_size) << " bytes. ("
+ << string_human_readable_size(max_buffer_size) << ").";
size_t num_elements = max_elements_for_max_buffer_size(max_buffer_size / 2, task->passes_size);
-
- return make_int2(round_up((int)sqrt(num_elements), 64), (int)sqrt(num_elements));
+ int2 global_size = make_int2(round_up((int)sqrt(num_elements), 64), (int)sqrt(num_elements));
+ VLOG(1) << "Global size: " << global_size << ".";
+ return global_size;
}
};
diff --git a/intern/cycles/util/util_logging.cpp b/intern/cycles/util/util_logging.cpp
index 03041723e1..6824f1ff83 100644
--- a/intern/cycles/util/util_logging.cpp
+++ b/intern/cycles/util/util_logging.cpp
@@ -69,6 +69,15 @@ void util_logging_verbosity_set(int verbosity)
}
std::ostream& operator <<(std::ostream &os,
+ const int2 &value)
+{
+ os << "(" << value.x
+ << ", " << value.y
+ << ")";
+ return os;
+}
+
+std::ostream& operator <<(std::ostream &os,
const float3 &value)
{
os << "(" << value.x
diff --git a/intern/cycles/util/util_logging.h b/intern/cycles/util/util_logging.h
index 2aa9c25b1a..ecf9c9cfee 100644
--- a/intern/cycles/util/util_logging.h
+++ b/intern/cycles/util/util_logging.h
@@ -45,6 +45,7 @@ public:
#define VLOG_ONCE(level, flag) if(!flag) flag = true, VLOG(level)
+struct int2;
struct float3;
void util_logging_init(const char *argv0);
@@ -52,6 +53,8 @@ void util_logging_start(void);
void util_logging_verbosity_set(int verbosity);
std::ostream& operator <<(std::ostream &os,
+ const int2 &value);
+std::ostream& operator <<(std::ostream &os,
const float3 &value);
CCL_NAMESPACE_END
More information about the Bf-blender-cvs
mailing list